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