Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=78214a3851fc2387a40ebdff7eee783e00b8311d

commit 78214a3851fc2387a40ebdff7eee783e00b8311d
Author: James Buren <[email protected]>
Date:   Tue Jul 24 02:08:50 2012 -0500

postgrey-1.34-3-x86_64
* convert to systemd schema
* remove /var/run

diff --git a/source/network-extra/postgrey/FrugalBuild 
b/source/network-extra/postgrey/FrugalBuild
index e2266f6..3c9efa9 100644
--- a/source/network-extra/postgrey/FrugalBuild
+++ b/source/network-extra/postgrey/FrugalBuild
@@ -3,7 +3,7 @@

pkgname=postgrey
pkgver=1.34
-pkgrel=2
+pkgrel=3
pkgdesc="a Postfix policy server implementing greylisting"
url="http://postgrey.schweikert.ch/";
depends=('perl>=5.6.0' 'perl-net-server' 'perl-io-multiplex' 'perl-berkeleydb' 
'db>=4.7.25' 'postfix>=2.1')
@@ -11,13 +11,16 @@ groups=('network-extra')
archs=('i686' 'x86_64')
up2date="Flasttar $url/pub/"
source=(http://postgrey.schweikert.ch/pub/postgrey-$pkgver.tar.gz \
-        rc.$pkgname rc.$pkgname-hu.po README.Frugalware $pkgname)
-backup=(/etc/postfix/${pkgname}_whitelist_clients 
/etc/postfix/${pkgname}_whitelist_recipients)
+        rc.$pkgname rc.$pkgname-hu.po README.Frugalware $pkgname 
$pkgname.service)
+backup=(/etc/postfix/${pkgname}_whitelist_clients 
/etc/postfix/${pkgname}_whitelist_recipients /etc/sysconfig/postgrey)
+_F_systemd_scriptlet="$pkgname.install"
+_F_sysvinit_units=($pkgname)
+_F_systemd_units=($pkgname=)
+Finclude systemd

build()
{
Fmkdir usr/{s,}bin
-       Fmkdir var/run
Fmkdir var/spool/postfix/$pkgname
chown 109 $Fdestdir/var/spool/postfix/$pkgname
chmod 0700 $Fdestdir/var/spool/postfix/$pkgname
@@ -30,10 +33,13 @@ build()
Fexerel contrib/${pkgname}report usr/bin/
Ffile /etc/sysconfig/postgrey
Frcd2 $pkgname
+       Ffile /lib/systemd/system/$pkgname.service
+       Fgenscriptlet
}

sha1sums=('62529cd6232dc68c724548b476b89cda863b75ea' \
'74b36884ccc3935dc84e662500e72efbe0748d81' \
'b078a79443d0807456483f33f64c2ee86bf7367a' \
'3d5691e5021265ac1667b2254558ca0388e61d9d' \
-          '86f3c5c775bda976657b7851c1c35e4ac6711da0')
+          '86f3c5c775bda976657b7851c1c35e4ac6711da0' \
+          '81570e86cbd32405bca0091a2c9b87d73ca3d7fb')
diff --git a/source/network-extra/postgrey/postgrey.install 
b/source/network-extra/postgrey/postgrey.install
index 0f92888..5fe30da 100644
--- a/source/network-extra/postgrey/postgrey.install
+++ b/source/network-extra/postgrey/postgrey.install
@@ -1,17 +1,63 @@
+sysvinit_units=(@_F_sysvinit_units@)
+systemd_units=(@_F_systemd_units@)
+
post_install()
{
if ! grep -q '^postgrey:' /etc/passwd ; then
useradd -u 109 -g 99 -s /bin/false -c "Postgrey" -d /var/spool/postfix/postgrey 
postgrey
fi
+
+       local unit
+       local op
+
+       for i in ${sysvinit_units[@]}; do
+               chkconfig --del rc.$i >/dev/null 2>&1
+       done
+
+       for i in ${systemd_units[@]}; do
+               unit=$(echo $i | cut -f 1 -d '=')
+               op=$(echo $i | cut -f 2 -d '=')
+               if echo $op | grep -q 'e'; then
+                       systemctl enable $unit.service >/dev/null 2>&1
+               fi
+               if echo $op | grep -q 's'; then
+                       systemctl start $unit.service >/dev/null 2>&1
+               fi
+       done
+}
+
+post_upgrade()
+{
+       for i in ${sysvinit_units[@]}; do
+               chkconfig --del rc.$i >/dev/null 2>&1
+       done
+
+       systemctl daemon-reload >/dev/null 2>&1
}

pre_remove()
{
+       local unit
+
+       for i in ${sysvinit_units[@]}; do
+               chkconfig --del rc.$i >/dev/null 2>&1
+       done
+
+       for i in ${systemd_units[@]}; do
+               unit=$(echo $i | cut -f 1 -d '=')
+               systemctl --no-reload disable $unit.service >/dev/null 2>&1
+               systemctl stop $unit.service >/dev/null 2>&1
+       done
+}
+
+post_remove()
+{
userdel -r postgrey >/dev/null 2>&1
rm -fr /var/lib/postgrey 2>&1
+
+       systemctl daemon-reload >/dev/null 2>&1
}

op=$1
shift
-
$op $*
diff --git a/source/network-extra/postgrey/postgrey.service 
b/source/network-extra/postgrey/postgrey.service
new file mode 100644
index 0000000..c311c35
--- /dev/null
+++ b/source/network-extra/postgrey/postgrey.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Postfix Greylisting Service
+Before=postfix.service
+
+[Service]
+Type=forking
+EnvironmentFile=/etc/sysconfig/postgrey
+ExecStartPre=/bin/rm -f /var/run/postgrey.pid
+PIDFile=/var/run/postgrey.pid
+ExecStart=/usr/sbin/postgrey --unix=/var/spool/postfix/postgrey/socket 
--pidfile=/var/run/postgrey.pid --daemonize $POSTGREY_ARGS
+Restart=always
+RestartSec=1
+
+[Install]
+WantedBy=multi-user.target
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to