]>
Commit | Line | Data |
---|---|---|
4f9ad698 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
43d026e1 | 4 | %bcond_without supervise # install initscript instead of supervise |
4f9ad698 | 5 | # |
7de691a5 | 6 | %include /usr/lib/rpm/macros.perl |
4f9ad698 | 7 | %define pnam OPM |
247723c2 | 8 | Summary: Open proxy monitor and blocker, designed for use with ircds |
0d7fc05d | 9 | Summary(pl.UTF-8): Monitorowanie i blokowanie otwartych proxy do używania z ircd |
247723c2 ER |
10 | Name: bopm |
11 | Version: 3.1.2 | |
3d54ec9d | 12 | Release: 0.28 |
247723c2 ER |
13 | License: GPL |
14 | Group: Applications/Communications | |
15 | Source0: http://static.blitzed.org/www.blitzed.org/bopm/files/%{name}-%{version}.tar.gz | |
16 | # Source0-md5: ab1b7494c4242eef957b5fca61c92b18 | |
17 | Source1: %{name}.init | |
18 | Source2: %{name}.conf | |
43d026e1 ER |
19 | Source3: %{name}-supervise.tar.bz2 |
20 | # Source3-md5: 247c0438a5e2860097d09a374a521151 | |
247723c2 | 21 | Patch0: %{name}-DESTDIR.patch |
dd92f00a | 22 | Patch1: %{name}-shared.patch |
230387e5 | 23 | Patch2: %{name}-cr-connect.patch |
fd285861 ER |
24 | Patch3: http://www.nedworks.org/bopm/%{name}.whitelists.3.1.2.diff |
25 | Patch4: %{name}-gcc4.patch | |
cea03816 | 26 | Patch5: http://dgl.cx/2006/09/bopm-conf-cmd.diff |
247723c2 | 27 | URL: http://www.blitzed.org/bopm/ |
247723c2 | 28 | BuildRequires: autoconf |
bf066d47 | 29 | BuildRequires: automake |
bf066d47 | 30 | BuildRequires: libtool |
7de691a5 | 31 | BuildRequires: rpm-perlprov >= 4.1-13 |
5acd3d23 | 32 | BuildRequires: rpmbuild(macros) >= 1.268 |
3d54ec9d | 33 | %{!?with_supervise:Requires(post,preun): /sbin/chkconfig} |
5acd3d23 ER |
34 | Requires(postun): /usr/sbin/groupdel |
35 | Requires(postun): /usr/sbin/userdel | |
286f9739 | 36 | Requires(pre): /bin/id |
2d088e6b | 37 | Requires(pre): /usr/bin/getgid |
286f9739 JB |
38 | Requires(pre): /usr/sbin/groupadd |
39 | Requires(pre): /usr/sbin/useradd | |
7de691a5 | 40 | Requires: %{name}-libs = %{version}-%{release} |
43d026e1 ER |
41 | %{!?with_supervise:Requires: rc-scripts >= 0.4.0.17} |
42 | %{?with_supervise:Requires: daemontools >= 0.76-5} | |
26254c94 | 43 | Provides: group(%{name}) |
44 | Provides: user(%{name}) | |
247723c2 ER |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
46 | ||
43d026e1 ER |
47 | %define _supervise /etc/supervise/%{name} |
48 | ||
247723c2 ER |
49 | %description |
50 | The Blitzed Open Proxy Monitor is designed to connect to an IRC server | |
51 | and become an IRC operator. It then watches connect notices in order | |
52 | to scan all connecting clients for open (insecure) proxies. Such | |
53 | insecure proxies are commonly used for spamming, floods and other | |
54 | abusive activities. | |
55 | ||
56 | BOPM can detect WinGates, HTTP proxies, SOCKS 4/5 proxies and Cisco | |
57 | routers with default passwords. BOPM also has support for checking | |
58 | against a DNS-Based Blacklist (similar to MAPS RBL) and can be | |
59 | configured to report new proxies back to the Blitzed Open Proxy | |
60 | Monitoring project. | |
61 | ||
71f5af04 JR |
62 | %description -l pl.UTF-8 |
63 | Blitzed Open Proxy Monitor jest zaprojektowany tak, że łączy się z | |
64 | serwerem IRC i staje operatorem. Następnie ogląda informacje o | |
65 | połączeniach w celu skanowania wszystkich klientów pod kątem otwartych | |
66 | (niebezpiecznych) proxy. Takie niebezpieczne proxy zwykle są używane | |
67 | do spamowania, floodowania i innych nadużyć. | |
68 | ||
69 | BOPM jest w stanie wykryć WinGates, proxy HTTP, proxy SOCKS 4/5 oraz | |
70 | routery Cisco z domyślnymi hasłami. BOPM obsługuje także sprawdzanie | |
71 | czarnych list opartych na DNS (takich jak MAPS RBL) i może być | |
72 | skonfigurowany do zgłaszania nowych proxy z powrotem do projektu | |
5acd3d23 | 73 | Blitzed Open Proxy Monitoring. |
286f9739 | 74 | |
dd92f00a ER |
75 | %package libs |
76 | Summary: libopm open proxy scanning library | |
0d7fc05d | 77 | Summary(pl.UTF-8): Biblioteka libopm do szukania otwartych proxy |
dd92f00a ER |
78 | Group: Libraries |
79 | ||
80 | %description libs | |
81 | libopm open proxy scanning library. | |
82 | ||
71f5af04 | 83 | %description libs -l pl.UTF-8 |
c5d2454c JB |
84 | Biblioteka libopm do szukania otwartych proxy. |
85 | ||
7de691a5 ER |
86 | %package devel |
87 | Summary: Header files for libopm library | |
0d7fc05d | 88 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libopm |
7de691a5 ER |
89 | Group: Development/Libraries |
90 | Requires: %{name}-libs = %{version}-%{release} | |
91 | ||
92 | %description devel | |
93 | This is the package containing the header files for libopm library. | |
94 | ||
71f5af04 JR |
95 | %description devel -l pl.UTF-8 |
96 | Ten pakiet zawiera pliki nagłówkowe biblioteki libopm. | |
c5d2454c | 97 | |
7de691a5 | 98 | %package static |
c5d2454c | 99 | Summary: Static libopm library |
0d7fc05d | 100 | Summary(pl.UTF-8): Statyczna biblioteka libopm |
7de691a5 ER |
101 | Group: Development/Libraries |
102 | Requires: %{name}-devel = %{version}-%{release} | |
103 | ||
104 | %description static | |
105 | Static libopm library. | |
106 | ||
71f5af04 | 107 | %description static -l pl.UTF-8 |
c5d2454c JB |
108 | Statyczna biblioteka libopm. |
109 | ||
4f9ad698 | 110 | %package -n perl-%{pnam} |
7de691a5 | 111 | Summary: OPM - Perl interface to libopm open proxy scanning library |
0d7fc05d | 112 | Summary(pl.UTF-8): OPM - perlowy interfejs do biblioteki libopm szukającej otwartych proxy |
7de691a5 ER |
113 | Group: Development/Languages/Perl |
114 | Requires: %{name}-libs = %{version}-%{release} | |
115 | # should here be Version: 0.01 due to "Provides: OPM.so perl(OPM) = 0.01"? | |
116 | ||
4f9ad698 | 117 | %description -n perl-%{pnam} |
7de691a5 ER |
118 | OPM - Perl interface to libopm open proxy scanning library. |
119 | ||
71f5af04 JR |
120 | %description -n perl-%{pnam} -l pl.UTF-8 |
121 | OPM - perlowy interfejs do biblioteki libopm szukającej otwartych | |
c5d2454c JB |
122 | proxy. |
123 | ||
247723c2 ER |
124 | %prep |
125 | %setup -q | |
126 | %patch0 -p1 | |
dd92f00a | 127 | %patch1 -p1 |
230387e5 | 128 | %patch2 -p0 |
24377f10 | 129 | %patch3 -p0 |
fd285861 | 130 | %patch4 -p1 |
cea03816 ER |
131 | cd src |
132 | %patch5 -p0 | |
247723c2 | 133 | |
dd92f00a | 134 | # we include contrib in %doc. cleanup it |
247723c2 ER |
135 | find -name CVS | xargs -r rm -rf |
136 | rm -f contrib/bopm.spec | |
137 | ||
138 | %build | |
139 | %{__libtoolize} | |
140 | %{__aclocal} | |
141 | %{__autoconf} | |
142 | %{__autoheader} | |
143 | %{__automake} | |
144 | %configure \ | |
145 | --localstatedir=/var/log/%{name} \ | |
146 | --bindir=%{_sbindir} | |
147 | ||
148 | %{__make} | |
149 | ||
7de691a5 ER |
150 | cd src/libopm/OPM |
151 | %{__perl} Makefile.PL \ | |
152 | INSTALLDIRS=vendor | |
153 | %{__make} \ | |
154 | OPTIMIZE="%{rpmcflags}" | |
4f9ad698 | 155 | %{?with_tests:%{__make} test} |
7de691a5 | 156 | |
247723c2 ER |
157 | %install |
158 | rm -rf $RPM_BUILD_ROOT | |
43d026e1 | 159 | install -d $RPM_BUILD_ROOT/var/log/%{name} |
286f9739 | 160 | |
247723c2 ER |
161 | %{__make} install \ |
162 | DESTDIR=$RPM_BUILD_ROOT | |
163 | ||
43d026e1 ER |
164 | %if %{with supervise} |
165 | install -d $RPM_BUILD_ROOT%{_supervise} | |
166 | tar xf %{SOURCE3} -C $RPM_BUILD_ROOT%{_supervise} | |
167 | ||
168 | install -d $RPM_BUILD_ROOT%{_supervise}/{,log/}supervise | |
169 | touch $RPM_BUILD_ROOT%{_supervise}/{,log/}supervise/lock | |
170 | touch $RPM_BUILD_ROOT%{_supervise}/{,log/}supervise/status | |
171 | mkfifo $RPM_BUILD_ROOT%{_supervise}/{,log/}supervise/control | |
172 | mkfifo $RPM_BUILD_ROOT%{_supervise}/{,log/}supervise/ok | |
173 | ||
174 | %else | |
175 | install -D %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} | |
176 | install -d $RPM_BUILD_ROOT/var/run/%{name} | |
177 | %endif | |
178 | ||
247723c2 ER |
179 | install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf |
180 | > $RPM_BUILD_ROOT/var/log/%{name}/bopm.log | |
181 | > $RPM_BUILD_ROOT/var/log/%{name}/scan.log | |
182 | ||
43d026e1 | 183 | # Perl module |
7de691a5 ER |
184 | cd src/libopm/OPM |
185 | %{__make} pure_install \ | |
186 | DESTDIR=$RPM_BUILD_ROOT | |
4f9ad698 ER |
187 | rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{pnam}/.packlist |
188 | install -d $RPM_BUILD_ROOT%{_examplesdir}/perl-%{pnam}-%{version} | |
189 | mv $RPM_BUILD_ROOT{%{perl_vendorarch},%{_examplesdir}/perl-%{pnam}-%{version}}/bopchecker.pl | |
7de691a5 | 190 | |
247723c2 ER |
191 | %clean |
192 | rm -rf $RPM_BUILD_ROOT | |
193 | ||
194 | %pre | |
195 | %groupadd -g 151 %{name} | |
196 | %useradd -u 151 -c "BOPM Daemon" -g %{name} %{name} | |
197 | ||
198 | %post | |
43d026e1 | 199 | %if %{with supervise} |
43d026e1 ER |
200 | if [ -d /service/%{name}/supervise ]; then |
201 | svc -t /service/%{name} /service/%{name}/log | |
202 | fi | |
3d54ec9d ER |
203 | if [ "$1" = 1 ]; then |
204 | ln -snf %{_supervise} /service/%{name} | |
205 | fi | |
206 | %else | |
207 | /sbin/chkconfig --add %{name} | |
208 | %service %{name} restart "BOPM daemon" | |
43d026e1 | 209 | %endif |
247723c2 ER |
210 | |
211 | %preun | |
212 | if [ "$1" = "0" ]; then | |
43d026e1 ER |
213 | %if %{with supervise} |
214 | if [ -d /service/%{name}/supervise ]; then | |
215 | cd /service/%{name} | |
216 | rm /service/%{name} | |
217 | svc -dx . log | |
218 | fi | |
219 | %else | |
5acd3d23 | 220 | %service %{name} stop |
247723c2 | 221 | /sbin/chkconfig --del %{name} |
43d026e1 | 222 | %endif |
247723c2 ER |
223 | fi |
224 | ||
31fd28f8 ER |
225 | %postun |
226 | if [ "$1" = "0" ]; then | |
227 | %userremove %{name} | |
228 | %groupremove %{name} | |
229 | fi | |
230 | ||
dd92f00a ER |
231 | %post libs -p /sbin/ldconfig |
232 | %postun libs -p /sbin/ldconfig | |
233 | ||
247723c2 ER |
234 | %files |
235 | %defattr(644,root,root,755) | |
236 | %doc ChangeLog INSTALL README bopm.conf.sample | |
237 | %doc contrib/ network-bopm/ | |
fee36979 | 238 | %attr(640,root,bopm) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf |
247723c2 ER |
239 | %attr(755,root,root) %{_sbindir}/%{name} |
240 | ||
43d026e1 ER |
241 | %if %{with supervise} |
242 | %attr(1755,root,root) %dir %{_supervise} | |
243 | %attr(755,root,root) %{_supervise}/run | |
244 | %attr(700,root,root) %dir %{_supervise}/supervise | |
245 | ||
246 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %ghost %{_supervise}/supervise/* | |
247 | %attr(1755,root,root) %dir %{_supervise}/log | |
248 | %attr(755,root,root) %{_supervise}/log/run | |
249 | %attr(700,root,root) %dir %{_supervise}/log/supervise | |
250 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %ghost %{_supervise}/log/supervise/* | |
251 | %else | |
252 | %attr(754,root,root) /etc/rc.d/init.d/%{name} | |
247723c2 | 253 | %attr(770,root,bopm) %dir /var/run/%{name} |
43d026e1 ER |
254 | %endif |
255 | ||
247723c2 ER |
256 | %attr(770,root,bopm) %dir /var/log/%{name} |
257 | %attr(640,bopm,bopm) %ghost /var/log/%{name}/bopm.log | |
258 | %attr(640,bopm,bopm) %ghost /var/log/%{name}/scan.log | |
dd92f00a ER |
259 | |
260 | %files libs | |
261 | %defattr(644,root,root,755) | |
262 | %attr(755,root,root) %{_libdir}/libopm.so.*.*.* | |
263 | ||
dd92f00a ER |
264 | %files devel |
265 | %defattr(644,root,root,755) | |
266 | %{_includedir}/opm.h | |
267 | %{_includedir}/opm_common.h | |
268 | %{_includedir}/opm_error.h | |
269 | %{_includedir}/opm_types.h | |
270 | %{_libdir}/libopm.la | |
271 | ||
272 | %files static | |
273 | %defattr(644,root,root,755) | |
274 | %{_libdir}/libopm.a | |
7de691a5 | 275 | |
4f9ad698 | 276 | %files -n perl-%{pnam} |
7de691a5 ER |
277 | %defattr(644,root,root,755) |
278 | %{perl_vendorarch}/OPM.pm | |
279 | %dir %{perl_vendorarch}/auto/OPM | |
280 | %{perl_vendorarch}/auto/OPM/OPM.bs | |
281 | %attr(755,root,root) %{perl_vendorarch}/auto/OPM/OPM.so | |
282 | %{_examplesdir}/perl-OPM-%{version} | |
283 | %{_mandir}/man3/OPM.3pm* |