]> git.pld-linux.org Git - packages/apache1-mod_antihak.git/blob - apache1-mod_antihak.spec
c14a5b49050c50c9becb88e85cd40557042d3b26
[packages/apache1-mod_antihak.git] / apache1-mod_antihak.spec
1 %define         apxs    /usr/sbin/apxs
2 Summary:        Antihak module for Apache
3 Summary(pl):    Modu³ antihak dla Apache
4 Name:           apache-mod_antihak
5 %define         tar_ver 0.3.1-beta
6 Version:        0.3.1beta
7 Release:        3
8 License:        GPL
9 Group:          Networking/Daemons
10 Source0:        http://dl.sourceforge.net/apantihak/mod_antihak-%{tar_ver}.tar.gz
11 # Source0-md5:  38f22f5b5662e8dd7318c42fa96fb083
12 Patch0:         mod_antihak-iptables.patch
13 Patch1:         mod_antihak-am.patch
14 BuildRequires:  automake
15 BuildRequires:  autoconf
16 BuildRequires:  apache(EAPI)-devel
17 BuildRequires:  libtool
18 BuildRequires:  mysql-devel
19 BuildRequires:  %{apxs}
20 Requires(post,preun):   %{apxs}
21 Requires(post,preun):   grep
22 Requires(post,preun):   sudo
23 Requires(preun):        fileutils
24 Requires:       apache(EAPI) >= 1.3.1
25 Requires:       iptables
26 Requires:       sudo
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %define         _libexecdir     %{_libdir}/apache
30 %define         _htmldocdir     /home/httpd/manual/mod
31
32 %description
33 mod_antihak is an Apache Module designed to eliminate the CodeRed and
34 Nimda worm's network bandwidth consumption. We're working to make it
35 as easy as writing a line of text to add more worms! :)
36
37 %description -l pl
38 mod_antihak to modu³ Apache s³u¿±cy do eliminowania zapychania sieci
39 przez robaki CodeRed i Nimda. Ponadto trwaj± prace nad umo¿liwieniem
40 ³atwego dodawania obs³ugi kolejnych robaków.
41
42 %prep
43 %setup -q -n mod_antihak-0.3.1-beta
44 cd src
45 %patch0 -p0
46 %patch1 -p0
47
48 %build
49 cd src
50
51 rm -f tools/missing
52 %{__libtoolize}
53 %{__aclocal}
54 %{__autoconf}
55 %{__automake}
56
57 %configure \
58         CC=%{__cc} \
59         CFLAGS="%{rpmcflags} -I/usr/include/mysql" \
60         APACHE_APXS=%{apxs} \
61         --with-mysql
62
63 %{__make}
64
65 %install
66 rm -rf $RPM_BUILD_ROOT
67 install -d $RPM_BUILD_ROOT{%{_libexecdir},%{_htmldocdir}}
68
69 cd src
70
71 install mod_antihak/mod_antihak.so $RPM_BUILD_ROOT%{_libexecdir}
72
73 %clean
74 rm -rf $RPM_BUILD_ROOT
75
76 %post
77 if ! grep -qF "http ALL= NOPASSWD: /sbin/iptables" ; then
78         echo "http ALL= NOPASSWD: /sbin/iptables" >> /etc/sudoers
79 fi
80
81 %{apxs} -e -a -n antihak %{_libexecdir}/mod_antihak.so 1>&2
82 if [ -f /var/lock/subsys/httpd ]; then
83         /etc/rc.d/init.d/httpd restart 1>&2
84 else
85         echo "Run \"/etc/rc.d/init.d/httpd start\" to start apache http daemon."
86 fi
87
88 %preun
89 if [ "$1" = "0" ]; then
90         if grep -qF "http ALL= NOPASSWD: /sbin/iptables" /etc/sudoers ; then
91                 umask 227
92                 grep -v '^http ALL= NOPASSWD: /sbin/iptables$' /etc/sudoers \
93                         > /etc/sudoers.rpmnew-antihak
94                 mv -f /etc/sudoers.rpmnew-antihak /etc/sudoers
95         fi
96
97         %{apxs} -e -A -n antihak %{_libexecdir}/mod_antihak.so 1>&2
98         if [ -f /var/lock/subsys/httpd ]; then
99                 /etc/rc.d/init.d/httpd restart 1>&2
100         fi
101 fi
102
103 %files
104 %defattr(644,root,root,755)
105 %doc src/{AUTHORS,INSTALL,ChangeLog,NEWS,TODO}
106 %attr(755,root,root) %{_libexecdir}/*
This page took 0.049126 seconds and 2 git commands to generate.