blob: 4a6aebc224f6e9574ef3df7b56851838c59c12f4 (
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
|
# Maintainer: Carl Smedstad <carsme@archlinux.org>
pkgname=opengfw
_pkgname=OpenGFW
pkgver=0.4.0
pkgrel=1
pkgdesc="A flexible, easy-to-use, open source implementation of GFW"
arch=(x86_64)
url="https://github.com/apernet/OpenGFW"
license=(MPL-2.0)
depends=(glibc)
makedepends=(go)
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('7bc3489edd5e4dc41c396612d2a93b70ba8720807edcf2536b064a482f9f374c')
_archive="$_pkgname-$pkgver"
prepare() {
cd "$_archive"
go mod download -x
}
build() {
cd "$_archive"
export CGO_CPPFLAGS="$CPPFLAGS"
export CGO_CFLAGS="$CFLAGS"
export CGO_CXXFLAGS="$CXXFLAGS"
export CGO_LDFLAGS="$LDFLAGS"
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
go build -v -buildvcs=false
}
check() {
cd "$_archive"
go test -v ./...
}
package() {
cd "$_archive"
install -Dm755 -t "$pkgdir/usr/bin" OpenGFW
ln -s /usr/bin/OpenGFW "$pkgdir/usr/bin/opengfw"
install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md
cp -a -t "$pkgdir/usr/share/doc/$pkgname" docs
}
|