forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mail-filter/rspamd: new ebuild, from my overlay
- Loading branch information
Showing
5 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DIST rspamd-1.0.11.tar.xz 1176160 SHA256 b914c77c30dcab863f6c685b4a83a1662ee1b4503654fbf3ee3ae2fbca1ed928 SHA512 79464e8c29bdf5b081744b79fb8eee944bf647abf334cd77686a8fa4d0a3ab7ff4293fc464606d298fb57c8d7fe909e333ae7e58768330e4d65464bf42f76f15 WHIRLPOOL ca1f8338ef6f917622c8a93fa8bf230b2767d750e953d9f790649e660865caaa255c5a8eb35a14cb882acc193a237bf107d79c7c01f3d7ec6520301edc9f2629 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/sbin/runscript | ||
# Copyright 2015 Gentoo Foundation | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
extra_commands="checkconfig" | ||
extra_started_commands="reload" | ||
|
||
PIDFILE=/var/run/rspamd/rspamd.pid | ||
|
||
depend() { | ||
need net | ||
} | ||
|
||
checkconfig() { | ||
/usr/bin/rspamadm configtest -c /etc/rspamd/rspamd.sysvinit.conf > /dev/null \ | ||
|| return 1 | ||
} | ||
|
||
start() { | ||
checkconfig || return 1 | ||
ebegin "Starting ${SVCNAME}" | ||
start-stop-daemon --start --quiet --pidfile $PIDFILE -u rspamd -g rspamd \ | ||
--exec /usr/bin/rspamd | ||
eend $? | ||
} | ||
|
||
stop() { | ||
if [ "${RC_CMD}" = "restart" ] ; then | ||
checkconfig || return 1 | ||
fi | ||
|
||
ebegin "Stopping ${SVCNAME}" | ||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE \ | ||
--exec /usr/bin/rspamd | ||
eend $? | ||
} | ||
|
||
reload() { | ||
checkconfig || return 1 | ||
ebegin "Reloading ${SVCNAME}" | ||
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE \ | ||
--exec /usr/bin/rspamd | ||
eend $? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/var/log/rspamd/rspamd.log{ | ||
daily | ||
rotate 4 | ||
delaycompress | ||
compress | ||
notifempty | ||
missingok | ||
postrotate | ||
service rspamd reopenlog >/dev/null 2>&1 || true | ||
endscript | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> | ||
<pkgmetadata> | ||
<maintainer> | ||
<email>[email protected]</email> | ||
<name>Dirkjan Ochtman</name> | ||
</maintainer> | ||
</pkgmetadata> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Copyright 1999-2015 Gentoo Foundation | ||
# Distributed under the terms of the GNU General Public License v2 | ||
# $Id$ | ||
|
||
EAPI=5 | ||
|
||
inherit cmake-utils user | ||
|
||
DESCRIPTION="Rapid spam filtering system" | ||
SRC_URI="https://rspamd.com/downloads/${P}.tar.xz" | ||
HOMEPAGE="https://github.com/vstakhov/rspamd" | ||
|
||
LICENSE="BSD-2" | ||
SLOT="0" | ||
KEYWORDS="~amd64 ~x86" | ||
IUSE="" | ||
|
||
DEPEND="dev-libs/libpcre | ||
mail-filter/libmilter | ||
mail-filter/opendkim | ||
mail-filter/libspf2 | ||
dev-lang/luajit:2 | ||
dev-libs/libevent | ||
dev-db/sqlite:3 | ||
dev-libs/glib:2 | ||
dev-libs/gmime | ||
dev-libs/hiredis" | ||
RDEPEND="${DEPEND}" | ||
|
||
pkg_setup() { | ||
enewgroup rspamd | ||
enewuser rspamd -1 -1 /var/lib/rspamd rspamd | ||
} | ||
|
||
src_configure() { | ||
local mycmakeargs=( | ||
-DCONFDIR=/etc/rspamd | ||
-DRUNDIR=/var/run/rspamd | ||
-DDBDIR=/var/lib/rspamd | ||
-DLOGDIR=/var/log/rspamd | ||
) | ||
cmake-utils_src_configure | ||
} | ||
|
||
src_install() { | ||
cmake-utils_src_install | ||
newinitd "${FILESDIR}/rspamd.init" rspamd | ||
|
||
dodir /var/lib/rspamd | ||
dodir /var/log/rspamd | ||
dodir /var/run/rspamd | ||
fowners rspamd:rspamd /var/lib/rspamd /var/log/rspamd /var/run/rspamd | ||
|
||
insinto /etc/logrotate.d | ||
newins "${FILESDIR}/rspamd.logrotate" rspamd | ||
} |