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