Require Privoxy 2.9.16 and AF 1.3
[privoxy.git] / privoxy-rh.spec
index 23f93ca..818cf5c 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: privoxy-rh.spec,v 1.33.2.6 2002/07/02 17:38:10 morcego Exp $
+# $Id: privoxy-rh.spec,v 1.33.2.11 2002/07/25 09:47:57 kick_ Exp $
 #
 # Written by and Copyright (C) 2001 the SourceForge
 # Privoxy team. http://www.privoxy.org/
@@ -37,8 +37,8 @@ Name: privoxy
 # ATTENTION
 # Version and release should be updated acordingly on configure.in and
 # configure. Otherwise, the package can be build with the wrong value
-Version: 2.9.15
-Release: 6
+Version: 2.9.16
+Release: 1
 Summary: Privoxy - privacy enhancing proxy
 License: GPL
 Source0: http://www.waldherr.org/%{name}/%{name}-%{version}.tar.gz
@@ -113,15 +113,15 @@ install -s -m 744 %{name} %{buildroot}%{_sbindir}/%{name}
 # wrong format
 for i in `ls *.action`
 do
-       cat $i | sed -e 's/\r$//' > %{buildroot}%{privoxyconf}/$i
+       cat $i | sed -e 's/[[:cntrl:]]*$//' > %{buildroot}%{privoxyconf}/$i
 done
-cat default.filter | sed -e 's/\r$//' > %{buildroot}%{privoxyconf}/default.filter
-cat trust | sed -e 's/\r$//' > %{buildroot}%{privoxyconf}/trust
+cat default.filter | sed -e 's/[[:cntrl:]]*$//' > %{buildroot}%{privoxyconf}/default.filter
+cat trust | sed -e 's/[[:cntrl:]]*$//' > %{buildroot}%{privoxyconf}/trust
 (
 cd templates
 for i in `ls`
 do
-       cat $i | sed -e 's/\r$//' > %{buildroot}%{privoxyconf}/templates/$i
+       cat $i | sed -e 's/[[:cntrl:]]*$//' > %{buildroot}%{privoxyconf}/templates/$i
 done
 )
 
@@ -143,23 +143,12 @@ cat config | \
 #    sed 's/^forward.*/forward \/etc\/%{name}\/forward/g' | \
 #    sed 's/^aclfile.*/aclfile \/etc\/%{name}\/aclfile/g' > \
     sed 's@^logdir.*@logdir %{_localstatedir}/log/%{name}@g' | \
-    sed -e 's/\r$//' > \
+    sed -e 's/[[:cntrl:]]*$//' > \
     %{buildroot}%{privoxyconf}/config
 perl -pe 's/{-no-cookies}/{-no-cookies}\n\.redhat.com/' default.action >\
     %{buildroot}%{privoxyconf}/default.action
 
 
-# Creating ghost init files
-mkdir -p %{buildroot}/%{_sysconfdir}/rc.d/rc{0,1,2,3,4,5,6}.d
-for i in 0 1 4 6
-do
-ln -sf ../init.d/%{name} %{buildroot}/%{_sysconfdir}/rc.d/rc${i}.d/K09%{name}
-done
-for i in 2 3 5
-do
-ln -sf ../init.d/%{name} %{buildroot}/%{_sysconfdir}/rc.d/rc${i}.d/S84%{name}
-done
-
 ## Macros are expanded even on commentaries. So, we have to use %%
 ## -- morcego
 #%%makeinstall
@@ -171,18 +160,18 @@ done
 # We should do it for the group as well -- morcego
 # Doing it by brute force. Much cleaner (no more Mr. Nice Guy) -- morcego
 
-# Change the group name. Remove anything left behind.
-groupmod -g %{privoxy_gid} -n %{name} %{oldname} > /dev/null 2>&1 ||:
-groupmod -g %{privoxy_gid} -n %{name} %{veryoldname} > /dev/null 2>&1 ||:
-groupdel %{oldname} > /dev/null 2>&1 ||:
-groupdel %{veryoldname} > /dev/null 2>&1 ||:
-
 # Same for username
 usermod -u %{privoxy_uid} -g %{privoxy_gid} -l %{name} -d %{_sysconfdir}/%{name} -s "" %{oldname} > /dev/null 2>&1 || :
 usermod -u %{privoxy_uid} -g %{privoxy_gid} -l %{name} -d %{_sysconfdir}/%{name} -s "" %{veryoldname} > /dev/null 2>&1 || :
 userdel %{oldname} > /dev/null 2>&1 ||:
 userdel %{veryoldname} > /dev/null 2>&1 ||:
 
+# Change the group name. Remove anything left behind.
+groupmod -g %{privoxy_gid} -n %{name} %{oldname} > /dev/null 2>&1 ||:
+groupmod -g %{privoxy_gid} -n %{name} %{veryoldname} > /dev/null 2>&1 ||:
+groupdel %{oldname} > /dev/null 2>&1 ||:
+groupdel %{veryoldname} > /dev/null 2>&1 ||:
+
 # Doublecheck to see if the group exist, and that it has the correct gid
 /bin/grep -E '^%{name}:' %{_sysconfdir}/group > /dev/null 2>&1
 if [ $? -eq 1 ]; then
@@ -217,12 +206,15 @@ fi
 
 %post
 # for upgrade from 2.0.x
-[ -f %{_localstatedir}/log/%{oldname}/logfile ] &&\
- mv -f %{_localstatedir}/log/%{oldname}/logfile %{_localstatedir}/log/%{name}/logfile || /bin/true
-[ -f %{_localstatedir}/log/%{name}/%{name} ] &&\
- mv -f %{_localstatedir}/log/%{name}/%{name} %{_localstatedir}/log/%{name}/logfile || /bin/true
-chown -R %{name}:%{name} %{_localstatedir}/log/%{name} 2>/dev/null
-chown -R %{name}:%{name} %{_sysconfdir}/%{name} 2>/dev/null
+[ -f %{_localstatedir}/log/%{oldname}/logfile ] && {
+  mv -f %{_localstatedir}/log/%{oldname}/logfile %{_localstatedir}/log/%{name}/logfile ||: ;
+  chown -R %{name}:%{name} %{_localstatedir}/log/%{name} 2>/dev/null ||: ;
+}
+[ -f %{_localstatedir}/log/%{name}/%{name} ] && {
+  mv -f %{_localstatedir}/log/%{name}/%{name} %{_localstatedir}/log/%{name}/logfile ||: ;
+  chown -R %{name}:%{name} %{_sysconfdir}/%{name} 2>/dev/null ||: ;
+}
+/sbin/chkconfig --add privoxy
 if [ "$1" = "1" ]; then
        /sbin/service %{name} condrestart > /dev/null 2>&1
 fi
@@ -233,7 +225,7 @@ fi
 
 if [ "$1" = "0" ]; then
        /sbin/service %{name} stop > /dev/null 2>&1 ||:
-       # No need to use chkconfig. The %%ghost files will handle it
+       /sbin/chkconfig --del privoxy
 fi
 
 %postun
@@ -242,8 +234,8 @@ fi
 #fi
 # We only remove it we this is not an upgrade
 if [ "$1" = "0" ]; then
-       /bin/grep -E '^%{name}:' %{_sysconfdir}/group > /dev/null && %{_sbindir}/groupdel %{name} || /bin/true
        id privoxy > /dev/null 2>&1 && %{_sbindir}/userdel privoxy || /bin/true
+       /bin/grep -E '^%{name}:' %{_sysconfdir}/group > /dev/null && %{_sbindir}/groupdel %{name} || /bin/true
 fi
 
 %clean
@@ -321,17 +313,27 @@ fi
 
 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
 %config(noreplace) %attr(0744,root,root) %{_sysconfdir}/rc.d/init.d/%{name}
-%ghost %attr(-,root,root) %{_sysconfdir}/rc.d/rc0.d/K09%{name}
-%ghost %attr(-,root,root) %{_sysconfdir}/rc.d/rc1.d/K09%{name}
-%ghost %attr(-,root,root) %{_sysconfdir}/rc.d/rc2.d/S84%{name}
-%ghost %attr(-,root,root) %{_sysconfdir}/rc.d/rc3.d/S84%{name}
-%ghost %attr(-,root,root) %{_sysconfdir}/rc.d/rc4.d/K09%{name}
-%ghost %attr(-,root,root) %{_sysconfdir}/rc.d/rc5.d/S84%{name}
-%ghost %attr(-,root,root) %{_sysconfdir}/rc.d/rc6.d/K09%{name}
 
 %{_mandir}/man1/%{name}.*
 
 %changelog
+* Sat Jul 27 2002 Hal Burgiss <hal@foobox.net>
+- Reset version and release for 2.9.16.
+
+* Fri Jul 12 2002 Karsten Hopp <karsten@redhat.de>
+- don't use ghost files for rcX.d/*, using chkconfig is the 
+  correct way to do this job (#68619)
+
+* Fri Jul 05 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
++ privoxy-2.9.15-8
+- Changing delete order for groups and users (users should be first)
+
+* Wed Jul 03 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
++ privoxy-2.9.15-7
+- Changing sed expression that removed CR from the end of the lines. This
+  new one removes any control caracter, and should work with older versions
+  of sed
+
 * Tue Jul 02 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
 + privoxy-2.9.15-6
 - Fixing defattr values. File and directory modes where swapped
@@ -717,6 +719,23 @@ fi
        additional "-r @" flag.
 
 # $Log: privoxy-rh.spec,v $
+# Revision 1.33.2.11  2002/07/25 09:47:57  kick_
+# this caused some errors during a fresh installation. It's unnecessary to call an extra program (/bin/true) to set the error code to 0
+#
+# Revision 1.33.2.10  2002/07/12 09:14:26  kick_
+# don't use ghost files for rcX.d/*, chkconfig is available to do this job. Enable translation of error messge
+#
+# Revision 1.33.2.9  2002/07/05 17:16:19  morcego
+# - Changing delete order for groups and users (users should be first)
+#
+# Revision 1.33.2.8  2002/07/03 20:46:24  morcego
+# - Changing sed expression that removed CR from the end of the lines. This
+#   new one removes any control caracter, and should work with older versions
+#   of sed
+#
+# Revision 1.33.2.7  2002/07/02 18:16:48  morcego
+# - Fixing defattr values. File and directory modes where swapped
+#
 # Revision 1.33.2.6  2002/07/02 17:38:10  morcego
 # Bumping Release number
 #