changeset 135:8e813497582e stable-5-20

fix rpm scripts
author carl
date Wed, 02 Aug 2006 21:33:34 -0700
parents f9917ce924a3
children f4746d8a12a3
files dnsbl.spec.in
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/dnsbl.spec.in	Wed Aug 02 21:06:05 2006 -0700
+++ b/dnsbl.spec.in	Wed Aug 02 21:33:34 2006 -0700
@@ -67,10 +67,10 @@
 
 
 %pre
-/usr/bin/getent passwd @PACKAGE@ >/dev/null || useradd -r -d %{_sysconfdir}/@PACKAGE@ -M -c "@PACKAGE@ pseudo-user" -s /sbin/nologin @PACKAGE@
 
 
 %post
+/usr/bin/getent passwd @PACKAGE@ >/dev/null || useradd -r -d %{_sysconfdir}/@PACKAGE@ -M -c "@PACKAGE@ pseudo-user" -s /sbin/nologin @PACKAGE@
 /sbin/chkconfig --add @PACKAGE@
 echo Remember to edit %{_sysconfdir}/@PACKAGE@/@PACKAGE@.conf and add the following line to your sendmail.mc:
 echo "INPUT_MAIL_FILTER(\`dnsbl', \`S=local:/var/run/dnsbl/dnsbl.sock, F=T, T=C:30s;S:5m;R:5m;E:5m')"
@@ -79,11 +79,11 @@
 
 %preun
 /sbin/service @PACKAGE@ stop || :
-/sbin/chkconfig --del @PACKAGE@
-userdel @PACKAGE@ || :
 
 
 %postun
+[ $1 = 0 ] && /sbin/chkconfig --del @PACKAGE@
+[ $1 = 0 ] && userdel @PACKAGE@ || :
 
 
 %clean
@@ -100,6 +100,9 @@
 
 
 %changelog
+* Wed Aug 02 2006 Carl Byington 5.20
+- http://www.rpm.org/max-rpm/s1-rpm-inside-scripts.html help with postun
+
 * Thu Mar 16 2006 Carl Byington 5.16
 - use @PACKAGE@ in more places