]> git.pld-linux.org Git - packages/privoxy.git/blob - privoxy.spec
- changed dl.sf.net to dl.sourceforge.net (SourceN:'s)
[packages/privoxy.git] / privoxy.spec
1
2 %define veryoldname junkbust
3 %define oldname junkbuster
4 %define privoxyconf %{_sysconfdir}/%{name}
5 # TODO: resolve conflict
6 %define privoxy_uid 73
7 %define privoxy_gid 73
8
9 Summary:        Privoxy - privacy enhancing proxy
10 Summary(pl):    Privoxy - proxy rozszerzaj±ce prywatno¶æ
11 Name:           privoxy
12 Version:        3.0.0
13 Release:        1
14 License:        GPL
15 Source0:        http://dl.sourceforge.net/ijbswa/%{name}-%{version}.tar.gz
16 # Source0-md5:  152e21d4fb57b79da33559ba6dd1dd74
17 Group:          Networking/Daemons
18 URL:            http://www.privoxy.org/
19 BuildRequires:  autoconf
20 BuildRequires:  libtool
21 BuildRequires:  lynx
22 BuildRequires:  perl
23 PreReq:         rc-scripts
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
32 Obsoletes:      junkbuster
33 Obsoletes:      junkbuster-blank
34 Obsoletes:      junkbuster-raw
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %description
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.
44
45 Privoxy is based on the Internet Junkbuster.
46
47 %description -l pl
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.
55
56 Privoxy jest oparte na Internet Junkbusterze.
57
58 %prep
59 %setup -q -c
60
61 %build
62 %{__autoheader}
63 %{__autoconf}
64 %configure \
65         --disable-dynamic-pcre
66
67 %{__make}
68
69 %install
70 rm -rf $RPM_BUILD_ROOT
71
72 install -d $RPM_BUILD_ROOT%{_sbindir} \
73          $RPM_BUILD_ROOT%{_mandir}/man1 \
74          $RPM_BUILD_ROOT/var/log/%{name} \
75          $RPM_BUILD_ROOT%{privoxyconf}/templates \
76          $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d}
77
78 install -m 744 %{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
79
80 # Using sed to "convert" from DOS format to UNIX
81 # This is important behaviour, and should not be removed without some
82 # other assurance that these files don't get packed in the the
83 # wrong format
84 for i in `ls *.action`
85 do
86        cat $i | sed -e 's/[[:cntrl:]]*$//' > $RPM_BUILD_ROOT%{privoxyconf}/$i
87 done
88 cat default.filter | sed -e 's/[[:cntrl:]]*$//' > $RPM_BUILD_ROOT%{privoxyconf}/default.filter
89 cat trust | sed -e 's/[[:cntrl:]]*$//' > $RPM_BUILD_ROOT%{privoxyconf}/trust
90 (
91 cd templates
92 for i in `ls`
93 do
94         cat $i | sed -e 's/[[:cntrl:]]*$//' > $RPM_BUILD_ROOT%{privoxyconf}/templates/$i
95 done
96 )
97
98 cp -f %{name}.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
99 cp -f %{name}.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
100 install -m 755 %{name}.init $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
101 install -m 711 -d $RPM_BUILD_ROOT/var/log/%{name}
102
103 # verify all file locations, etc. in the config file
104 # don't start with ^ or commented lines are not replaced
105 ## Changing the sed paramter delimiter to @, so we don't have to
106 ## escape the slashes
107 cat config | \
108     sed 's@^confdir.*@confdir %{privoxyconf}@g' | \
109 #    sed 's/^permissionsfile.*/permissionsfile \/etc\/%{name}\/permissionsfile/g' | \
110 #    sed 's/^filterfile.*/default.filter \/etc\/%{name}\/default.filter/g' | \
111 #    sed 's/^logfile.*/logfile \/var\/log\/%{name}\/logfile/g' | \
112 #    sed 's/^jarfile.*/jarfile \/var\/log\/%{name}\/jarfile/g' | \
113 #    sed 's/^forward.*/forward \/etc\/%{name}\/forward/g' | \
114 #    sed 's/^aclfile.*/aclfile \/etc\/%{name}\/aclfile/g' > \
115     sed 's@^logdir.*@logdir %{_localstatedir}/log/%{name}@g' | \
116     sed -e 's/[[:cntrl:]]*$//' > \
117     $RPM_BUILD_ROOT%{privoxyconf}/config
118 perl -pe 's/{-no-cookies}/{-no-cookies}\n\.redhat.com/' default.action >\
119     $RPM_BUILD_ROOT%{privoxyconf}/default.action
120
121
122 ## Macros are expanded even on commentaries. So, we have to use %%
123 ## -- morcego
124 #%%makeinstall
125
126 %clean
127 rm -rf $RPM_BUILD_ROOT
128
129 %pre
130 if [ -n "`getgid %{name}`" ]; then
131         if [ "`getgid %{name}`" != "%{privoxy_gid}" ]; then
132                 echo "Error: group %{name} doesn't have gid=%{privoxy_gid}. Correct this before installing %{name}." 1>&2
133                 exit 1
134         fi
135 else
136         /usr/sbin/groupadd -g %{privoxy_gid} -r -f %{name}
137 fi
138 if [ -n "`id -u %{name} 2>/dev/null`" ]; then
139         if [ "`id -u %{name}`" != "%{privoxy_uid}" ]; then
140                 echo "Error: user %{name} doesn't have uid=%{privoxy_uid}. Correct this before installing %{name}." 1>&2
141                 exit 1
142         fi
143 else
144         /usr/sbin/useradd -u %{privoxy_uid} -r -d %{privoxyconf} -s /bin/false -c "%{name} user" -g %{name} %{name} 1>&2
145 fi
146
147 %post
148 # for upgrade from 2.0.x
149 [ -f /var/log/%{oldname}/logfile ] && {
150         mv -f /var/log/%{oldname}/logfile /var/log/%{name}/logfile ||: ;
151         chown -R %{name}:%{name} /var/log/%{name} 2>/dev/null ||: ;
152 }
153 [ -f /var/log/%{name}/%{name} ] && {
154         mv -f /var/log/%{name}/%{name} /var/log/%{name}/logfile ||: ;
155         chown -R %{name}:%{name} %{privoxyconf} 2>/dev/null ||: ;
156 }
157 /sbin/chkconfig --add privoxy
158 if [ -f /var/lock/subsys/%{name} ]; then
159         /etc/rc.d/init.d/%{name} restart
160 fi
161 #if [ "$1" = "1" ]; then
162 #       /sbin/service %{name} condrestart > /dev/null 2>&1 ||:
163 #fi
164
165 %preun
166 if [ "$1" = "0" ]; then
167         if [ -f /var/lock/subsys/%{name} ]; then
168                 /etc/rc.d/init.d/%{name} stop 1>&2
169         fi
170 #       /sbin/service %{name} stop > /dev/null 2>&1 ||:
171         /sbin/chkconfig --del privoxy
172 fi
173
174 %postun
175 if [ "$1" = "0" ]; then
176         /usr/sbin/userdel %{name} || :
177         /usr/sbin/groupdel %{name} || :
178 fi
179
180 %files
181 %defattr(644,root,root,755)
182 %doc AUTHORS ChangeLog README
183 %doc doc/text/developer-manual.txt doc/text/user-manual.txt doc/text/faq.txt
184 %doc doc/webserver/developer-manual
185 %doc doc/webserver/user-manual
186 %doc doc/webserver/faq
187 %doc doc/webserver/p_doc.css doc/webserver/p_web.css doc/webserver/privoxy-index.html
188 %doc doc/webserver/images
189 %doc doc/webserver/man-page
190
191 %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/%{name}
192 %attr(754,root,root) /etc/rc.d/init.d/%{name}
193 %attr(755,root,root) %{_sbindir}/%{name}
194 %{_mandir}/man1/%{name}.*
195
196 # ATTENTION FOR defattr change here !
197 %defattr(644,%{name},%{name},755)
198
199 %dir %{privoxyconf}
200 %dir %{privoxyconf}/templates
201 %dir /var/log/%{name}
202
203 # WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! WARNING !
204 # We should not use wildchars here. This could mask missing files problems
205 # -- morcego
206 # WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! WARNING !
207 %config(noreplace) %verify(not size mtime md5) %{privoxyconf}/config
208 %config %{privoxyconf}/standard.action
209 %config(noreplace) %verify(not size mtime md5) %{privoxyconf}/user.action
210 %config %{privoxyconf}/default.action
211 %config %{privoxyconf}/default.filter
212 %config %{privoxyconf}/trust
213
214 # Please keep these alphabetized so its easier to find one that
215 # is not included.
216 %config %{privoxyconf}/templates/blocked
217 %config %{privoxyconf}/templates/cgi-error-404
218 %config %{privoxyconf}/templates/cgi-error-bad-param
219 %config %{privoxyconf}/templates/cgi-error-disabled
220 %config %{privoxyconf}/templates/cgi-error-file
221 %config %{privoxyconf}/templates/cgi-error-file-read-only
222 %config %{privoxyconf}/templates/cgi-error-modified
223 %config %{privoxyconf}/templates/cgi-error-parse
224 %config %{privoxyconf}/templates/cgi-style.css
225 %config %{privoxyconf}/templates/connect-failed
226 %config %{privoxyconf}/templates/default
227 %config %{privoxyconf}/templates/edit-actions-add-url-form
228 %config %{privoxyconf}/templates/edit-actions-for-url
229 %config %{privoxyconf}/templates/edit-actions-for-url-filter
230 %config %{privoxyconf}/templates/edit-actions-list
231 %config %{privoxyconf}/templates/edit-actions-list-button
232 %config %{privoxyconf}/templates/edit-actions-list-section
233 %config %{privoxyconf}/templates/edit-actions-list-url
234 %config %{privoxyconf}/templates/edit-actions-remove-url-form
235 %config %{privoxyconf}/templates/edit-actions-url-form
236 %config %{privoxyconf}/templates/mod-local-help
237 %config %{privoxyconf}/templates/mod-support-and-service
238 %config %{privoxyconf}/templates/mod-title
239 %config %{privoxyconf}/templates/mod-unstable-warning
240 %config %{privoxyconf}/templates/no-such-domain
241 %config %{privoxyconf}/templates/show-request
242 %config %{privoxyconf}/templates/show-status
243 %config %{privoxyconf}/templates/show-status-file
244 %config %{privoxyconf}/templates/show-url-info
245 %config %{privoxyconf}/templates/show-version
246 %config %{privoxyconf}/templates/toggle
247 %config %{privoxyconf}/templates/toggle-mini
248 %config %{privoxyconf}/templates/untrusted
This page took 0.101595 seconds and 4 git commands to generate.