-# $Id: junkbuster-rh.spec,v 1.32 2002/03/05 12:34:24 morcego Exp $
+# $Id: junkbuster-rh.spec,v 1.33 2002/03/05 13:13:57 morcego Exp $
#
# Written by and Copyright (C) 2001 the SourceForge
# IJBSWA team. http://ijbswa.sourceforge.net
# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# $Log: junkbuster-rh.spec,v $
+# Revision 1.33 2002/03/05 13:13:57 morcego
+# - Added "make redhat-dok" to the build phase
+# - Added docbook-utils to BuildRequires
+#
# Revision 1.32 2002/03/05 12:34:24 morcego
# - Changing section internaly on the manpage from 1 to 8
# - We now require packages, not files, to avoid issues with apt
Vendor: http://ijbswa.sourceforge.net
Name: junkbuster
Version: 2.9.11
-Release: 5
+Release: 6
Source0: http://www.waldherr.org/%{name}/ijbswa-%{version}.tar.gz
License: GPL
BuildRoot: %{_tmppath}/%{name}-%{version}-root
URL: http://ijbswa.sourceforge.net/
Obsoletes: junkbuster-raw junkbuster-blank
# Prereq: /usr/sbin/useradd , /sbin/chkconfig , /sbin/service
-Prereq: shadow-utils, chkconfig, initscripts
+Prereq: shadow-utils, chkconfig, initscripts, sh-utils
BuildRequires: perl gzip sed docbook-utils
Conflicts: junkbuster-raw junkbuster-blank
## anyone wants to build an unstriped version - morcego
#strip %{name}
-%pre
-/usr/sbin/useradd -d /etc/%{name} -r %{name} -s "" > /dev/null 2>&1 || /bin/true
-
%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
mkdir -p %{buildroot}%{_sbindir} \
## -- morcego
#%%makeinstall
+%pre
+# We check to see if the user junkbuster exists.
+# If it does, we do nothing
+# If we don't, we check to see if the user junkbust exist and, in case it
+# does, we change it do junkbuster. If it also does not exist, we create the
+# junkbuster user -- morcego
+id junkbuster > /dev/null 2>&1 || ( id junkbust && ( /usr/sbin/usermod -l junkbuster junkbust ) || ( /usr/sbin/useradd -d /etc/%{name} -r %{name} -s "" > /dev/null 2>&1 || /bin/true )
+
%post
# for upgrade from 2.0.x
[ -f %{_localstatedir}/log/%{name}/%{name} ] &&\
/sbin/service %{name} condrestart > /dev/null 2>&1
fi
# 01/09/02 HB, getting rid of any user=junkbust
-grep junkbust: /etc/passwd >/dev/null && userdel junkbust || /bin/true
+# Changed by morcego to use the id command.
+id junkbust > /dev/null 2>&1 && /usr/sbin/userdel junkbust || /bin/true
%preun
if [ "$1" = "0" ]; then
%dir %{ijbconf}
%dir %{ijbconf}/templates
-%attr(0744,%{name},%{name}) %dir %{_localstatedir}/log/%{name}
+%attr(0744,junkbuster,junkbuster) %dir %{_localstatedir}/log/%{name}
-%attr(0744,%{name},%{name})%{_sbindir}/%{name}
+%attr(0744,junkbuster,junkbuster)%{_sbindir}/%{name}
# We should not use wildchars here. This could mask missing files problems
# -- morcego
%{_mandir}/man8/%{name}.8*
%changelog
+* Tue Mar 06 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
++ junkbuster-2.9.11-6
+- Changed the routined that handle the junkbust and junkbuster users on
+ %%pre and %%post to work in a smoother manner
+- %%files now uses hardcoded usernames, to avoid problems with package
+ name changes in the future
+
* Tue Mar 05 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
+ junkbuster-2.9.11-5
- Added "make redhat-dok" to the build process