summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f5a33b6c85e421d5f8f0ae4f6c40ffe7f767f81c (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
56
57
58
59
60
61
62
63
# Maintainer: DuckSoft <realducksoft at gmail dot com>
pkgbase=gun-git
pkgname=(gun-proxy-git gun-sip003-git gun-docs-git)
pkgdesc="PoC of tunneling traffic via gRPC CDNs"
pkgver=0.2.0.r8.g3c4c562
pkgrel=1
arch=(x86_64 aarch64)
url="https://github.com/Qv2ray/gun"
license=('MIT')
depends=(gcc-libs)
makedepends=(go git)
source=("${pkgbase%-git}::git+$url")
b2sums=(SKIP)

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

build() {
    cd "$srcdir"/"${pkgbase%-git}"
    go build -v \
        -buildmode=pie -trimpath -mod=readonly -modcacherw \
        -ldflags="-s -w -extldflags=-Wl,-z,now,-z,relro" \
        -o gun github.com/Qv2ray/gun/cmd
    go build -v \
        -buildmode=pie -trimpath -mod=readonly -modcacherw \
        -ldflags="-s -w -extldflags=-Wl,-z,now,-z,relro" \
        -o gun-sip003 github.com/Qv2ray/gun/cmd/sip003
}

package_gun-proxy-git() {
	pkgdesc="PoC of tunneling traffic via gRPC CDNs"
	arch=(x86_64 aarch64)
	provides=(gun-proxy)
	conflicts=(gun-proxy)
	
	cd "$srcdir"/"${pkgbase%-git}"
	install -Dm755 gun -t "$pkgdir"/usr/bin/
}

package_gun-sip003-git() {
	pkgdesc="PoC of tunneling traffic via gRPC CDNs (Shadowsocks SIP003 Plugin)"
    arch=(x86_64 aarch64)
    provides=(gun-sip003)
	conflicts=(gun-sip003)
	optdepends=('shadowsocks-rust: shadowsocks sip003 host'
                'shadowsocks-libev: shadowsocks sip003 host')
	
    cd "$srcdir"/"${pkgbase%-git}"
    install -Dm755 gun-sip003 -t "$pkgdir"/usr/bin/
}

package_gun-docs-git() {
    pkgdesc="PoC of tunneling traffic via gRPC CDNs (Documentations)"
    arch=(any)
    provides=(gun-docs)
    conflicts=(gun-docs)
    
    cd "$srcdir"/"${pkgbase%-git}"
    install -Dm644 README.md branding.png -t "$pkgdir"/usr/share/doc/gun/
    install -Dm644 cmd/sip003/README         "$pkgdir"/usr/share/doc/gun/README-SIP003
}