summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fe667607c11726464a1491366e0f782b92ba19ed (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
# Maintainer: Fancy Zhang <springzfx@gmail.com>
pkgname=cgproxy
pkgver=0.16
pkgrel=2
pkgdesc="A transparent proxy program powered by cgroup2 and tproxy"
arch=('x86_64')
url="https://github.com/springzfx/cgproxy"
license=('GPL')
groups=('')
makedepends=('llvm' 'clang' 'cmake' 'nlohmann-json' 'bpf')
depends=('gcc-libs' 'systemd' 'which' 'iproute2')
provides=('cgproxy')
conflicts=('cgproxy')

source=("${pkgname}::git+https://github.com/springzfx/cgproxy#tag=${pkgver}")
md5sums=('SKIP')

backup=('etc/cgproxy/config.json')
install='cgproxy.install'

build(){
    cd ${srcdir}/${pkgname}
    # init submodule
    git submodule init
    git submodule update

    # build libexecsnoop.so
    cd "${srcdir}/${pkgname}/execsnoop-libbpf"
    make clean
    make CFLAGS="-O2 -Wall" libexecsnoop.so

    # build main binary
    cd "${srcdir}/${pkgname}"
    mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make
}

package_cgproxy(){
    cd "${srcdir}/$pkgname"/build
    make DESTDIR=$pkgdir install
    # cd "${srcdir}/${pkgname}/execsnoop-libbpf"
    # make DESTDIR=$pkgdir install
}