1 |
Summary: Lightweight, non-caching, optionally anonymizing HTTP proxy |
2 |
Name: tinyproxy |
3 |
Version: 1.8.3 |
4 |
Release: %mkrel 5 |
5 |
Group: System/Servers |
6 |
# License bundled is gpl v3, but source code say gpl v2 or later |
7 |
License: GPLv2+ |
8 |
URL: https://www.banu.com/%{name}/ |
9 |
Source0: https://www.banu.com/pub/%{name}/1.8/%{name}-%{version}.tar.bz2 |
10 |
Source1: tinyproxy.init |
11 |
Patch0: tinyproxy-1.8.3-group.patch |
12 |
Patch1: tinyproxy-CVE-2012-3505-randomized-hashmaps.patch |
13 |
Patch2: tinyproxy-CVE-2012-3505-limit-headers.patch |
14 |
BuildRequires: asciidoc |
15 |
BuildRequires: xsltproc |
16 |
BuildRequires: docbook-style-xsl |
17 |
BuildRequires: docbook-dtd45-xml |
18 |
Requires(post): systemd >= %{systemd_required_version} |
19 |
Requires(post): rpm-helper |
20 |
Requires(preun): rpm-helper |
21 |
|
22 |
%description |
23 |
An anonymizing http proxy which is very light on system resources, ideal for |
24 |
smaller networks and similar situations where other proxies (such as Squid) may |
25 |
be overkill and/or a security risk. Tinyproxy can also be configured to |
26 |
anonymize http requests (allowing for exceptions on a per-header basis). |
27 |
|
28 |
%prep |
29 |
|
30 |
%setup -q |
31 |
%patch0 -p1 -b .group |
32 |
%patch1 -p1 -b .randomized-hashmaps |
33 |
%patch2 -p1 -b .limit-headers |
34 |
|
35 |
cp %{SOURCE1} tinyproxy.init |
36 |
|
37 |
%build |
38 |
%serverbuild |
39 |
|
40 |
%configure2_5x \ |
41 |
--enable-xtinyproxy \ |
42 |
--enable-filter \ |
43 |
--enable-upstream \ |
44 |
--enable-transparent \ |
45 |
--enable-reverse \ |
46 |
--sysconfdir=%{_sysconfdir}/tinyproxy \ |
47 |
--with-stathost=localhost \ |
48 |
--program-prefix="" |
49 |
|
50 |
%make |
51 |
|
52 |
%install |
53 |
%__rm -rf %{buildroot} |
54 |
|
55 |
%__install -d %{buildroot}%{_sysconfdir}/tinyproxy |
56 |
%__install -d %{buildroot}%{_sysconfdir}/logrotate.d |
57 |
%__install -d %{buildroot}%{_sysconfdir}/sysconfig |
58 |
%__install -d %{buildroot}%{_initrddir} |
59 |
|
60 |
%__install -d %{buildroot}%{_logdir}/tinyproxy |
61 |
|
62 |
%makeinstall bindir=%{buildroot}%{_sbindir} |
63 |
|
64 |
mv %{buildroot}%{_sysconfdir}/tinyproxy.conf %{buildroot}%{_sysconfdir}/tinyproxy/tinyproxy.conf |
65 |
/bin/touch %{buildroot}%{_sysconfdir}/tinyproxy/filter |
66 |
|
67 |
%__install -m0755 tinyproxy.init %{buildroot}%{_initrddir}/tinyproxy |
68 |
|
69 |
/bin/echo "FLAGS=\" -c /etc/tinyproxy/tinyproxy.conf\"" > %{buildroot}%{_sysconfdir}/sysconfig/tinyproxy |
70 |
|
71 |
cat > %{buildroot}%{_sysconfdir}/logrotate.d/tinyproxy <<EOF |
72 |
/var/log/tinyproxy.log { |
73 |
rotate 7 |
74 |
daily |
75 |
compress |
76 |
missingok |
77 |
postrotate |
78 |
if [ -f /run/tinyproxy.pid ]; then |
79 |
/etc/init.d/tinyproxy restart > /dev/null |
80 |
fi |
81 |
endscript |
82 |
} |
83 |
EOF |
84 |
|
85 |
mkdir -p %{buildroot}%{_tmpfilesdir} |
86 |
cat <<EOF > %{buildroot}%{_tmpfilesdir}/%{name}.conf |
87 |
d /run/tinyproxy 0755 root root |
88 |
EOF |
89 |
|
90 |
%post |
91 |
%_tmpfilescreate %{name} |
92 |
%_post_service tinyproxy |
93 |
|
94 |
%preun |
95 |
%_preun_service tinyproxy |
96 |
|
97 |
|
98 |
%files |
99 |
%doc docs/*.txt |
100 |
%doc AUTHORS COPYING ChangeLog INSTALL NEWS README TODO |
101 |
%attr(0755,root,root) %{_sbindir}/tinyproxy |
102 |
%attr(0755,root,root) %{_initrddir}/tinyproxy |
103 |
%config(noreplace) %{_sysconfdir}/sysconfig/tinyproxy |
104 |
%config(noreplace) %{_sysconfdir}/logrotate.d/tinyproxy |
105 |
%dir %{_sysconfdir}/tinyproxy |
106 |
%config(noreplace) %{_sysconfdir}/tinyproxy/tinyproxy.conf |
107 |
%config(noreplace) %{_sysconfdir}/tinyproxy/filter |
108 |
%{_tmpfilesdir}/%{name}.conf |
109 |
%{_logdir}/tinyproxy/ |
110 |
%{_mandir}/man8/tinyproxy.8* |
111 |
%{_mandir}/man5/* |
112 |
%{_datadir}/tinyproxy |