Update pre post preun and postun scripts

This commit is contained in:
Jan F. Chadima 2010-03-13 05:17:42 +00:00
parent c4c518457a
commit 3744cb1ab6

View File

@ -1,4 +1,3 @@
%define uid 50
%define username saslauth %define username saslauth
%define hint "Saslauthd user" %define hint "Saslauthd user"
%define homedir %{_var}/empty/%{username} %define homedir %{_var}/empty/%{username}
@ -9,7 +8,7 @@
Summary: The Cyrus SASL library Summary: The Cyrus SASL library
Name: cyrus-sasl Name: cyrus-sasl
Version: 2.1.23 Version: 2.1.23
Release: 10%{?dist} Release: 11%{?dist}
License: BSD License: BSD
Group: System Environment/Libraries Group: System Environment/Libraries
# Source0 originally comes from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/; # Source0 originally comes from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/;
@ -53,8 +52,8 @@ Requires(post): chkconfig, /sbin/service
Requires(pre): /usr/sbin/useradd /usr/sbin/groupadd Requires(pre): /usr/sbin/useradd /usr/sbin/groupadd
Requires(postun): /usr/sbin/userdel /usr/sbin/groupdel Requires(postun): /usr/sbin/userdel /usr/sbin/groupdel
Requires: /sbin/nologin Requires: /sbin/nologin
Provides: user(%username) = %uid Provides: user(%username)
Provides: group(%username) = %uid Provides: group(%username)
%description %description
@ -312,24 +311,28 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/cat8/saslauthd.8
test "$RPM_BUILD_ROOT" != "/" && rm -rf $RPM_BUILD_ROOT test "$RPM_BUILD_ROOT" != "/" && rm -rf $RPM_BUILD_ROOT
%pre %pre
%__fe_groupadd %{uid} -r %{username} >/dev/null 2>&1 || : getent group %{username} >/dev/null || groupadd -r %{username}
%__fe_useradd %{uid} -r -c \"%{hint}\" -g %{username} -s /sbin/nologin -d %{homedir} %{username} >/dev/null 2>&1 || : getent passwd %{username} >/dev/null || \
useradd -r -g %{username} -d %{homedir} -s /sbin/nologin \
-c \"%{hint}\" %{username}
exit 0
%post %post
/sbin/chkconfig --add saslauthd /sbin/chkconfig --add saslauthd
exit 0
%preun %preun
if [ $1 -eq 0 ] ; then if [ $1 -eq 0 ] ; then
/sbin/service saslauthd stop 2>&1 > /dev/null /sbin/service saslauthd stop 2>&1 > /dev/null
/sbin/chkconfig --del saslauthd /sbin/chkconfig --del saslauthd
fi fi
exit 0
%postun %postun
if [ $1 -ne 0 ] ; then if [ $1 -ne 0 ] ; then
/sbin/service saslauthd condrestart 2>&1 > /dev/null /sbin/service saslauthd condrestart 2>&1 > /dev/null
fi fi
%__fe_userdel %{username} >/dev/null 2>&1 || : exit 0
%__fe_groupdel %{username} >/dev/null 2>&1 || :
%post lib -p /sbin/ldconfig %post lib -p /sbin/ldconfig
%postun lib -p /sbin/ldconfig %postun lib -p /sbin/ldconfig
@ -396,6 +399,9 @@ fi
%{_sbindir}/sasl2-shared-mechlist %{_sbindir}/sasl2-shared-mechlist
%changelog %changelog
* Fri Mar 11 2010 Jan F. Chadima <jchadima@redhat.com> - 2.1.23-11
- Update pre post preun and postun scripts
* Wed Mar 10 2010 Jan F. Chadima <jchadima@redhat.com> - 2.1.23-10 * Wed Mar 10 2010 Jan F. Chadima <jchadima@redhat.com> - 2.1.23-10
- Rewrite spec file, make corect CFLAGS, CPPFLAGS and LDFLAGS - Rewrite spec file, make corect CFLAGS, CPPFLAGS and LDFLAGS