archrelease: copy trunk to community-any
[ArchLinux/community.git] / wireproxy / repos / community-x86_64 / PKGBUILD
blob85af0ae0bb980ae9212feda2791041f3b141fce0
1 # Maintainer: Justin Kromlinger <hashworks@archlinux.org>
2 # Contributor: Ivan <vantu5z@mail.ru>
4 pkgname=wireproxy
5 pkgver=1.0.5
6 pkgrel=3
7 arch=(x86_64)
8 license=(ISC)
9 url="https://github.com/octeep/wireproxy"
10 pkgdesc="Wireguard client that exposes itself as a socks5 proxy"
11 depends=('glibc')
12 makedepends=('go')
13 source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz"
14         "${pkgname}.sysusers"
15         "${pkgname}.tmpfiles"
16         "${pkgname}.service"
17         "${pkgname}@.service"
18         "${pkgname}-user.service"
19         "${pkgname}-user@.service")
20 sha256sums=('3779a157713b462a7b5322f1437f768ab69ae446df0ceca76c6dff7c4030e425'
21             '24a30e40d3fb5d79b81b2028b17533abf1e27cb9684035ba19c639f6c45907d2'
22             'ab9a59d0f200371aee18abc93653cf8f9504063d14ae08e289b90f711e559735'
23             '2386e40a6b1999341907262abc0f6e62d9a2d02706a497d619664b4c43cf852f'
24             'b72ca8f8716d2eea9eb782ffa11942e6a44b2e8e9ec7b60e96565b8f29731276'
25             '9c136bca0f65070f450ce942be7cd48254a385ed2a286f792d22ab74bb9a29a2'
26             'fae5f0e1669d05d10b13a00031132c9bde8cc9b3e22fc91154edd5c01d750ef3')
28 build() {
29   cd "${pkgname}-${pkgver}"
31   export CGO_CFLAGS="${CFLAGS}"
32   export CGO_CPPFLAGS="${CPPFLAGS}"
33   export CGO_CXXFLAGS="${CXXFLAGS}"
34   export CGO_LDFLAGS="${LDFLAGS}"
36   go build -v \
37     -buildmode=pie \
38     -trimpath \
39     -mod=readonly \
40     -modcacherw \
41     -ldflags "-linkmode=external \
42       -X main.version=${pkgver}" \
43     -o "${pkgname}" \
44     "./cmd/${pkgname}"
47 package() {
48   install -Dm0644 "${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
49   install -Dm0644 "${pkgname}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
50   install -Dm0644 "${pkgname}.service" "${pkgname}@.service" -t "${pkgdir}/usr/lib/systemd/system/"
51   install -Dm0644 "${pkgname}-user.service" "${pkgdir}/usr/lib/systemd/user/${pkgname}.service"
52   install -Dm0644 "${pkgname}-user@.service" "${pkgdir}/usr/lib/systemd/user/${pkgname}@.service"
54   cd "${pkgname}-${pkgver}"
55   install -Dm0755 "${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
56   install -Dm0644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"