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