added helper targets to the makefile. They shouldn't break anything, but
[privoxy.git] / privoxy-rh.spec
index 581624d..d23de60 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: privoxy-rh.spec,v 1.33.2.3 2002/06/24 12:13:34 kick_ Exp $
+# $Id: privoxy-rh.spec,v 1.33.2.9 2002/07/05 17:16:19 morcego Exp $
 #
 # Written by and Copyright (C) 2001 the SourceForge
 # Privoxy team. http://www.privoxy.org/
@@ -38,7 +38,7 @@ Name: privoxy
 # 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: 4
+Release: 8
 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
@@ -223,6 +212,7 @@ fi
  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
+/sbin/chkconfig --add privoxy
 if [ "$1" = "1" ]; then
        /sbin/service %{name} condrestart > /dev/null 2>&1
 fi
@@ -233,7 +223,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 +232,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
@@ -261,7 +251,7 @@ fi
 %doc doc/webserver/man-page
 
 # ATTENTION FOR defattr change here !
-%defattr(0755,%{name},%{name},0644)
+%defattr(0644,%{name},%{name},0755)
 
 %dir %{privoxyconf}
 %dir %{privoxyconf}/templates
@@ -317,21 +307,41 @@ fi
 %config %{privoxyconf}/templates/untrusted
 
 # Attention, new defattr change here !
-%defattr(0755,root,root,0644)
+%defattr(0644,root,root,0755)
 
 %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
+* 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
+
+* Tue Jul 02 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
++ privoxy-2.9.15-5
+- Bumping Release number (which should be changed every time the specfile
+  is)
+
+* Tue Jul 02 2002 Hal Burgiss <hal@foobox.net>
++ privoxy-2.9.15-4
+- Fix typo in templates creation.
+
 * Wed Jun 26 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
 + privoxy-2.9.15-4
 - Fixing issues created by specfile sync between branches
@@ -704,6 +714,26 @@ fi
        additional "-r @" flag.
 
 # $Log: privoxy-rh.spec,v $
+# 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
+#
+# Revision 1.33.2.5  2002/07/02 11:43:20  hal9
+# Fix typo in templates creation.
+#
+# Revision 1.33.2.4  2002/06/26 17:32:45  morcego
+# Integrating fixed from the main branch.
+#
 # Revision 1.33.2.3  2002/06/24 12:13:34  kick_
 # shut up rpmlint. btw: The vendor tag should be set in you .rpmmacros file, not in the spec file!
 #