1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
8 AUTOTOOLS_IN_SOURCE_BUILD=1
10 inherit autotools-utils eutils flag-o-matic linux-info readme.gentoo systemd user
12 DESCRIPTION="A userspace logging daemon for netfilter/iptables related logging"
13 HOMEPAGE="https://netfilter.org/projects/ulogd/index.html"
15 https://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2
16 ftp://ftp.netfilter.org/pub/${PN}/${P}.tar.bz2
21 KEYWORDS="amd64 ~ia64 ppc x86"
22 IUSE="dbi doc json mysql nfacct +nfct +nflog pcap postgres sqlite -ulog"
25 || ( net-firewall/iptables net-firewall/nftables )
26 >=net-libs/libnfnetlink-1.0.1
27 dbi? ( dev-db/libdbi )
28 json? ( dev-libs/jansson )
30 >=net-libs/libmnl-1.0.3
31 >=net-libs/libnetfilter_acct-1.0.1
33 nfct? ( >=net-libs/libnetfilter_conntrack-1.0.2 )
34 nflog? ( >=net-libs/libnetfilter_log-1.0.0 )
35 mysql? ( virtual/mysql )
36 pcap? ( net-libs/libpcap )
37 postgres? ( dev-db/postgresql:= )
38 sqlite? ( dev-db/sqlite:3 )
42 app-text/linuxdoc-tools
48 PATCHES=( "${FILESDIR}/${P}-remove-db-automagic.patch" )
50 DOCS=( AUTHORS README TODO )
52 You must have at least one logging stack enabled to make ulogd work.
53 Please edit example configuration located at /etc/ulogd.conf
58 enewuser ulogd -1 -1 /var/log/ulogd ulogd
62 if kernel_is lt 2 6 14; then
63 die "ulogd requires kernel newer than 2.6.14"
66 if kernel_is lt 2 6 18; then
67 ewarn "You are using kernel older than 2.6.18"
68 ewarn "Some ulogd features may be unavailable"
71 if use nfacct && kernel_is lt 3 3 0; then
72 ewarn "NFACCT input plugin requires kernel newer than 3.3.0"
75 if use ulog && kernel_is gt 3 17 0; then
76 ewarn "ULOG target was removed since 3.17.0 kernel release"
77 ewarn "Consider enabling NFACCT, NFCT or NFLOG support"
82 # - make all logs to be kept in a single dir /var/log/ulogd
83 # - place sockets in /run instead of /tmp
85 -e 's:var/log:var/log/ulogd:g' \
87 ulogd.conf.in || die 'sed on ulogd.conf.in failed'
90 autotools-utils_src_prepare
96 $(use_with json jansson)
102 $(use_with postgres pgsql)
106 autotools-utils_src_configure
110 autotools-utils_src_compile
113 # Prevent access violations from bitmap font files generation
114 export VARTEXFONTS="${T}"/fonts
120 autotools-utils_src_install
121 readme.gentoo_create_doc
122 prune_libtool_files --modules
125 dohtml doc/${PN}.html
126 dodoc doc/${PN}.dvi doc/${PN}.txt doc/${PN}.ps
129 use sqlite && dodoc doc/sqlite3.table
130 use mysql && dodoc doc/mysql-*.sql
131 use postgres && dodoc doc/pgsql-*.sql
136 fowners root:ulogd /etc/ulogd.conf
137 fperms 640 /etc/ulogd.conf
139 newinitd "${FILESDIR}/${PN}.init-r1" ${PN}
140 systemd_newunit "${FILESDIR}/${PN}.service-r1" ${PN}.service
142 insinto /etc/logrotate.d
143 newins "${FILESDIR}/${PN}.logrotate" ${PN}
145 diropts -o ulogd -g ulogd
146 keepdir /var/log/ulogd