2 %define veryoldname junkbust
3 %define oldname junkbuster
4 %define privoxyconf %{_sysconfdir}/%{name}
5 # TODO: resolve conflict
9 Summary: Privoxy - privacy enhancing proxy
10 Summary(pl): Privoxy - proxy rozszerzaj±ce prywatno¶æ
15 Source0: http://www.waldherr.org/%{name}/%{name}-%{version}.tar.gz
16 # Source0-md5: 152e21d4fb57b79da33559ba6dd1dd74
17 Group: Networking/Daemons
18 URL: http://www.privoxy.org/
19 BuildRequires: autoconf
20 BuildRequires: libtool
24 Requires(pre): /usr/bin/getgid
25 Requires(pre): /bin/id
26 Requires(pre): /usr/sbin/groupadd
27 Requires(pre): /usr/sbin/useradd
28 Requires(post): fileutils
29 Requires(post,preun): /sbin/chkconfig
30 Requires(postun): /usr/sbin/userdel
31 Requires(postun): /usr/sbin/groupdel
33 Obsoletes: junkbuster-blank
34 Obsoletes: junkbuster-raw
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 Privoxy is a web proxy with advanced filtering capabilities for
39 protecting privacy, filtering web page content, managing cookies,
40 controlling access, and removing ads, banners, pop-ups and other
41 obnoxious Internet junk. Privoxy has a very flexible configuration and
42 can be customized to suit individual needs and tastes. Privoxy has
43 application for both stand-alone systems and multi-user networks.
45 Privoxy is based on the Internet Junkbuster.
48 Privoxy to proxy WWW z rozszerzonymi mo¿liwo¶ciami filtrowania
49 s³u¿±cymi do zabezpieczenia prywatno¶ci, filtrowania zawarto¶ci stron
50 WWW, zarz±dzania ciasteczkami, kontroli dostêpu, usuwania bannerów,
51 wyskakuj±cych okienek i innych wstrêtrnych internetowych ¶mieci.
52 Privoxy ma bardzo elastyczn± konfiguracjê i mo¿e byæ dopasowywane do
53 indywidualnych potrzeb i gustów. Privoxy ma aplikacjê dla systemów
54 samodzielnych i serwerów sieciowych dla wielu u¿ytkowników.
56 Privoxy jest oparte na Internet Junkbusterze.
64 %configure --disable-dynamic-pcre
69 rm -rf $RPM_BUILD_ROOT
71 install -d $RPM_BUILD_ROOT%{_sbindir} \
72 $RPM_BUILD_ROOT%{_mandir}/man1 \
73 $RPM_BUILD_ROOT/var/log/%{name} \
74 $RPM_BUILD_ROOT%{privoxyconf}/templates \
75 $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d}
77 install -m 744 %{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
79 # Using sed to "convert" from DOS format to UNIX
80 # This is important behaviour, and should not be removed without some
81 # other assurance that these files don't get packed in the the
83 for i in `ls *.action`
85 cat $i | sed -e 's/[[:cntrl:]]*$//' > $RPM_BUILD_ROOT%{privoxyconf}/$i
87 cat default.filter | sed -e 's/[[:cntrl:]]*$//' > $RPM_BUILD_ROOT%{privoxyconf}/default.filter
88 cat trust | sed -e 's/[[:cntrl:]]*$//' > $RPM_BUILD_ROOT%{privoxyconf}/trust
93 cat $i | sed -e 's/[[:cntrl:]]*$//' > $RPM_BUILD_ROOT%{privoxyconf}/templates/$i
97 cp -f %{name}.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
98 cp -f %{name}.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
99 install -m 755 %{name}.init $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
100 install -m 711 -d $RPM_BUILD_ROOT/var/log/%{name}
102 # verify all file locations, etc. in the config file
103 # don't start with ^ or commented lines are not replaced
104 ## Changing the sed paramter delimiter to @, so we don't have to
105 ## escape the slashes
107 sed 's@^confdir.*@confdir %{privoxyconf}@g' | \
108 # sed 's/^permissionsfile.*/permissionsfile \/etc\/%{name}\/permissionsfile/g' | \
109 # sed 's/^filterfile.*/default.filter \/etc\/%{name}\/default.filter/g' | \
110 # sed 's/^logfile.*/logfile \/var\/log\/%{name}\/logfile/g' | \
111 # sed 's/^jarfile.*/jarfile \/var\/log\/%{name}\/jarfile/g' | \
112 # sed 's/^forward.*/forward \/etc\/%{name}\/forward/g' | \
113 # sed 's/^aclfile.*/aclfile \/etc\/%{name}\/aclfile/g' > \
114 sed 's@^logdir.*@logdir %{_localstatedir}/log/%{name}@g' | \
115 sed -e 's/[[:cntrl:]]*$//' > \
116 $RPM_BUILD_ROOT%{privoxyconf}/config
117 perl -pe 's/{-no-cookies}/{-no-cookies}\n\.redhat.com/' default.action >\
118 $RPM_BUILD_ROOT%{privoxyconf}/default.action
121 ## Macros are expanded even on commentaries. So, we have to use %%
126 rm -rf $RPM_BUILD_ROOT
129 if [ -n "`getgid %{name}`" ]; then
130 if [ "`getgid %{name}`" != "%{privoxy_gid}" ]; then
131 echo "Error: group %{name} doesn't have gid=%{privoxy_gid}. Correct this before installing %{name}." 1>&2
135 /usr/sbin/groupadd -g %{privoxy_gid} -r -f %{name}
137 if [ -n "`id -u %{name} 2>/dev/null`" ]; then
138 if [ "`id -u %{name}`" != "%{privoxy_uid}" ]; then
139 echo "Error: user %{name} doesn't have uid=%{privoxy_uid}. Correct this before installing %{name}." 1>&2
143 /usr/sbin/useradd -u %{privoxy_uid} -r -d %{privoxyconf} -s /bin/false -c "%{name} user" -g %{name} %{name} 1>&2
147 # for upgrade from 2.0.x
148 [ -f /var/log/%{oldname}/logfile ] && {
149 mv -f /var/log/%{oldname}/logfile /var/log/%{name}/logfile ||: ;
150 chown -R %{name}:%{name} /var/log/%{name} 2>/dev/null ||: ;
152 [ -f /var/log/%{name}/%{name} ] && {
153 mv -f /var/log/%{name}/%{name} /var/log/%{name}/logfile ||: ;
154 chown -R %{name}:%{name} %{privoxyconf} 2>/dev/null ||: ;
156 /sbin/chkconfig --add privoxy
157 if [ -f /var/lock/subsys/%{name} ]; then
158 /etc/rc.d/init.d/%{name} restart
160 #if [ "$1" = "1" ]; then
161 # /sbin/service %{name} condrestart > /dev/null 2>&1 ||:
165 if [ "$1" = "0" ]; then
166 if [ -f /var/lock/subsys/%{name} ]; then
167 /etc/rc.d/init.d/%{name} stop 1>&2
169 # /sbin/service %{name} stop > /dev/null 2>&1 ||:
170 /sbin/chkconfig --del privoxy
174 if [ "$1" = "0" ]; then
175 /usr/sbin/userdel %{name} || :
176 /usr/sbin/groupdel %{name} || :
180 %defattr(644,root,root,755)
181 %doc README AUTHORS ChangeLog LICENSE
182 %doc doc/text/developer-manual.txt doc/text/user-manual.txt doc/text/faq.txt
183 %doc doc/webserver/developer-manual
184 %doc doc/webserver/user-manual
185 %doc doc/webserver/faq
186 %doc doc/webserver/p_doc.css doc/webserver/p_web.css doc/webserver/privoxy-index.html
187 %doc doc/webserver/images
188 %doc doc/webserver/man-page
190 %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/%{name}
191 %attr(754,root,root) /etc/rc.d/init.d/%{name}
192 %attr(755,root,root) %{_sbindir}/%{name}
193 %{_mandir}/man1/%{name}.*
195 # ATTENTION FOR defattr change here !
196 %defattr(644,%{name},%{name},755)
199 %dir %{privoxyconf}/templates
200 %dir /var/log/%{name}
202 # WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! WARNING !
203 # We should not use wildchars here. This could mask missing files problems
205 # WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! WARNING !
206 %config(noreplace) %verify(not size mtime md5) %{privoxyconf}/config
207 %config %{privoxyconf}/standard.action
208 %config(noreplace) %verify(not size mtime md5) %{privoxyconf}/user.action
209 %config %{privoxyconf}/default.action
210 %config %{privoxyconf}/default.filter
211 %config %{privoxyconf}/trust
213 # Please keep these alphabetized so its easier to find one that
215 %config %{privoxyconf}/templates/blocked
216 %config %{privoxyconf}/templates/cgi-error-404
217 %config %{privoxyconf}/templates/cgi-error-bad-param
218 %config %{privoxyconf}/templates/cgi-error-disabled
219 %config %{privoxyconf}/templates/cgi-error-file
220 %config %{privoxyconf}/templates/cgi-error-file-read-only
221 %config %{privoxyconf}/templates/cgi-error-modified
222 %config %{privoxyconf}/templates/cgi-error-parse
223 %config %{privoxyconf}/templates/cgi-style.css
224 %config %{privoxyconf}/templates/connect-failed
225 %config %{privoxyconf}/templates/default
226 %config %{privoxyconf}/templates/edit-actions-add-url-form
227 %config %{privoxyconf}/templates/edit-actions-for-url
228 %config %{privoxyconf}/templates/edit-actions-for-url-filter
229 %config %{privoxyconf}/templates/edit-actions-list
230 %config %{privoxyconf}/templates/edit-actions-list-button
231 %config %{privoxyconf}/templates/edit-actions-list-section
232 %config %{privoxyconf}/templates/edit-actions-list-url
233 %config %{privoxyconf}/templates/edit-actions-remove-url-form
234 %config %{privoxyconf}/templates/edit-actions-url-form
235 %config %{privoxyconf}/templates/mod-local-help
236 %config %{privoxyconf}/templates/mod-support-and-service
237 %config %{privoxyconf}/templates/mod-title
238 %config %{privoxyconf}/templates/mod-unstable-warning
239 %config %{privoxyconf}/templates/no-such-domain
240 %config %{privoxyconf}/templates/show-request
241 %config %{privoxyconf}/templates/show-status
242 %config %{privoxyconf}/templates/show-status-file
243 %config %{privoxyconf}/templates/show-url-info
244 %config %{privoxyconf}/templates/show-version
245 %config %{privoxyconf}/templates/toggle
246 %config %{privoxyconf}/templates/toggle-mini
247 %config %{privoxyconf}/templates/untrusted