Skip to content

Commit

Permalink
mail-filter/rspamd: new ebuild, from my overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Dec 26, 2015
1 parent 48b46cf commit 5ac1c4d
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 0 deletions.
1 change: 1 addition & 0 deletions mail-filter/rspamd/Manifest
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
44 changes: 44 additions & 0 deletions mail-filter/rspamd/files/rspamd.init
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 $?
}
12 changes: 12 additions & 0 deletions mail-filter/rspamd/files/rspamd.logrotate
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
}

8 changes: 8 additions & 0 deletions mail-filter/rspamd/metadata.xml
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>
56 changes: 56 additions & 0 deletions mail-filter/rspamd/rspamd-1.0.11.ebuild
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
}

0 comments on commit 5ac1c4d

Please sign in to comment.