blob: 4fcbe883c725772e97064f51eb13393728957b72 (
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.1
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=('dc077722576d2b96659a16fe11d8bb2519e5c51dc841e7b109ec9107153e16f9')
_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
}
|