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