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