summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7a34c2329f333b48aff9eb9b3199a50976efe26f (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
# 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
}