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