1 # $Id: junkbuster-rh.spec,v 1.32 2002/03/05 12:34:24 morcego Exp $
3 # Written by and Copyright (C) 2001 the SourceForge
4 # IJBSWA team. http://ijbswa.sourceforge.net
6 # Based on the Internet Junkbuster originally written
7 # by and Copyright (C) 1997 Anonymous Coders and
8 # Junkbusters Corporation. http://www.junkbusters.com
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.
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.
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.
28 # $Log: junkbuster-rh.spec,v $
29 # Revision 1.32 2002/03/05 12:34:24 morcego
30 # - Changing section internaly on the manpage from 1 to 8
31 # - We now require packages, not files, to avoid issues with apt
33 # Revision 1.31 2002/03/04 18:06:09 morcego
34 # SPECFILE: fixing permissing of the init script (broken by the last change)
36 # Revision 1.30 2002/03/04 16:18:03 morcego
37 # General cleanup of the rh specfile.
40 # * Mon Mar 04 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
41 # + junkbuster-2.9.11-2
42 # - General specfile fixup, using the best recomended practices, including:
43 # - Adding -q to %%setup
44 # - Using macros whereever possible
45 # - Not using wildchars on %%files section
46 # - Doubling the percentage char on changelog and comments, to
47 # avoid rpm expanding them
49 # Revision 1.29 2002/03/03 19:21:22 hal9
50 # Init script fails if shell is /bin/false.
52 # Revision 1.28 2002/01/09 18:34:03 hal9
55 # Revision 1.27 2002/01/09 18:32:02 hal9
56 # Removed RPM_OPT_FLAGS kludge.
58 # Revision 1.26 2002/01/09 18:21:10 hal9
59 # A few minor updates.
61 # Revision 1.25 2001/12/28 01:45:36 steudten
62 # Add paranoia check and BuildReq: gzip
64 # Revision 1.24 2001/12/01 21:43:14 hal9
65 # Allowed for new ijb.action file.
67 # Revision 1.23 2001/11/06 12:09:03 steudten
68 # Compress doc files. Install README and AUTHORS at last as document.
70 # Revision 1.22 2001/11/05 21:37:34 steudten
71 # Fix to include the actual version for name.
72 # Let the 'real' packager be included - sorry stefan.
74 # Revision 1.21 2001/10/31 19:27:27 swa
75 # consistent description. new name for suse since
76 # we had troubles with rpms of identical names
79 # Revision 1.20 2001/10/24 15:45:49 hal9
80 # To keep Thomas happy (aka correcting my mistakes)
82 # Revision 1.19 2001/10/15 03:23:59 hal9
85 # Revision 1.17 2001/10/10 18:59:28 hal9
86 # Minor change for init script.
88 # Revision 1.16 2001/09/24 20:56:23 hal9
91 # Revision 1.13 2001/09/10 17:44:43 swa
92 # integrate three pieces of documentation. needs work.
93 # will not build cleanly under redhat.
95 # Revision 1.12 2001/09/10 16:25:04 swa
96 # copy all templates. version updated.
98 # Revision 1.11 2001/07/03 11:00:25 sarantis
99 # replaced permissionsfile with actionsfile
101 # Revision 1.10 2001/07/03 09:34:44 sarantis
102 # bumped up version number.
104 # Revision 1.9 2001/06/12 18:15:29 swa
105 # the %% in front of configure (see tag below) confused
106 # the rpm build process on 7.1.
108 # Revision 1.8 2001/06/12 17:15:56 swa
109 # fixes, because a clean build on rh6.1 was impossible.
110 # GZIP confuses make, %% configure confuses rpm, etc.
112 # Revision 1.7 2001/06/11 12:17:26 sarantis
115 # Revision 1.6 2001/06/11 11:28:25 sarantis
116 # Further optimizations and adaptations in the spec file.
118 # Revision 1.5 2001/06/09 09:14:11 swa
119 # shamelessly adapted RPM stuff from the newest rpm that
120 # RedHat provided for the JB.
122 # Revision 1.4 2001/06/08 20:54:18 swa
123 # type with status file. remove forward et. al from file list.
125 # Revision 1.3 2001/06/07 17:28:10 swa
128 # Revision 1.2 2001/06/04 18:31:58 swa
129 # files are now prefixed with either `confdir' or `logdir'.
130 # `make redhat-dist' replaces both entries confdir and logdir
133 # Revision 1.1 2001/06/04 10:44:57 swa
134 # `make redhatr-dist' now works. Except for the paths
135 # in the config file.
140 # Defines should happen in the begining of the file
141 %define ijbconf %{_sysconfdir}/%{name}
143 Summary: The Internet Junkbuster
144 Vendor: http://ijbswa.sourceforge.net
148 Source0: http://www.waldherr.org/%{name}/ijbswa-%{version}.tar.gz
150 BuildRoot: %{_tmppath}/%{name}-%{version}-root
151 Group: Networking/Utilities
152 URL: http://ijbswa.sourceforge.net/
153 Obsoletes: junkbuster-raw junkbuster-blank
154 # Prereq: /usr/sbin/useradd , /sbin/chkconfig , /sbin/service
155 Prereq: shadow-utils, chkconfig, initscripts
156 BuildRequires: perl gzip sed docbook-utils
157 Conflicts: junkbuster-raw junkbuster-blank
160 Internet Junkbuster is a web proxy with advanced filtering
161 capabilities for protecting privacy, filtering web page content,
162 managing cookies, controlling access, and removing ads, banners,
163 pop-ups and other obnoxious Internet Junk. Junkbuster has a very
164 flexible configuration and can be customized to suit individual needs
165 and tastes. Internet Junkbuster has application for both stand-alone
166 systems and multi-user networks.
169 %setup -q -c -n ijbswa
176 ## Explicitily stripping is not recomended.
177 ## This is handled altomaticaly by RPM, and can couse troubles if
178 ## anyone wants to build an unstriped version - morcego
182 /usr/sbin/useradd -d /etc/%{name} -r %{name} -s "" > /dev/null 2>&1 || /bin/true
185 [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
186 mkdir -p %{buildroot}%{_sbindir} \
187 %{buildroot}%{_mandir}/man8 \
188 %{buildroot}%{_localstatedir}/log/%{name} \
189 %{buildroot}%{ijbconf}/templates \
190 %{buildroot}%{_sysconfdir}/logrotate.d \
191 %{buildroot}%{_sysconfdir}/rc.d/init.d
193 ## Manual gziping of manpages should not be done, once it can
194 ## break the building on some distributions. Anyway, rpm does it
195 ## automagicaly these days
196 ## Gziping the documentation files is not recomended - morcego
197 #gzip README AUTHORS ChangeLog %{name}.1 || /bin/true
199 install -s -m 744 %{name} %{buildroot}%{_sbindir}/%{name}
201 ## We need to change the man section internaly on the manpage
202 ## -- morcego (sugestion by Hal Burgiss)
203 #cp -f %{name}.1 %{buildroot}%{_mandir}/man8/%{name}.8
204 sed -e 's@^.TH JUNKBUSTER 1@.TH JUNKBUSTER 8@g' %{name}.1 > %{buildroot}%{_mandir}/man8/%{name}.8
205 cp -f *.action %{buildroot}%{ijbconf}/
206 cp -f re_filterfile %{buildroot}%{ijbconf}/re_filterfile
207 cp -f trust %{buildroot}%{ijbconf}/trust
208 cp -f templates/* %{buildroot}%{ijbconf}/templates/
209 cp -f %{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
210 install -m 755 %{name}.init %{buildroot}%{_sysconfdir}/rc.d/init.d/%{name}
211 install -m 711 -d %{buildroot}%{_localstatedir}/log/%{name}
213 # verify all file locations, etc. in the config file
214 # don't start with ^ or commented lines are not replaced
215 ## Changing the sed paramter delimiter to @, so we don't have to
216 ## escape the slashes
218 sed 's@^confdir.*@confdir %{_sysconfdir}/%{name}@g' | \
219 # sed 's/^permissionsfile.*/permissionsfile \/etc\/%{name}\/permissionsfile/g' | \
220 # sed 's/^re_filterfile.*/re_filterfile \/etc\/%{name}\/re_filterfile/g' | \
221 # sed 's/^logfile.*/logfile \%{_localstatedir}\/log\/%{name}\/logfile/g' | \
222 # sed 's/^jarfile.*/jarfile \%{_localstatedir}\/log\/%{name}\/jarfile/g' | \
223 # sed 's/^forward.*/forward \/etc\/%{name}\/forward/g' | \
224 # sed 's/^aclfile.*/aclfile \/etc\/%{name}\/aclfile/g' > \
225 sed 's@^logdir.*@logdir %{_localstatedir}/log/%{name}@g' > \
226 %{buildroot}%{ijbconf}/config
227 perl -pe 's/{-no-cookies}/{-no-cookies}\n\.redhat.com/' ijb.action >\
228 %{buildroot}%{ijbconf}/ijb.action
230 ## Macros are expanded even on commentaries. So, we have to use %%
235 # for upgrade from 2.0.x
236 [ -f %{_localstatedir}/log/%{name}/%{name} ] &&\
237 mv -f %{_localstatedir}/log/%{name}/%{name} %{_localstatedir}/log/%{name}/logfile || /bin/true
238 chown -R %{name}:%{name} %{_localstatedir}/log/%{name} 2>/dev/null
239 chown -R %{name}:%{name} /etc/%{name} 2>/dev/null
240 if [ "$1" = "1" ]; then
241 /sbin/chkconfig --add %{name}
242 /sbin/service %{name} condrestart > /dev/null 2>&1
244 # 01/09/02 HB, getting rid of any user=junkbust
245 grep junkbust: /etc/passwd >/dev/null && userdel junkbust || /bin/true
248 if [ "$1" = "0" ]; then
249 /sbin/service %{name} stop > /dev/null 2>&1 ||:
250 /sbin/chkconfig --del %{name}
254 #if [ "$1" -ge "1" ]; then
255 # /sbin/service %{name} condrestart > /dev/null 2>&1
259 [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
262 %defattr(0644,root,root,0755)
263 %doc README AUTHORS ChangeLog
264 # Where are the webserver/{developer,user}-manual files ?
265 %doc doc/text/developer-manual.txt doc/text/user-manual.txt
266 %doc doc/webserver/developer-manual
267 %doc doc/webserver/user-manual
268 #%doc %{name}.weekly %{name}.monthly AUTHORS
271 %dir %{ijbconf}/templates
272 %attr(0744,%{name},%{name}) %dir %{_localstatedir}/log/%{name}
274 %attr(0744,%{name},%{name})%{_sbindir}/%{name}
276 # We should not use wildchars here. This could mask missing files problems
278 %config %{ijbconf}/config
279 %config %{ijbconf}/ijb-advanced.action
280 %config %{ijbconf}/ijb-basic.action
281 %config %{ijbconf}/ijb-intermediate.action
282 %config %{ijbconf}/ijb.action
283 %config %{ijbconf}/re_filterfile
284 %config %{ijbconf}/trust
286 %config %{ijbconf}/templates/blocked
287 %config %{ijbconf}/templates/blocked-compact
288 %config %{ijbconf}/templates/cgi-error-404
289 %config %{ijbconf}/templates/cgi-error-bad-param
290 %config %{ijbconf}/templates/cgi-error-disabled
291 %config %{ijbconf}/templates/cgi-error-file
292 %config %{ijbconf}/templates/cgi-error-modified
293 %config %{ijbconf}/templates/cgi-error-parse
294 %config %{ijbconf}/templates/connect-failed
295 %config %{ijbconf}/templates/default
296 %config %{ijbconf}/templates/edit-actions-add-url-form
297 %config %{ijbconf}/templates/edit-actions-for-url
298 %config %{ijbconf}/templates/edit-actions-list
299 %config %{ijbconf}/templates/edit-actions-list-section
300 %config %{ijbconf}/templates/edit-actions-list-url
301 %config %{ijbconf}/templates/edit-actions-remove-url-form
302 %config %{ijbconf}/templates/edit-actions-url-form
303 %config %{ijbconf}/templates/no-such-domain
304 %config %{ijbconf}/templates/show-request
305 %config %{ijbconf}/templates/show-status
306 %config %{ijbconf}/templates/show-status-file
307 %config %{ijbconf}/templates/show-url-info
308 %config %{ijbconf}/templates/show-version
309 %config %{ijbconf}/templates/toggle
310 %config %{ijbconf}/templates/toggle-mini
311 %config %{ijbconf}/templates/untrusted
313 %config %{_sysconfdir}/logrotate.d/%{name}
314 %config %attr(0744,root,root) %{_sysconfdir}/rc.d/init.d/%{name}
316 %{_mandir}/man8/%{name}.8*
319 * Tue Mar 05 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
320 + junkbuster-2.9.11-5
321 - Added "make redhat-dok" to the build process
322 - Added docbook-utils to BuildRequires
324 * Tue Mar 05 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
325 + junkbuster-2.9.11-4
326 - Changing man section in the manpage from 1 to 8
327 - We now require packages, not files, to avoid issues with apt
329 * Mon Mar 04 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
330 + junkbuster-2.9.11-3
331 - Fixing permissions of the init script
333 * Mon Mar 04 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
334 + junkbuster-2.9.11-2
335 - General specfile fixup, using the best recomended practices, including:
336 - Adding -q to %%setup
337 - Using macros whereever possible
338 - Not using wildchars on %%files section
339 - Doubling the percentage char on changelog and comments, to
340 avoid rpm expanding them
342 * Sun Mar 03 2002 Hal Burgiss <hal@foobox.net>
343 - /bin/false for shell causes init script to fail. Reverting.
345 * Wed Jan 09 2002 Hal Burgiss <hal@foobox.net>
346 - Removed UID 73. Included user-manual and developer-manual in docs.
347 Include other actions files. Default shell is now /bin/false.
348 Userdel user=junkbust. ChangeLog was not zipped. Removed
349 RPM_OPT_FLAGS kludge.
351 * Fri Dec 28 2001 Thomas Steudten <thomas@steudten.ch>
352 - add paranoia check for 'rm -rf %%{buildroot}'
353 - add gzip to 'BuildRequires'
355 * Sat Dec 1 2001 Hal Burgiss <hal@foobox.net>
356 - actionsfile is now ijb.action.
358 * Tue Nov 6 2001 Thomas Steudten <thomas@steudten.ch>
360 - Add more documents for installation
361 - Add version string to name and source
363 * Wed Oct 24 2001 Hal Burigss <hal@foobox.net>
364 - Back to user 'junkbuster' and fix configure macro.
366 * Wed Oct 10 2001 Hal Burigss <hal@foobox.net>
367 - More changes for user 'junkbust'. Init script had 'junkbuster'.
369 * Sun Sep 23 2001 Hal Burgiss <hal@foobox.net>
370 - Change of $RPM_OPT_FLAGS handling. Added new HTML doc files.
371 - Changed owner of /etc/junkbuster to shut up PAM/xauth log noise.
373 * Thu Sep 13 2001 Hal Burgiss <hal@foobox.net>
374 - Added $RPM_OPT_FLAGS support, renaming of old logfile, and
375 - made sure no default shell exists for user junkbust.
377 * Sun Jun 3 2001 Stefan Waldherr <stefan@waldherr.org>
380 * Mon Sep 25 2000 Stefan Waldherr <stefan@waldherr.org>
381 - CLF Logging patch by davep@cyw.uklinux.net
382 - Hal DeVore <haldevore@earthling.net> fix akamaitech in blocklist
384 * Sun Sep 17 2000 Stefan Waldherr <stefan@waldherr.org>
385 - Steve Kemp skx@tardis.ed.ac.uk's javascript popup patch.
386 - Markus Breitenbach breitenb@rbg.informatik.tu-darmstadt.de supplied
387 numerous fixes and enhancements for Steve's patch.
388 - adamlock@netscape.com (Adam Lock) in the windows version:
389 - Taskbar activity spinner always spins even when logging is
390 turned off (which is the default) - people who don't
391 like the spinner can turn it off from a menu option.
392 - Taskbar popup menu has a options submenu - people can now
393 open the settings files for cookies, blockers etc.
394 without opening the JB window.
395 - Logging functionality works again
396 - Buffer overflow is fixed - new code uses a bigger buffer
397 and snprintf so it shouldn't overflow anymore.
398 - Fixed userid swa, group learning problem while installing.
400 - Added patch by Benjamin Low <ben@snrc.uow.edu.au> that prevents JB to
401 core dump when there is no log file.
402 - Tweaked SuSE startup with the help of mohataj@gmx.net and Doc.B@gmx.de.
403 - Fixed man page to include imagefile and popupfile.
404 - Sanity check for the statistics function added.
405 - "Patrick D'Cruze" <pdcruze@orac.iinet.net.au>: It seems Microsoft
406 are transitioning Hotmail from FreeBSD/Apache to Windows 2000/IIS.
407 With IIS/5, it appears to omit the trailing \r\n from http header
408 only messages. eg, when I visit http://www.hotmail.com, IIS/5
409 responds with a HTTP 302 redirect header. However, this header
410 message is missing the trailing \r\n. IIS/5 then closes the
411 connection. Junkbuster, unfortunately, discards the header becomes
412 it thinks it is incomplete - and it is. MS have transmitted an
414 - Added bug reports and patch submission forms in the docs.
416 * Mon Mar 20 2000 Stefan Waldherr <stefan@waldherr.org>
417 Andrew <anw@tirana.freewire.co.uk> extended the JB:
418 Display of statistics of the total number of requests and the number
419 of requests filtered by junkbuster, also the percentage of requests
420 filtered. Suppression of the listing of files on the proxy-args page.
421 All stuff optional and configurable.
423 * Sun Sep 12 1999 Stefan Waldherr <stefan@waldherr.org>
424 Jan Willamowius (jan@janhh.shnet.org) fixed a bug in the
425 code which prevented the JB from handling URLs of the form
426 user:password@www.foo.com. Fixed.
428 * Mon Aug 2 1999 Stefan Waldherr <stefan@waldherr.org>
429 Blank images are no longer cached, thanks to a hint from Markus
430 Breitenbach <breitenb@rbg.informatik.tu-darmstadt.de>. The user
431 agent is NO longer set by the Junkbuster. Sadly, many sites depend
432 on the correct browser version nowadays. Incorporated many
433 suggestions from Jan "Yenya" Kasprzak <kas@fi.muni.cz> for the
434 spec file. Fixed logging problem and since runlevel 2 does not
435 use networking, I replaced /etc/rc.d/rc2.d/S84junkbuster with
436 /etc/rc.d/rc2.d/K09junkbuster thanks to Shaw Walker
437 <walker@netgate.net>. You should now be able to build this RPM as
438 a non-root user (mathias@weidner.sem.lipsia.de).
440 * Sun Jan 31 1999 Stefan Waldherr <stefan@waldherr.org>
441 %%{_localstatedir}/log/junkbuster set to nobody. Added /etc/junkbuster/imagelist
442 to allow more sophisticated matching of blocked images. Logrotate
443 logfile. Added files for auto-updating the blocklist et al.
445 * Wed Dec 16 1998 Stefan Waldherr <stefan@waldherr.org>
446 Configure blank version via config file. No separate blank
447 version anymore. Added Roland's <roland@spinnaker.rhein.de>
448 patch to show a logo instead of a blank area. Added a suggestion
449 from Alex <alex@cocoa.demon.co.uk>: %%{_localstatedir}/lock/subsys/junkbuster.
450 More regexps in the blocklist. Prepared the forwardfile for
451 squid. Extended image regexp with help from gabriel
452 <somlo@CS.ColoState.EDU>.
454 * Thu Nov 19 1998 Stefan Waldherr <stefan@waldherr.org>
455 All RPMs now identify themselves in the show-proxy-args page.
456 Released Windoze version. Run junkbuster as nobody instead of
459 * Fri Oct 30 1998 Stefan Waldherr <stefan@waldherr.org>
460 Newest version. First release (hence the little version number
461 mixture -- 2.0.2-0 instead of 2.0-7). This version tightens
462 security over 2.0.1; some multi-user sites will need to change
463 the listen-address in the configuration file. The blank version of
464 the Internet Junkbuster has a more sophisticated way of replacing
465 images. All RPMs identify themselves in the show-proxy-args page.
467 * Thu Sep 23 1998 Stefan Waldherr <stefan@waldherr.org>
468 Modified the blocking feature, so that only GIFs and JPEGs are
469 blocked and replaced but not HTML pages. Thanks to
470 "Gerd Flender" <plgerd@informatik.uni-siegen.de> for this nice
471 idea. Added numerous stuff to the blocklist. Keep patches in
472 seperate files and no longer in diffs (easier to maintain).
474 * Tue Jun 16 1998 Stefan Waldherr <swa@cs.cmu.edu>
475 Moved config files to /etc/junkbuster directory, moved man page,
476 added BuildRoot directive (Thanks to Alexey Nogin <ayn2@cornell.edu>)
477 Made new version junkbuster-raw (which is only a stripped version of
478 the junkuster rpm, i.e. without my blocklist, etc.)
480 * Tue Jun 16 1998 (2.0-1)
481 Uhm, not that much. Just a new junkbuster version that
482 fixes a couple of bugs ... and of course a bigger
483 blocklist with the unique Now-less-ads-than-ever(SM)
485 Oh, one thing: I changed the default user agent to Linux -- no
486 need anymore to support Apple.
488 * Tue Jun 16 1998 (2.0-0)
489 Now-less-ads-than-ever (SM)
490 compiled with gcc instead of cc
491 compiled with -O3, thus it should be a little faster
492 show-proxy-args now works
493 /etc/junkbuster.init wasn't necessary
495 * Tue Jun 16 1998 (1.4)
496 some more config files were put into /etc
497 The junkbuster-blank rpm returns a 1x1 pixel image, that gets
498 displayed by Netscape instead of the blocked image.
499 Read http://www.waldherr.org/junkbuster/ for
502 * Tue Jun 16 1998 (1.3)
503 The program has been moved to /usr/sbin (from /usr/local/bin)
504 Init- and stopscripts (/etc/rc.d/rc*) have been added so
505 that the junkbuster starts automatically during bootup.
506 The /etc/blocklist file is much more sophisticated. Theoretically
507 one should e.g. browse all major US and German newspapers without
508 seeing one annoying ad.
509 junkbuster.init was modified. It now starts junkbuster with an
510 additional "-r @" flag.