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