Block feedproxy.google.com/~r/.*/~4/.
[privoxy.git] / privoxy-suse.spec
1 # $Id: privoxy-suse.spec,v 1.30 2008/08/13 16:57:46 fabiankeil Exp $
2 #
3 # Written by and Copyright (C) 2001-2006 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.10
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:     http://www.privoxy.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, modifying web page data, 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/^forward.*/forward \/etc\/privoxy\/forward/g' | \
124 #    sed 's/^aclfile.*/aclfile \/etc\/privoxy\/aclfile/g' > \
125     sed 's/^logdir.*/logdir \/var\/log\/privoxy/g' > \
126     $RPM_BUILD_ROOT%{privoxyconf}/config
127
128 #
129 # -----------------------------------------------------------------------------
130 #
131 %pre
132 # We check to see if the user privoxy exists.
133 # If it does, we do nothing
134 # If we don't, we check to see if the user junkbust exist and, in case it
135 # does, we change it do privoxy. If it also does not exist, we create the
136 # privoxy user -- morcego
137 id privoxy > /dev/null 2>&1 
138 if [ $? -eq 1 ]; then
139         id junkbust > /dev/null 2>&1 
140         if [ $? -eq 0 ]; then
141                 /usr/sbin/usermod -u %{privoxy_uid} -g %{privoxy_gid} -l privoxy -d %{_sysconfdir}/privoxy -s "" junkbust  > /dev/null 2>&1
142         else
143 # -r does not work on suse.
144                 /usr/sbin/groupadd -g %{privoxy_gid} privoxy
145                 /usr/sbin/useradd -u %{privoxy_uid} -d %{_sysconfdir}/privoxy -g privoxy -s "" privoxy > /dev/null 2>&1 
146         fi
147 fi
148
149 #
150 # -----------------------------------------------------------------------------
151 #
152 %post
153 [ -f /var/log/privoxy/privoxy ] &&\
154  mv -f /var/log/privoxy/privoxy /var/log/privoxy/logfile || /bin/true
155 chown -R privoxy:privoxy /var/log/privoxy 2>/dev/null
156 chown -R privoxy:privoxy /etc/privoxy 2>/dev/null
157 # not available on suse
158 #if [ "$1" = "1" ]; then
159 #     /sbin/chkconfig --add privoxy
160 #       /sbin/service privoxy condrestart > /dev/null 2>&1
161 #fi
162 # 01/09/02 HB, getting rid of any user=junkbust
163 # Changed by morcego to use the id command.
164 id junkbust > /dev/null 2>&1 && /usr/sbin/userdel junkbust || /bin/true
165 sbin/insserv etc/init.d/privoxy
166
167 #
168 # -----------------------------------------------------------------------------
169 #
170 %preun
171 # need to stop the service on suse. swa.
172 #if [ "$1" = "0" ]; then
173 #       /sbin/service privoxy stop > /dev/null 2>&1 ||:
174 #fi
175
176 #
177 # -----------------------------------------------------------------------------
178 #
179 %postun
180 sbin/insserv etc/init.d/
181 # dont forget to remove user and group privoxy
182 id privoxy > /dev/null 2>&1 && /usr/sbin/userdel privoxy || /bin/true
183
184 #
185 # -----------------------------------------------------------------------------
186 #
187 %clean
188 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
189
190 #
191 # -----------------------------------------------------------------------------
192 #
193 %files
194 %defattr(-,root,root)
195 %doc README.gz AUTHORS.gz ChangeLog.gz LICENSE.gz
196 %doc doc/webserver/developer-manual
197 %doc doc/webserver/user-manual
198 %doc doc/webserver/faq
199 %doc doc/webserver/p_doc.css
200 %doc doc/webserver/privoxy-index.html
201 %doc doc/webserver/images
202 %doc doc/webserver/man-page
203
204 %dir %{privoxyconf}
205 %config %{privoxyconf}/*
206 %attr(0740,privoxy,privoxy) %dir /var/log/privoxy
207 %config %{_sysconfdir}/logrotate.d/privoxy
208 %attr(0755,root,root)/usr/sbin/privoxy
209 %{_mandir}/man8/*
210 %config %{_sysconfdir}/init.d/privoxy
211 /usr/sbin/rcprivoxy
212
213 #
214 # -----------------------------------------------------------------------------
215 #
216 %changelog
217 * Wed Sep 20 2006 Hal Burgiss <hal@foobox.net>
218 - Bump version for 3.0.5.
219
220 * Fri Sep 08 2006 Hal Burgiss <hal@foobox.net>
221 - Bump version for 3.0.4.
222
223 * Wed Mar 26 2003 Andreas Oesterhelt <andreas@oesterhelt.org>
224 - Bump version for 3.0.2.
225
226 * Wed Mar 19 2003 Hal Burgiss <hal@foobox.net>
227 - Bump version for 3.0.1.
228
229 * Tue Aug 25 2002 Hal Burgiss <hal@foobox.net>
230 - Bump version for 3.0.0 :) 
231
232 * Tue Aug 06 2002 Hal Burgiss <hal@foobox.net>
233 - Reset version for 2.9.18. 
234
235 * Wed Jul 30 2002 Hal Burgiss <hal@foobox.net>
236 - Reset version for 2.9.17.
237
238 * Sat Jul 27 2002 Hal Burgiss <hal@foobox.net>
239 - Reset version and release for 2.9.16.
240
241 * Mon May 27 2002 Hal Burgiss <hal@foobox.net>
242 + privoxy-2.9.15-1
243 - Index.html is now privoxy-index.html for doc usage.
244
245 * Mon May 27 2002 Hal Burgiss <hal@foobox.net>
246 + privoxy-2.9.15-1
247 - Index.html is now privoxy-index.html for doc usage.
248
249 * Sat May 25 2002 Hal Burgiss <hal@foobox.net>
250 + privoxy-2.9.15-1
251 - Add html man page so index.html does not 404.
252
253 * Fri May 24 2002 Hal Burgiss <hal@foobox.net>
254 + privoxy-2.9.15-1
255 - Add doc/images directory.
256
257 * Fri May 03 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
258 + privoxy-suse-2.9.15-1
259 - Version bump
260
261 * Fri Apr 26 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
262 + privoxy-suse-2.9.14-3
263 - Changing Vendor to Privoxy.Org
264
265 * Mon Apr 22 2002 Rodrigo Barbosa <rodrigob@tisbrasil.com.br>
266 + privoxy-suse-2.9.14-2
267 - Bumping release to reflect the new value on configure.in
268 - Taking the oportunity to change the header Copyright to License. The
269   Copyright headers is deprecated, and after all, GPL is a license, not a
270   Copyright
271
272 * Mon Apr 08 2002 Hal Burgiss <hal@foobox.net>
273 + privoxy-2.9.13-4
274 - Add LICENSE.gz, p_web.css, and index.html. Add autoconf
275 - to Buildrequires.
276
277 * Wed Mar 27 2002 Hal Burgiss <hal@foobox.net>
278 + privoxy-2.9.13-3
279 - Doc css has changed names.
280
281 * Tue Mar 25 2002 Hal Burgiss <hal@foobox.net>
282 + privoxy-2.9.13-3
283 - Minor fix to description.
284
285 * Sun Mar 24 2002 Hal Burgiss <hal@foobox.net>
286 - added faq to docs.
287
288 * Thu Mar 21 2002 Hal Burgiss <hal@foobox.net>
289 - added ijb_docs.css to docs.
290
291 * Mon Mar 11 2002 Hal Burgiss <hal@foobox.net>
292 - Remove --enable-no-gifs from configure.
293
294 * Sun Mar 03 2002 Hal Burgiss <hal@foobox.net>
295 - /bin/false for shell causes init script to fail. Reverting.
296
297 * Wed Jan 09 2002 Hal Burgiss <hal@foobox.net>
298 - Removed UID 73. Included user-manual and developer-manual in docs.
299   Include other actions files. Default shell is now /bin/false.
300   Userdel user=junkbust. ChangeLog was not zipped. Removed
301   RPM_OPT_FLAGS kludge.
302
303 * Fri Dec 28 2001 Thomas Steudten <thomas@steudten.ch>
304 - add paranoia check for 'rm -rf $RPM_BUILD_ROOT'
305 - add gzip to 'BuildRequires'
306
307 * Sat Dec  1 2001 Hal Burgiss <hal@foobox.net>
308 - actionsfile is now ijb.action.
309
310 * Tue Nov  6 2001 Thomas Steudten <thomas@steudten.ch>
311 - Compress manpage
312 - Add more documents for installation
313 - Add version string to name and source
314
315 * Wed Oct 24 2001 Hal Burigss <hal@foobox.net>
316 - Back to user 'junkbuster' and fix configure macro.
317
318 * Wed Oct 10 2001 Hal Burigss <hal@foobox.net>
319 - More changes for user 'junkbust'. Init script had 'junkbuster'.
320
321 * Sun Sep 23 2001 Hal Burgiss <hal@foobox.net>
322 - Change of $RPM_OPT_FLAGS handling. Added new HTML doc files.
323 - Changed owner of /etc/junkbuster to shut up PAM/xauth log noise.
324
325 * Thu Sep 13 2001 Hal Burgiss <hal@foobox.net>
326 - Added $RPM_OPT_FLAGS support, renaming of old logfile, and
327 - made sure no default shell exists for user junkbust.
328
329 * Sun Jun  3 2001 Stefan Waldherr <stefan@waldherr.org>
330 - rework of RPM
331 * Wed Feb 14 2001 - uli@suse.de
332 - fixed init script
333 * Wed Dec 06 2000 - bjacke@suse.de
334 - renamed package to junkbuster
335 - fixed copyright tag
336 * Thu Nov 30 2000 - uli@suse.de
337 - moved init script to /etc/init.d
338 * Wed Feb 16 2000 - kukuk@suse.de
339 - Move /usr/man -> /usr/share/man
340 - Mark /etc/ijb as "config(noreplace)"
341 * Mon Sep 20 1999 - uli@suse.de
342 - fixed init script
343 * Mon Sep 13 1999 - bs@suse.de
344 - ran old prepare_spec on spec file to switch to new prepare_spec.
345 * Thu Apr 01 1999 - daniel@suse.de
346 - do not start ijb as root (security)
347 * Tue Mar 30 1999 - daniel@suse.de
348 - donĀ“t use saclfile.ini
349 * Tue Mar 30 1999 - daniel@suse.de
350 - small fix to whitelist-configuration,
351   version is and was 2.0.2 WITHOUT Stefan Waldherr's patches
352   (http://www.waldherr.org/junkbuster/)
353 * Mon Mar 01 1999 - daniel@suse.de
354 - new package: version 2.0
355
356 # $Log: privoxy-suse.spec,v $
357 # Revision 1.30  2008/08/13 16:57:46  fabiankeil
358 # Change version to 3.0.10.
359 #
360 # Revision 1.29  2008/03/02 17:36:43  fabiankeil
361 # Set version to 3.0.9.
362 #
363 # Revision 1.28  2008/01/20 14:30:59  fabiankeil
364 # Set version to 3.0.8.
365 #
366 # Revision 1.27  2006/11/18 14:37:12  fabiankeil
367 # Bump version to 3.0.6.
368 #
369 # Revision 1.26  2006/09/20 23:51:26  hal9
370 # Bump versions to 3.0.5
371 #
372 # Revision 1.25  2006/09/09 00:35:10  hal9
373 # Bumped versions to 3.0.4. Both files should be checked further.
374 #
375 # Revision 1.24  2006/07/18 14:48:47  david__schmidt
376 # Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
377 # with what was really the latest development (the v_3_0_branch branch)
378 #
379 # Revision 1.20.2.10  2004/01/30 17:09:29  oes
380 # Bumped version for 3.0.3
381 #
382 # Revision 1.20.2.9  2003/03/26 00:24:58  oes
383 # Bump version for 3.0.2
384 #
385 # Revision 1.20.2.8  2003/03/20 03:27:11  hal9
386 # Bump version for 3.0.1 pending release.
387 #
388 # Revision 1.20.2.7  2002/08/25 23:36:03  hal9
389 # Bump version for 3.0.0.
390 #
391 # Revision 1.20.2.6  2002/08/10 11:28:50  oes
392 # Bumped version
393 #
394 # Revision 1.20.2.5  2002/08/07 01:08:49  hal9
395 # Bumped version to 2.9.18.
396 #
397 # Revision 1.20.2.4  2002/07/30 21:51:19  hal9
398 # Bump version to 2.9.17.
399 #
400 # Revision 1.20.2.3  2002/07/27 15:47:10  hal9
401 # Reset version and release for 2.9.16.
402 #
403 # Revision 1.20.2.2  2002/05/28 02:39:38  hal9
404 # Replace index.html with privoxy-index.html for docs.
405 #
406 # Revision 1.20.2.1  2002/05/26 17:20:23  hal9
407 # Add images to doc dirs.
408 #
409 # Revision 1.20  2002/05/25 02:08:23  hal9
410 # Add doc/images directory.
411 # Redhat: alphabetized list of templates (and I think added one in the process)
412 #
413 # Revision 1.19  2002/05/03 17:14:36  morcego
414 # *.spec: Version bump to 2.9.15
415 # -rh.spec: noreplace for %%{privoxyconf}/config
416 #           Will interrupt the build if versions from configure.in and
417 #               specfile do not match
418 #
419 # Revision 1.18  2002/04/27 20:26:59  swa
420 # uid, gui 73 incorporated
421 #
422 # Revision 1.17  2002/04/26 15:51:05  morcego
423 # Changing Vendor value to Privoxy.Org
424 #
425 # Revision 1.16  2002/04/22 16:32:31  morcego
426 # configure.in, *.spec: Bumping release to 2 (2.9.14-2)
427 # -rh.spec: uid and gid are now macros
428 # -suse.spec: Changing the header Copyright to License (Copyright is
429 #             deprecable)
430 #
431 # Revision 1.15  2002/04/16 18:49:07  oes
432 # Build with static built-in pcre
433 #
434 # Revision 1.14  2002/04/11 17:57:40  oes
435 # Fixed(?) Conflicts: Provides: Obsoletes:
436 #
437 # Revision 1.13  2002/04/11 10:09:20  oes
438 # Version 2.9.14
439 #
440 # Revision 1.12  2002/04/09 13:29:43  swa
441 # build suse and gen-dist with html docs. do not generate docs while building rpm
442 #
443 # Revision 1.11  2002/04/09 03:12:37  hal9
444 # Add LICENSE, p_web.css and index.html. Add autoconf to buildrequires.
445 #
446 # Revision 1.10  2002/04/08 20:24:13  swa
447 # fixed JB spelling
448 #
449 # Revision 1.9  2002/03/30 09:01:52  swa
450 # new release
451 #
452 # Revision 1.8  2002/03/27 23:46:41  hal9
453 # ijb_docs.css to p_doc.css
454 #
455 # Revision 1.7  2002/03/27 00:49:39  hal9
456 # Minor fix to description.
457 #
458 # Revision 1.6  2002/03/26 22:29:55  swa
459 # we have a new homepage!
460 #
461 # Revision 1.5  2002/03/25 03:10:50  hal9
462 # Added faq to docs.
463 #
464 # Revision 1.4  2002/03/24 12:56:21  swa
465 # name change related issues.
466 #
467 # Revision 1.3  2002/03/24 12:44:31  swa
468 # new version string
469 #
470 # Revision 1.2  2002/03/24 11:40:14  swa
471 # name change
472 #
473 # Revision 1.1  2002/03/24 11:23:44  swa
474 # name change
475 #
476 # Revision 1.21  2002/03/21 16:04:33  hal9
477 # added ijb_docs.css to %%doc
478 #
479 # Revision 1.20  2002/03/12 13:42:14  sarantis
480 # remove hardcoded "ijbswa" from build phase
481 #
482 # Revision 1.19  2002/03/11 22:59:05  hal9
483 # Remove --enable-no-gifs
484 #
485 # Revision 1.18  2002/03/11 12:30:31  swa
486 # be consistent with rh spec file
487 #
488 # Revision 1.17  2002/03/08 19:30:23  swa
489 # remove user junkbuster after de-installation.
490 # synced suse with rh-specfile. installation
491 # and de-installation seem to work.
492 #
493 # Revision 1.16  2002/03/08 18:40:44  swa
494 # build requires tools. useradd and del works
495 # now.
496 #
497 # Revision 1.15  2002/03/07 19:23:50  swa
498 # i hate to scroll. suse: wrong configdir.
499 #
500 # Revision 1.14  2002/03/07 19:10:21  swa
501 # builds cleanly. thanks to kukuk@suse.de
502 # not yet tested.
503 #
504 # Revision 1.13  2002/03/07 18:25:56  swa
505 # synced redhat and suse build process
506 #
507 # Revision 1.12  2002/03/02 15:50:04  swa
508 # 2.9.11 version. more input for docs.
509 #
510 # Revision 1.11  2001/12/02 10:29:26  swa
511 # New version made these changes necessary.
512 #
513 # Revision 1.10  2001/10/31 19:27:27  swa
514 # consistent description. new name for suse since
515 # we had troubles with rpms of identical names
516 # on the webserver.
517 #
518 # Revision 1.9  2001/10/26 18:17:23  swa
519 # new version string
520 #
521 # Revision 1.8  2001/09/13 16:22:42  swa
522 # man page is legacy. suse rpm now contains html
523 # documentation.
524 #
525 # Revision 1.7  2001/09/10 17:44:22  swa
526 # integrate three pieces of documentation.
527 #
528 # Revision 1.6  2001/09/10 16:29:23  swa
529 # binary contained debug info.
530 # buildroot definition fucks up the build process under suse.
531 # program needs to write in varlogjunkbuster
532 # install all templates
533 # create varlogjunkbuster
534 #
535 # Revision 1.5  2001/06/09 09:13:29  swa
536 # description shorter
537 #
538 # Revision 1.4  2001/06/08 20:53:36  swa
539 # use buildroot, export init to separate file (better manageability)
540 #
541 # Revision 1.3  2001/06/07 17:28:10  swa
542 # cosmetics
543 #
544 # Revision 1.2  2001/06/07 17:18:44  swa
545 # header fixed
546 #
547 #