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