]> git.pld-linux.org Git - packages/apache1-mod_antihak.git/blob - apache1-mod_antihak.spec
- "HTTP" unification
[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.1
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 URL:            http://sourceforge.net/projects/apantihak/
16 BuildRequires:  automake
17 BuildRequires:  autoconf
18 BuildRequires:  apache1-devel
19 BuildRequires:  libtool
20 BuildRequires:  mysql-devel
21 BuildRequires:  %{apxs}
22 Requires(post,preun):   %{apxs}
23 Requires(post,preun):   grep
24 Requires(post,preun):   sudo
25 Requires(preun):        fileutils
26 Requires:       apache1 >= 1.3.1
27 Requires:       iptables
28 Requires:       sudo
29 Obsoletes:      apache-mod_%{mod_name} <= %{version}
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR)
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
49 %build
50 rm -f tools/missing
51 %{__libtoolize}
52 %{__aclocal}
53 %{__autoconf}
54 %{__automake}
55
56 %configure \
57         CC=%{__cc} \
58         CFLAGS="%{rpmcflags} -I/usr/include/mysql" \
59         APACHE_APXS=%{apxs} \
60         --with-mysql
61
62 %{__make}
63
64 %install
65 rm -rf $RPM_BUILD_ROOT
66 install -d $RPM_BUILD_ROOT%{_pkglibdir}
67
68 install mod_antihak/mod_antihak.so $RPM_BUILD_ROOT%{_pkglibdir}
69
70 %clean
71 rm -rf $RPM_BUILD_ROOT
72
73 %post
74 if ! grep -qF "http ALL= NOPASSWD: /sbin/iptables" ; then
75         echo "#http ALL= NOPASSWD: /sbin/iptables" >> /etc/sudoers
76         echo "%{mod_name}: you need to allow apache to run iptables as root,"
77         echo "%{mod_name}: appropriate (commented out) line added to /etc/sudoers;"
78         echo "%{mod_name}: be sure to uncomment it if you want this module to work"
79 fi
80
81 %{apxs} -e -a -n antihak %{_pkglibdir}/mod_antihak.so 1>&2
82 if [ -f /var/lock/subsys/apache ]; then
83         /etc/rc.d/init.d/apache restart 1>&2
84 else
85         echo "Run \"/etc/rc.d/init.d/apache 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 %{_pkglibdir}/mod_antihak.so 1>&2
98         if [ -f /var/lock/subsys/apache ]; then
99                 /etc/rc.d/init.d/apache restart 1>&2
100         fi
101 fi
102
103 %files
104 %defattr(644,root,root,755)
105 %doc AUTHORS INSTALL ChangeLog NEWS TODO
106 %attr(755,root,root) %{_pkglibdir}/*
This page took 0.029868 seconds and 4 git commands to generate.