Gentoo Archives: gentoo-commits

From: Ian Delaney <idella4@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/ulogd/files/, app-admin/ulogd/
Date: Mon, 21 Sep 2015 07:44:06
Message-Id: 1442821420.d108e160bd54bc10ebb7c3697e214b3b2c8c7eb9.idella4@gentoo
1 commit: d108e160bd54bc10ebb7c3697e214b3b2c8c7eb9
2 Author: Ian Delaney <idella4 <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 21 07:14:27 2015 +0000
4 Commit: Ian Delaney <idella4 <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 21 07:43:40 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d108e160
7
8 app-admin/ulogd: revbump to -2.0.5-r2
9
10 Update ebuild to support nftables, Update OpenRC initscript to accommodate
11 nftables, update systemd service file to start ulogd before ebtables and
12 nftables, patches submitted by maintainer via, and closes, bug #560470
13 removed defunct -2.0.5, -2.0.5-r1
14
15 Package-Manager: portage-2.2.20.1
16
17 app-admin/ulogd/files/ulogd.init-r1 | 41 ++++++
18 app-admin/ulogd/files/ulogd.service-r1 | 13 ++
19 ...ulogd-2.0.5-r1.ebuild => ulogd-2.0.5-r2.ebuild} | 25 ++--
20 app-admin/ulogd/ulogd-2.0.5.ebuild | 141 ---------------------
21 4 files changed, 68 insertions(+), 152 deletions(-)
22
23 diff --git a/app-admin/ulogd/files/ulogd.init-r1 b/app-admin/ulogd/files/ulogd.init-r1
24 new file mode 100644
25 index 0000000..47a0674
26 --- /dev/null
27 +++ b/app-admin/ulogd/files/ulogd.init-r1
28 @@ -0,0 +1,41 @@
29 +#!/sbin/runscript
30 +# Copyright 1999-2015 Gentoo Foundation
31 +# Distributed under the terms of the GNU General Public License v2
32 +# $Id$
33 +
34 +extra_started_commands="reload reopen"
35 +
36 +: ${ULOGD_BINARY:=/usr/sbin/ulogd}
37 +: ${ULOGD_PIDFILE:=/run/${SVCNAME}.pid}
38 +: ${ULOGD_OPTS:=--daemon --uid ulogd --pidfile ${ULOGD_PIDFILE}}
39 +
40 +depend() {
41 + before iptables ip6tables ebtables nftables firewall
42 + after mysql postgresql
43 +}
44 +
45 +start() {
46 + ebegin "Starting ${SVCNAME}"
47 + start-stop-daemon --start \
48 + --exec ${ULOGD_BINARY} --pidfile ${ULOGD_PIDFILE} \
49 + -- ${ULOGD_OPTS}
50 + eend $?
51 +}
52 +
53 +stop() {
54 + ebegin "Stopping ${SVCNAME}"
55 + start-stop-daemon --stop --pidfile ${ULOGD_PIDFILE}
56 + eend $?
57 +}
58 +
59 +reload() {
60 + ebegin "Reloading ${SVCNAME} configuration"
61 + start-stop-daemon --signal USR1 --pidfile ${ULOGD_PIDFILE}
62 + eend $?
63 +}
64 +
65 +reopen() {
66 + ebegin "Reopening ${SVCNAME} logfiles"
67 + start-stop-daemon --signal HUP --pidfile ${ULOGD_PIDFILE}
68 + eend $?
69 +}
70
71 diff --git a/app-admin/ulogd/files/ulogd.service-r1 b/app-admin/ulogd/files/ulogd.service-r1
72 new file mode 100644
73 index 0000000..e6c88fb
74 --- /dev/null
75 +++ b/app-admin/ulogd/files/ulogd.service-r1
76 @@ -0,0 +1,13 @@
77 +[Unit]
78 +Description=A userspace logging daemon for netfilter/iptables related logging
79 +Before=iptables.service ip6tables.service ebtables.service nftables.service
80 +After=mysql.service postgresql.service
81 +
82 +[Service]
83 +Type=forking
84 +PIDFile=/run/ulogd.pid
85 +ExecStart=/usr/sbin/ulogd --daemon --uid ulogd --pidfile /run/ulogd.pid
86 +ExecReload=/bin/kill -USR1 $MAINPID
87 +
88 +[Install]
89 +WantedBy=network.target
90
91 diff --git a/app-admin/ulogd/ulogd-2.0.5-r1.ebuild b/app-admin/ulogd/ulogd-2.0.5-r2.ebuild
92 similarity index 85%
93 rename from app-admin/ulogd/ulogd-2.0.5-r1.ebuild
94 rename to app-admin/ulogd/ulogd-2.0.5-r2.ebuild
95 index 0115be0..2fc5a7e 100644
96 --- a/app-admin/ulogd/ulogd-2.0.5-r1.ebuild
97 +++ b/app-admin/ulogd/ulogd-2.0.5-r2.ebuild
98 @@ -20,7 +20,7 @@ KEYWORDS="~amd64 ~ia64 ~ppc ~x86"
99 IUSE="dbi doc json mysql nfacct +nfct +nflog pcap postgres sqlite -ulog"
100
101 RDEPEND="
102 - net-firewall/iptables
103 + || ( net-firewall/iptables net-firewall/nftables )
104 >=net-libs/libnfnetlink-1.0.1
105 dbi? ( dev-db/libdbi )
106 json? ( dev-libs/jansson )
107 @@ -33,20 +33,23 @@ RDEPEND="
108 mysql? ( virtual/mysql )
109 pcap? ( net-libs/libpcap )
110 postgres? ( dev-db/postgresql:= )
111 - sqlite? ( dev-db/sqlite:3 )"
112 -
113 + sqlite? ( dev-db/sqlite:3 )
114 +"
115 DEPEND="${RDEPEND}
116 doc? (
117 app-text/linuxdoc-tools
118 app-text/texlive-core
119 virtual/latex-base
120 - )"
121 + )
122 +"
123
124 PATCHES=( "${FILESDIR}/${P}-remove-db-automagic.patch" )
125
126 DOCS=( AUTHORS README TODO )
127 -DOC_CONTENTS="You must have at least one logging stack enabled to make ulogd work.
128 -Please edit example configuration located at /etc/ulogd.conf"
129 +DOC_CONTENTS="
130 + You must have at least one logging stack enabled to make ulogd work.
131 + Please edit example configuration located at /etc/ulogd.conf
132 +"
133
134 pkg_setup() {
135 enewgroup ulogd
136 @@ -55,12 +58,12 @@ pkg_setup() {
137 linux-info_pkg_setup
138
139 if kernel_is lt 2 6 14; then
140 - die "ulogd2 requires kernel newer than 2.6.14"
141 + die "ulogd requires kernel newer than 2.6.14"
142 fi
143
144 if kernel_is lt 2 6 18; then
145 ewarn "You are using kernel older than 2.6.18"
146 - ewarn "Some ulogd2 features may be unavailable"
147 + ewarn "Some ulogd features may be unavailable"
148 fi
149
150 if use nfacct && kernel_is lt 3 3 0; then
151 @@ -105,7 +108,7 @@ src_compile() {
152 autotools-utils_src_compile
153
154 if use doc; then
155 - # prevent access violations from generation of bitmap font files
156 + # Prevent access violations from bitmap font files generation
157 export VARTEXFONTS="${T}"/fonts
158 emake -C doc
159 fi
160 @@ -131,8 +134,8 @@ src_install() {
161 fowners root:ulogd /etc/ulogd.conf
162 fperms 640 /etc/ulogd.conf
163
164 - newinitd "${FILESDIR}/${PN}.init" ${PN}
165 - systemd_dounit "${FILESDIR}/${PN}.service"
166 + newinitd "${FILESDIR}/${PN}.init-r1" ${PN}
167 + systemd_newunit "${FILESDIR}/${PN}.service-r1" ${PN}.service
168
169 insinto /etc/logrotate.d
170 newins "${FILESDIR}/${PN}.logrotate" ${PN}
171
172 diff --git a/app-admin/ulogd/ulogd-2.0.5.ebuild b/app-admin/ulogd/ulogd-2.0.5.ebuild
173 deleted file mode 100644
174 index 0822bd7..0000000
175 --- a/app-admin/ulogd/ulogd-2.0.5.ebuild
176 +++ /dev/null
177 @@ -1,141 +0,0 @@
178 -# Copyright 1999-2015 Gentoo Foundation
179 -# Distributed under the terms of the GNU General Public License v2
180 -# $Id$
181 -
182 -EAPI=5
183 -
184 -AUTOTOOLS_AUTORECONF=1
185 -AUTOTOOLS_IN_SOURCE_BUILD=1
186 -
187 -inherit autotools-utils eutils linux-info readme.gentoo systemd user
188 -
189 -DESCRIPTION="A userspace logging daemon for netfilter/iptables related logging"
190 -HOMEPAGE="http://netfilter.org/projects/ulogd/index.html"
191 -SRC_URI="ftp://ftp.netfilter.org/pub/${PN}/${P}.tar.bz2
192 - http://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2"
193 -
194 -LICENSE="GPL-2"
195 -SLOT="0"
196 -KEYWORDS="~amd64 ~ia64 ~ppc ~x86"
197 -IUSE="dbi doc json mysql nfacct +nfct +nflog pcap postgres sqlite -ulog"
198 -
199 -RDEPEND="
200 - net-firewall/iptables
201 - >=net-libs/libnfnetlink-1.0.1
202 - dbi? ( dev-db/libdbi )
203 - json? ( dev-libs/jansson )
204 - nfacct? (
205 - >=net-libs/libmnl-1.0.3
206 - >=net-libs/libnetfilter_acct-1.0.1
207 - )
208 - nfct? ( >=net-libs/libnetfilter_conntrack-1.0.2 )
209 - nflog? ( >=net-libs/libnetfilter_log-1.0.0 )
210 - mysql? ( virtual/mysql )
211 - pcap? ( net-libs/libpcap )
212 - postgres? ( dev-db/postgresql:= )
213 - sqlite? ( dev-db/sqlite:3 )"
214 -
215 -DEPEND="${RDEPEND}
216 - doc? (
217 - app-text/linuxdoc-tools
218 - app-text/texlive-core
219 - virtual/latex-base
220 - )"
221 -
222 -PATCHES=( "${FILESDIR}/${P}-remove-db-automagic.patch" )
223 -
224 -DOCS=( AUTHORS README TODO )
225 -DOC_CONTENTS="You must have at least one logging stack enabled to make ulogd work.
226 -Please edit example configuration located at /etc/ulogd.conf"
227 -
228 -pkg_setup() {
229 - enewgroup ulogd
230 - enewuser ulogd -1 -1 /var/log/ulogd ulogd
231 -
232 - linux-info_pkg_setup
233 -
234 - if kernel_is lt 2 6 14; then
235 - die "ulogd2 requires kernel newer than 2.6.14"
236 - fi
237 -
238 - if kernel_is lt 2 6 18; then
239 - ewarn "You are using kernel older than 2.6.18"
240 - ewarn "Some ulogd2 features may be unavailable"
241 - fi
242 -
243 - if use nfacct && kernel_is lt 3 3 0; then
244 - ewarn "NFACCT input plugin requires kernel newer than 3.3.0"
245 - fi
246 -
247 - if use ulog && kernel_is gt 3 17 0; then
248 - ewarn "ULOG target was removed since 3.17.0 kernel release"
249 - ewarn "Consider enabling NFACCT, NFCT or NFLOG support"
250 - fi
251 -}
252 -
253 -src_prepare() {
254 - # - make all logs to be kept in a single dir /var/log/ulogd
255 - # - place sockets in /run instead of /tmp
256 - sed -i \
257 - -e 's:var/log:var/log/ulogd:g' \
258 - -e 's:tmp:run:g' \
259 - ulogd.conf.in || die 'sed on ulogd.conf.in failed'
260 -
261 - autotools-utils_src_prepare
262 -}
263 -
264 -src_configure() {
265 - local myeconfargs=(
266 - $(use_with dbi)
267 - $(use_with json jansson)
268 - $(use_enable nfacct)
269 - $(use_enable nfct)
270 - $(use_enable nflog)
271 - $(use_with mysql)
272 - $(use_with pcap)
273 - $(use_with postgres pgsql)
274 - $(use_with sqlite)
275 - $(use_enable ulog)
276 - )
277 - autotools-utils_src_configure
278 -}
279 -
280 -src_compile() {
281 - autotools-utils_src_compile
282 -
283 - if use doc; then
284 - # prevent access violations from generation of bitmap font files
285 - export VARTEXFONTS="${T}"/fonts
286 - emake -C doc
287 - fi
288 -}
289 -
290 -src_install() {
291 - autotools-utils_src_install
292 - readme.gentoo_create_doc
293 - prune_libtool_files --modules
294 -
295 - if use doc; then
296 - dohtml doc/${PN}.html
297 - dodoc doc/${PN}.dvi doc/${PN}.txt doc/${PN}.ps
298 - fi
299 -
300 - use sqlite && dodoc doc/sqlite3.table
301 - use mysql && dodoc doc/mysql-*.sql
302 - use postgres && dodoc doc/pgsql-*.sql
303 - doman ${PN}.8
304 -
305 - insinto /etc
306 - doins ${PN}.conf
307 - fowners root:ulogd /etc/ulogd.conf
308 - fperms 640 /etc/ulogd.conf
309 -
310 - newinitd "${FILESDIR}/${PN}.init" ${PN}
311 - systemd_dounit "${FILESDIR}/${PN}.service"
312 -
313 - insinto /etc/logrotate.d
314 - newins "${FILESDIR}/${PN}.logrotate" ${PN}
315 -
316 - diropts -o ulogd -g ulogd
317 - keepdir /var/log/ulogd
318 -}