blob: 8de00ec8f35a8247eae7e9153baa5c768f2bc4cb (
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
|
# Maintainer: Leo <i@setuid0.dev>
pkgname=tlsrouter-git
pkgver=r68.2862066
pkgrel=1
pkgdesc="Proxy TCP connections based on static rules, HTTP Host headers, and SNI server names"
arch=(x86_64)
url="https://pkg.go.dev/inet.af/tcpproxy"
license=('Apache-2.0')
groups=()
depends=()
makedepends=('git' 'go>=1.16')
provides=("${pkgname%-VCS}")
conflicts=("${pkgname%-VCS}")
replaces=()
backup=()
options=()
install=
source=(
'tcpproxy::git+https://github.com/inetaf/tcpproxy.git'
'tlsrouter.sample.conf'
)
noextract=()
md5sums=('SKIP' 'SKIP')
pkgver() {
cd "$srcdir/tcpproxy"
# Git, no tags available
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
export GOPATH="$srcdir/gopath"
cd "$srcdir/tcpproxy"
go mod download
go mod verify
}
build() {
export GOPATH="$srcdir/gopath"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
cd "$srcdir/tcpproxy"
CGO_ENABLED=0 go build \
-trimpath \
-o ./tlsrouter \
./cmd/tlsrouter/main.go \
./cmd/tlsrouter/config.go \
./cmd/tlsrouter/sni.go
}
check() {
:
}
package() {
install -Dt "$pkgdir/usr/bin/" -m755 "$srcdir/tcpproxy/tlsrouter"
install -Dt "$pkgdir/usr/share/tlsrouter/" -m644 "$srcdir/tlsrouter.sample.conf"
install -Dt "$pkgdir/usr/lib/systemd/system/" -m644 "$srcdir/tcpproxy/systemd/tlsrouter.service"
}
|