# Contributor: Ɓukasz Jendrysik # Maintainer: Leonardo Arena pkgname=ulogd pkgver=2.0.7 pkgrel=4 pkgdesc="A userspace logging daemon for netfilter/iptables related logging" url="http://netfilter.org/projects/ulogd/index.html" arch="all" license="GPL-2.0-only" makedepends="libmnl-dev libpcap-dev libnetfilter_acct-dev bsd-compat-headers libnfnetlink-dev libnetfilter_conntrack-dev libnetfilter_log-dev pkgconfig mariadb-connector-c-dev openssl-dev postgresql-dev zlib-dev linux-headers autoconf automake libtool jansson-dev sqlite-dev" subpackages=" $pkgname-doc $pkgname-openrc " source="https://www.netfilter.org/projects/ulogd/files/ulogd-$pkgver.tar.bz2 musl-fixes.patch ulogd.initd ulogd.confd ulogd.logrotate " _modules="mysql pgsql json xml sqlite3" for _module in $_modules; do subpackages="$subpackages $pkgname-$_module:_plugin" done build() { cd "$builddir" export CFLAGS="$CFLAGS -D_GNU_SOURCE" autoreconf -vif ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --with-pgsql \ --with-mysql make } package() { cd "$builddir" make DESTDIR="$pkgdir" install install -Dm644 ulogd.conf "$pkgdir"/etc/ulogd.conf install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname install -m644 -D "$srcdir"/$pkgname.logrotate "$pkgdir"/etc/logrotate.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 } _plugin() { plugin="${subpkgname##*-}" depends="$pkgname=$pkgver-r$pkgrel" pkgdesc="$plugin output for $pkgname" mkdir -p "$subpkgdir"/usr/lib/ulogd mv "$pkgdir"/usr/lib/ulogd/ulogd_output_"$(echo $plugin | tr '[a-z]' '[A-Z]')".so \ "$subpkgdir"/usr/lib/ulogd # Move the .sql files to their plugins to subpackage case "$plugin" in pgsql|mysql) mkdir -p "$subpkgdir"/usr/share/ulogd/doc mv "$pkgdir"/usr/share/ulogd/doc/"$plugin"* "$subpkgdir"/usr/share/ulogd/doc ;; esac } sha512sums="1ad12bcf91bebe8bf8580de38693318cdabd17146f1f65acf714334885cf13adf5f783abdf2dd67474ef12f82d2cfb84dd4859439bc7af10a0df58e4c7e48b09 ulogd-2.0.7.tar.bz2 f65e051520645c5e1618b1ef9d570ebac77ec8d05972c9b58ca93475a9612a725b26634a71e9fb8e117ae004a2dc13da2a1368b549d2808bd299e39b8f8d6bab musl-fixes.patch ab60e367a18d6dafcf5ee22562e303d74944f97b1e42717607db85f11d15d94be3e0e9aaa422c2bac13cdeee1aabc550f751f3e6419b1c7b16d86d0ee8fad55a ulogd.initd bdae1ff90c671b6847dfda1947a33e24bfbe16ad963f85769d923ba33021bc4ca315fd410b46fac102f0a24e879e4be4ad7bb5978c5a6755e74e6b5d7c3e18ee ulogd.confd e079c714f1e34d84cf9927fbbc102fed7a7ce3a8c58d0cea44766ad26d3d6f4bbfe5838be3d7e52e059c0e6d566ad4cb9bdbcd8fbf47999c73aa315f41c0652e ulogd.logrotate"