Create saslauth user according to fedora packaging guide

This commit is contained in:
Jan F. Chadima 2009-10-16 17:16:41 +00:00
parent edcf0e373f
commit 189981c1de

View File

@ -1,3 +1,4 @@
%define uid 50
%define username saslauth
%define hint "Saslauthd user"
%define homedir %{_var}/empty/%{username}
@ -8,7 +9,7 @@
Summary: The Cyrus SASL library
Name: cyrus-sasl
Version: 2.1.23
Release: 5%{?dist}
Release: 6%{?dist}
License: BSD
Group: System Environment/Libraries
# Source0 originally comes from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/;
@ -41,6 +42,7 @@ BuildRequires: autoconf, automake, libtool, gdbm-devel, groff
BuildRequires: krb5-devel >= 1.2.2, openssl-devel, pam-devel, pkgconfig
BuildRequires: mysql-devel, postgresql-devel, zlib-devel
BuildRequires: db4-devel
BuildRequires: fedora-usermgmt-devel
%if ! %{bootstrap_cyrus_sasl}
BuildRequires: openldap-devel
%endif
@ -48,8 +50,8 @@ Requires(post): chkconfig, /sbin/service
Requires(pre): /usr/sbin/useradd /usr/sbin/groupadd
Requires(postun): /usr/sbin/userdel /usr/sbin/groupdel
Requires: /sbin/nologin
Provides: user(%username) = %hint
Provides: group(%username) = %hint
Provides: user(%username) = %uid
Provides: group(%username) = %uid
%description
@ -303,8 +305,8 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/cat8/saslauthd.8
test "$RPM_BUILD_ROOT" != "/" && rm -rf $RPM_BUILD_ROOT
%pre
/usr/sbin/groupadd -r %{username} 2> /dev/null || :
/usr/sbin/useradd -c \"%{hint}\" -g %{username} -s /sbin/nologin -r -d %{homedir} %{username} 2> /dev/null || :
%__fe_groupadd %{uid} -r %{username} >/dev/null 2>&1 || :
%__fe_useradd %{uid} -r -c \"%{hint}\" -g %{username} -s /sbin/nologin -d %{homedir} %{username} >/dev/null 2>&1 || :
%post
/sbin/chkconfig --add saslauthd
@ -319,8 +321,8 @@ fi
if [ $1 -ne 0 ] ; then
/sbin/service saslauthd condrestart 2>&1 > /dev/null
fi
/usr/sbin/userdel %{username}
/usr/sbin/groupdel %{username}
%__fe_userdel %{username} >/dev/null 2>&1 || :
%__fe_groupdel %{username} >/dev/null 2>&1 || :
%post lib -p /sbin/ldconfig
%postun lib -p /sbin/ldconfig
@ -387,6 +389,9 @@ fi
%{_sbindir}/sasl2-shared-mechlist
%changelog
* Fri Oct 16 2009 Jan F. Chadima <jchadima@redhat.com> - 2.1.23-6
- Create the saslauth user according to fedora packaging guide
* Thu Sep 24 2009 Jan F. Chadima <jchadima@redhat.com> - 2.1.23-5
- Repair initscript to make condrestart working properly (#522103)