summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f17fa7f14d9f0c3742a02a5a43fec8a04d230123 (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
#  Maintainer: Sinnamon (George Aladin) <AngleSi at yahoo dot com>

pkgname=opendpi-netfilter-git
_pkgname=opendpi-netfilter
_pkgsrc=opendpi
pkgver=r7.c0fb9c1
pkgrel=1
pkgdesc="This package is a GPL implementation of an iptables and netfilter module for OpenDPI integration into the Linux kernel."
arch=('i686' 'x86_64')
license=('GPL2')
url="http://opendpi.org/"
depends=('iptables>=1.4.8' 'glibc' 'linux>=3.1')
makedepends=('linux-headers' 'linux-api-headers' 'git')
install=${_pkgname}.install
source=(${_pkgsrc}'::git+https://github.com/thomasbhatia/OpenDPI.git'
		${_pkgname}'::git+https://github.com/thomasbhatia/opendpi-netfilter.git'
		'protocols_make.patch')
md5sums=('SKIP' 'SKIP' 
		 '93d73ebf999433451fc6c2ca8b2858dd')

pkgver() {
	cd ${_pkgname}
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}


prepare() {
	patch -p1 -i "protocols_make.patch"
	cd ${srcdir}/${_pkgname}/src/
	if test -f "built-in.o";then  make clean;fi || return 1
}

build() {
	cd ${srcdir}/${_pkgname}
	OPENDPI_PATH=${srcdir}/${_pkgsrc} make -j1 || return 1

}

package() {
	mkdir -p $pkgdir/usr/lib/iptables/
	cd ${srcdir}/${_pkgname}
	cp ipt/libxt_opendpi.so ${pkgdir}/usr/lib/iptables/
	make -j1 modules_install INSTALL_MOD_PATH=${pkgdir}/usr || return 1
	mv ${pkgdir}/usr/lib/modules/$(uname -r)/extra $pkgdir/usr/lib/modules/$(uname -r)/$(readlink /usr/lib/modules/$(uname -r)/extramodules)
	rmdir ${pkgdir}/usr/lib/modules/$(uname -r)
	chmod a-x ${pkgdir}/usr/lib/iptables/libxt_opendpi.so
}