aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ipt-netflow-grsec/APKBUILD
blob: 326b0d0a4de115cd2b436948f60234e806a43fcf (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
69
70
71
72
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>

_flavor=grsec
_kpkg=linux-$_flavor
_kver=3.14.4
_kpkgrel=2

# when chaning _ver we *must* bump _mypkgrel
_ver=1.8

_mypkgrel=0

# verify the kernel version before entering chroot
if [ -f ../linux-${_flavor}/APKBUILD ]; then
	. ../linux-${_flavor}/APKBUILD
	pkgname=ipt-netflow-${_flavor}
	[ "$_kver" != "$pkgver" ] && die "please update _kver to $pkgver"
	[ "$_kpkgrel" != "$pkgrel" ] && die "please update _kpkgrel to $pkgrel"
fi

_kpkgver="$_kver-r$_kpkgrel"
_abi_release=${_kver}-${_kpkgrel}-${_flavor}

pkgname=ipt-netflow-${_flavor}
pkgver=$_kver

pkgrel=$(( $_kpkgrel + $_mypkgrel ))
pkgdesc="Linux kernel netflow sensor module"
url="http://ipt-netflow.sourceforge.net/"
arch="all"
license=GPL3+
source="ipt-netflow-$_ver.tar.gz::https://github.com/aabc/ipt-netflow/archive/v$_ver.tar.gz
	git.patch
	"
depends="$_kpkg-dev=$_kpkgver"
makedepends="linux-${_flavor}-dev=$_kpkgver iptables-dev bash"
install_if="$_kpkg=$_kpkgver ipt-netflow"

_builddir="$srcdir"/ipt-netflow-$_ver
prepare() {
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
        cd "$_builddir"
        ./configure --kver=$_abi_release \
		--ipt-inc=/usr/include/libiptc \
		|| return 1
	make ipt_NETFLOW.ko || return 1
}

package() {
        cd "$_builddir"
        make -j1 minstall DEPMOD=: DESTDIR="$pkgdir" || return 1
}

# override dev() from kernel's APKBUILD
dev() {
	default_dev
}

md5sums="922a7d9dd17f28a2c3551a1c5e9849eb  ipt-netflow-1.8.tar.gz
77875a5979589bca8c49a8331e7cc22b  git.patch"
sha256sums="eefe766eda6d4d918e4cc919b5d5acd2b681a258246017ab7948b80f0cb95112  ipt-netflow-1.8.tar.gz
75ea3afe9532699d4fd1bef7f198dfaa97b3a310234a86b48371522ae0704a60  git.patch"
sha512sums="c413515deeac1d604e36a53b39edcf340d6c3f78c29e53979fede8aa013e324ada4622b571ac5270f7495ab6982096cd2bd9e9283c9cc2cc7360aa5c3954792d  ipt-netflow-1.8.tar.gz
3fade2ceb00ddae15dd6b1eacebc36480efe0c5c2d050e050e0aef37382ad72ca454f4d23080b7263ab2f078f72db4572e2514d3faca113d8e437437f7c3afcf  git.patch"