summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 69658b1b88685d87f85c6e9a13afe3a8dd655bd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Maintainer: leo <douglarek at gmail dot com>
_name=dae
pkgname=$_name-git
pkgver=0.5.1.r12.gb9741c9
pkgrel=1
pkgdesc="A Linux lightweight and high-performance transparent proxy solution based on eBPF."
arch=('x86_64' 'aarch64')
url="https://github.com/daeuniverse/dae"
license=('AGPL')
provides=("$_name")
conflicts=("$_name")
depends=('glibc')
makedepends=('clang' 'go' 'git')
backup=("etc/dae/config.dae")
source=(
	"git+https://github.com/daeuniverse/dae.git"
	"dae.service"
	"geoip.dat::https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat"
	"geosite.dat::https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat"
)
sha256sums=(
	'SKIP'
	'323467e65408a68c6f443ca0cdc25c4e5e94254d7e4397560a9a2dce86149b96'
	'SKIP'
	'SKIP'
)

pkgver() {
    cd "$_name"
    git describe --tags --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-\([^-]*\)-\([^-]*\)$/.\1.\2/;s/-//'
}

prepare() {
	cd "$srcdir/$_name"
	git submodule update --init --recursive
}

build() {
	cd "$srcdir/$_name"
	export GOFLAGS="-buildmode=pie -trimpath -modcacherw"
	export CFLAGS="-fno-stack-protector"
	make VERSION="${pkgver}"
}

package() {
	cd "$srcdir/$_name"
	install -Dm755 "dae" -t "${pkgdir}/usr/bin/"
	install -Dm644 "../dae.service" -t "${pkgdir}/usr/lib/systemd/system/"
	install -Dm640 "install/empty.dae" "${pkgdir}/etc/dae/config.dae"
	install -Dm644 "example.dae" "${pkgdir}/etc/dae/config.dae.example"

	mkdir -p "${pkgdir}/usr/share/dae/"
	cp ../geoip.dat "${pkgdir}/usr/share/dae/geoip.dat"
	cp ../geosite.dat "${pkgdir}/usr/share/dae/geosite.dat"
}