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