more info on not hiding ip address
[privoxy.git] / junkbuster-suse.spec
index 9600c8c..c015ad1 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: junkbuster-suse.spec,v 1.13 2002/03/07 18:25:56 swa Exp $
+# $Id: junkbuster-suse.spec,v 1.16 2002/03/08 18:40:44 swa Exp $
 #
 # Written by and Copyright (C) 2001 the SourceForge
 # IJBSWA team.  http://ijbswa.sourceforge.net
 # or write to the Free Software Foundation, Inc., 59
 # Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #
-# $Log: junkbuster-suse.spec,v $
-# Revision 1.13  2002/03/07 18:25:56  swa
-# synced redhat and suse build process
-#
-# Revision 1.12  2002/03/02 15:50:04  swa
-# 2.9.11 version. more input for docs.
-#
-# Revision 1.11  2001/12/02 10:29:26  swa
-# New version made these changes necessary.
-#
-# Revision 1.10  2001/10/31 19:27:27  swa
-# consistent description. new name for suse since
-# we had troubles with rpms of identical names
-# on the webserver.
-#
-# Revision 1.9  2001/10/26 18:17:23  swa
-# new version string
-#
-# Revision 1.8  2001/09/13 16:22:42  swa
-# man page is legacy. suse rpm now contains html
-# documentation.
-#
-# Revision 1.7  2001/09/10 17:44:22  swa
-# integrate three pieces of documentation.
-#
-# Revision 1.6  2001/09/10 16:29:23  swa
-# binary contained debug info.
-# buildroot definition fucks up the build process under suse.
-# program needs to write in varlogjunkbuster
-# install all templates
-# create varlogjunkbuster
-#
-# Revision 1.5  2001/06/09 09:13:29  swa
-# description shorter
-#
-# Revision 1.4  2001/06/08 20:53:36  swa
-# use buildroot, export init to separate file (better manageability)
-#
-# Revision 1.3  2001/06/07 17:28:10  swa
-# cosmetics
-#
-# Revision 1.2  2001/06/07 17:18:44  swa
-# header fixed
-#
-#
 
-%define ijbconf %{_sysconfdir}/%{name}
+# do not set to %{name}
+%define ijbconf %{_sysconfdir}/junkbuster
 
 Summary:      The Internet Junkbuster
 Vendor:       http://ijbswa.sourceforge.net
@@ -89,6 +45,7 @@ URL: http://ijbswa.sourceforge.net/
 Provides:     ijb
 Obsoletes:    ijb
 Autoreqprov:  on
+BuildRequires: perl gzip docbktls libtool
 
 #
 # -----------------------------------------------------------------------------
@@ -123,14 +80,11 @@ autoconf
 ./configure
 make
 make dok
-strip junkbuster
 
-#
-# -----------------------------------------------------------------------------
-# hint by kukuk@suse.de
-%pre
-usr/sbin/groupadd -r junkbuster
-usr/sbin/useradd -g junkbuster -d /etc/junkbuster -r junkbuster -s "/bin/false" > /dev/null 2>&1 || /bin/true
+## Explicitily stripping is not recomended.
+## This is handled altomaticaly by RPM, and can couse troubles if
+## anyone wants to build an unstriped version - morcego
+#strip junkbuster
 
 #
 # -----------------------------------------------------------------------------
@@ -171,20 +125,58 @@ cat config | \
 #
 # -----------------------------------------------------------------------------
 #
-%post
-# for upgrade from 2.0.x
-if [ -f /var/log/junkbuster/junkbuster ]; then
- mv -f /var/log/junkbuster/junkbuster /var/log/junkbuster/logfile
- chown -R junkbuster:junkbuster /var/log/junkbuster 2>/dev/null
- chown -R junkbuster:junkbuster /etc/junkbuster 2>/dev/null
+%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 
+if [ $? -eq 1 ]; then
+       id junkbust > /dev/null 2>&1 
+       if [ $? -eq 0 ]; then
+               /usr/sbin/usermod -l junkbuster -d %{_sysconfdir}/junkbuster -s "" junkbust  > /dev/null 2>&1
+       else
+# -r does not work on suse.
+               /usr/sbin/groupadd junkbuster
+               /usr/sbin/useradd -d %{_sysconfdir}/junkbuster -g junkbuster -s "" junkbuster > /dev/null 2>&1 
+       fi
 fi
+
+#
+# -----------------------------------------------------------------------------
+#
+%post
+[ -f /var/log/junkbuster/junkbuster ] &&\
+ mv -f /var/log/junkbuster/junkbuster /var/log/junkbuster/logfile || /bin/true
+chown -R junkbuster:junkbuster /var/log/junkbuster 2>/dev/null
+chown -R junkbuster:junkbuster /etc/junkbuster 2>/dev/null
+# not available on suse
+#if [ "$1" = "1" ]; then
+#     /sbin/chkconfig --add junkbuster
+#      /sbin/service junkbuster condrestart > /dev/null 2>&1
+#fi
+# 01/09/02 HB, getting rid of any user=junkbust
+# Changed by morcego to use the id command.
+id junkbust > /dev/null 2>&1 && /usr/sbin/userdel junkbust || /bin/true
 sbin/insserv etc/init.d/junkbuster
 
+#
+# -----------------------------------------------------------------------------
+#
+%preun
+# need to stop the service on suse. swa.
+#if [ "$1" = "0" ]; then
+#      /sbin/service junkbuster stop > /dev/null 2>&1 ||:
+#fi
+
 #
 # -----------------------------------------------------------------------------
 #
 %postun
 sbin/insserv etc/init.d/
+# dont forget to remove user and group junkbuster
+id junkbuster > /dev/null 2>&1 && /usr/sbin/userdel junkbuster || /bin/true
 
 #
 # -----------------------------------------------------------------------------
@@ -278,3 +270,60 @@ sbin/insserv etc/init.d/
   (http://www.waldherr.org/junkbuster/)
 * Mon Mar 01 1999 - daniel@suse.de
 - new package: version 2.0
+
+# $Log: junkbuster-suse.spec,v $
+# Revision 1.16  2002/03/08 18:40:44  swa
+# build requires tools. useradd and del works
+# now.
+#
+# Revision 1.15  2002/03/07 19:23:50  swa
+# i hate to scroll. suse: wrong configdir.
+#
+# Revision 1.14  2002/03/07 19:10:21  swa
+# builds cleanly. thanks to kukuk@suse.de
+# not yet tested.
+#
+# Revision 1.13  2002/03/07 18:25:56  swa
+# synced redhat and suse build process
+#
+# Revision 1.12  2002/03/02 15:50:04  swa
+# 2.9.11 version. more input for docs.
+#
+# Revision 1.11  2001/12/02 10:29:26  swa
+# New version made these changes necessary.
+#
+# Revision 1.10  2001/10/31 19:27:27  swa
+# consistent description. new name for suse since
+# we had troubles with rpms of identical names
+# on the webserver.
+#
+# Revision 1.9  2001/10/26 18:17:23  swa
+# new version string
+#
+# Revision 1.8  2001/09/13 16:22:42  swa
+# man page is legacy. suse rpm now contains html
+# documentation.
+#
+# Revision 1.7  2001/09/10 17:44:22  swa
+# integrate three pieces of documentation.
+#
+# Revision 1.6  2001/09/10 16:29:23  swa
+# binary contained debug info.
+# buildroot definition fucks up the build process under suse.
+# program needs to write in varlogjunkbuster
+# install all templates
+# create varlogjunkbuster
+#
+# Revision 1.5  2001/06/09 09:13:29  swa
+# description shorter
+#
+# Revision 1.4  2001/06/08 20:53:36  swa
+# use buildroot, export init to separate file (better manageability)
+#
+# Revision 1.3  2001/06/07 17:28:10  swa
+# cosmetics
+#
+# Revision 1.2  2001/06/07 17:18:44  swa
+# header fixed
+#
+#