initial import
This commit is contained in:
143
rspamd/PKGBUILD
Normal file
143
rspamd/PKGBUILD
Normal file
@@ -0,0 +1,143 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
pkgname=rspamd
|
||||
pkgver=2.7
|
||||
pkgrel=4
|
||||
pkgdesc="Fast, free and libre spam filtering system"
|
||||
arch=('i686' 'x86_64')
|
||||
url='https://rspamd.com'
|
||||
license=('Apache-2.0')
|
||||
depends=('file' 'glib2' 'glibc' 'icu' 'jemalloc' 'libsodium' 'luajit' 'openblas'
|
||||
'libressl' 'pcre' 'sqlite' 'zlib')
|
||||
makedepends=('cmake' 'ninja' 'perl' 'ragel')
|
||||
backup=('etc/rspamd/actions.conf'
|
||||
'etc/rspamd/cgp.inc'
|
||||
'etc/rspamd/common.conf'
|
||||
'etc/rspamd/composites.conf'
|
||||
'etc/rspamd/groups.conf'
|
||||
'etc/rspamd/logging.inc'
|
||||
'etc/rspamd/maps.d/dmarc_whitelist.inc'
|
||||
'etc/rspamd/maps.d/maillist.inc'
|
||||
'etc/rspamd/maps.d/mid.inc'
|
||||
'etc/rspamd/maps.d/mime_types.inc'
|
||||
'etc/rspamd/maps.d/redirectors.inc'
|
||||
'etc/rspamd/maps.d/spf_dkim_whitelist.inc'
|
||||
'etc/rspamd/maps.d/surbl-whitelist.inc'
|
||||
'etc/rspamd/metrics.conf'
|
||||
'etc/rspamd/modules.conf'
|
||||
'etc/rspamd/modules.d/antivirus.conf'
|
||||
'etc/rspamd/modules.d/arc.conf'
|
||||
'etc/rspamd/modules.d/asn.conf'
|
||||
'etc/rspamd/modules.d/chartable.conf'
|
||||
'etc/rspamd/modules.d/clickhouse.conf'
|
||||
'etc/rspamd/modules.d/dcc.conf'
|
||||
'etc/rspamd/modules.d/dkim.conf'
|
||||
'etc/rspamd/modules.d/dkim_signing.conf'
|
||||
'etc/rspamd/modules.d/dmarc.conf'
|
||||
'etc/rspamd/modules.d/elastic.conf'
|
||||
'etc/rspamd/modules.d/emails.conf'
|
||||
'etc/rspamd/modules.d/external_services.conf'
|
||||
'etc/rspamd/modules.d/force_actions.conf'
|
||||
'etc/rspamd/modules.d/forged_recipients.conf'
|
||||
'etc/rspamd/modules.d/fuzzy_check.conf'
|
||||
'etc/rspamd/modules.d/greylist.conf'
|
||||
'etc/rspamd/modules.d/hfilter.conf'
|
||||
'etc/rspamd/modules.d/http_headers.conf'
|
||||
'etc/rspamd/modules.d/maillist.conf'
|
||||
'etc/rspamd/modules.d/metadata_exporter.conf'
|
||||
'etc/rspamd/modules.d/metric_exporter.conf'
|
||||
'etc/rspamd/modules.d/mid.conf'
|
||||
'etc/rspamd/modules.d/milter_headers.conf'
|
||||
'etc/rspamd/modules.d/mime_types.conf'
|
||||
'etc/rspamd/modules.d/multimap.conf'
|
||||
'etc/rspamd/modules.d/mx_check.conf'
|
||||
'etc/rspamd/modules.d/neural.conf'
|
||||
'etc/rspamd/modules.d/once_received.conf'
|
||||
'etc/rspamd/modules.d/p0f.conf'
|
||||
'etc/rspamd/modules.d/phishing.conf'
|
||||
'etc/rspamd/modules.d/ratelimit.conf'
|
||||
'etc/rspamd/modules.d/rbl.conf'
|
||||
'etc/rspamd/modules.d/regexp.conf'
|
||||
'etc/rspamd/modules.d/replies.conf'
|
||||
'etc/rspamd/modules.d/reputation.conf'
|
||||
'etc/rspamd/modules.d/rspamd_update.conf'
|
||||
'etc/rspamd/modules.d/spamassassin.conf'
|
||||
'etc/rspamd/modules.d/spamtrap.conf'
|
||||
'etc/rspamd/modules.d/spf.conf'
|
||||
'etc/rspamd/modules.d/surbl.conf'
|
||||
'etc/rspamd/modules.d/trie.conf'
|
||||
'etc/rspamd/modules.d/url_redirector.conf'
|
||||
'etc/rspamd/modules.d/whitelist.conf'
|
||||
'etc/rspamd/options.inc'
|
||||
'etc/rspamd/rspamd.conf'
|
||||
'etc/rspamd/scores.d/fuzzy_group.conf'
|
||||
'etc/rspamd/scores.d/headers_group.conf'
|
||||
'etc/rspamd/scores.d/hfilter_group.conf'
|
||||
'etc/rspamd/scores.d/mime_types_group.conf'
|
||||
'etc/rspamd/scores.d/mua_group.conf'
|
||||
'etc/rspamd/scores.d/phishing_group.conf'
|
||||
'etc/rspamd/scores.d/policies_group.conf'
|
||||
'etc/rspamd/scores.d/rbl_group.conf'
|
||||
'etc/rspamd/scores.d/statistics_group.conf'
|
||||
'etc/rspamd/scores.d/subject_group.conf'
|
||||
'etc/rspamd/scores.d/surbl_group.conf'
|
||||
'etc/rspamd/scores.d/whitelist_group.conf'
|
||||
'etc/rspamd/settings.conf'
|
||||
'etc/rspamd/statistic.conf'
|
||||
'etc/rspamd/worker-controller.inc'
|
||||
'etc/rspamd/worker-fuzzy.inc'
|
||||
'etc/rspamd/worker-normal.inc'
|
||||
'etc/rspamd/worker-proxy.inc')
|
||||
install=$pkgname.install
|
||||
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/rspamd/rspamd/archive/refs/tags/${pkgver}.tar.gz"
|
||||
"$pkgname.initd"
|
||||
"$pkgname.confd"
|
||||
"$pkgname.run")
|
||||
sha512sums=('8779771baf85ef6ca1d7d2180429072ab1547ab834b073ee9222dcc6494efdd0a23f5e7ac52a777c23fd89296769f5b6f182593e714097c6f11ca7c9165e4ba7'
|
||||
'eb18a8d357ac17f6ef645d7856df9a6fe2d445538368671b723636e45450f98d27f29df8726627c0861be4ce74670cb0a4e101fc948ba0afa362725c9f5ac833'
|
||||
'038250d7b1cf45a5bc656a8f54d7ad1bd61996eccbe2f35a5dbf3d00fb4bf3fc09e13833810fbaa40c0d9e1b00b2fccfddd7e9215fac518a1df065c7929c86b3'
|
||||
'02178d47965c48e0d7b544218fb96c4511df9c76543a47cf3f55e561a9676a724403ce60c5d371419b846cc1f5910205ee2b444ee657de51e7db95607ec377e7')
|
||||
|
||||
build() {
|
||||
cmake -S ${pkgname}-${pkgver} \
|
||||
-B build \
|
||||
-G Ninja \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCONFDIR=/etc/rspamd \
|
||||
-DDBDIR=/var/lib/rspamd \
|
||||
-DLOGDIR=/var/log/rspamd \
|
||||
-DRUNDIR=/run/rspamd \
|
||||
-DRSPAMD_USER=rspamd \
|
||||
-DNO_SHARED=ON \
|
||||
-DWANT_SYSTEMD_UNITS=OFF \
|
||||
-DENABLE_HYPERSCAN=OFF \
|
||||
-DENABLE_JEMALLOC=ON \
|
||||
-DENABLE_OPTIMIZATION=ON
|
||||
cmake --build build
|
||||
}
|
||||
|
||||
package() {
|
||||
DESTDIR="${pkgdir}" cmake --build build --target install
|
||||
|
||||
local path="${pkgdir}"/usr/bin
|
||||
for file in rspamd rspamc rspamadm;
|
||||
do
|
||||
rm "$path"/$file
|
||||
mv "$path"/$file-$pkgver "$path"/$file
|
||||
done
|
||||
|
||||
mv "$path"/rspamd_stats "$path"/rspamd-stats
|
||||
install -d "${pkgdir}"/usr/sbin
|
||||
mv "${pkgdir}"/usr/bin/$pkgname "${pkgdir}"/usr/sbin/
|
||||
rm "${pkgdir}"/etc/rspamd/modules.d/{history_redis,redis}.conf
|
||||
|
||||
install -dm750 "${pkgdir}"/var/lib/$pkgname
|
||||
install -dm750 "${pkgdir}"/var/log/$pkgname
|
||||
install -dm755 "${pkgdir}"/etc/$pkgname/local.d/maps.d
|
||||
|
||||
install -Dm755 "${srcdir}/$pkgname.initd" "${pkgdir}/etc/init.d/$pkgname"
|
||||
install -Dm644 "${srcdir}/$pkgname.confd" "${pkgdir}/etc/conf.d/$pkgname"
|
||||
install -Dm755 "${srcdir}/$pkgname.run" "${pkgdir}/etc/sv/$pkgname/run"
|
||||
|
||||
install -Dm644 ${pkgname}-${pkgver}/LICENSE.md -t "${pkgdir}"/usr/share/licenses/$pkgname
|
||||
}
|
||||
32
rspamd/rspamd.confd
Normal file
32
rspamd/rspamd.confd
Normal file
@@ -0,0 +1,32 @@
|
||||
# /etc/conf.d/rspamd
|
||||
|
||||
# specified group
|
||||
RSPAMD_GROUP=rspamd
|
||||
|
||||
# specified user
|
||||
RSPAMD_USER=rspamd
|
||||
|
||||
# Configuration file
|
||||
RSPAMD_CONFIGFILE="/etc/rspamd/rspamd.conf"
|
||||
|
||||
# PID file
|
||||
# If you should ever change this, remember to update
|
||||
# "/etc/logrotate.d/rspamd", too.
|
||||
RSPAMD_PIDFILE="/run/rspamd.pid"
|
||||
|
||||
# You can use this configuration option to pass additional options to the
|
||||
# start-stop-daemon, see start-stop-daemon(8) for more details.
|
||||
# Per default we wait 1000ms after we have started the service to ensure
|
||||
# that the daemon is really up and running.
|
||||
RSPAMD_SSDARGS="--wait 1000"
|
||||
|
||||
# The termination timeout (start-stop-daemon parameter "retry") ensures
|
||||
# that the service will be terminated within a given time (60 + 5 seconds
|
||||
# per default) when you are stopping the service.
|
||||
RSPAMD_TERMTIMEOUT="TERM/60/KILL/5"
|
||||
|
||||
# Options to rspamd
|
||||
# See rspamd(8) for more details
|
||||
# Notes:
|
||||
# * Do not specify another CONFIGFILE but use the variable above to change the location
|
||||
RSPAMD_OPTS=""
|
||||
49
rspamd/rspamd.initd
Normal file
49
rspamd/rspamd.initd
Normal file
@@ -0,0 +1,49 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 2015-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
command="/usr/sbin/rspamd"
|
||||
command_rspamadm="/usr/bin/rspamadm"
|
||||
command_args="${RSPAMD_OPTS} -c \"${RSPAMD_CONFIGFILE}\" -u ${RSPAMD_USER} -g ${RSPAMD_GROUP} --pid \"${RSPAMD_PIDFILE}\""
|
||||
start_stop_daemon_args=${RSPAMD_SSDARGS}
|
||||
pidfile="${RSPAMD_PIDFILE}"
|
||||
retry=${RSPAMD_TERMTIMEOUT}
|
||||
|
||||
required_files="${RSPAMD_CONFIGFILE}"
|
||||
|
||||
description="Rapid spam filtering system"
|
||||
|
||||
extra_commands="checkconfig"
|
||||
extra_started_commands="reload"
|
||||
|
||||
description_checkconfig="Validate rspamd's configuration"
|
||||
description_reload="Sends rspamd a signal to reload its configuration"
|
||||
|
||||
depend() {
|
||||
before mta
|
||||
use dns redis
|
||||
}
|
||||
|
||||
checkconfig() {
|
||||
${command_rspamadm} configtest 1>/dev/null || return 1
|
||||
}
|
||||
|
||||
reload() {
|
||||
checkconfig || return 1
|
||||
|
||||
ebegin "Reloading ${SVCNAME}"
|
||||
start-stop-daemon --signal HUP --pidfile "${pidfile}"
|
||||
eend $?
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
if [ "${RC_CMD}" != "restart" ]; then
|
||||
checkconfig || return 1
|
||||
fi
|
||||
}
|
||||
|
||||
stop_pre() {
|
||||
if [ "${RC_CMD}" = "restart" ]; then
|
||||
checkconfig || return 1
|
||||
fi
|
||||
}
|
||||
25
rspamd/rspamd.install
Normal file
25
rspamd/rspamd.install
Normal file
@@ -0,0 +1,25 @@
|
||||
post_install() {
|
||||
if ! getent group rspamd &>/dev/null; then
|
||||
groupadd rspamd >/dev/null
|
||||
fi
|
||||
if ! getent passwd rspamd &>/dev/null; then
|
||||
useradd -d /var/lib/rspamd -g rspamd -s /bin/nologin rspamd >/dev/null
|
||||
fi
|
||||
|
||||
chown rspamd:rspamd /var/lib/rspamd
|
||||
chown rspamd:rspamd /var/log/rspamd
|
||||
chown rspamd:rspamd /etc/rspamd/local.d/maps.d
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
post_install
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
if getent passwd rspamd &>/dev/null; then
|
||||
userdel rspamd >/dev/null
|
||||
fi
|
||||
if getent group rspamd &>/dev/null; then
|
||||
groupdel rspamd >/dev/null
|
||||
fi
|
||||
}
|
||||
2
rspamd/rspamd.run
Normal file
2
rspamd/rspamd.run
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec /usr/sbin/rspamd -c /etc/rspamd/rspamd.conf -f -u rspamd -g rspamd
|
||||
Reference in New Issue
Block a user