aboutsummaryrefslogtreecommitdiffstats
path: root/testing/flowd/APKBUILD
blob: 953b9c49363de7c3517b73d3699e22033a7ffc24 (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
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Valery Kartel <valery.kartel@gmail.com>
pkgname=flowd
pkgver=0.9.1
pkgrel=6
pkgdesc="Small, fast and secure NetFlow collector"
url="https://www.mindrot.org/projects/flowd/"
arch="all"
license="BSD-3-Clause"
install="$pkgname.pre-install"
pkgusers="$pkgname"
makedepends="byacc perl-dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-openrc
	perl-$pkgname:_perl perl-$pkgname-doc:_perldoc:noarch"
source="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/$pkgname/$pkgname-$pkgver.tar.gz
	fix_path.patch
	fix_user.patch
	$pkgname.initd"

# Packages remove ddue to depending on python2
replaces="$pkgname-tools $pkgname-rrd py-$pkgname"

prepare() {
	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--target=$CTARGET \
		--prefix=/usr \
		--localstatedir=/var \
		--sysconfdir=/etc/$pkgname
	make

	# perl
	cd Flowd-perl
	CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
	make
}

check() {
	make -C "$builddir"/Flowd-perl test
}

package() {
	make -C "$builddir" DESTDIR="$pkgdir" install
	install -dm750 -o $pkgname "$pkgdir"/var/lib/$pkgname
	install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	rm -f "$pkgdir"/usr/lib/*.a
}

_perl() {
	pkgdesc="$pkgdesc (perl module)"
	make -C "$builddir"/Flowd-perl DESTDIR="$subpkgdir" install
	find "$subpkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
	mkdir -p "$subpkgdir-doc"/usr
	mv "$subpkgdir"/usr/share "$subpkgdir-doc"/usr
}

_perldoc() {
	pkgdesc="$pkgdesc (perl module documentation)"
	install_if="docs perl-$pkgname=$pkgver-r$pkgrel"
}

sha512sums="c86d810de9a163206525c4ac12029d650209a370213d701d38b0e7ea746e087d2a0f80ab1657ccca87851cdf64628813666028e267529d6b7391b63542230967  flowd-0.9.1.tar.gz
427a0b690519ddeb28da581ba7740faa6de9c6baf40ba285ad82f5652def3c950c8b080ca677de9748eea6cc1c2c5ab38559a139655e6cb176b021a5a9d5d912  fix_path.patch
5264f4e913464c7cd6957ea4ef2a458551e3b52c66d1b709e90bfbe014327b72fbff52e282acbf6a2222972ca96f5908410f6ab51c3d8a161e9eef111634d8f2  fix_user.patch
68cfe2ea07eb981c02660f5c05018308c164705f52c0c1d90bdacc45ec993dca971439c60b02f5ba3e521c8730e54d968a31af1eddfe6924d39d33c50843836b  flowd.initd"