1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
8 COMMIT_ID="a82d9cfe03679b82ab4d9586c93ad377e9e27149"
10 inherit autotools-utils eutils flag-o-matic linux-info readme.gentoo-r1 systemd user vcs-snapshot
12 DESCRIPTION="A userspace logging daemon for netfilter/iptables related logging"
13 HOMEPAGE="https://netfilter.org/projects/ulogd/index.html"
14 SRC_URI="https://git.netfilter.org/${PN}2/snapshot/${COMMIT_ID}.tar.gz -> ${P}.tar.gz"
18 KEYWORDS="amd64 ~ia64 ppc x86"
19 IUSE="dbi doc json mysql nfacct +nfct +nflog pcap postgres sqlite -ulog"
22 || ( net-firewall/iptables net-firewall/nftables )
23 >=net-libs/libnfnetlink-1.0.1
24 dbi? ( dev-db/libdbi )
25 json? ( dev-libs/jansson )
27 >=net-libs/libmnl-1.0.3
28 >=net-libs/libnetfilter_acct-1.0.1
30 nfct? ( >=net-libs/libnetfilter_conntrack-1.0.2 )
31 nflog? ( >=net-libs/libnetfilter_log-1.0.0 )
32 mysql? ( virtual/mysql )
33 pcap? ( net-libs/libpcap )
34 postgres? ( dev-db/postgresql:= )
35 sqlite? ( dev-db/sqlite:3 )
39 app-text/linuxdoc-tools
41 dev-texlive/texlive-fontsrecommended
46 DOCS=( AUTHORS README TODO )
49 You must have at least one logging stack enabled to make ulogd work.
50 Please edit the example configuration located at /etc/ulogd.conf.
55 enewuser ulogd -1 -1 /var/log/ulogd ulogd
59 if kernel_is lt 2 6 14; then
60 die "${PN} requires a kernel >= 2.6.14."
63 if use nfacct && kernel_is lt 3 3 0; then
64 ewarn "NFACCT input plugin requires a kernel >= 3.3."
67 if use ulog && kernel_is ge 3 17 0; then
68 ewarn "ULOG target has been removed in the 3.17 kernel release."
69 ewarn "Consider enabling NFACCT, NFCT, or NFLOG support instead."
74 # - make all logs to be kept in a single dir /var/log/ulogd
75 # - place sockets in /run instead of /tmp
77 -e "s%var/log%var/log/${PN}%g" \
82 autotools-utils_src_prepare
88 $(use_with json jansson)
94 $(use_with postgres pgsql)
98 autotools-utils_src_configure
102 autotools-utils_src_compile
105 # Prevent access violations from bitmap font files generation
106 export VARTEXFONTS="${T}"/fonts
112 autotools-utils_src_install
113 prune_libtool_files --modules
114 readme.gentoo_create_doc
117 dohtml doc/${PN}.html
118 dodoc doc/${PN}.{dvi,ps,txt}
121 use mysql && dodoc doc/mysql-*.sql
122 use postgres && dodoc doc/pgsql-*.sql
123 use sqlite && dodoc doc/sqlite3.table
128 doins "${BUILD_DIR}/${PN}.conf"
129 fowners root:ulogd /etc/${PN}.conf
130 fperms 640 /etc/${PN}.conf
132 newinitd "${FILESDIR}/${PN}.init" ${PN}
133 systemd_dounit "${FILESDIR}/${PN}.service"
135 insinto /etc/logrotate.d
136 newins "${FILESDIR}/${PN}.logrotate" ${PN}
138 diropts -o ulogd -g ulogd
139 keepdir /var/log/ulogd
143 readme.gentoo_print_elog