Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=3c5bb6f60950f8137c1ee4e42756092198079435

commit 3c5bb6f60950f8137c1ee4e42756092198079435
Author: Miklos Vajna <vmik...@frugalware.org>
Date:   Thu Sep 22 00:58:31 2011 +0200

postfix-2.8.0-3-i686

- add native systemd unit

diff --git a/source/network/postfix/FrugalBuild 
b/source/network/postfix/FrugalBuild
index eafd001..565aa05 100644
--- a/source/network/postfix/FrugalBuild
+++ b/source/network/postfix/FrugalBuild
@@ -4,7 +4,7 @@

pkgname=postfix
pkgver=2.8.0
-pkgrel=2
+pkgrel=3
vdaver=2.8.0
pkgdesc="A fast, easy to administer, and secure MTA"
url="http://www.postfix.org/";
@@ -22,11 +22,13 @@ mirror="ftp://ftp.kfki.hu/pub/packages/mail/postfix";
up2date="lynx -dump $mirror/index.html|grep -m1 '.tar.gz'|sed 
's/.*-\(.*\).tar.gz/\1/'"
source=($mirror/official/$pkgname-$pkgver.tar.gz \
rc.$pkgname \
+       postfix.service \
README.Frugalware
http://vda.sourceforge.net/VDA/postfix-vda-$vdaver.patch)

sha1sums=('d7a4fb5ee1f5d12aa1abd6cf8ce8254b4805486d' \
'8c660979e9e4571df8ec6361f46ce84b6fc8a41d' \
+          '09cdb731899b0fac0438589b03e1a9b14ddf1878' \
'b05736300a01bc6d4d0ca7bb92704de29b68651d' \
'3ef6f4a82fdbdf75746545f4876f7a72a50ce5c8')

@@ -47,6 +49,7 @@ build()
Fsed '\(^#alias_maps = netinfo:/aliases$\)' '\1\nalias_maps = 
hash:/etc/postfix/aliases' $Fdestdir/etc/postfix/main.cf
Fsed '\(^#alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases$\)' 
'\1\nalias_database = hash:/etc/postfix/aliases' $Fdestdir/etc/postfix/main.cf
Frcd
+       Ffile /lib/systemd/system/postfix.service
# For compatibility reasons - some app searches the sendmail
# binary in /usr/lib
Fln /usr/sbin/sendmail /usr/lib/sendmail
diff --git a/source/network/postfix/postfix.install 
b/source/network/postfix/postfix.install
index f728e18..03cfa29 100644
--- a/source/network/postfix/postfix.install
+++ b/source/network/postfix/postfix.install
@@ -11,26 +11,33 @@ post_install()
chgrp postdrop var/spool/postfix/{public,maildrop,trace} 
usr/sbin/{postqueue,postdrop}
chmod g+s usr/sbin/{postqueue,postdrop}
/usr/sbin/chkconfig --add rc.postfix
-}
-
-pre_upgrade()
-{
-       [ -e /etc/rc.d/rc.functions ] && /sbin/service postfix stop
+       systemctl enable postfix.service >/dev/null 2>&1
}

post_upgrade()
{
-       post_install $1
-       [ -e /etc/rc.d/rc.functions ] && /sbin/service postfix start
+       systemctl daemon-reload >/dev/null 2>&1
+       # this can be removed after Frugalware-1.6
+       if [ `vercmp $2 2.8.0-3` -lt 0 ] ; then
+               if chkconfig rc.postfix; then
+                       post_install
+               fi
+       fi
}

pre_remove()
{
-       [ -e /etc/rc.d/rc.functions ] && /sbin/service postfix stop
userdel postfix &> /dev/null
groupdel postfix &> /dev/null
groupdel postdrop &> /dev/null
/usr/sbin/chkconfig --del rc.postfix
+       systemctl --no-reload disable postfix.service >/dev/null 2>&1
+       systemctl stop postfix.service >/dev/null 2>&1
+}
+
+post_remove()
+{
+       systemctl daemon-reload >/dev/null 2>&1
}

op=$1
diff --git a/source/network/postfix/postfix.service 
b/source/network/postfix/postfix.service
new file mode 100644
index 0000000..35fbfc6
--- /dev/null
+++ b/source/network/postfix/postfix.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Postfix Mail Transport Agent
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/var/spool/postfix/pid/master.pid
+ExecStartPre=/usr/bin/newaliases
+ExecStart=/usr/sbin/postfix start
+ExecReload=/usr/sbin/postfix reload
+ExecStop=/usr/sbin/postfix stop
+
+[Install]
+WantedBy=multi-user.target
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to