summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirkjan Ochtman <djc@gentoo.org>2015-12-26 14:20:48 +0100
committerDirkjan Ochtman <djc@gentoo.org>2015-12-26 14:21:24 +0100
commit5ac1c4d8cdc5c1e313926b113e89b1f284a872f8 (patch)
tree00ee7100e8e0c01982e9526d6d8bf706f3095384
parentmail-filter/rmilter: new ebuild, imported from my overlay (diff)
downloadgentoo-5ac1c4d8cdc5c1e313926b113e89b1f284a872f8.tar.gz
gentoo-5ac1c4d8cdc5c1e313926b113e89b1f284a872f8.tar.bz2
gentoo-5ac1c4d8cdc5c1e313926b113e89b1f284a872f8.zip
mail-filter/rspamd: new ebuild, from my overlay
-rw-r--r--mail-filter/rspamd/Manifest1
-rw-r--r--mail-filter/rspamd/files/rspamd.init44
-rw-r--r--mail-filter/rspamd/files/rspamd.logrotate12
-rw-r--r--mail-filter/rspamd/metadata.xml8
-rw-r--r--mail-filter/rspamd/rspamd-1.0.11.ebuild56
5 files changed, 121 insertions, 0 deletions
diff --git a/mail-filter/rspamd/Manifest b/mail-filter/rspamd/Manifest
new file mode 100644
index 000000000000..034db933768f
--- /dev/null
+++ b/mail-filter/rspamd/Manifest
@@ -0,0 +1 @@
+DIST rspamd-1.0.11.tar.xz 1176160 SHA256 b914c77c30dcab863f6c685b4a83a1662ee1b4503654fbf3ee3ae2fbca1ed928 SHA512 79464e8c29bdf5b081744b79fb8eee944bf647abf334cd77686a8fa4d0a3ab7ff4293fc464606d298fb57c8d7fe909e333ae7e58768330e4d65464bf42f76f15 WHIRLPOOL ca1f8338ef6f917622c8a93fa8bf230b2767d750e953d9f790649e660865caaa255c5a8eb35a14cb882acc193a237bf107d79c7c01f3d7ec6520301edc9f2629
diff --git a/mail-filter/rspamd/files/rspamd.init b/mail-filter/rspamd/files/rspamd.init
new file mode 100644
index 000000000000..8ba223193683
--- /dev/null
+++ b/mail-filter/rspamd/files/rspamd.init
@@ -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 $?
+}
diff --git a/mail-filter/rspamd/files/rspamd.logrotate b/mail-filter/rspamd/files/rspamd.logrotate
new file mode 100644
index 000000000000..dca9cfadf662
--- /dev/null
+++ b/mail-filter/rspamd/files/rspamd.logrotate
@@ -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
+}
+
diff --git a/mail-filter/rspamd/metadata.xml b/mail-filter/rspamd/metadata.xml
new file mode 100644
index 000000000000..56a1880364bf
--- /dev/null
+++ b/mail-filter/rspamd/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>djc@gentoo.org</email>
+ <name>Dirkjan Ochtman</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/mail-filter/rspamd/rspamd-1.0.11.ebuild b/mail-filter/rspamd/rspamd-1.0.11.ebuild
new file mode 100644
index 000000000000..54376f0c483f
--- /dev/null
+++ b/mail-filter/rspamd/rspamd-1.0.11.ebuild
@@ -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
+}