Gentoo Archives: gentoo-commits

From: Dirkjan Ochtman <djc@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/rspamd/files/, mail-filter/rspamd/
Date: Tue, 03 Jan 2017 19:01:02
Message-Id: 1483470051.0dce7fbc4dc9fb16a13056da4902cd120ec9be4e.djc@gentoo
1 commit: 0dce7fbc4dc9fb16a13056da4902cd120ec9be4e
2 Author: Dirkjan Ochtman <djc <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 3 18:56:37 2017 +0000
4 Commit: Dirkjan Ochtman <djc <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 3 19:00:51 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0dce7fbc
7
8 mail-filter/rspamd: use checkpath in init script (fixes bug 603248)
9
10 Package-Manager: portage-2.3.0
11
12 mail-filter/rspamd/files/rspamd.init-r4 | 48 +++++++++++++++++++++
13 mail-filter/rspamd/rspamd-1.4.1-r1.ebuild | 71 +++++++++++++++++++++++++++++++
14 2 files changed, 119 insertions(+)
15
16 diff --git a/mail-filter/rspamd/files/rspamd.init-r4 b/mail-filter/rspamd/files/rspamd.init-r4
17 new file mode 100644
18 index 00000000..cb4520f
19 --- /dev/null
20 +++ b/mail-filter/rspamd/files/rspamd.init-r4
21 @@ -0,0 +1,48 @@
22 +#!/sbin/openrc-run
23 +# Copyright 2015-2017 Gentoo Foundation
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +extra_commands="checkconfig"
27 +extra_started_commands="reload"
28 +
29 +RUNDIR=/var/run/rspamd
30 +PIDFILE=$RUNDIR/rspamd.pid
31 +
32 +depend() {
33 + need net
34 +}
35 +
36 +checkconfig() {
37 + /usr/bin/rspamadm configtest -c /etc/rspamd/rspamd.sysvinit.conf > /dev/null \
38 + || return 1
39 +}
40 +
41 +start() {
42 + checkconfig || return 1
43 + ebegin "Starting ${SVCNAME}"
44 +
45 + checkpath -d $RUNDIR -m 2750 -o rspamd:rspamd
46 + rm -f $RUNDIR/$SVCNAME.sock
47 +
48 + start-stop-daemon --start --quiet --pidfile $PIDFILE -u rspamd -g rspamd \
49 + --exec /usr/bin/rspamd
50 + eend $?
51 +}
52 +
53 +stop() {
54 + if [ "${RC_CMD}" = "restart" ] ; then
55 + checkconfig || return 1
56 + fi
57 +
58 + ebegin "Stopping ${SVCNAME}"
59 + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE \
60 + --exec /usr/bin/rspamd
61 + eend $?
62 +}
63 +
64 +reload() {
65 + checkconfig || return 1
66 + ebegin "Reloading ${SVCNAME}"
67 + start-stop-daemon --signal HUP --quiet --pidfile $PIDFILE
68 + eend $?
69 +}
70
71 diff --git a/mail-filter/rspamd/rspamd-1.4.1-r1.ebuild b/mail-filter/rspamd/rspamd-1.4.1-r1.ebuild
72 new file mode 100644
73 index 00000000..978a2bd
74 --- /dev/null
75 +++ b/mail-filter/rspamd/rspamd-1.4.1-r1.ebuild
76 @@ -0,0 +1,71 @@
77 +# Copyright 1999-2017 Gentoo Foundation
78 +# Distributed under the terms of the GNU General Public License v2
79 +# $Id$
80 +
81 +EAPI=5
82 +
83 +inherit cmake-utils pax-utils user systemd
84 +
85 +DESCRIPTION="Rapid spam filtering system"
86 +SRC_URI="https://rspamd.com/downloads/${P}.tar.xz"
87 +HOMEPAGE="https://github.com/vstakhov/rspamd"
88 +
89 +LICENSE="Apache-2.0"
90 +SLOT="0"
91 +KEYWORDS="~amd64 ~x86"
92 +IUSE="+fann +jit libressl"
93 +
94 +RDEPEND="!libressl? ( dev-libs/openssl:0[-bindist] )
95 + libressl? ( dev-libs/libressl:0 )
96 + fann? ( sci-mathematics/fann )
97 + jit? (
98 + dev-libs/libpcre[jit]
99 + dev-lang/luajit:2
100 + )
101 + !jit? (
102 + dev-libs/libpcre[-jit]
103 + >=dev-lang/lua-5.1:0
104 + )
105 + dev-libs/libevent
106 + dev-db/sqlite:3
107 + dev-libs/glib:2
108 + dev-libs/gmime
109 + dev-util/ragel
110 + sys-apps/file
111 + virtual/libiconv"
112 +DEPEND="dev-util/ragel
113 + ${RDEPEND}"
114 +
115 +pkg_setup() {
116 + enewgroup rspamd
117 + enewuser rspamd -1 -1 /var/lib/rspamd rspamd
118 +}
119 +
120 +src_configure() {
121 + local mycmakeargs=(
122 + -DCONFDIR=/etc/rspamd
123 + -DRUNDIR=/var/run/rspamd
124 + -DDBDIR=/var/lib/rspamd
125 + -DLOGDIR=/var/log/rspamd
126 + -DENABLE_LUAJIT=$(usex jit ON OFF)
127 + -DENABLE_FANN=$(usex fann ON OFF)
128 + )
129 + cmake-utils_src_configure
130 +}
131 +
132 +src_install() {
133 + cmake-utils_src_install
134 + pax-mark m "${ED}"/usr/bin/rspamadm-*
135 + pax-mark m "${ED}"/usr/bin/rspamd-*
136 + newinitd "${FILESDIR}/rspamd.init-r3" rspamd
137 +
138 + dodir /var/lib/rspamd
139 + dodir /var/log/rspamd
140 +
141 + fowners rspamd:rspamd /var/lib/rspamd /var/log/rspamd
142 +
143 + insinto /etc/logrotate.d
144 + newins "${FILESDIR}/rspamd.logrotate" rspamd
145 +
146 + systemd_newunit rspamd.service rspamd.service
147 +}