Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=ryuotesting2.git;a=commitdiff;h=4a6841b4c550de972933ff86e0c39d9f2090ec8a
commit 4a6841b4c550de972933ff86e0c39d9f2090ec8a Author: James Buren <[email protected]> Date: Tue Jun 5 01:45:22 2012 -0500 postfix-2.9.1-2-x86_64 * convert to use systemd schema diff --git a/source/network/postfix/FrugalBuild b/source/network/postfix/FrugalBuild index d7b3e81..ac5eecb 100644 --- a/source/network/postfix/FrugalBuild +++ b/source/network/postfix/FrugalBuild @@ -4,7 +4,7 @@ pkgname=postfix pkgver=2.9.1 -pkgrel=1 +pkgrel=2 vdaver=2.9.1 pkgdesc="A fast, easy to administer, and secure MTA" url="http://www.postfix.org/" @@ -16,7 +16,10 @@ groups=('network') archs=('i686' 'x86_64') backup=(etc/postfix/{aliases,aliases.db} \ etc/postfix/{main.cf,master.cf,virtual,canonical,generic,transport}) -install="$pkgname.install" +_F_systemd_scriptlet="$pkgname.install" +_F_sysvinit_units=(postfix) +_F_systemd_units=(postfix=e) +Finclude systemd mirror="http://de.postfix.org/ftpmirror" up2date="lynx -dump $mirror/index.html|grep -m1 '.tar.gz'|sed 's/.*-\(.*\).tar.gz/\1/'" @@ -54,6 +57,7 @@ build() # binary in /usr/lib Fln /usr/sbin/sendmail /usr/lib/sendmail Fdirschown var/lib/$pkgname 73 73 + Fgenscriptlet } # optimization OK diff --git a/source/network/postfix/postfix.install b/source/network/postfix/postfix.install index f899345..def8f61 100644 --- a/source/network/postfix/postfix.install +++ b/source/network/postfix/postfix.install @@ -1,3 +1,6 @@ +sysvinit_units=(@_F_sysvinit_units@) +systemd_units=(@_F_systemd_units@) + post_install() { [ -z "`grep '^postdrop::' /etc/group`" ] && \ @@ -5,27 +8,37 @@ post_install() [ -z "`grep '^postfix::' /etc/group`" ] && \ groupadd -g 73 postfix >& /dev/null [ -z "`grep '^postfix:' /etc/passwd`" ] && \ - useradd -u 73 -d /var/spool/postfix -g postfix postfix - + useradd -u 73 -d /var/spool/postfix -g postfix postfix chown postfix /var/spool/postfix/{active,bounce,corrupt,defer,deferred,flush,hold,incoming,private,public,trace,maildrop,saved} 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 - systemctl enable postfix.service >/dev/null 2>&1 + + 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 - if [ `vercmp $2 2.8.0-5` -lt 0 ] ; then - post_install - fi - # 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() @@ -33,9 +46,18 @@ pre_remove() 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 + + 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() @@ -45,5 +67,4 @@ post_remove() op=$1 shift - $op $* _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
