summaryrefslogtreecommitdiffstats
path: root/main/ulogd/APKBUILD
blob: 5b6c7bdcd15fb448d1d73c937a90b899d09342c8 (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
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=ulogd
pkgver=2.0.1
pkgrel=0
pkgdesc="A userspace logging daemon for netfilter/iptables related logging"
url="http://netfilter.org/projects/ulogd/index.html"
arch="all"
license="GPL"
depends=
makedepends="libmnl-dev libpcap-dev libnetfilter_acct-dev 
	libnfnetlink-dev libnetfilter_conntrack-dev libnetfilter_log-dev 
	pkgconfig mysql-dev openssl-dev postgresql-dev zlib-dev"
subpackages="$pkgname-mysql $pkgname-pgsql $pkgname-doc"
source="http://www.netfilter.org/projects/$pkgname/files/$pkgname-$pkgver.tar.bz2
	ulogd.initd
	ulogd.confd
	ulogd.logrotate"

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

build() {
	cd "$_builddir"

	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--with-pgsql \
		--with-mysql
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install
	install -Dm644 ulogd.conf "$pkgdir"/etc/ulogd.conf
	install -Dm644 ulogd.logrotate "$pkgdir"/etc/logrotate.d/ulogd
	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
	install -dm755 "$pkgdir"/usr/share/doc/ulogd
	install -Dm644 ulogd.conf "$pkgdir"/usr/share/doc/ulogd/ulogd.conf.sample
	install -Dm644 doc/ulogd.sgml "$pkgdir"/usr/share/doc/ulogd/ulogd.sgml
	install -dm0755 "$pkgdir"/usr/share/ulogd
	for file in $(ls doc/*.sql)
	do
		install -Dm644 $file "$pkgdir"/usr/share/ulogd/$file
	done
	find "$pkgdir" -name *.la -delete
}

mysql() {
	depends="$pkgname"
	mkdir -p "$subpkgdir"/usr/lib/ulogd/
	mv "$pkgdir"/usr/lib/ulogd/ulogd_output_MYSQL.so "$subpkgdir"/usr/lib/ulogd/
}

pgsql() {
	depends="$pkgname"
	mkdir -p "$subpkgdir"/usr/lib/ulogd/
	mv "$pkgdir"/usr/lib/ulogd/ulogd_output_PGSQL.so "$subpkgdir"/usr/lib/ulogd/
}

md5sums="2f4b1a58955fcad4ebf22f0d00885fc9  ulogd-2.0.1.tar.bz2
5b229ed2622f1e5871a04cae62053112  ulogd.initd
b9b2fa217ee02211debee5a5dffdcda7  ulogd.confd
77688e9c300750f5423ed2ad37ae8b32  ulogd.logrotate"