Version 2.9.14
[privoxy.git] / privoxy-suse.spec
1 # $Id: privoxy-suse.spec,v 1.12 2002/04/09 13:29:43 swa Exp $
2 #
3 # Written by and Copyright (C) 2001 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 ijbconf %{_sysconfdir}/privoxy
31
32 Summary:      Privoxy - privacy enhancing proxy
33 Vendor:       http://www.privoxy.org
34 Name:         privoxy-suse
35 Distribution: defineme
36 Version: 2.9.14
37 Release: 1
38 Source: http://www.waldherr.org/%{name}/privoxy-%{version}.tar.gz
39 # not sure if this works
40 BuildRoot: %{_tmppath}/%{name}-%{version}-root
41 Packager:     Stefan Waldherr <stefan@waldherr.org>
42 Copyright:    GPL
43 Group:        Networking/Utilities
44 URL:          http://www.privoxy.org/
45 Provides:     privoxy
46 Obsoletes:    privoxy
47 Autoreqprov:  on
48 BuildRequires: perl gzip libtool autoconf
49 Conflicts: junkbuster-raw junkbuster-blank junkbuster
50
51 #
52 # -----------------------------------------------------------------------------
53 #
54 %description
55 Privoxy is a web proxy with advanced filtering capabilities for
56 protecting privacy, filtering web page content, managing cookies,
57 controlling access, and removing ads, banners, pop-ups and other
58 obnoxious Internet junk. Privoxy has a very flexible configuration and
59 can be customized to suit individual needs and tastes. Privoxy has 
60 application for both stand-alone systems and multi-user networks.
61
62 Privoxy is based on the  Internet Junkbuster.
63
64 Authors:
65 --------
66     http://www.privoxy.org/
67
68 SuSE series: n
69
70 #
71 # -----------------------------------------------------------------------------
72 #
73 %prep
74 %setup -c
75
76 #
77 # -----------------------------------------------------------------------------
78 #
79 %build
80 autoheader
81 autoconf
82 ./configure
83 make
84
85
86 ## Explicitily stripping is not recomended.
87 ## This is handled altomaticaly by RPM, and can couse troubles if
88 ## anyone wants to build an unstriped version - morcego
89 #strip privoxy
90
91 #
92 # -----------------------------------------------------------------------------
93 #
94 %install
95 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
96 mkdir -p ${RPM_BUILD_ROOT}%{_sbindir} \
97          ${RPM_BUILD_ROOT}%{_mandir}/man8 \
98          ${RPM_BUILD_ROOT}/var/log/privoxy \
99          ${RPM_BUILD_ROOT}%{ijbconf}/templates \
100          ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d \
101          ${RPM_BUILD_ROOT}%{_sysconfdir}/init.d
102 gzip README AUTHORS ChangeLog privoxy.1 LICENSE || /bin/true
103 install -s -m 744 privoxy $RPM_BUILD_ROOT%{_sbindir}/privoxy
104 cp -f privoxy.1.gz $RPM_BUILD_ROOT%{_mandir}/man8/privoxy.8.gz
105 cp -f *.action $RPM_BUILD_ROOT%{ijbconf}/
106 cp -f default.filter $RPM_BUILD_ROOT%{ijbconf}/default.filter
107 cp -f trust $RPM_BUILD_ROOT%{ijbconf}/trust
108 cp -f templates/*  $RPM_BUILD_ROOT%{ijbconf}/templates/
109 cp -f privoxy.logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/privoxy
110 install -m 755 privoxy.init.suse $RPM_BUILD_ROOT%{_sysconfdir}/init.d/privoxy
111 install -m 711 -d $RPM_BUILD_ROOT/var/log/privoxy
112 ln -sf /etc/init.d/privoxy $RPM_BUILD_ROOT/usr/sbin/rcprivoxy
113
114 # verify all file locations, etc. in the config file
115 # don't start with ^ or commented lines are not replaced
116 cat config | \
117     sed 's/^confdir.*/confdir \/etc\/privoxy/g' | \
118 #    sed 's/^permissionsfile.*/permissionsfile \/etc\/privoxy\/permissionsfile/g' | \
119 #    sed 's/^filterfile.*/default.filter \/etc\/privoxy\/default.filter/g' | \
120 #    sed 's/^logfile.*/logfile \/var\/log\/privoxy\/logfile/g' | \
121 #    sed 's/^jarfile.*/jarfile \/var\/log\/privoxy\/jarfile/g' | \
122 #    sed 's/^forward.*/forward \/etc\/privoxy\/forward/g' | \
123 #    sed 's/^aclfile.*/aclfile \/etc\/privoxy\/aclfile/g' > \
124     sed 's/^logdir.*/logdir \/var\/log\/privoxy/g' > \
125     $RPM_BUILD_ROOT%{ijbconf}/config
126
127 #
128 # -----------------------------------------------------------------------------
129 #
130 %pre
131 # We check to see if the user privoxy exists.
132 # If it does, we do nothing
133 # If we don't, we check to see if the user junkbust exist and, in case it
134 # does, we change it do privoxy. If it also does not exist, we create the
135 # privoxy user -- morcego
136 id privoxy > /dev/null 2>&1 
137 if [ $? -eq 1 ]; then
138         id junkbust > /dev/null 2>&1 
139         if [ $? -eq 0 ]; then
140                 /usr/sbin/usermod -l privoxy -d %{_sysconfdir}/privoxy -s "" junkbust  > /dev/null 2>&1
141         else
142 # -r does not work on suse.
143                 /usr/sbin/groupadd privoxy
144                 /usr/sbin/useradd -d %{_sysconfdir}/privoxy -g privoxy -s "" privoxy > /dev/null 2>&1 
145         fi
146 fi
147
148 #
149 # -----------------------------------------------------------------------------
150 #
151 %post
152 [ -f /var/log/privoxy/privoxy ] &&\
153  mv -f /var/log/privoxy/privoxy /var/log/privoxy/logfile || /bin/true
154 chown -R privoxy:privoxy /var/log/privoxy 2>/dev/null
155 chown -R privoxy:privoxy /etc/privoxy 2>/dev/null
156 # not available on suse
157 #if [ "$1" = "1" ]; then
158 #     /sbin/chkconfig --add privoxy
159 #       /sbin/service privoxy condrestart > /dev/null 2>&1
160 #fi
161 # 01/09/02 HB, getting rid of any user=junkbust
162 # Changed by morcego to use the id command.
163 id junkbust > /dev/null 2>&1 && /usr/sbin/userdel junkbust || /bin/true
164 sbin/insserv etc/init.d/privoxy
165
166 #
167 # -----------------------------------------------------------------------------
168 #
169 %preun
170 # need to stop the service on suse. swa.
171 #if [ "$1" = "0" ]; then
172 #       /sbin/service privoxy stop > /dev/null 2>&1 ||:
173 #fi
174
175 #
176 # -----------------------------------------------------------------------------
177 #
178 %postun
179 sbin/insserv etc/init.d/
180 # dont forget to remove user and group privoxy
181 id privoxy > /dev/null 2>&1 && /usr/sbin/userdel privoxy || /bin/true
182
183 #
184 # -----------------------------------------------------------------------------
185 #
186 %clean
187 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
188
189 #
190 # -----------------------------------------------------------------------------
191 #
192 %files
193 %defattr(-,root,root)
194 %doc README.gz AUTHORS.gz ChangeLog.gz LICENSE.gz
195 %doc doc/webserver/developer-manual
196 %doc doc/webserver/user-manual
197 %doc doc/webserver/faq
198 %doc doc/webserver/p_doc.css
199 %doc doc/webserver/p_web.css
200 %doc doc/webserver/index.html
201 #%doc privoxy.weekly privoxy.monthly AUTHORS
202 %dir %{ijbconf}
203 %config %{ijbconf}/*
204 %attr(0744,privoxy,privoxy) %dir /var/log/privoxy
205 %config %{_sysconfdir}/logrotate.d/privoxy
206 %attr(0755,root,root)/usr/sbin/privoxy
207 %{_mandir}/man8/*
208 %config %{_sysconfdir}/init.d/privoxy
209 /usr/sbin/rcprivoxy
210
211 #
212 # -----------------------------------------------------------------------------
213 #
214 %changelog
215 * Mon Apr 08 2002 Hal Burgiss <hal@foobox.net>
216 + privoxy-2.9.13-4
217 - Add LICENSE.gz, p_web.css, and index.html. Add autoconf
218 - to Buildrequires.
219
220 * Wed Mar 27 2002 Hal Burgiss <hal@foobox.net>
221 + privoxy-2.9.13-3
222 - Doc css has changed names.
223
224 * Tue Mar 25 2002 Hal Burgiss <hal@foobox.net>
225 + privoxy-2.9.13-3
226 - Minor fix to description.
227
228 * Sun Mar 24 2002 Hal Burgiss <hal@foobox.net>
229 - added faq to docs.
230
231 * Thu Mar 21 2002 Hal Burgiss <hal@foobox.net>
232 - added ijb_docs.css to docs.
233
234 * Mon Mar 11 2002 Hal Burgiss <hal@foobox.net>
235 - Remove --enable-no-gifs from configure.
236
237 * Sun Mar 03 2002 Hal Burgiss <hal@foobox.net>
238 - /bin/false for shell causes init script to fail. Reverting.
239
240 * Wed Jan 09 2002 Hal Burgiss <hal@foobox.net>
241 - Removed UID 73. Included user-manual and developer-manual in docs.
242   Include other actions files. Default shell is now /bin/false.
243   Userdel user=junkbust. ChangeLog was not zipped. Removed
244   RPM_OPT_FLAGS kludge.
245
246 * Fri Dec 28 2001 Thomas Steudten <thomas@steudten.ch>
247 - add paranoia check for 'rm -rf $RPM_BUILD_ROOT'
248 - add gzip to 'BuildRequires'
249
250 * Sat Dec  1 2001 Hal Burgiss <hal@foobox.net>
251 - actionsfile is now ijb.action.
252
253 * Tue Nov  6 2001 Thomas Steudten <thomas@steudten.ch>
254 - Compress manpage
255 - Add more documents for installation
256 - Add version string to name and source
257
258 * Wed Oct 24 2001 Hal Burigss <hal@foobox.net>
259 - Back to user 'junkbuster' and fix configure macro.
260
261 * Wed Oct 10 2001 Hal Burigss <hal@foobox.net>
262 - More changes for user 'junkbust'. Init script had 'junkbuster'.
263
264 * Sun Sep 23 2001 Hal Burgiss <hal@foobox.net>
265 - Change of $RPM_OPT_FLAGS handling. Added new HTML doc files.
266 - Changed owner of /etc/junkbuster to shut up PAM/xauth log noise.
267
268 * Thu Sep 13 2001 Hal Burgiss <hal@foobox.net>
269 - Added $RPM_OPT_FLAGS support, renaming of old logfile, and
270 - made sure no default shell exists for user junkbust.
271
272 * Sun Jun  3 2001 Stefan Waldherr <stefan@waldherr.org>
273 - rework of RPM
274 * Wed Feb 14 2001 - uli@suse.de
275 - fixed init script
276 * Wed Dec 06 2000 - bjacke@suse.de
277 - renamed package to junkbuster
278 - fixed copyright tag
279 * Thu Nov 30 2000 - uli@suse.de
280 - moved init script to /etc/init.d
281 * Wed Feb 16 2000 - kukuk@suse.de
282 - Move /usr/man -> /usr/share/man
283 - Mark /etc/ijb as "config(noreplace)"
284 * Mon Sep 20 1999 - uli@suse.de
285 - fixed init script
286 * Mon Sep 13 1999 - bs@suse.de
287 - ran old prepare_spec on spec file to switch to new prepare_spec.
288 * Thu Apr 01 1999 - daniel@suse.de
289 - do not start ijb as root (security)
290 * Tue Mar 30 1999 - daniel@suse.de
291 - donĀ“t use saclfile.ini
292 * Tue Mar 30 1999 - daniel@suse.de
293 - small fix to whitelist-configuration,
294   version is and was 2.0.2 WITHOUT Stefan Waldherr's patches
295   (http://www.waldherr.org/junkbuster/)
296 * Mon Mar 01 1999 - daniel@suse.de
297 - new package: version 2.0
298
299 # $Log: privoxy-suse.spec,v $
300 # Revision 1.12  2002/04/09 13:29:43  swa
301 # build suse and gen-dist with html docs. do not generate docs while building rpm
302 #
303 # Revision 1.11  2002/04/09 03:12:37  hal9
304 # Add LICENSE, p_web.css and index.html. Add autoconf to buildrequires.
305 #
306 # Revision 1.10  2002/04/08 20:24:13  swa
307 # fixed JB spelling
308 #
309 # Revision 1.9  2002/03/30 09:01:52  swa
310 # new release
311 #
312 # Revision 1.8  2002/03/27 23:46:41  hal9
313 # ijb_docs.css to p_doc.css
314 #
315 # Revision 1.7  2002/03/27 00:49:39  hal9
316 # Minor fix to description.
317 #
318 # Revision 1.6  2002/03/26 22:29:55  swa
319 # we have a new homepage!
320 #
321 # Revision 1.5  2002/03/25 03:10:50  hal9
322 # Added faq to docs.
323 #
324 # Revision 1.4  2002/03/24 12:56:21  swa
325 # name change related issues.
326 #
327 # Revision 1.3  2002/03/24 12:44:31  swa
328 # new version string
329 #
330 # Revision 1.2  2002/03/24 11:40:14  swa
331 # name change
332 #
333 # Revision 1.1  2002/03/24 11:23:44  swa
334 # name change
335 #
336 # Revision 1.21  2002/03/21 16:04:33  hal9
337 # added ijb_docs.css to %%doc
338 #
339 # Revision 1.20  2002/03/12 13:42:14  sarantis
340 # remove hardcoded "ijbswa" from build phase
341 #
342 # Revision 1.19  2002/03/11 22:59:05  hal9
343 # Remove --enable-no-gifs
344 #
345 # Revision 1.18  2002/03/11 12:30:31  swa
346 # be consistent with rh spec file
347 #
348 # Revision 1.17  2002/03/08 19:30:23  swa
349 # remove user junkbuster after de-installation.
350 # synced suse with rh-specfile. installation
351 # and de-installation seem to work.
352 #
353 # Revision 1.16  2002/03/08 18:40:44  swa
354 # build requires tools. useradd and del works
355 # now.
356 #
357 # Revision 1.15  2002/03/07 19:23:50  swa
358 # i hate to scroll. suse: wrong configdir.
359 #
360 # Revision 1.14  2002/03/07 19:10:21  swa
361 # builds cleanly. thanks to kukuk@suse.de
362 # not yet tested.
363 #
364 # Revision 1.13  2002/03/07 18:25:56  swa
365 # synced redhat and suse build process
366 #
367 # Revision 1.12  2002/03/02 15:50:04  swa
368 # 2.9.11 version. more input for docs.
369 #
370 # Revision 1.11  2001/12/02 10:29:26  swa
371 # New version made these changes necessary.
372 #
373 # Revision 1.10  2001/10/31 19:27:27  swa
374 # consistent description. new name for suse since
375 # we had troubles with rpms of identical names
376 # on the webserver.
377 #
378 # Revision 1.9  2001/10/26 18:17:23  swa
379 # new version string
380 #
381 # Revision 1.8  2001/09/13 16:22:42  swa
382 # man page is legacy. suse rpm now contains html
383 # documentation.
384 #
385 # Revision 1.7  2001/09/10 17:44:22  swa
386 # integrate three pieces of documentation.
387 #
388 # Revision 1.6  2001/09/10 16:29:23  swa
389 # binary contained debug info.
390 # buildroot definition fucks up the build process under suse.
391 # program needs to write in varlogjunkbuster
392 # install all templates
393 # create varlogjunkbuster
394 #
395 # Revision 1.5  2001/06/09 09:13:29  swa
396 # description shorter
397 #
398 # Revision 1.4  2001/06/08 20:53:36  swa
399 # use buildroot, export init to separate file (better manageability)
400 #
401 # Revision 1.3  2001/06/07 17:28:10  swa
402 # cosmetics
403 #
404 # Revision 1.2  2001/06/07 17:18:44  swa
405 # header fixed
406 #
407 #