[arch-commits] Commit in postfix/trunk (PKGBUILD install postfix postfix.install rc.d)

Gaetan Bisson bisson at archlinux.org
Mon Mar 28 22:40:28 UTC 2011


    Date: Monday, March 28, 2011 @ 18:40:27
  Author: bisson
Revision: 117139

cleanup rc.d script, address FS#23469, remove postfix prefix to filenames

Added:
  postfix/trunk/install
    (from rev 117071, postfix/trunk/postfix.install)
  postfix/trunk/rc.d
    (from rev 117071, postfix/trunk/postfix)
Modified:
  postfix/trunk/PKGBUILD
Deleted:
  postfix/trunk/postfix
  postfix/trunk/postfix.install

-----------------+
 PKGBUILD        |   10 ++++-----
 install         |   35 ++++++++++++++++++++++++++++++++
 postfix         |   58 ------------------------------------------------------
 postfix.install |   35 --------------------------------
 rc.d            |   37 ++++++++++++++++++++++++++++++++++
 5 files changed, 77 insertions(+), 98 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-03-28 20:41:46 UTC (rev 117138)
+++ PKGBUILD	2011-03-28 22:40:27 UTC (rev 117139)
@@ -5,7 +5,7 @@
 
 pkgname=postfix
 pkgver=2.8.2
-pkgrel=1
+pkgrel=2
 pkgdesc='Secure, fast, easy to administer drop in replacement for Sendmail (MTA)'
 url='http://www.postfix.org/'
 arch=('i686' 'x86_64')
@@ -14,16 +14,16 @@
 backup=('etc/postfix/'{access,aliases,canonical,generic,header_checks,main.cf,master.cf,relocated,transport,virtual})
 source=("ftp://ftp.porcupine.org/mirrors/postfix-release/official/${pkgname}-${pkgver}.tar.gz" \
         'aliases.patch' \
-        "${pkgname}")
+        'rc.d')
 sha1sums=('224e0b6dd161f4648114de8902124c9dec64aa8c'
           '5fc3de6c7df1e5851a0a379e825148868808318b'
-          '6f41e9ce5c0125fbd4eb016464c6ad1fd18eccea')
+          '050e6afc5886049682c945ce147b3c47fe113939')
 
 provides=('smtp-server' 'smtp-forwarder')
 replaces=('postfix-mysql' 'postfix-pgsql')
 conflicts=('postfix-mysql' 'postfix-pgsql' 'smtp-server' 'smtp-forwarder')
 
-install="${pkgname}.install"
+install=install
 
 build() {
 	cd "${srcdir}/${pkgname}-${pkgver}"
@@ -48,7 +48,7 @@
 		sample_directory="/etc/${pkgname}/sample" \
 		manpage_directory="/usr/share/man"
 
-	install -D -m755 "../${pkgname}" "${pkgdir}/etc/rc.d/${pkgname}"
+	install -D -m755 ../rc.d "${pkgdir}/etc/rc.d/${pkgname}"
 	install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
 
 	cd "${pkgdir}"

Copied: postfix/trunk/install (from rev 117071, postfix/trunk/postfix.install)
===================================================================
--- install	                        (rev 0)
+++ install	2011-03-28 22:40:27 UTC (rev 117139)
@@ -0,0 +1,35 @@
+post_install() {
+	getent group postdrop &>/dev/null || groupadd -g 75 postdrop >/dev/null
+	getent group postfix  &>/dev/null || groupadd -g 73 postfix  >/dev/null
+	getent passwd postfix &>/dev/null || useradd -u 73 -d /var/spool/postfix -g postfix -s /bin/false postfix >/dev/null
+
+	cd var/spool/postfix
+	chown postfix active bounce corrupt defer deferred flush hold incoming private public maildrop trace saved
+	chgrp postdrop public maildrop
+	cd ../../../usr/sbin
+	chgrp postdrop postqueue postdrop
+	chmod g+s postqueue postdrop
+	cd ../..
+	chown postfix var/lib/postfix
+
+	newaliases
+}
+
+post_upgrade() {
+	post_install
+
+	if [ `vercmp $2 2.8` = -1 ]; then cat <<EOF
+
+==> You must now execute "/etc/rc.d/postfix reload" (or restart).
+==> This is needed because the queue manager to delivery agent
+==> protocol has changed.
+
+EOF
+	fi
+}
+
+pre_remove() {
+	getent passwd postfix &>/dev/null && userdel  postfix  >/dev/null
+	getent group postfix  &>/dev/null && groupdel postfix  >/dev/null
+	getent group postdrop &>/dev/null && groupdel postdrop >/dev/null
+}

Deleted: postfix
===================================================================
--- postfix	2011-03-28 20:41:46 UTC (rev 117138)
+++ postfix	2011-03-28 22:40:27 UTC (rev 117139)
@@ -1,58 +0,0 @@
-#!/bin/bash
-
-. /etc/rc.conf
-. /etc/rc.d/functions
-
-PID=`pgrep -f /usr/lib/postfix/master`
-
-start() {
-  stat_busy "Starting Postfix"
-  [ -z "$PID" ] && /usr/sbin/postfix start &> /dev/null
-  if [ $? -gt 0 ]; then
-    stat_fail
-  else
-    add_daemon postfix
-    stat_done
-  fi
-}
-
-stop() {
-  stat_busy "Stopping Postfix"
-  [ ! -z "$PID" ]  && /usr/sbin/postfix stop &> /dev/null
-  if [ $? -gt 0 ]; then
-    stat_fail
-  else
-    rm_daemon postfix
-    stat_done
-  fi
-}
-
-reload() {
-  stat_busy "Reloading Postfix"
-  [ ! -z "$PID" ] && kill -HUP $PID &> /dev/null
-  if [ $? -gt 0 ]; then
-    stat_fail
-  else
-    stat_done
-  fi
-}
-
-case "$1" in
-  start)
-    start
-    ;;
-  stop)
-    stop
-    ;;
-  restart)
-    # calling 'stop' and 'start' without the $0 fails...
-    $0 stop
-    $0 start
-    ;;
-  reload)
-    reload
-    ;;
-  *)
-    echo "usage: $0 {start|stop|restart|reload}"
-esac
-exit 0

Deleted: postfix.install
===================================================================
--- postfix.install	2011-03-28 20:41:46 UTC (rev 117138)
+++ postfix.install	2011-03-28 22:40:27 UTC (rev 117139)
@@ -1,35 +0,0 @@
-post_install() {
-	getent group postdrop &>/dev/null || groupadd -g 75 postdrop >/dev/null
-	getent group postfix  &>/dev/null || groupadd -g 73 postfix  >/dev/null
-	getent passwd postfix &>/dev/null || useradd -u 73 -d /var/spool/postfix -g postfix -s /bin/false postfix >/dev/null
-
-	cd var/spool/postfix
-	chown postfix active bounce corrupt defer deferred flush hold incoming private public maildrop trace saved
-	chgrp postdrop public maildrop
-	cd ../../../usr/sbin
-	chgrp postdrop postqueue postdrop
-	chmod g+s postqueue postdrop
-	cd ../..
-	chown postfix var/lib/postfix
-
-	newaliases
-}
-
-post_upgrade() {
-	post_install
-
-	if [ `vercmp $2 2.8` = -1 ]; then cat <<EOF
-
-==> You must now execute "/etc/rc.d/postfix reload" (or restart).
-==> This is needed because the queue manager to delivery agent
-==> protocol has changed.
-
-EOF
-	fi
-}
-
-pre_remove() {
-	getent passwd postfix &>/dev/null && userdel  postfix  >/dev/null
-	getent group postfix  &>/dev/null && groupdel postfix  >/dev/null
-	getent group postdrop &>/dev/null && groupdel postdrop >/dev/null
-}

Copied: postfix/trunk/rc.d (from rev 117071, postfix/trunk/postfix)
===================================================================
--- rc.d	                        (rev 0)
+++ rc.d	2011-03-28 22:40:27 UTC (rev 117139)
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+name=postfix
+PID=$(pidof -o %PPID /usr/lib/postfix/master)
+
+case "$1" in
+start)
+	stat_busy "Starting $name daemon"
+	[[ -z "$PID" ]] && /usr/sbin/postfix start &>/dev/null \
+	&& { add_daemon $name; stat_done; } \
+	|| { stat_fail; exit 1; }
+	;;
+stop)
+	stat_busy "Stopping $name daemon"
+	[[ -n "$PID" ]] && /usr/sbin/postfix stop &>/dev/null \
+	&& { rm_daemon $name; stat_done; } \
+	|| { stat_fail; exit 1; }
+	;;
+reload)
+	stat_busy "Reloading $name daemon"
+	[[ -n "$PID" ]] && kill -HUP $PID &>/dev/null \
+	&& { stat_done; } \
+	|| { stat_fail; exit 1; }
+	;;
+restart)
+	$0 stop
+	sleep 1
+	$0 start
+	;;
+*)
+	echo "usage: $0 {start|stop|restart|reload}"
+	;;
+esac
+exit 0




More information about the arch-commits mailing list