]> git.pld-linux.org Git - packages/apache1-mod_antihak.git/blob - apache1-mod_antihak.spec
- confdir enabled apache1 (no triggers as it wasn't on ftp)
[packages/apache1-mod_antihak.git] / apache1-mod_antihak.spec
1 %define apxs    /usr/sbin/apxs1
2 %define mod_name        antihak
3 Summary:        Antihak module for Apache
4 Summary(pl):    Modu³ antihak dla Apache
5 Name:           apache1-mod_%{mod_name}
6 %define         tar_ver 0.3.1-beta
7 Version:        0.3.1beta
8 Release:        3.2
9 License:        GPL
10 Group:          Networking/Daemons
11 Source0:        http://dl.sourceforge.net/apantihak/mod_antihak-%{tar_ver}.tar.gz
12 # Source0-md5:  38f22f5b5662e8dd7318c42fa96fb083
13 Patch0:         %{name}-iptables.patch
14 Patch1:         %{name}-am.patch
15 Patch2:         %{name}-mysql-API.patch
16 URL:            http://sourceforge.net/projects/apantihak/
17 BuildRequires:  automake
18 BuildRequires:  autoconf
19 BuildRequires:  apache1-devel >= 1.3.33-2
20 BuildRequires:  libtool
21 BuildRequires:  mysql-devel
22 BuildRequires:  %{apxs}
23 Requires(post,preun):   grep
24 Requires(preun):        sed >= 4.0
25 Requires:       apache1 >= 1.3.33-2
26 Requires:       iptables
27 Requires:       sudo
28 Obsoletes:      apache-mod_%{mod_name} <= %{version}
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
32 %define         _sysconfdir     %(%{apxs} -q SYSCONFDIR 2>/dev/null)
33
34 %description
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! :)
38
39 %description -l pl
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.
43
44 %prep
45 %setup -q -n mod_antihak-0.3.1-beta/src
46 %patch0 -p0
47 %patch1 -p0
48 %patch2 -p1
49
50 %build
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{%{_pkglibdir},%{_sysconfdir}/conf.d}
68
69 install mod_antihak/mod_antihak.so $RPM_BUILD_ROOT%{_pkglibdir}
70 echo 'LoadModule %{mod_name}_module     modules/mod_%{mod_name}.so' > \
71         $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf
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         echo "%{mod_name}: You need to allow apache to run iptables as root,"
80         echo "%{mod_name}: appropriate (commented out) line added to /etc/sudoers;"
81         echo "%{mod_name}: be sure to uncomment it if you want this module to work."
82 fi
83
84 if [ -f /var/lock/subsys/apache ]; then
85         /etc/rc.d/init.d/apache restart 1>&2
86 else
87         echo "Run \"/etc/rc.d/init.d/apache start\" to start apache HTTP daemon."
88 fi
89
90 %preun
91 if [ "$1" = "0" ]; then
92         if grep -qF "^http ALL= NOPASSWD: /sbin/iptables" /etc/sudoers ; then
93                 sed -i -e '/^http ALL= NOPASSWD: /sbin/iptables$/d' /etc/sudoers
94         fi
95
96         if [ -f /var/lock/subsys/apache ]; then
97                 /etc/rc.d/init.d/apache restart 1>&2
98         fi
99 fi
100
101 %files
102 %defattr(644,root,root,755)
103 %doc AUTHORS INSTALL ChangeLog NEWS TODO
104 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf
105 %attr(755,root,root) %{_pkglibdir}/*
This page took 0.033144 seconds and 3 git commands to generate.