More warnings in debug mode
[privoxy.git] / junkbuster-rh.spec
index 2ede8a8..d267a58 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: junkbuster-rh.spec,v 1.31 2002/03/04 18:06:09 morcego Exp $
+# $Id: junkbuster-rh.spec,v 1.41 2002/03/11 22:58:32 hal9 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-rh.spec,v $
-# Revision 1.31  2002/03/04 18:06:09  morcego
-# SPECFILE: fixing permissing of the init script (broken by the last change)
-#
-# Revision 1.30  2002/03/04 16:18:03  morcego
-# General cleanup of the rh specfile.
-#
-# %changelog
-# * Mon Mar 04 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
-# + junkbuster-2.9.11-2
-# - General specfile fixup, using the best recomended practices, including:
-#         - Adding -q to %%setup
-#         - Using macros whereever possible
-#         - Not using wildchars on %%files section
-#         - Doubling the percentage char on changelog and comments, to
-#           avoid rpm expanding them
-#
-# Revision 1.29  2002/03/03 19:21:22  hal9
-# Init script fails if shell is /bin/false.
-#
-# Revision 1.28  2002/01/09 18:34:03  hal9
-# nit.
-#
-# Revision 1.27  2002/01/09 18:32:02  hal9
-# Removed RPM_OPT_FLAGS kludge.
-#
-# Revision 1.26  2002/01/09 18:21:10  hal9
-# A few minor updates.
-#
-# Revision 1.25  2001/12/28 01:45:36  steudten
-# Add paranoia check and BuildReq: gzip
-#
-# Revision 1.24  2001/12/01 21:43:14  hal9
-# Allowed for new ijb.action file.
-#
-# Revision 1.23  2001/11/06 12:09:03  steudten
-# Compress doc files. Install README and AUTHORS at last as document.
-#
-# Revision 1.22  2001/11/05 21:37:34  steudten
-# Fix to include the actual version for name.
-# Let the 'real' packager be included - sorry stefan.
-#
-# Revision 1.21  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.20  2001/10/24 15:45:49  hal9
-# To keep Thomas happy (aka correcting my  mistakes)
-#
-# Revision 1.19  2001/10/15 03:23:59  hal9
-# Nits.
-#
-# Revision 1.17  2001/10/10 18:59:28  hal9
-# Minor change for init script.
-#
-# Revision 1.16  2001/09/24 20:56:23  hal9
-# Minor changes.
-#
-# Revision 1.13  2001/09/10 17:44:43  swa
-# integrate three pieces of documentation. needs work.
-# will not build cleanly under redhat.
-#
-# Revision 1.12  2001/09/10 16:25:04  swa
-# copy all templates. version updated.
-#
-# Revision 1.11  2001/07/03 11:00:25  sarantis
-# replaced permissionsfile with actionsfile
-#
-# Revision 1.10  2001/07/03 09:34:44  sarantis
-# bumped up version number.
-#
-# Revision 1.9  2001/06/12 18:15:29  swa
-# the %% in front of configure (see tag below) confused
-# the rpm build process on 7.1.
-#
-# Revision 1.8  2001/06/12 17:15:56  swa
-# fixes, because a clean build on rh6.1 was impossible.
-# GZIP confuses make, %% configure confuses rpm, etc.
-#
-# Revision 1.7  2001/06/11 12:17:26  sarantis
-# fix typo in %%post
-#
-# Revision 1.6  2001/06/11 11:28:25  sarantis
-# Further optimizations and adaptations in the spec file.
-#
-# Revision 1.5  2001/06/09 09:14:11  swa
-# shamelessly adapted RPM stuff from the newest rpm that
-# RedHat provided for the JB.
-#
-# Revision 1.4  2001/06/08 20:54:18  swa
-# type with status file. remove forward et. al from file list.
-#
-# Revision 1.3  2001/06/07 17:28:10  swa
-# cosmetics
-#
-# Revision 1.2  2001/06/04 18:31:58  swa
-# files are now prefixed with either `confdir' or `logdir'.
-# `make redhat-dist' replaces both entries confdir and logdir
-# with redhat values
-#
-# Revision 1.1  2001/06/04 10:44:57  swa
-# `make redhatr-dist' now works. Except for the paths
-# in the config file.
-#
-#
-#
 
 # Defines should happen in the begining of the file
 %define ijbconf %{_sysconfdir}/%{name}
@@ -140,7 +33,7 @@ Summary: The Internet Junkbuster
 Vendor: http://ijbswa.sourceforge.net
 Name: junkbuster
 Version: 2.9.11
-Release: 4
+Release: 9
 Source0: http://www.waldherr.org/%{name}/ijbswa-%{version}.tar.gz
 License: GPL
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
@@ -148,8 +41,8 @@ Group: Networking/Utilities
 URL: http://ijbswa.sourceforge.net/
 Obsoletes: junkbuster-raw junkbuster-blank
 # Prereq: /usr/sbin/useradd , /sbin/chkconfig , /sbin/service 
-Prereq: shadow-utils, chkconfig, initscripts
-BuildRequires: perl gzip sed
+Prereq: shadow-utils, chkconfig, initscripts, sh-utils
+BuildRequires: perl gzip sed docbook-utils libtool
 Conflicts: junkbuster-raw junkbuster-blank
 
 %description
@@ -162,20 +55,18 @@ and tastes. Internet Junkbuster has application for both stand-alone
 systems and multi-user networks.
 
 %prep
-%setup -q -c -n ijbswa
+%setup -q -c
 
 %build
 %configure
 make 
+make redhat-dok
 
 ## 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 %{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} \
@@ -226,6 +117,22 @@ perl -pe 's/{-no-cookies}/{-no-cookies}\n\.redhat.com/' ijb.action >\
 ## -- 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 
+if [ $? -eq 1 ]; then
+       id junkbust > /dev/null 2>&1 
+       if [ $? -eq 0 ]; then
+               /usr/sbin/usermod -l junkbuster -d %{_sysconfdir}/%{name} -s "" junkbust  > /dev/null 2>&1
+       else
+               /usr/sbin/useradd -d %{_sysconfdir}/%{name} -r -s "" junkbuster > /dev/null 2>&1 
+       fi
+fi
+
 %post
 # for upgrade from 2.0.x
 [ -f %{_localstatedir}/log/%{name}/%{name} ] &&\
@@ -237,7 +144,8 @@ if [ "$1" = "1" ]; then
        /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
@@ -249,6 +157,8 @@ fi
 #if [ "$1" -ge "1" ]; then
 #      /sbin/service %{name} condrestart > /dev/null 2>&1
 #fi
+# dont forget to remove user and group junkbuster
+id junkbuster > /dev/null 2>&1 && /usr/sbin/userdel junkbuster || /bin/true
 
 %clean
 [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
@@ -264,9 +174,9 @@ fi
 
 %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
@@ -311,6 +221,30 @@ fi
 %{_mandir}/man8/%{name}.8*
 
 %changelog
+* Mon Mar 11 2002 Hal Burgiss <hal@foobox.net>
++ junkbuster-2.9.11-8 
+- Take out --enable-no-gifs, breaks some browsers.
+
+* Sun Mar 10 2002 Hal Burgiss <hal@foobox.net>
++ junkbuster-2.9.11-8 
+- Add --enable-no-gifs to configure.
+
+* Fri Mar 08 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
++ junkbuster-2.9.11-7
+- Added BuildRequires to libtool.
+
+* 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
+- Added docbook-utils to BuildRequires
+
 * Tue Mar 05 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
 + junkbuster-2.9.11-4
 - Changing man section in the manpage from 1 to 8
@@ -498,3 +432,138 @@ fi
        seeing one annoying ad.
        junkbuster.init was modified. It now starts junkbuster with an
        additional "-r @" flag.
+
+# $Log: junkbuster-rh.spec,v $
+# Revision 1.41  2002/03/11 22:58:32  hal9
+# Remove --enable-no-gifs
+#
+# Revision 1.39  2002/03/08 18:57:29  swa
+# remove user junkbuster after de-installation.
+#
+# Revision 1.38  2002/03/08 13:45:27  morcego
+# Adding libtool to Buildrequires
+#
+# Revision 1.37  2002/03/07 19:23:49  swa
+# i hate to scroll. suse: wrong configdir.
+#
+# Revision 1.36  2002/03/07 05:06:54  morcego
+# Fixed %pre scriptlet. And, as a bonus, you can even understand it now. :-)
+#
+# Revision 1.34  2002/03/07 00:11:57  morcego
+# Few changes on the %pre and %post sections of the rh specfile to handle
+# usernames more cleanly
+#
+# 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
+#
+# Revision 1.31  2002/03/04 18:06:09  morcego
+# SPECFILE: fixing permissing of the init script (broken by the last change)
+#
+# Revision 1.30  2002/03/04 16:18:03  morcego
+# General cleanup of the rh specfile.
+#
+# %changelog
+# * Mon Mar 04 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
+# + junkbuster-2.9.11-2
+# - General specfile fixup, using the best recomended practices, including:
+#         - Adding -q to %%setup
+#         - Using macros whereever possible
+#         - Not using wildchars on %%files section
+#         - Doubling the percentage char on changelog and comments, to
+#           avoid rpm expanding them
+#
+# Revision 1.29  2002/03/03 19:21:22  hal9
+# Init script fails if shell is /bin/false.
+#
+# Revision 1.28  2002/01/09 18:34:03  hal9
+# nit.
+#
+# Revision 1.27  2002/01/09 18:32:02  hal9
+# Removed RPM_OPT_FLAGS kludge.
+#
+# Revision 1.26  2002/01/09 18:21:10  hal9
+# A few minor updates.
+#
+# Revision 1.25  2001/12/28 01:45:36  steudten
+# Add paranoia check and BuildReq: gzip
+#
+# Revision 1.24  2001/12/01 21:43:14  hal9
+# Allowed for new ijb.action file.
+#
+# Revision 1.23  2001/11/06 12:09:03  steudten
+# Compress doc files. Install README and AUTHORS at last as document.
+#
+# Revision 1.22  2001/11/05 21:37:34  steudten
+# Fix to include the actual version for name.
+# Let the 'real' packager be included - sorry stefan.
+#
+# Revision 1.21  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.20  2001/10/24 15:45:49  hal9
+# To keep Thomas happy (aka correcting my  mistakes)
+#
+# Revision 1.19  2001/10/15 03:23:59  hal9
+# Nits.
+#
+# Revision 1.17  2001/10/10 18:59:28  hal9
+# Minor change for init script.
+#
+# Revision 1.16  2001/09/24 20:56:23  hal9
+# Minor changes.
+#
+# Revision 1.13  2001/09/10 17:44:43  swa
+# integrate three pieces of documentation. needs work.
+# will not build cleanly under redhat.
+#
+# Revision 1.12  2001/09/10 16:25:04  swa
+# copy all templates. version updated.
+#
+# Revision 1.11  2001/07/03 11:00:25  sarantis
+# replaced permissionsfile with actionsfile
+#
+# Revision 1.10  2001/07/03 09:34:44  sarantis
+# bumped up version number.
+#
+# Revision 1.9  2001/06/12 18:15:29  swa
+# the %% in front of configure (see tag below) confused
+# the rpm build process on 7.1.
+#
+# Revision 1.8  2001/06/12 17:15:56  swa
+# fixes, because a clean build on rh6.1 was impossible.
+# GZIP confuses make, %% configure confuses rpm, etc.
+#
+# Revision 1.7  2001/06/11 12:17:26  sarantis
+# fix typo in %%post
+#
+# Revision 1.6  2001/06/11 11:28:25  sarantis
+# Further optimizations and adaptations in the spec file.
+#
+# Revision 1.5  2001/06/09 09:14:11  swa
+# shamelessly adapted RPM stuff from the newest rpm that
+# RedHat provided for the JB.
+#
+# Revision 1.4  2001/06/08 20:54:18  swa
+# type with status file. remove forward et. al from file list.
+#
+# Revision 1.3  2001/06/07 17:28:10  swa
+# cosmetics
+#
+# Revision 1.2  2001/06/04 18:31:58  swa
+# files are now prefixed with either `confdir' or `logdir'.
+# `make redhat-dist' replaces both entries confdir and logdir
+# with redhat values
+#
+# Revision 1.1  2001/06/04 10:44:57  swa
+# `make redhatr-dist' now works. Except for the paths
+# in the config file.
+#
+#
+#