Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/rspamd/files/, mail-filter/rspamd/
Date: Wed, 16 Jan 2019 03:15:57
Message-Id: 1547608544.c334938edc52f23ed95834e3b8a658f2e76c53cb.whissi@gentoo
1 commit: c334938edc52f23ed95834e3b8a658f2e76c53cb
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jan 16 03:15:11 2019 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 16 03:15:44 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c334938e
7
8 mail-filter/rspamd: bump to v1.8.3
9
10 - runscript rewritten
11
12 - username used in systemd unit adjusted for Gentoo
13
14 - priv escalation via PID file fixed
15
16 - dev-util/ragel version constraint removed (package
17 is now compatible with ragel-7)
18
19 Closes: https://github.com/gentoo/gentoo/pull/10598
20 Closes: https://github.com/gentoo/gentoo/pull/10561
21 Closes: https://github.com/gentoo/gentoo/pull/10057
22 Package-Manager: Portage-2.3.56, Repoman-2.3.12
23 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
24
25 mail-filter/rspamd/Manifest | 1 +
26 mail-filter/rspamd/files/rspamd-r1.logrotate | 16 +++++++
27 mail-filter/rspamd/files/rspamd-r6.init | 55 ++++++++++++++++++++++
28 mail-filter/rspamd/files/rspamd.conf | 26 ++++++++++
29 mail-filter/rspamd/files/rspamd.tmpfile | 1 +
30 .../{rspamd-9999.ebuild => rspamd-1.8.3.ebuild} | 55 +++++++++++++---------
31 mail-filter/rspamd/rspamd-9999.ebuild | 55 +++++++++++++---------
32 7 files changed, 165 insertions(+), 44 deletions(-)
33
34 diff --git a/mail-filter/rspamd/Manifest b/mail-filter/rspamd/Manifest
35 index 2223d7172bb..d45c6ec491a 100644
36 --- a/mail-filter/rspamd/Manifest
37 +++ b/mail-filter/rspamd/Manifest
38 @@ -7,3 +7,4 @@ DIST rspamd-1.7.7.tar.gz 4534430 BLAKE2B 83ba39b80293bf87f397e6b1b1cbec27e7c44f0
39 DIST rspamd-1.7.8.tar.gz 4542955 BLAKE2B 78fbb01c51d290f8d88f4c512df248fcbc8e28e00a820ba0d3dc22adf4bb1b54b1923aa5306fde5d4d75c81a9304f220608a6cec3f1077bbb9adfa1ea8bdc2a4 SHA512 43f2350dfa4e0369cd53480bd4c8d0aa3898d7c471540281e7460a264207032aea226c4fd519a26397b9e9e8c8de3951e5a9752e010eabf1b3733a0c3e3086c2
40 DIST rspamd-1.7.9.tar.gz 4557492 BLAKE2B f42775ba8157ef4815331c304e3030c522e9ae5e10ef0194da0c7dde105b40fed2ae84b063d78aed37992146311aecc1ac77f64dacdaf3ff11bb85076e8aef7c SHA512 d11d8c03668b85feae665ed491cd156c7430fbad30f42fe44103ea3c3a8bc988e5f8981e784e8f31aa35ba1ff9f7abd23605638e4ee3086a056b22fb3109563e
41 DIST rspamd-1.8.1.tar.gz 4286637 BLAKE2B dd202a2f3dab4ef459d978e06231f8fcef3724ea5912c7455d553dc04e2744322b9144ba05a2f6f22a7eb58cd0a967f213bfc76fb273b5425036a5042975ed89 SHA512 98c2d909b7dc19f1c431d4e64444968092a10630ef238d3c8cc2825e7b2d92bee893bc7f9c431f3a6337ef2af4d2a157f0584e7b13fba0540660d7c853bc25cc
42 +DIST rspamd-1.8.3.tar.gz 4319623 BLAKE2B b7fdd6791df5899710bb1d696a9b94d1840335b6a34d6cdeebc2b5eebe9f4e5b6da3e90ed9ab5e3945aab7ef33f54f048024b51c3de37db1a083ad89c656b456 SHA512 5e20255466fe2cd4842196fb2138732b59911de655e73d9cc13009b5179b84e5a2060083961b35fe40b9f550f8e18067056415a1d803fac54fac000070024c01
43
44 diff --git a/mail-filter/rspamd/files/rspamd-r1.logrotate b/mail-filter/rspamd/files/rspamd-r1.logrotate
45 new file mode 100644
46 index 00000000000..5cb2fdd55e0
47 --- /dev/null
48 +++ b/mail-filter/rspamd/files/rspamd-r1.logrotate
49 @@ -0,0 +1,16 @@
50 +/var/log/rspamd/rspamd.log {
51 + daily
52 + rotate 4
53 + delaycompress
54 + compress
55 + notifempty
56 + missingok
57 + postrotate
58 + if test -d /run/systemd/system ; then
59 + systemctl kill -s USR1 --kill-who=main rspamd.service
60 + else
61 + test -r /run/rspamd.pid && kill -USR1 $(cat /run/rspamd.pid) &>/dev/null
62 + fi
63 + endscript
64 +}
65 +
66
67 diff --git a/mail-filter/rspamd/files/rspamd-r6.init b/mail-filter/rspamd/files/rspamd-r6.init
68 new file mode 100644
69 index 00000000000..8c31fd7d027
70 --- /dev/null
71 +++ b/mail-filter/rspamd/files/rspamd-r6.init
72 @@ -0,0 +1,55 @@
73 +#!/sbin/openrc-run
74 +# Copyright 2015-2019 Gentoo Authors
75 +# Distributed under the terms of the GNU General Public License v2
76 +
77 +RSPAMD_CONFIGFILE=${RSPAMD_CONFIGFILE:-"/etc/rspamd/rspamd.conf"}
78 +RSPAMD_GROUP=${RSPAMD_GROUP:-rspamd}
79 +RSPAMD_OPTS=${RSPAMD_OPTS:-""}
80 +RSPAMD_PIDFILE=${RSPAMD_PIDFILE:-"/run/rspamd.pid"}
81 +RSPAMD_USER=${RSPAMD_USER:-rspamd}
82 +
83 +command="/usr/bin/rspamd"
84 +command_args="${RSPAMD_OPTS} -c \"${RSPAMD_CONFIGFILE}\" -u ${RSPAMD_USER} -g ${RSPAMD_GROUP} --pid \"${RSPAMD_PIDFILE}\""
85 +start_stop_daemon_args=${RSPAMD_SSDARGS:-"--wait 1000"}
86 +pidfile="${RSPAMD_PIDFILE}"
87 +retry=${RSPAMD_TERMTIMEOUT:-"TERM/60/KILL/5"}
88 +
89 +required_files="${RSPAMD_CONFIGFILE}"
90 +
91 +description="Rapid spam filtering system"
92 +
93 +extra_commands="checkconfig"
94 +extra_started_commands="reload"
95 +
96 +description_checkconfig="Validate rspamd's configuration"
97 +description_reload="Sends rspamd a signal to reload its configuration"
98 +
99 +depend() {
100 + before mta
101 + use dns redis
102 +}
103 +
104 +checkconfig() {
105 + ${command} -c "${RSPAMD_CONFIGFILE}" -u ${RSPAMD_USER} -g ${RSPAMD_GROUP} -t 1>/dev/null \
106 + || return 1
107 +}
108 +
109 +reload() {
110 + checkconfig || return 1
111 +
112 + ebegin "Reloading ${SVCNAME}"
113 + start-stop-daemon --signal HUP --pidfile "${pidfile}"
114 + eend $?
115 +}
116 +
117 +start_pre() {
118 + if [ "${RC_CMD}" != "restart" ]; then
119 + checkconfig || return 1
120 + fi
121 +}
122 +
123 +stop_pre() {
124 + if [ "${RC_CMD}" = "restart" ]; then
125 + checkconfig || return 1
126 + fi
127 +}
128
129 diff --git a/mail-filter/rspamd/files/rspamd.conf b/mail-filter/rspamd/files/rspamd.conf
130 new file mode 100644
131 index 00000000000..f3a65cbb20a
132 --- /dev/null
133 +++ b/mail-filter/rspamd/files/rspamd.conf
134 @@ -0,0 +1,26 @@
135 +# /etc/conf.d/rspamd
136 +
137 +# Configuration file
138 +#RSPAMD_CONFIGFILE="/etc/rsyslog.conf"
139 +
140 +# PID file
141 +# If you should ever change this, remember to update
142 +# "/etc/logrotate.d/rspamd", too.
143 +#RSPAMD_PIDFILE="/run/rspamd.pid"
144 +
145 +# You can use this configuration option to pass additional options to the
146 +# start-stop-daemon, see start-stop-daemon(8) for more details.
147 +# Per default we wait 1000ms after we have started the service to ensure
148 +# that the daemon is really up and running.
149 +#RSPAMD_SSDARGS="--wait 1000"
150 +
151 +# The termination timeout (start-stop-daemon parameter "retry") ensures
152 +# that the service will be terminated within a given time (60 + 5 seconds
153 +# per default) when you are stopping the service.
154 +#RSPAMD_TERMTIMEOUT="TERM/60/KILL/5"
155 +
156 +# Options to rspamd
157 +# See rspamd(8) for more details
158 +# Notes:
159 +# * Do not specify another CONFIGFILE but use the variable above to change the location
160 +#RSPAMD_OPTS=""
161
162 diff --git a/mail-filter/rspamd/files/rspamd.tmpfile b/mail-filter/rspamd/files/rspamd.tmpfile
163 new file mode 100644
164 index 00000000000..9f7a2c46c31
165 --- /dev/null
166 +++ b/mail-filter/rspamd/files/rspamd.tmpfile
167 @@ -0,0 +1 @@
168 +d /run/rspamd 0755 rspamd rspamd
169
170 diff --git a/mail-filter/rspamd/rspamd-9999.ebuild b/mail-filter/rspamd/rspamd-1.8.3.ebuild
171 similarity index 72%
172 copy from mail-filter/rspamd/rspamd-9999.ebuild
173 copy to mail-filter/rspamd/rspamd-1.8.3.ebuild
174 index 40d3b529082..64cb537424f 100644
175 --- a/mail-filter/rspamd/rspamd-9999.ebuild
176 +++ b/mail-filter/rspamd/rspamd-1.8.3.ebuild
177 @@ -1,26 +1,20 @@
178 -# Copyright 1999-2018 Gentoo Foundation
179 +# Copyright 1999-2019 Gentoo Authors
180 # Distributed under the terms of the GNU General Public License v2
181
182 EAPI=6
183
184 -if [[ ${PV} == *9999 ]] ; then
185 - SCM="git-r3"
186 - EGIT_REPO_URI="https://github.com/vstakhov/rspamd.git"
187 -fi
188 -
189 -inherit cmake-utils pax-utils systemd user ${SCM}
190 -
191 -DESCRIPTION="Rapid spam filtering system"
192 -HOMEPAGE="https://github.com/vstakhov/rspamd"
193 +inherit cmake-utils pax-utils systemd tmpfiles user
194
195 if [[ ${PV} == *9999 ]] ; then
196 - SRC_URI=""
197 - KEYWORDS=""
198 + EGIT_REPO_URI="https://github.com/vstakhov/rspamd.git"
199 + inherit git-r3
200 else
201 SRC_URI="https://github.com/vstakhov/rspamd/archive/${PV}.tar.gz -> ${P}.tar.gz"
202 KEYWORDS="~amd64 ~x86"
203 fi
204
205 +DESCRIPTION="Rapid spam filtering system"
206 +HOMEPAGE="https://github.com/vstakhov/rspamd"
207 LICENSE="Apache-2.0"
208 SLOT="0"
209 IUSE="cpu_flags_x86_ssse3 fann gd jemalloc +jit libressl pcre2 +torch"
210 @@ -32,7 +26,7 @@ RDEPEND="dev-db/sqlite:3
211 dev-libs/libevent:=
212 net-libs/libnsl
213 sys-apps/file
214 - <dev-util/ragel-7.0
215 + dev-util/ragel
216 cpu_flags_x86_ssse3? ( dev-libs/hyperscan )
217 fann? ( sci-mathematics/fann )
218 gd? ( media-libs/gd[jpeg] )
219 @@ -49,6 +43,14 @@ pkg_setup() {
220 enewuser rspamd -1 -1 /var/lib/rspamd rspamd
221 }
222
223 +src_prepare() {
224 + cmake-utils_src_prepare
225 +
226 + sed -i -e 's/User=_rspamd/User=rspamd/g' \
227 + rspamd.service \
228 + || die
229 +}
230 +
231 src_configure() {
232 local mycmakeargs=(
233 -DCONFDIR=/etc/rspamd
234 @@ -66,22 +68,31 @@ src_configure() {
235 cmake-utils_src_configure
236 }
237
238 +src_test() {
239 + cmake-utils_src_test
240 +}
241 +
242 src_install() {
243 cmake-utils_src_install
244 - newinitd "${FILESDIR}/rspamd.init-r5" rspamd
245 +
246 + newconfd "${FILESDIR}"/rspamd.conf rspamd
247 + newinitd "${FILESDIR}/rspamd-r6.init" rspamd
248 + systemd_newunit rspamd.service rspamd.service
249 +
250 + newtmpfiles "${FILESDIR}"/${PN}.tmpfile ${PN}.conf
251
252 # Remove mprotect for JIT support
253 if use jit; then
254 - pax-mark m "${ED}"/usr/bin/rspamd-* "${ED}"/usr/bin/rspamadm-*
255 + pax-mark m "${ED%/}"/usr/bin/rspamd-* "${ED%/}"/usr/bin/rspamadm-*
256 fi
257
258 - keepdir /var/lib/rspamd
259 - keepdir /var/log/rspamd
260 -
261 - fowners rspamd:rspamd /var/lib/rspamd /var/log/rspamd
262 -
263 insinto /etc/logrotate.d
264 - newins "${FILESDIR}/rspamd.logrotate" rspamd
265 + newins "${FILESDIR}"/rspamd-r1.logrotate rspamd
266
267 - systemd_newunit rspamd.service rspamd.service
268 + diropts -o rspamd -g rspamd
269 + keepdir /var/{lib,log}/rspamd
270 +}
271 +
272 +pkg_postinst() {
273 + tmpfiles_process "${PN}.conf"
274 }
275
276 diff --git a/mail-filter/rspamd/rspamd-9999.ebuild b/mail-filter/rspamd/rspamd-9999.ebuild
277 index 40d3b529082..64cb537424f 100644
278 --- a/mail-filter/rspamd/rspamd-9999.ebuild
279 +++ b/mail-filter/rspamd/rspamd-9999.ebuild
280 @@ -1,26 +1,20 @@
281 -# Copyright 1999-2018 Gentoo Foundation
282 +# Copyright 1999-2019 Gentoo Authors
283 # Distributed under the terms of the GNU General Public License v2
284
285 EAPI=6
286
287 -if [[ ${PV} == *9999 ]] ; then
288 - SCM="git-r3"
289 - EGIT_REPO_URI="https://github.com/vstakhov/rspamd.git"
290 -fi
291 -
292 -inherit cmake-utils pax-utils systemd user ${SCM}
293 -
294 -DESCRIPTION="Rapid spam filtering system"
295 -HOMEPAGE="https://github.com/vstakhov/rspamd"
296 +inherit cmake-utils pax-utils systemd tmpfiles user
297
298 if [[ ${PV} == *9999 ]] ; then
299 - SRC_URI=""
300 - KEYWORDS=""
301 + EGIT_REPO_URI="https://github.com/vstakhov/rspamd.git"
302 + inherit git-r3
303 else
304 SRC_URI="https://github.com/vstakhov/rspamd/archive/${PV}.tar.gz -> ${P}.tar.gz"
305 KEYWORDS="~amd64 ~x86"
306 fi
307
308 +DESCRIPTION="Rapid spam filtering system"
309 +HOMEPAGE="https://github.com/vstakhov/rspamd"
310 LICENSE="Apache-2.0"
311 SLOT="0"
312 IUSE="cpu_flags_x86_ssse3 fann gd jemalloc +jit libressl pcre2 +torch"
313 @@ -32,7 +26,7 @@ RDEPEND="dev-db/sqlite:3
314 dev-libs/libevent:=
315 net-libs/libnsl
316 sys-apps/file
317 - <dev-util/ragel-7.0
318 + dev-util/ragel
319 cpu_flags_x86_ssse3? ( dev-libs/hyperscan )
320 fann? ( sci-mathematics/fann )
321 gd? ( media-libs/gd[jpeg] )
322 @@ -49,6 +43,14 @@ pkg_setup() {
323 enewuser rspamd -1 -1 /var/lib/rspamd rspamd
324 }
325
326 +src_prepare() {
327 + cmake-utils_src_prepare
328 +
329 + sed -i -e 's/User=_rspamd/User=rspamd/g' \
330 + rspamd.service \
331 + || die
332 +}
333 +
334 src_configure() {
335 local mycmakeargs=(
336 -DCONFDIR=/etc/rspamd
337 @@ -66,22 +68,31 @@ src_configure() {
338 cmake-utils_src_configure
339 }
340
341 +src_test() {
342 + cmake-utils_src_test
343 +}
344 +
345 src_install() {
346 cmake-utils_src_install
347 - newinitd "${FILESDIR}/rspamd.init-r5" rspamd
348 +
349 + newconfd "${FILESDIR}"/rspamd.conf rspamd
350 + newinitd "${FILESDIR}/rspamd-r6.init" rspamd
351 + systemd_newunit rspamd.service rspamd.service
352 +
353 + newtmpfiles "${FILESDIR}"/${PN}.tmpfile ${PN}.conf
354
355 # Remove mprotect for JIT support
356 if use jit; then
357 - pax-mark m "${ED}"/usr/bin/rspamd-* "${ED}"/usr/bin/rspamadm-*
358 + pax-mark m "${ED%/}"/usr/bin/rspamd-* "${ED%/}"/usr/bin/rspamadm-*
359 fi
360
361 - keepdir /var/lib/rspamd
362 - keepdir /var/log/rspamd
363 -
364 - fowners rspamd:rspamd /var/lib/rspamd /var/log/rspamd
365 -
366 insinto /etc/logrotate.d
367 - newins "${FILESDIR}/rspamd.logrotate" rspamd
368 + newins "${FILESDIR}"/rspamd-r1.logrotate rspamd
369
370 - systemd_newunit rspamd.service rspamd.service
371 + diropts -o rspamd -g rspamd
372 + keepdir /var/{lib,log}/rspamd
373 +}
374 +
375 +pkg_postinst() {
376 + tmpfiles_process "${PN}.conf"
377 }