fixes, because a clean build on rh6.1 was impossible.
[privoxy.git] / junkbuster-rh.spec
1 # $Id: junkbuster-rh.spec,v 1.7 2001/06/11 12:17:26 sarantis Exp $
2 #
3 # Written by and Copyright (C) 2001 the SourceForge
4 # IJBSWA team.  http://ijbswa.sourceforge.net
5 #
6 # Based on the Internet Junkbuster originally written
7 # by and Copyright (C) 1997 Anonymous Coders and 
8 # Junkbusters Corporation.  http://www.junkbusters.com
9 #
10 # This program is free software; you can redistribute it 
11 # and/or modify it under the terms of the GNU General
12 # Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at
14 # your option) any later version.
15 #
16 # This program is distributed in the hope that it will
17 # be useful, but WITHOUT ANY WARRANTY; without even the
18 # implied warranty of MERCHANTABILITY or FITNESS FOR A
19 # PARTICULAR PURPOSE.  See the GNU General Public
20 # License for more details.
21 #
22 # The GNU General Public License should be included with
23 # this file.  If not, you can view it at
24 # http://www.gnu.org/copyleft/gpl.html
25 # or write to the Free Software Foundation, Inc., 59
26 # Temple Place - Suite 330, Boston, MA  02111-1307, USA.
27 #
28 # $Log: junkbuster-rh.spec,v $
29 # Revision 1.7  2001/06/11 12:17:26  sarantis
30 # fix typo in %post
31 #
32 # Revision 1.6  2001/06/11 11:28:25  sarantis
33 # Further optimizations and adaptations in the spec file.
34 #
35 # Revision 1.5  2001/06/09 09:14:11  swa
36 # shamelessly adapted RPM stuff from the newest rpm that
37 # RedHat provided for the JB.
38 #
39 # Revision 1.4  2001/06/08 20:54:18  swa
40 # type with status file. remove forward et. al from file list.
41 #
42 # Revision 1.3  2001/06/07 17:28:10  swa
43 # cosmetics
44 #
45 # Revision 1.2  2001/06/04 18:31:58  swa
46 # files are now prefixed with either `confdir' or `logdir'.
47 # `make redhat-dist' replaces both entries confdir and logdir
48 # with redhat values
49 #
50 # Revision 1.1  2001/06/04 10:44:57  swa
51 # `make redhatr-dist' now works. Except for the paths
52 # in the config file.
53 #
54 #
55 #
56 Summary: The Internet Junkbuster
57 Vendor: http://ijbswa.sourceforge.net
58 Name: junkbuster
59 Version: 2.9.4
60 Release: 1
61 Source0: http://www.waldherr.org/junkbuster/ijbswa.tar.gz
62 Copyright: GPL
63 BuildRoot: %{_tmppath}/%{name}-root
64 Group: Networking/Utilities
65 URL: http://ijbswa.sourceforge.net/
66 Packager: Stefan Waldherr <stefan@waldherr.org>
67 Obsoletes: junkbuster-raw junkbuster-blank
68 Prereq: /usr/sbin/useradd , /sbin/chkconfig , /sbin/service 
69 Conflicts: junkbuster-raw junkbuster-blank
70
71 %description
72 The Internet Junkbuster stops your browser from displaying the
73 advertisement images that pervade many commercial web pages.  Since
74 your browser has to download fewer images, surfing the web should be
75 faster.
76
77 %define ijbconf %{_sysconfdir}/junkbuster
78
79 %prep
80 %setup -c -n ijbswa
81
82 %build
83 ./configure
84 make
85 strip junkbuster
86
87 %pre
88 /usr/sbin/useradd -d /etc/junkbuster -u 73 -r junkbust > /dev/null 2>&1 || /bin/true
89
90 %install
91 rm -rf $RPM_BUILD_ROOT
92 mkdir -p ${RPM_BUILD_ROOT}%{_sbindir} \
93          ${RPM_BUILD_ROOT}%{_mandir}/man8 \
94          ${RPM_BUILD_ROOT}/var/log/junkbuster \
95          ${RPM_BUILD_ROOT}%{ijbconf}/templates \
96          ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d \
97          ${RPM_BUILD_ROOT}%{_sysconfdir}/rc.d/init.d
98
99 install -s -m 744 junkbuster $RPM_BUILD_ROOT%{_sbindir}/junkbuster
100 cp -f junkbuster.1 $RPM_BUILD_ROOT%{_mandir}/man8/junkbuster.8
101 cp -f permissionsfile $RPM_BUILD_ROOT%{ijbconf}/permissionsfile
102 cp -f re_filterfile $RPM_BUILD_ROOT%{ijbconf}/re_filterfile
103 cp -f trust $RPM_BUILD_ROOT%{ijbconf}/trust
104 cp -f templates/default $RPM_BUILD_ROOT%{ijbconf}/templates/
105 cp -f templates/show-status  $RPM_BUILD_ROOT%{ijbconf}/templates/
106 cp -f templates/show-status-file  $RPM_BUILD_ROOT%{ijbconf}/templates/
107 cp -f junkbuster.logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/junkbuster
108 install -m 755 junkbuster.init $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/junkbuster
109 install -m 744 -d $RPM_BUILD_ROOT/var/log/junkbuster
110
111 # verify all file locations, etc. in the config file
112 # don't start with ^ or commented lines are not replaced
113 cat config | \
114     sed 's/^confdir.*/confdir \/etc\/junkbuster/g' | \
115 #    sed 's/^permissionsfile.*/permissionsfile \/etc\/junkbuster\/permissionsfile/g' | \
116 #    sed 's/^re_filterfile.*/re_filterfile \/etc\/junkbuster\/re_filterfile/g' | \
117 #    sed 's/^logfile.*/logfile \/var\/log\/junkbuster\/logfile/g' | \
118 #    sed 's/^jarfile.*/jarfile \/var\/log\/junkbuster\/jarfile/g' | \
119 #    sed 's/^forward.*/forward \/etc\/junkbuster\/forward/g' | \
120 #    sed 's/^aclfile.*/aclfile \/etc\/junkbuster\/aclfile/g' > \
121     sed 's/^logdir.*/logdir \/var\/log\/junkbuster/g' > \
122     $RPM_BUILD_ROOT%{ijbconf}/config
123
124 %post
125 if [ "$1" = "1" ]; then
126         /sbin/chkconfig --add junkbuster
127 fi
128
129 %preun
130 if [ "$1" = "0" ]; then
131         /sbin/service junkbuster stop > /dev/null 2>&1 ||:
132         /sbin/chkconfig --del junkbuster
133 fi
134
135 %postun
136 if [ "$1" -ge "1" ]; then
137         /sbin/service junkbuster condrestart > /dev/null 2>&1
138 fi
139
140 %clean
141 rm -rf $RPM_BUILD_ROOT
142
143 %files
144 %defattr(-,root,root)
145 # %doc ijbfaq.html ijbman.html README README.TOO gpl.html
146 %doc junkbuster.weekly junkbuster.monthly
147 %dir %{ijbconf}
148 %config %{ijbconf}/*
149 %attr(0744,junkbust,junkbust) %dir /var/log/junkbuster
150 %config %{_sysconfdir}/logrotate.d/junkbuster
151 %attr(0744,junkbust,junkbust)/usr/sbin/junkbuster
152 %{_mandir}/man8/*
153 %config %{_sysconfdir}/rc.d/init.d/junkbuster
154
155
156 %changelog
157
158 * Sun Jun  3 2001 Stefan Waldherr <stefan@waldherr.org>
159 - rework of RPM
160
161 * Mon Sep 25 2000 Stefan Waldherr <stefan@waldherr.org>
162 - CLF Logging patch by davep@cyw.uklinux.net
163 - Hal DeVore <haldevore@earthling.net> fix akamaitech in blocklist
164
165 * Sun Sep 17 2000 Stefan Waldherr <stefan@waldherr.org>
166 - Steve Kemp skx@tardis.ed.ac.uk's javascript popup patch.
167 - Markus Breitenbach breitenb@rbg.informatik.tu-darmstadt.de supplied
168   numerous fixes and enhancements for Steve's patch.
169 - adamlock@netscape.com (Adam Lock) in the windows version:
170   - Taskbar activity spinner always spins even when logging is
171   turned off (which is the default) - people who don't
172   like the spinner can turn it off from a menu option.
173   - Taskbar popup menu has a options submenu - people can now
174   open the settings files for cookies, blockers etc.
175   without opening the JB window.
176   - Logging functionality works again
177   - Buffer overflow is fixed - new code uses a bigger buffer
178   and snprintf so it shouldn't overflow anymore.
179 - Fixed userid swa, group learning problem while installing.
180   root must build RPM.
181 - Added patch by Benjamin Low <ben@snrc.uow.edu.au> that prevents JB to
182   core dump when there is no log file.
183 - Tweaked SuSE startup with the help of mohataj@gmx.net and Doc.B@gmx.de.
184 - Fixed man page to include imagefile and popupfile.
185 - Sanity check for the statistics function added.
186 - "Patrick D'Cruze" <pdcruze@orac.iinet.net.au>: It seems Microsoft
187  are transitioning Hotmail from FreeBSD/Apache to Windows 2000/IIS.
188  With IIS/5, it appears to omit the trailing \r\n from http header
189  only messages.  eg, when I visit http://www.hotmail.com, IIS/5
190  responds with a HTTP 302 redirect header.  However, this header
191  message is missing the trailing \r\n.  IIS/5 then closes the
192  connection.  Junkbuster, unfortunately, discards the header becomes
193  it thinks it is incomplete - and it is.  MS have transmitted an
194  incomplete header!
195 - Added bug reports and patch submission forms in the docs.
196
197 * Mon Mar 20 2000 Stefan Waldherr <stefan@waldherr.org>
198        Andrew <anw@tirana.freewire.co.uk> extended the JB:
199        Display of statistics of the total number of requests and the number
200        of requests filtered by junkbuster, also the percentage of requests
201        filtered. Suppression of the listing of files on the proxy-args page.
202        All stuff optional and configurable.
203
204 * Sun Sep 12 1999 Stefan Waldherr <stefan@waldherr.org>
205        Jan Willamowius (jan@janhh.shnet.org) fixed a bug in the 
206        code which prevented the JB from handling URLs of the form
207        user:password@www.foo.com. Fixed.
208
209 * Mon Aug  2 1999 Stefan Waldherr <stefan@waldherr.org>
210         Blank images are no longer cached, thanks to a hint from Markus 
211         Breitenbach <breitenb@rbg.informatik.tu-darmstadt.de>. The user 
212         agent is NO longer set by the Junkbuster. Sadly, many sites depend 
213         on the correct browser version nowadays. Incorporated many 
214         suggestions from Jan "Yenya" Kasprzak <kas@fi.muni.cz> for the
215         spec file. Fixed logging problem and since runlevel 2 does not 
216         use networking, I replaced /etc/rc.d/rc2.d/S84junkbuster with
217         /etc/rc.d/rc2.d/K09junkbuster thanks to Shaw Walker 
218         <walker@netgate.net>. You should now be able to build this RPM as 
219         a non-root user (mathias@weidner.sem.lipsia.de).
220
221 * Sun Jan 31 1999 Stefan Waldherr <stefan@waldherr.org>
222         /var/log/junkbuster set to nobody. Added /etc/junkbuster/imagelist
223         to allow more sophisticated matching of blocked images. Logrotate
224         logfile. Added files for auto-updating the blocklist et al.
225
226 * Wed Dec 16 1998 Stefan Waldherr <stefan@waldherr.org>
227         Configure blank version via config file. No separate blank
228         version anymore. Added Roland's <roland@spinnaker.rhein.de>
229         patch to show a logo instead of a blank area. Added a suggestion
230         from Alex <alex@cocoa.demon.co.uk>: /var/lock/subsys/junkbuster.
231         More regexps in the blocklist. Prepared the forwardfile for
232         squid. Extended image regexp with help from gabriel 
233         <somlo@CS.ColoState.EDU>.
234
235 * Thu Nov 19 1998 Stefan Waldherr <stefan@waldherr.org>
236         All RPMs now identify themselves in the show-proxy-args page.
237         Released Windoze version. Run junkbuster as nobody instead of
238         root. 
239
240 * Fri Oct 30 1998 Stefan Waldherr <stefan@waldherr.org>
241         Newest version. First release (hence the little version number
242         mixture -- 2.0.2-0 instead of 2.0-7). This version tightens 
243         security over 2.0.1; some multi-user sites will need to change 
244         the listen-address in the configuration file. The blank version of
245         the Internet Junkbuster has a more sophisticated way of replacing
246         images. All RPMs identify themselves in the show-proxy-args page.
247
248 * Thu Sep 23 1998 Stefan Waldherr <stefan@waldherr.org>
249         Modified the blocking feature, so that only GIFs and JPEGs are
250         blocked and replaced but not HTML pages. Thanks to 
251         "Gerd Flender" <plgerd@informatik.uni-siegen.de> for this nice
252         idea. Added numerous stuff to the blocklist. Keep patches in
253         seperate files and no longer in diffs (easier to maintain).
254
255 * Tue Jun 16 1998 Stefan Waldherr <swa@cs.cmu.edu>
256         Moved config files to /etc/junkbuster directory, moved man page,
257         added BuildRoot directive (Thanks to Alexey Nogin <ayn2@cornell.edu>)
258         Made new version junkbuster-raw (which is only a stripped version of 
259         the junkuster rpm, i.e. without my blocklist, etc.)
260
261 * Tue Jun 16 1998 (2.0-1)
262         Uhm, not that much. Just a new junkbuster version that
263         fixes a couple of bugs ... and of course a bigger 
264         blocklist with the unique Now-less-ads-than-ever(SM)
265         feature.
266         Oh, one thing: I changed the default user agent to Linux -- no 
267         need anymore to support Apple.
268
269 * Tue Jun 16 1998 (2.0-0)
270         Now-less-ads-than-ever (SM)
271         compiled with gcc instead of cc
272         compiled with -O3, thus it should be a little faster
273         show-proxy-args now works
274         /etc/junkbuster.init wasn't necessary
275
276 * Tue Jun 16 1998 (1.4)
277         some more config files were put into /etc
278         The junkbuster-blank rpm returns a 1x1 pixel image, that gets 
279         displayed by Netscape instead of the blocked image.
280         Read http://www.waldherr.org/junkbuster/ for
281         further info.
282
283 * Tue Jun 16 1998 (1.3)
284         The program has been moved to /usr/sbin (from /usr/local/bin)
285         Init- and stopscripts (/etc/rc.d/rc*) have been added so
286         that the junkbuster starts automatically during bootup.
287         The /etc/blocklist file is much more sophisticated. Theoretically
288         one should e.g. browse all major US and German newspapers without
289         seeing one annoying ad.
290         junkbuster.init was modified. It now starts junkbuster with an
291         additional "-r @" flag.