diff options
author | Denis Yantarev | 2015-06-09 00:33:20 +0300 |
---|---|---|
committer | Denis Yantarev | 2015-06-09 00:33:20 +0300 |
commit | f783d8804aef894a9591b3b46e52d22141d78aaa (patch) | |
tree | 6b76412f49b749508b1f35ebacc30a852f1312a7 | |
download | aur-f783d8804aef894a9591b3b46e52d22141d78aaa.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 25 | ||||
-rw-r--r-- | PKGBUILD | 60 | ||||
-rw-r--r-- | greylistd | 80 | ||||
-rw-r--r-- | greylistd.install | 25 | ||||
-rw-r--r-- | greylistd.service | 10 | ||||
-rw-r--r-- | greylistd.tmpfiles | 1 | ||||
-rw-r--r-- | python2.patch | 16 |
7 files changed, 217 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..112ae608e818 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,25 @@ +pkgbase = greylistd + pkgdesc = Simple greylisting system for mail transport agents + pkgver = 0.8.8.5 + pkgrel = 1 + url = http://packages.debian.org/stable/mail/greylistd + install = greylistd.install + arch = x86_64 + arch = i686 + license = GPL + depends = python2 + depends = start-stop-daemon + backup = etc/greylistd/config + source = http://ftp.debian.org/debian/pool/main/g/greylistd/greylistd_0.8.8.5.tar.xz + source = greylistd.service + source = greylistd.tmpfiles + source = greylistd.install + source = python2.patch + md5sums = 2a5bca5486441b0037c9e9e532fed5fc + md5sums = ad1f516bdb732982fec38f492134d5b8 + md5sums = 5c76ca975a41ef967f6a1f8bfc760446 + md5sums = 7c309496b15079820b852c7140194d8c + md5sums = ef3b973a0a07fecd673ed5f9c0df026e + +pkgname = greylistd + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..fd0dfc909cb5 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,60 @@ +# Greylisting daemon from Debian project. Requires 'start-stop-daemon'. +# Contributor: Vladimir Koshelenko <koshelenko@rndavia.ru> +# Maintainer: Denis Yantarev <denis dot yantarev at gmail dot com> + +pkgname=greylistd +pkgver=0.8.8.5 +pkgrel=1 +pkgdesc="Simple greylisting system for mail transport agents" +url="http://packages.debian.org/stable/mail/greylistd" +depends=('python2' 'start-stop-daemon') +source=(http://ftp.debian.org/debian/pool/main/g/greylistd/${pkgname}_${pkgver}.tar.xz + greylistd.service + greylistd.tmpfiles + greylistd.install + python2.patch) +md5sums=('2a5bca5486441b0037c9e9e532fed5fc' + 'ad1f516bdb732982fec38f492134d5b8' + '5c76ca975a41ef967f6a1f8bfc760446' + '7c309496b15079820b852c7140194d8c' + 'ef3b973a0a07fecd673ed5f9c0df026e') +backup=(etc/greylistd/config) +install=greylistd.install +arch=('x86_64' 'i686') +license=('GPL') + +build() { + cd $srcdir || return 1 + patch -p0 <python2.patch || return 1 +} + +package() { + cd $srcdir + + # configuration + mkdir -p $pkgdir/etc/greylistd || return 1 + install -D -m644 $srcdir/$pkgname-$pkgver/config/config $pkgdir/etc/greylistd/ || return 1 + install -D -m644 $srcdir/$pkgname-$pkgver/config/whitelist-hosts $pkgdir/etc/greylistd/ || return 1 + install -D -m644 $srcdir/$pkgname-$pkgver/doc/examples/exim4-acl-example.txt $pkgdir/etc/greylistd/ || return 1 + + # systemd scripts + mkdir -p $pkgdir/usr/lib/systemd/system || return 1 + install -D -m644 $srcdir/greylistd.service $pkgdir/usr/lib/systemd/system/ || return 1 + + mkdir -p $pkgdir/usr/lib/tmpfiles.d || return 1 + install -D -m644 $srcdir/greylistd.tmpfiles $pkgdir/usr/lib/tmpfiles.d/greylistd.conf || return 1 + + # man pages + mkdir -p $pkgdir/usr/man/man1 || return 1 + install -D -m644 $srcdir/$pkgname-$pkgver/doc/man1/greylist.1 $pkgdir/usr/man/man1/ || return 1 + gzip $pkgdir/usr/man/man1/greylist.1 + + mkdir -p $pkgdir/usr/man/man8 || return 1 + install -D -m644 $srcdir/$pkgname-$pkgver/doc/man8/greylistd.8 $pkgdir/usr/man/man8/ || return 1 + gzip $pkgdir/usr/man/man8/greylistd.8 + + # binaries + mkdir -p $pkgdir/usr/bin || return 1 + install -D -m755 $srcdir/$pkgname-$pkgver/program/greylist $pkgdir/usr/bin/ || return 1 + install -D -m755 $srcdir/$pkgname-$pkgver/program/greylistd $pkgdir/usr/bin/ || return 1 +} diff --git a/greylistd b/greylistd new file mode 100644 index 000000000000..9cce8d995b40 --- /dev/null +++ b/greylistd @@ -0,0 +1,80 @@ +#!/bin/bash + +client=/usr/bin/greylist +daemon=/usr/sbin/greylistd +rundir=/var/run/greylistd +datadir=/var/lib/greylistd +pidfile=$rundir/pid +socket=$rundir/socket +user=greylist +group=greylist + +. /etc/rc.conf +. /etc/rc.d/functions + +# See if the daemon is present +test -x "$daemon" || exit 0 + +# Make sure /var/run/greylistd exists (/var/run may be a tmpfs) +test -d "$rundir" || { + mkdir -p "$rundir" + chown "$user:$group" "$rundir" +} + +case "$1" in + start) + stat_busy "Starting Greylistd" + + if [ -e "$socket" ] + then + echo "$0:" + echo " Another instance of \`${daemon##*/}' seems to be running." + echo " If this is not the case, please remove \"$socket\"." + stat_fail + exit 1 + fi + + if [ ! -e $rundir ]; then + mkdir $rundir + fi + chown $user:$group $rundir + chmod 755 $rundir + + start-stop-daemon --start --background \ + --chuid "$user" \ + --pidfile "$pidfile" --make-pidfile \ + --exec "$daemon" + add_daemon greylistd + stat_done + ;; + + stop) + stat_busy "Stopping Greylistd" + start-stop-daemon --stop --pidfile "$pidfile" && + rm -f "$pidfile" + rm_daemon greylistd + stat_done + ;; + + reload|force-reload) + "$client" reload + ;; + + status) + "$client" stats + ;; + + restart) + $0 stop + sleep 2 + $0 start + ;; + + *) + echo "Usage: $0 {start|stop|restart|reload|force-reload|status}" >&2 + exit 1 + ;; +esac + +exit 0 + diff --git a/greylistd.install b/greylistd.install new file mode 100644 index 000000000000..64b654a5ec8e --- /dev/null +++ b/greylistd.install @@ -0,0 +1,25 @@ +# arg 1: the new package version +post_install() { + # UID selected is 113, i really do not know what it must be! + groupadd -g 113 greylist &>/dev/null + useradd -u 113 -g greylist -d /var/run/greylistd -s /bin/false greylist &>/dev/null + if [ ! -e /var/lib/greylistd ]; then + mkdir /var/lib/greylistd &>/dev/null + fi + chown greylist:greylist /var/lib/greylistd &>/dev/null + chmod 755 /var/lib/greylistd &>/dev/null +} + +# arg 1: the new package version +# arg 2: the old package version +post_upgrade() { + post_install $1 + systemctl --system daemon-reload >/dev/null 2>&1 +} + +# arg 1: the old package version +pre_remove() { + userdel greylist &>/dev/null + groupdel greylist &>/dev/null + rm -rf /var/run/greylistd &>/dev/null +} diff --git a/greylistd.service b/greylistd.service new file mode 100644 index 000000000000..15d86fb0ea40 --- /dev/null +++ b/greylistd.service @@ -0,0 +1,10 @@ +[Unit] +Description=Greylist Daemon + +[Service] +User=greylist +ExecStart=/usr/bin/greylistd +ExecReload=/usr/bin/greylist reload + +[Install] +WantedBy=multi-user.target diff --git a/greylistd.tmpfiles b/greylistd.tmpfiles new file mode 100644 index 000000000000..cbf8c8a193c4 --- /dev/null +++ b/greylistd.tmpfiles @@ -0,0 +1 @@ +d /run/greylistd 0755 greylist greylist - diff --git a/python2.patch b/python2.patch new file mode 100644 index 000000000000..5e835858d627 --- /dev/null +++ b/python2.patch @@ -0,0 +1,16 @@ +--- greylistd-0.8.8.5/program/greylist 2007-01-27 19:43:38.000000000 +0300 ++++ greylistd-0.8.8.5/program/greylist.new 2011-12-30 12:48:22.000000000 +0400 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/python2 + ######################################################################## + ### FILE: greylist + ### PURPOSE: Command line interface to "greylistd(8)" +--- greylistd-0.8.8.5/program/greylistd 2008-06-06 18:51:47.000000000 +0400 ++++ greylistd-0.8.8.5/program/greylistd.new 2011-12-30 12:48:28.000000000 +0400 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/python2 + ######################################################################## + ### FILE: greylistd.py + ### PURPOSE: Simple greylisting daemon. See "greylistd(8)". |