41 lines
1.5 KiB
Bash
41 lines
1.5 KiB
Bash
# Maintainer: Amir Husayn Panahifar <ahp@panahifar.ir>
|
|||
|
|
pkgname=prx
|
||
|
|
pkgver=0.1.0
|
||
|
|
pkgrel=1
|
||
|
|
pkgdesc="Safe proxy routing manager that keeps inbound connections (e.g. SSH) alive"
|
||
|
|
arch=('x86_64' 'aarch64')
|
||
|
|
url="https://github.com/example/prx"
|
||
|
|
license=('MIT')
|
||
|
|
depends=('glibc' 'nftables' 'iproute2' 'systemd')
|
||
|
|
optdepends=(
|
||
|
|
'sing-box: default proxy engine (TUN mode)'
|
||
|
|
'polkit: run privileged actions through pkexec without sudo'
|
||
|
|
)
|
||
|
|
makedepends=('go')
|
||
|
|
provides=('prx')
|
||
|
|
# Adjust `source` to a tagged tarball or a git source before publishing.
|
||
|
|
source=("$pkgname-$pkgver.tar.gz")
|
||
|
|
sha256sums=('SKIP')
|
||
|
|
|
||
|
|
build() {
|
||
|
|
cd "$srcdir/$pkgname-$pkgver"
|
||
|
|
export CGO_ENABLED=0
|
||
|
|
export GOFLAGS="-trimpath -mod=mod"
|
||
|
|
go build -ldflags "-s -w -X prx/internal/version.Version=$pkgver" -o prx ./cmd/prx
|
||
|
|
go build -ldflags "-s -w" -o prx-helper ./cmd/prx-helper
|
||
|
|
}
|
||
|
|
|
||
|
|
package() {
|
||
|
|
cd "$srcdir/$pkgname-$pkgver"
|
||
|
|
|
||
|
|
install -Dm755 prx "$pkgdir/usr/bin/prx"
|
||
|
|
install -Dm755 prx-helper "$pkgdir/usr/lib/prx/prx-helper"
|
||
|
|
install -Dm644 polkit/org.prx.policy "$pkgdir/usr/share/polkit-1/actions/org.prx.policy"
|
||
|
|
install -Dm644 systemd/prx-reapply.service "$pkgdir/usr/lib/systemd/system/prx-reapply.service"
|
||
|
|
install -Dm644 systemd/prx-reapply.timer "$pkgdir/usr/lib/systemd/system/prx-reapply.timer"
|
||
|
|
install -Dm644 man/prx.1 "$pkgdir/usr/share/man/man1/prx.1"
|
||
|
|
install -Dm644 man/prx-helper.1 "$pkgdir/usr/share/man/man1/prx-helper.1"
|
||
|
|
install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
|
||
|
|
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||
|
|
}
|