aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ntopng/APKBUILD
blob: 3cc20221d09d40becceed67422ca23a132510bc8 (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
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=ntopng
pkgver=2.4
pkgrel=2
pkgdesc="ntop next-generation"
url="http://www.ntop.org"
arch="all !s390x !ppc64le"
license="GPL"
depends=
pkgusers="ntop"
pkggroups="ntop"
makedepends="autoconf automake curl-dev geoip-dev glib-dev hiredis-dev
	libpcap-dev libtool libxml2-dev lua-dev luajit-dev lua-redis libressl-dev
	paxmark rrdtool-dev sqlite-dev wget zeromq-dev zlib-dev
	linux-headers mariadb-dev"
install="$pkgname.pre-install"
#subpackages="$pkgname-doc"
source="http://downloads.sourceforge.net/project/ntop/$pkgname/$pkgname-$pkgver-stable.tar.gz
	$pkgname.initd
	$pkgname.confd
	ntopng-update-geoip-db

	"

_builddir="$srcdir"/$pkgname-$pkgver-stable

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"
	./autogen.sh
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var/lib \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make all || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" MAN_DIR="$pkgdir/usr/share" install || return 1

	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
	install -m755 -D "$srcdir"/ntopng-update-geoip-db \
	 "$pkgdir"/usr/bin/ntopng-update-geoip-db
	# ntop internal db dir
	install -d -o ntop -g ntop -m755 "$pkgdir"/var/lib/ntopng/geoip || return 1
	install -d -o ntop -g ntop -m755 "$pkgdir"/var/run/ntopng || return 1
	# need to disable PAX mprotect protection for luajit
	paxmark -m "$pkgdir"/usr/bin/$pkgname || return 1
}