diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..7a34c2329f33 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,39 @@ +# Maintainer: soh @ AUR + +pkgname=tun2socks-git +_pkgname=tun2socks +pkgver=v2.5.1.r0.g7ab86fd +pkgrel=1 +pkgdesc='create a network interface which passes all traffic through proxy' +arch=('x86_64') +url='https://github.com/xjasonlyu/tun2socks' +license=('GPL3') +depends=() +source=('git+https://github.com/xjasonlyu/tun2socks') +makedepends=('go' 'git' 'make') +optdepends=() +backup=() +b2sums=('SKIP') +provides=('tun2socks') +conflicts=('tun2socks' 'tun2socks-bin') + + +pkgver() { + cd ${srcdir}/${_pkgname} + git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' +} + +build(){ + cd ${srcdir}/${_pkgname} + GO111MODULE=on CGO_ENABLED=0 go build -v \ + -buildmode=pie -trimpath -mod=readonly -modcacherw \ + -tags "full" \ + -ldflags="-s -w -extldflags=-Wl,-z,now,-z,relro" \ + -o tun2socks +} + +package(){ + cd ${srcdir}/${_pkgname} + install -Dm755 tun2socks ${pkgdir}/usr/bin/tun2socks + install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/tun2socks/LICENSE +} |