]>
Commit | Line | Data |
---|---|---|
89968183 | 1 | Summary: Antihak module for Apache |
2 | Name: apache-mod_antihak | |
3 | Version: 0.3.1beta | |
4 | Release: 2 | |
5 | License: GPL | |
89968183 | 6 | Group: Networking/Daemons |
7 | Group(de): Netzwerkwesen/Server | |
8 | Group(pl): Sieciowe/Serwery | |
d5022a56 | 9 | Source0: http://prdownloads.sourceforge.net/apantihak/mod_antihak-0.3.1-beta.tar.gz |
10 | Patch0: mod_antihak-iptables.patch | |
89968183 | 11 | Patch1: mod_antihak-am.patch |
f448d080 | 12 | BuildRequires: automake |
13 | BuildRequires: autoconf | |
14 | BuildRequires: apache(EAPI)-devel | |
15 | BuildRequires: libtool | |
16 | BuildRequires: mysql-devel | |
17 | Requires: apache(EAPI) >= 1.3.1 | |
18 | Requires: iptables | |
19 | Requires: sudo | |
89968183 | 20 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
89968183 | 21 | |
22 | %define _libexecdir %{_libdir}/apache | |
23 | %define _htmldocdir /home/httpd/manual/mod | |
24 | ||
25 | %description | |
f448d080 | 26 | mod_antihak is an Apache Module designed to eliminate the CodeRed and |
27 | Nimda worm's network bandwidth consumption. We're working to make it | |
28 | as easy as writing a line of text to add more worms! :) | |
89968183 | 29 | |
30 | %prep | |
31 | %setup -q -n mod_antihak-0.3.1-beta | |
32 | cd src | |
33 | %patch0 -p0 | |
34 | %patch1 -p0 | |
35 | ||
36 | %build | |
37 | cd src | |
38 | ||
f448d080 | 39 | rm -f tools/missing |
89968183 | 40 | libtoolize --copy --force |
41 | aclocal | |
42 | autoconf | |
43 | automake -a -c | |
44 | ||
45 | %configure \ | |
f448d080 | 46 | CC=%{__cc} \ |
89968183 | 47 | CFLAGS="${CFLAGS:-%optflags} -I/usr/include/mysql" \ |
48 | APACHE_APXS=/usr/sbin/apxs \ | |
49 | --with-mysql | |
50 | ||
f448d080 | 51 | %{__make} |
89968183 | 52 | |
53 | %install | |
54 | rm -rf $RPM_BUILD_ROOT | |
55 | install -d $RPM_BUILD_ROOT{%{_libexecdir},%{_htmldocdir}} | |
56 | ||
57 | cd src | |
58 | ||
59 | install mod_antihak/mod_antihak.so $RPM_BUILD_ROOT%{_libexecdir} | |
60 | ||
f448d080 | 61 | gzip -9nf AUTHORS INSTALL ChangeLog NEWS TODO |
89968183 | 62 | |
63 | %post | |
f448d080 | 64 | if [ `fgrep "http ALL= NOPASSWD: /sbin/iptables" /etc/sudoers | wc -l` = 0 ] then |
89968183 | 65 | echo "http ALL= NOPASSWD: /sbin/iptables" >> /etc/sudoers |
66 | fi | |
67 | ||
68 | %{_sbindir}/apxs -e -a -n antihak %{_libexecdir}/mod_antihak.so 1>&2 | |
69 | if [ -f /var/lock/subsys/httpd ]; then | |
70 | /etc/rc.d/init.d/httpd restart 1>&2 | |
71 | else | |
72 | echo "Run \"/etc/rc.d/init.d/httpd start\" to start apache http daemon." | |
73 | fi | |
74 | ||
75 | %preun | |
76 | if [ "$1" = "0" ]; then | |
77 | if [ `fgrep "http ALL= NOPASSWD: /sbin/iptables" /etc/sudoers | wc -l` != 0 ] | |
78 | then | |
79 | perl -pi -e "s|http ALL= NOPASSWD: /sbin/iptables\n||" /etc/sudoers | |
80 | fi | |
81 | ||
82 | %{_sbindir}/apxs -e -A -n antihak %{_libexecdir}/mod_antihak.so 1>&2 | |
83 | if [ -f /var/lock/subsys/httpd ]; then | |
84 | /etc/rc.d/init.d/httpd restart 1>&2 | |
85 | fi | |
86 | fi | |
87 | ||
88 | %clean | |
89 | rm -rf $RPM_BUILD_ROOT | |
90 | ||
91 | %files | |
92 | %defattr(644,root,root,755) | |
f448d080 | 93 | %doc src/*.gz |
89968183 | 94 | %attr(755,root,root) %{_libexecdir}/* |