Syncing with 3.0.0. No substantive changes otherwise.
[privoxy.git] / privoxy-suse.spec
1 # $Id: privoxy-suse.spec,v 1.22 2002/09/03 23:42:21 hal9 Exp $
2 #
3 # Written by and Copyright (C) 2001,2002 the SourceForge
4 # Privoxy team. http://www.privoxy.org/
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
29 # do not set to %{name}
30 %define privoxyconf %{_sysconfdir}/privoxy
31 %define privoxy_uid 73
32 %define privoxy_gid 73
33
34
35 Summary:      Privoxy - privacy enhancing proxy
36 Vendor:       Privoxy.Org
37 Name:         privoxy-suse
38 Distribution: defineme
39 Version: 3.0.0
40 Release: 1
41 # Needs makefile change: Source: http://prdownloads.sourceforge.net/ijbswa/privoxy-%{version}-%{status}-src.tar.gz
42 Source: http://prdownloads.sourceforge.net/ijbswa/privoxy-%{version}.tar.gz
43 # not sure if this works
44 BuildRoot: %{_tmppath}/%{name}-%{version}-root
45 Packager:     Stefan Waldherr <stefan@waldherr.org>
46 License:     GPL
47 Group:        Networking/Utilities
48 URL:          http://www.privoxy.org/
49 Autoreqprov:  on
50 BuildRequires: perl gzip libtool autoconf
51 Conflicts: junkbuster-raw junkbuster-blank junkbuster-suse junkbuster privoxy
52
53 #
54 # -----------------------------------------------------------------------------
55 #
56 %description
57 Privoxy is a web proxy with advanced filtering capabilities for
58 protecting privacy, filtering web page content, managing cookies,
59 controlling access, and removing ads, banners, pop-ups and other
60 obnoxious Internet junk. Privoxy has a very flexible configuration and
61 can be customized to suit individual needs and tastes. Privoxy has 
62 application for both stand-alone systems and multi-user networks.
63
64 Privoxy is based on the  Internet Junkbuster.
65
66 Authors:
67 --------
68     http://www.privoxy.org/
69
70 SuSE series: n
71
72 #
73 # -----------------------------------------------------------------------------
74 #
75 %prep
76 %setup -c
77
78 #
79 # -----------------------------------------------------------------------------
80 #
81 %build
82 autoheader
83 autoconf
84 ./configure --disable-dynamic-pcre
85 make
86
87
88 ## Explicitily stripping is not recomended.
89 ## This is handled altomaticaly by RPM, and can couse troubles if
90 ## anyone wants to build an unstriped version - morcego
91 #strip privoxy
92
93 #
94 # -----------------------------------------------------------------------------
95 #
96 %install
97 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
98 mkdir -p ${RPM_BUILD_ROOT}%{_sbindir} \
99          ${RPM_BUILD_ROOT}%{_mandir}/man8 \
100          ${RPM_BUILD_ROOT}/var/log/privoxy \
101          ${RPM_BUILD_ROOT}%{privoxyconf}/templates \
102          ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d \
103          ${RPM_BUILD_ROOT}%{_sysconfdir}/init.d
104 gzip README AUTHORS ChangeLog privoxy.1 LICENSE || /bin/true
105 install -s -m 744 privoxy $RPM_BUILD_ROOT%{_sbindir}/privoxy
106 cp -f privoxy.1.gz $RPM_BUILD_ROOT%{_mandir}/man8/privoxy.8.gz
107 cp -f *.action $RPM_BUILD_ROOT%{privoxyconf}/
108 cp -f default.filter $RPM_BUILD_ROOT%{privoxyconf}/default.filter
109 cp -f trust $RPM_BUILD_ROOT%{privoxyconf}/trust
110 cp -f templates/*  $RPM_BUILD_ROOT%{privoxyconf}/templates/
111 cp -f privoxy.logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/privoxy
112 install -m 755 privoxy.init.suse $RPM_BUILD_ROOT%{_sysconfdir}/init.d/privoxy
113 install -m 711 -d $RPM_BUILD_ROOT/var/log/privoxy
114 ln -sf /etc/init.d/privoxy $RPM_BUILD_ROOT/usr/sbin/rcprivoxy
115
116 # verify all file locations, etc. in the config file
117 # don't start with ^ or commented lines are not replaced
118 cat config | \
119     sed 's/^confdir.*/confdir \/etc\/privoxy/g' | \
120 #    sed 's/^permissionsfile.*/permissionsfile \/etc\/privoxy\/permissionsfile/g' | \
121 #    sed 's/^filterfile.*/default.filter \/etc\/privoxy\/default.filter/g' | \
122 #    sed 's/^logfile.*/logfile \/var\/log\/privoxy\/logfile/g' | \
123 #    sed 's/^jarfile.*/jarfile \/var\/log\/privoxy\/jarfile/g' | \
124 #    sed 's/^forward.*/forward \/etc\/privoxy\/forward/g' | \
125 #    sed 's/^aclfile.*/aclfile \/etc\/privoxy\/aclfile/g' > \
126     sed 's/^logdir.*/logdir \/var\/log\/privoxy/g' > \
127     $RPM_BUILD_ROOT%{privoxyconf}/config
128
129 #
130 # -----------------------------------------------------------------------------
131 #
132 %pre
133 # We check to see if the user privoxy exists.
134 # If it does, we do nothing
135 # If we don't, we check to see if the user junkbust exist and, in case it
136 # does, we change it do privoxy. If it also does not exist, we create the
137 # privoxy user -- morcego
138 id privoxy > /dev/null 2>&1 
139 if [ $? -eq 1 ]; then
140         id junkbust > /dev/null 2>&1 
141         if [ $? -eq 0 ]; then
142                 /usr/sbin/usermod -u %{privoxy_uid} -g %{privoxy_gid} -l privoxy -d %{_sysconfdir}/privoxy -s "" junkbust  > /dev/null 2>&1
143         else
144 # -r does not work on suse.
145                 /usr/sbin/groupadd -g %{privoxy_gid} privoxy
146                 /usr/sbin/useradd -u %{privoxy_uid} -d %{_sysconfdir}/privoxy -g privoxy -s "" privoxy > /dev/null 2>&1 
147         fi
148 fi
149
150 #
151 # -----------------------------------------------------------------------------
152 #
153 %post
154 [ -f /var/log/privoxy/privoxy ] &&\
155  mv -f /var/log/privoxy/privoxy /var/log/privoxy/logfile || /bin/true
156 chown -R privoxy:privoxy /var/log/privoxy 2>/dev/null
157 chown -R privoxy:privoxy /etc/privoxy 2>/dev/null
158 # not available on suse
159 #if [ "$1" = "1" ]; then
160 #     /sbin/chkconfig --add privoxy
161 #       /sbin/service privoxy condrestart > /dev/null 2>&1
162 #fi
163 # 01/09/02 HB, getting rid of any user=junkbust
164 # Changed by morcego to use the id command.
165 id junkbust > /dev/null 2>&1 && /usr/sbin/userdel junkbust || /bin/true
166 sbin/insserv etc/init.d/privoxy
167
168 #
169 # -----------------------------------------------------------------------------
170 #
171 %preun
172 # need to stop the service on suse. swa.
173 #if [ "$1" = "0" ]; then
174 #       /sbin/service privoxy stop > /dev/null 2>&1 ||:
175 #fi
176
177 #
178 # -----------------------------------------------------------------------------
179 #
180 %postun
181 sbin/insserv etc/init.d/
182 # dont forget to remove user and group privoxy
183 id privoxy > /dev/null 2>&1 && /usr/sbin/userdel privoxy || /bin/true
184
185 #
186 # -----------------------------------------------------------------------------
187 #
188 %clean
189 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
190
191 #
192 # -----------------------------------------------------------------------------
193 #
194 %files
195 %defattr(-,root,root)
196 %doc README.gz AUTHORS.gz ChangeLog.gz LICENSE.gz
197 %doc doc/webserver/developer-manual
198 %doc doc/webserver/user-manual
199 %doc doc/webserver/faq
200 %doc doc/webserver/p_doc.css
201 %doc doc/webserver/p_web.css
202 %doc doc/webserver/privoxy-index.html
203 %doc doc/webserver/images
204 #%doc privoxy.weekly privoxy.monthly AUTHORS
205 %dir %{privoxyconf}
206 #%config %{privoxyconf}/*
207 # WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! WARNING !
208 # We should not use wildchars here. This could mask missing files problems
209 # -- morcego
210 # WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! WARNING !
211 %config(noreplace) %{privoxyconf}/config
212 %config %{privoxyconf}/standard.action
213 %config(noreplace) %{privoxyconf}/user.action
214 %config %{privoxyconf}/default.action
215 %config %{privoxyconf}/default.filter
216 %config %{privoxyconf}/trust
217
218 # Please keep these alphabetized so its easier to find one that 
219 # is not included.
220 %config %{privoxyconf}/templates/blocked
221 %config %{privoxyconf}/templates/cgi-error-404
222 %config %{privoxyconf}/templates/cgi-error-bad-param
223 %config %{privoxyconf}/templates/cgi-error-disabled
224 %config %{privoxyconf}/templates/cgi-error-file
225 %config %{privoxyconf}/templates/cgi-error-file-read-only
226 %config %{privoxyconf}/templates/cgi-error-modified
227 %config %{privoxyconf}/templates/cgi-error-parse
228 %config %{privoxyconf}/templates/cgi-style.css
229 %config %{privoxyconf}/templates/connect-failed
230 %config %{privoxyconf}/templates/default
231 %config %{privoxyconf}/templates/edit-actions-add-url-form
232 %config %{privoxyconf}/templates/edit-actions-for-url
233 %config %{privoxyconf}/templates/edit-actions-for-url-filter
234 %config %{privoxyconf}/templates/edit-actions-list
235 %config %{privoxyconf}/templates/edit-actions-list-button
236 %config %{privoxyconf}/templates/edit-actions-list-section
237 %config %{privoxyconf}/templates/edit-actions-list-url
238 %config %{privoxyconf}/templates/edit-actions-remove-url-form
239 %config %{privoxyconf}/templates/edit-actions-url-form
240 %config %{privoxyconf}/templates/mod-local-help
241 %config %{privoxyconf}/templates/mod-support-and-service
242 %config %{privoxyconf}/templates/mod-title
243 %config %{privoxyconf}/templates/mod-unstable-warning
244 %config %{privoxyconf}/templates/no-such-domain
245 %config %{privoxyconf}/templates/show-request
246 %config %{privoxyconf}/templates/show-status
247 %config %{privoxyconf}/templates/show-status-file
248 %config %{privoxyconf}/templates/show-url-info
249 %config %{privoxyconf}/templates/show-version
250 %config %{privoxyconf}/templates/toggle
251 %config %{privoxyconf}/templates/toggle-mini
252 %config %{privoxyconf}/templates/untrusted
253
254 %attr(0744,privoxy,privoxy) %dir /var/log/privoxy
255 %config %{_sysconfdir}/logrotate.d/privoxy
256 %attr(0755,root,root)/usr/sbin/privoxy
257 %{_mandir}/man8/*
258 %config %{_sysconfdir}/init.d/privoxy
259 /usr/sbin/rcprivoxy
260
261 #
262 # -----------------------------------------------------------------------------
263 #
264 %changelog
265 * Thu Sep 05 2002 Hal Burgiss <hal@foobox.net>
266 - Sync changes with 3.0 branch.
267
268 * Tue Sep 03 2002 Hal Burgiss <hal@foobox.net>
269 + privoxy-3.1.1-1
270 - Explicitly list %%config files, and set noreplace flag for config and 
271 user.action. Note: no way I can test this change! Bump version while here.
272
273 * Mon May 27 2002 Hal Burgiss <hal@foobox.net>
274 + privoxy-2.9.15-1
275 - Index.html is now privoxy-index.html.
276
277 * Fri May 24 2002 Hal Burgiss <hal@foobox.net>
278 + privoxy-2.9.15-1
279 - Add doc/images directory.
280
281 * Fri May 03 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
282 + privoxy-suse-2.9.15-1
283 - Version bump
284
285 * Fri Apr 26 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
286 + privoxy-suse-2.9.14-3
287 - Changing Vendor to Privoxy.Org
288
289 * Mon Apr 22 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
290 + privoxy-suse-2.9.14-2
291 - Bumping release to reflect the new value on configure.in
292 - Taking the oportunity to change the header Copyright to License. The
293   Copyright headers is deprecated, and after all, GPL is a license, not a
294   Copyright
295
296 * Mon Apr 08 2002 Hal Burgiss <hal@foobox.net>
297 + privoxy-2.9.13-4
298 - Add LICENSE.gz, p_web.css, and index.html. Add autoconf
299 - to Buildrequires.
300
301 * Wed Mar 27 2002 Hal Burgiss <hal@foobox.net>
302 + privoxy-2.9.13-3
303 - Doc css has changed names.
304
305 * Tue Mar 25 2002 Hal Burgiss <hal@foobox.net>
306 + privoxy-2.9.13-3
307 - Minor fix to description.
308
309 * Sun Mar 24 2002 Hal Burgiss <hal@foobox.net>
310 - added faq to docs.
311
312 * Thu Mar 21 2002 Hal Burgiss <hal@foobox.net>
313 - added ijb_docs.css to docs.
314
315 * Mon Mar 11 2002 Hal Burgiss <hal@foobox.net>
316 - Remove --enable-no-gifs from configure.
317
318 * Sun Mar 03 2002 Hal Burgiss <hal@foobox.net>
319 - /bin/false for shell causes init script to fail. Reverting.
320
321 * Wed Jan 09 2002 Hal Burgiss <hal@foobox.net>
322 - Removed UID 73. Included user-manual and developer-manual in docs.
323   Include other actions files. Default shell is now /bin/false.
324   Userdel user=junkbust. ChangeLog was not zipped. Removed
325   RPM_OPT_FLAGS kludge.
326
327 * Fri Dec 28 2001 Thomas Steudten <thomas@steudten.ch>
328 - add paranoia check for 'rm -rf $RPM_BUILD_ROOT'
329 - add gzip to 'BuildRequires'
330
331 * Sat Dec  1 2001 Hal Burgiss <hal@foobox.net>
332 - actionsfile is now ijb.action.
333
334 * Tue Nov  6 2001 Thomas Steudten <thomas@steudten.ch>
335 - Compress manpage
336 - Add more documents for installation
337 - Add version string to name and source
338
339 * Wed Oct 24 2001 Hal Burigss <hal@foobox.net>
340 - Back to user 'junkbuster' and fix configure macro.
341
342 * Wed Oct 10 2001 Hal Burigss <hal@foobox.net>
343 - More changes for user 'junkbust'. Init script had 'junkbuster'.
344
345 * Sun Sep 23 2001 Hal Burgiss <hal@foobox.net>
346 - Change of $RPM_OPT_FLAGS handling. Added new HTML doc files.
347 - Changed owner of /etc/junkbuster to shut up PAM/xauth log noise.
348
349 * Thu Sep 13 2001 Hal Burgiss <hal@foobox.net>
350 - Added $RPM_OPT_FLAGS support, renaming of old logfile, and
351 - made sure no default shell exists for user junkbust.
352
353 * Sun Jun  3 2001 Stefan Waldherr <stefan@waldherr.org>
354 - rework of RPM
355 * Wed Feb 14 2001 - uli@suse.de
356 - fixed init script
357 * Wed Dec 06 2000 - bjacke@suse.de
358 - renamed package to junkbuster
359 - fixed copyright tag
360 * Thu Nov 30 2000 - uli@suse.de
361 - moved init script to /etc/init.d
362 * Wed Feb 16 2000 - kukuk@suse.de
363 - Move /usr/man -> /usr/share/man
364 - Mark /etc/ijb as "config(noreplace)"
365 * Mon Sep 20 1999 - uli@suse.de
366 - fixed init script
367 * Mon Sep 13 1999 - bs@suse.de
368 - ran old prepare_spec on spec file to switch to new prepare_spec.
369 * Thu Apr 01 1999 - daniel@suse.de
370 - do not start ijb as root (security)
371 * Tue Mar 30 1999 - daniel@suse.de
372 - donĀ“t use saclfile.ini
373 * Tue Mar 30 1999 - daniel@suse.de
374 - small fix to whitelist-configuration,
375   version is and was 2.0.2 WITHOUT Stefan Waldherr's patches
376   (http://www.waldherr.org/junkbuster/)
377 * Mon Mar 01 1999 - daniel@suse.de
378 - new package: version 2.0
379
380 # $Log: privoxy-suse.spec,v $
381 # Revision 1.22  2002/09/03 23:42:21  hal9
382 # Explicitly list all %config files, like RH spec. Set noreplace flag for config
383 # and user.action (only). Bump version. Note: I have no way to test this change,
384 # but am aiming for consistency among spec files.
385 #
386 # Revision 1.21  2002/05/28 03:56:59  hal9
387 # Index.html re-vamped as privoxy-index.html for docs.
388 #
389 # Revision 1.20  2002/05/25 02:08:23  hal9
390 # Add doc/images directory.
391 # Redhat: alphabetized list of templates (and I think added one in the process)
392 #
393 # Revision 1.19  2002/05/03 17:14:36  morcego
394 # *.spec: Version bump to 2.9.15
395 # -rh.spec: noreplace for %%{privoxyconf}/config
396 #           Will interrupt the build if versions from configure.in and
397 #               specfile do not match
398 #
399 # Revision 1.18  2002/04/27 20:26:59  swa
400 # uid, gui 73 incorporated
401 #
402 # Revision 1.17  2002/04/26 15:51:05  morcego
403 # Changing Vendor value to Privoxy.Org
404 #
405 # Revision 1.16  2002/04/22 16:32:31  morcego
406 # configure.in, *.spec: Bumping release to 2 (2.9.14-2)
407 # -rh.spec: uid and gid are now macros
408 # -suse.spec: Changing the header Copyright to License (Copyright is
409 #             deprecable)
410 #
411 # Revision 1.15  2002/04/16 18:49:07  oes
412 # Build with static built-in pcre
413 #
414 # Revision 1.14  2002/04/11 17:57:40  oes
415 # Fixed(?) Conflicts: Provides: Obsoletes:
416 #
417 # Revision 1.13  2002/04/11 10:09:20  oes
418 # Version 2.9.14
419 #
420 # Revision 1.12  2002/04/09 13:29:43  swa
421 # build suse and gen-dist with html docs. do not generate docs while building rpm
422 #
423 # Revision 1.11  2002/04/09 03:12:37  hal9
424 # Add LICENSE, p_web.css and index.html. Add autoconf to buildrequires.
425 #
426 # Revision 1.10  2002/04/08 20:24:13  swa
427 # fixed JB spelling
428 #
429 # Revision 1.9  2002/03/30 09:01:52  swa
430 # new release
431 #
432 # Revision 1.8  2002/03/27 23:46:41  hal9
433 # ijb_docs.css to p_doc.css
434 #
435 # Revision 1.7  2002/03/27 00:49:39  hal9
436 # Minor fix to description.
437 #
438 # Revision 1.6  2002/03/26 22:29:55  swa
439 # we have a new homepage!
440 #
441 # Revision 1.5  2002/03/25 03:10:50  hal9
442 # Added faq to docs.
443 #
444 # Revision 1.4  2002/03/24 12:56:21  swa
445 # name change related issues.
446 #
447 # Revision 1.3  2002/03/24 12:44:31  swa
448 # new version string
449 #
450 # Revision 1.2  2002/03/24 11:40:14  swa
451 # name change
452 #
453 # Revision 1.1  2002/03/24 11:23:44  swa
454 # name change
455 #
456 # Revision 1.21  2002/03/21 16:04:33  hal9
457 # added ijb_docs.css to %%doc
458 #
459 # Revision 1.20  2002/03/12 13:42:14  sarantis
460 # remove hardcoded "ijbswa" from build phase
461 #
462 # Revision 1.19  2002/03/11 22:59:05  hal9
463 # Remove --enable-no-gifs
464 #
465 # Revision 1.18  2002/03/11 12:30:31  swa
466 # be consistent with rh spec file
467 #
468 # Revision 1.17  2002/03/08 19:30:23  swa
469 # remove user junkbuster after de-installation.
470 # synced suse with rh-specfile. installation
471 # and de-installation seem to work.
472 #
473 # Revision 1.16  2002/03/08 18:40:44  swa
474 # build requires tools. useradd and del works
475 # now.
476 #
477 # Revision 1.15  2002/03/07 19:23:50  swa
478 # i hate to scroll. suse: wrong configdir.
479 #
480 # Revision 1.14  2002/03/07 19:10:21  swa
481 # builds cleanly. thanks to kukuk@suse.de
482 # not yet tested.
483 #
484 # Revision 1.13  2002/03/07 18:25:56  swa
485 # synced redhat and suse build process
486 #
487 # Revision 1.12  2002/03/02 15:50:04  swa
488 # 2.9.11 version. more input for docs.
489 #
490 # Revision 1.11  2001/12/02 10:29:26  swa
491 # New version made these changes necessary.
492 #
493 # Revision 1.10  2001/10/31 19:27:27  swa
494 # consistent description. new name for suse since
495 # we had troubles with rpms of identical names
496 # on the webserver.
497 #
498 # Revision 1.9  2001/10/26 18:17:23  swa
499 # new version string
500 #
501 # Revision 1.8  2001/09/13 16:22:42  swa
502 # man page is legacy. suse rpm now contains html
503 # documentation.
504 #
505 # Revision 1.7  2001/09/10 17:44:22  swa
506 # integrate three pieces of documentation.
507 #
508 # Revision 1.6  2001/09/10 16:29:23  swa
509 # binary contained debug info.
510 # buildroot definition fucks up the build process under suse.
511 # program needs to write in varlogjunkbuster
512 # install all templates
513 # create varlogjunkbuster
514 #
515 # Revision 1.5  2001/06/09 09:13:29  swa
516 # description shorter
517 #
518 # Revision 1.4  2001/06/08 20:53:36  swa
519 # use buildroot, export init to separate file (better manageability)
520 #
521 # Revision 1.3  2001/06/07 17:28:10  swa
522 # cosmetics
523 #
524 # Revision 1.2  2001/06/07 17:18:44  swa
525 # header fixed
526 #
527 #