blob: f856d2d28c13f47ecf4ee6fdb3f5eebd763ba9f1 (
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# Maintainer: Sherlock Holo <sherlockya@gmail.com>
_pkgname=camouflage
pkgname=$_pkgname-git
pkgver=2.0.1.r3.g1a6e14e
pkgrel=2
pkgdesc="a mux websocket over TLS proxy, experimental version"
arch=('x86_64')
license=('MPL')
depends=()
makedepends=('go>=2:1.17' 'git')
url='https://github.com/Sherlock-Holo/camouflage'
source=(
"git+https://github.com/Sherlock-Holo/camouflage"
"camouflage.install"
)
provides=(camouflage)
conflicts=(camouflage)
md5sums=('SKIP'
'd506ec62e984c89ddea0cec157292d42')
backup=(
'etc/camouflage/example.toml'
)
pkgver() {
cd $srcdir/$_pkgname
git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g' | sed 's/^v//g'
}
build() {
rm -rf "$srcdir/go/src"
mkdir -p "$srcdir/go/src"
export GOPATH="$srcdir/go"
cd "$srcdir/$_pkgname"
msg2 "Downloading dependencies"
export GO111MODULE=on
export CGO_ENABLED=0
export GOPROXY=https://goproxy.cn,direct
go mod download
export GOFLAGS="-trimpath -mod=readonly -modcacherw"
msg2 "Building binary"
msg2 "Cleaning residual"
chmod 777 -R $GOPATH/pkg/mod
rm -rf $GOPATH/pkg/mod
go build -v
}
package() {
mkdir -p $pkgdir/usr/bin
install -D $srcdir/$_pkgname/camouflage $pkgdir/usr/bin/camouflage
mkdir -p $pkgdir/etc/camouflage
install -Dm644 $srcdir/$_pkgname/config/example.toml $pkgdir/etc/camouflage/
mkdir -p $pkgdir/usr/lib/systemd/system
install $srcdir/$_pkgname/systemd/camouflage-{client,server}@.service \
-Dm644 $pkgdir/usr/lib/systemd/system/
}
|