blob: 5b0f467ffd4a43e9cabf10354f3eec4b840c012a (
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
|
# Maintainer: Eric Long <i@hack3r.moe>
_pkgname=mimic
_pkgbase=$_pkgname-bpf
pkgname=($_pkgbase-git $_pkgbase-dkms-git)
pkgver=0.6.0.r2.d851ddf
pkgrel=1
pkgdesc="eBPF UDP -> TCP obfuscator"
arch=('x86_64' 'aarch64' 'riscv64')
url="https://github.com/hack3ric/$_pkgname"
license=('GPL-2.0-only')
makedepends=('git' 'clang' 'bpf' 'ruby-ronn-ng' 'libbpf' 'libffi')
source=("git+https://github.com/hack3ric/$_pkgname#branch=master")
b2sums=('SKIP')
pkgver() {
cd $_pkgname
printf "%s" "$(git describe --dirty=-patched --tags --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g' | sed 's/^v//')"
}
prepare() {
cd $_pkgname
sed install/mimic@.service.in \
-e 's|@@MIMIC_EXEC@@|/usr/bin/mimic|' \
-e 's|@@MIMIC_CONFIG_PATH@@|/etc/mimic|' \
-e 's|@@MIMIC_RUNTIME_DIR@@|mimic|' \
> install/mimic@.service
sed kmod/dkms.conf.in \
-e 's|@@EXTRA_OPTS@@||' \
> kmod/dkms.conf
}
build() {
cd $_pkgname
make MODE=release build-cli generate-manpage
}
package_mimic-bpf-git() {
depends=('glibc' 'gcc-libs' 'libbpf' 'libffi' $_pkgbase-modules=$pkgver)
provides=($_pkgbase)
conflicts=($_pkgbase)
install -Dm755 "$srcdir/$_pkgname/out/$_pkgname" "$pkgdir/usr/bin/$_pkgname"
install -Dm644 "$srcdir/$_pkgname/out/$_pkgname.1.gz" "$pkgdir/usr/share/man/man1/$_pkgname.1.gz"
install -Dm644 "$srcdir/$_pkgname/install/eth0.conf.example" "$pkgdir/etc/mimic/eth0.conf.example"
install -Dm644 "$srcdir/$_pkgname/install/$_pkgname.sysusers" "$pkgdir/usr/lib/sysusers.d/$_pkgname.conf"
install -Dm644 "$srcdir/$_pkgname/install/$_pkgname@.service" "$pkgdir/usr/lib/systemd/system/$_pkgname@.service"
}
package_mimic-bpf-dkms-git() {
pkgdesc+=" - DKMS module"
depends=('dkms')
provides=($_pkgbase-modules=$pkgver $_pkgbase-dkms)
conflicts=($_pkgbase-modules=$pkgver $_pkgbase-dkms)
install -d "$pkgdir/usr/src/$_pkgname-$pkgver"
cp -r "$srcdir/$_pkgname/kmod/"* "$pkgdir/usr/src/$_pkgname-$pkgver/"
}
|