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