]>
Commit | Line | Data |
---|---|---|
d1f375e3 | 1 | %define apxs /usr/sbin/apxs1 |
2 | %define mod_name antihak | |
4afcca23 | 3 | %define tar_ver 0.3.1-beta |
89968183 | 4 | Summary: Antihak module for Apache |
5a995c7c | 5 | Summary(pl.UTF-8): Moduł antihak dla Apache |
d1f375e3 | 6 | Name: apache1-mod_%{mod_name} |
89968183 | 7 | Version: 0.3.1beta |
56f64e7c | 8 | Release: 3.3 |
89968183 | 9 | License: GPL |
89968183 | 10 | Group: Networking/Daemons |
cf2b4044 | 11 | Source0: http://dl.sourceforge.net/apantihak/mod_antihak-%{tar_ver}.tar.gz |
fff7c9ef | 12 | # Source0-md5: 38f22f5b5662e8dd7318c42fa96fb083 |
d1f375e3 | 13 | Patch0: %{name}-iptables.patch |
14 | Patch1: %{name}-am.patch | |
b6100208 | 15 | Patch2: %{name}-mysql-API.patch |
d1f375e3 | 16 | URL: http://sourceforge.net/projects/apantihak/ |
b712ea93 | 17 | BuildRequires: apache1-devel >= 1.3.39 |
93263cd5 ER |
18 | BuildRequires: autoconf |
19 | BuildRequires: automake | |
f448d080 | 20 | BuildRequires: libtool |
21 | BuildRequires: mysql-devel | |
4afcca23 | 22 | BuildRequires: rpmbuild(macros) >= 1.268 |
ae28ceca | 23 | Requires(post,preun): grep |
b6100208 ER |
24 | Requires(preun): sed >= 4.0 |
25 | Requires: apache1 >= 1.3.33-2 | |
f448d080 | 26 | Requires: iptables |
27 | Requires: sudo | |
7c2c7826 | 28 | Obsoletes: apache-mod_antihak <= 0.3.1beta |
89968183 | 29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
89968183 | 30 | |
b6100208 ER |
31 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) |
32 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null) | |
89968183 | 33 | |
34 | %description | |
f448d080 | 35 | mod_antihak is an Apache Module designed to eliminate the CodeRed and |
36 | Nimda worm's network bandwidth consumption. We're working to make it | |
37 | as easy as writing a line of text to add more worms! :) | |
89968183 | 38 | |
c6997329 JR |
39 | %description -l pl.UTF-8 |
40 | mod_antihak to moduł Apache służący do eliminowania zapychania sieci | |
41 | przez robaki CodeRed i Nimda. Ponadto trwają prace nad umożliwieniem | |
42 | łatwego dodawania obsługi kolejnych robaków. | |
e440673c | 43 | |
89968183 | 44 | %prep |
d1f375e3 | 45 | %setup -q -n mod_antihak-0.3.1-beta/src |
89968183 | 46 | %patch0 -p0 |
47 | %patch1 -p0 | |
b6100208 | 48 | %patch2 -p1 |
89968183 | 49 | |
50 | %build | |
f448d080 | 51 | rm -f tools/missing |
836c4f1b | 52 | %{__libtoolize} |
5a849ce9 | 53 | %{__aclocal} |
425317e3 | 54 | %{__autoconf} |
55 | %{__automake} | |
89968183 | 56 | |
57 | %configure \ | |
b5ba51c2 | 58 | CC="%{__cc}" \ |
e440673c | 59 | CFLAGS="%{rpmcflags} -I/usr/include/mysql" \ |
1413a638 | 60 | APACHE_APXS=%{apxs} \ |
89968183 | 61 | --with-mysql |
62 | ||
f448d080 | 63 | %{__make} |
89968183 | 64 | |
65 | %install | |
66 | rm -rf $RPM_BUILD_ROOT | |
b6100208 | 67 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d} |
89968183 | 68 | |
d1f375e3 | 69 | install mod_antihak/mod_antihak.so $RPM_BUILD_ROOT%{_pkglibdir} |
b6100208 ER |
70 | echo 'LoadModule %{mod_name}_module modules/mod_%{mod_name}.so' > \ |
71 | $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf | |
89968183 | 72 | |
ae28ceca JB |
73 | %clean |
74 | rm -rf $RPM_BUILD_ROOT | |
75 | ||
89968183 | 76 | %post |
ae28ceca | 77 | if ! grep -qF "http ALL= NOPASSWD: /sbin/iptables" ; then |
d1f375e3 | 78 | echo "#http ALL= NOPASSWD: /sbin/iptables" >> /etc/sudoers |
b6100208 | 79 | echo "%{mod_name}: You need to allow apache to run iptables as root," |
d1f375e3 | 80 | echo "%{mod_name}: appropriate (commented out) line added to /etc/sudoers;" |
b6100208 | 81 | echo "%{mod_name}: be sure to uncomment it if you want this module to work." |
89968183 | 82 | fi |
4afcca23 | 83 | %service -q apache restart |
89968183 | 84 | |
56f64e7c | 85 | %postun |
89968183 | 86 | if [ "$1" = "0" ]; then |
d1f375e3 | 87 | if grep -qF "^http ALL= NOPASSWD: /sbin/iptables" /etc/sudoers ; then |
b6100208 | 88 | sed -i -e '/^http ALL= NOPASSWD: /sbin/iptables$/d' /etc/sudoers |
89968183 | 89 | fi |
4afcca23 | 90 | %service -q apache restart |
89968183 | 91 | fi |
92 | ||
89968183 | 93 | %files |
94 | %defattr(644,root,root,755) | |
d1f375e3 | 95 | %doc AUTHORS INSTALL ChangeLog NEWS TODO |
93263cd5 | 96 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf |
d1f375e3 | 97 | %attr(755,root,root) %{_pkglibdir}/* |