]> git.pld-linux.org Git - packages/apache1-mod_antihak.git/blob - apache1-mod_antihak.spec
- changed to gzipped tar ball (on Source0 url I can't find bzipped2 tar ball),
[packages/apache1-mod_antihak.git] / apache1-mod_antihak.spec
1 Summary:        Antihak module for Apache
2 Name:           apache-mod_antihak
3 Version:        0.3.1beta
4 Release:        2
5 License:        GPL
6 Group:          Networking/Daemons
7 Group(de):      Netzwerkwesen/Server
8 Group(pl):      Sieciowe/Serwery
9 Source0:        http://prdownloads.sourceforge.net/apantihak/mod_antihak-0.3.1-beta.tar.gz
10 Patch0:         mod_antihak-iptables.patch
11 Patch1:         mod_antihak-am.patch
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
20 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21
22 %define         _libexecdir     %{_libdir}/apache
23 %define         _htmldocdir     /home/httpd/manual/mod
24
25 %description
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! :)
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
39 rm -f tools/missing
40 libtoolize --copy --force
41 aclocal
42 autoconf
43 automake -a -c
44
45 %configure \
46         CC=%{__cc} \
47         CFLAGS="${CFLAGS:-%optflags} -I/usr/include/mysql" \
48         APACHE_APXS=/usr/sbin/apxs \
49         --with-mysql
50
51 %{__make}
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
61 gzip -9nf AUTHORS INSTALL ChangeLog NEWS TODO
62
63 %post
64 if [ `fgrep "http ALL= NOPASSWD: /sbin/iptables" /etc/sudoers | wc -l` = 0 ] then
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)
93 %doc src/*.gz
94 %attr(755,root,root) %{_libexecdir}/*
This page took 0.070143 seconds and 3 git commands to generate.