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