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