summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2df218c3387493b62e0f2348e839a48397ca718c (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: Kimiblock
# Contributor: Fancy Zhang <springzfx@gmail.com>

pkgname=cgproxy-git
pkgver=0.20.r0.g86fe42ec
pkgrel=2
pkgdesc="A transparent proxy program powered by cgroup2 and tproxy"
arch=('x86_64')
url="https://github.com/springzfx/cgproxy"
license=('GPL-2.0-or-later')
makedepends=('cmake' 'nlohmann-json' 'clang' 'bpf' 'libbpf' "git")
depends=("libbpf" "iproute2" "which" "nftables" "iptables-nft" "bash" "glibc" "gcc-libs")
provides=('cgproxy')
conflicts=('cgproxy')

source=("${pkgname}::git+https://github.com/springzfx/cgproxy#branch=master")
md5sums=('SKIP')
backup=('etc/cgproxy/config.json')

function pkgver() {
	cd "${srcdir}/${pkgname}"
	git describe --long --tags --abbrev=8 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

function prepare() {
	cd "${srcdir}/${pkgname}"
	
	# Cherry Pick Pull Request #52
	git cherry-pick -n d7990c0c2f1a1add5f863d35c670ec6aa720f1d3^..0b2c9a4c8264c2c4464ac38b12a60b96adf364f6
	git cherry-pick -n 3e68415864bacfe7fdbb73c08f403f867b440253
	git cherry-pick -n cb809d4033a0fb30ad22c03d98e0792793835f07
}

function build() {
	mkdir -p "${srcdir}/${pkgname}/build"
	cd "${srcdir}/${pkgname}/build"
	cmake -DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-Dbuild_execsnoop_dl=ON \
		-Dbuild_static=OFF \
		.. 
	make
}

function package() {
	cd "${srcdir}/${pkgname}"/build
	make DESTDIR="${pkgdir}" install
}