]> git.pld-linux.org Git - packages/apache1-mod_antihak.git/blob - apache1-mod_antihak.spec
- converted to UTF-8
[packages/apache1-mod_antihak.git] / apache1-mod_antihak.spec
1 %define apxs    /usr/sbin/apxs1
2 %define mod_name        antihak
3 %define         tar_ver 0.3.1-beta
4 Summary:        Antihak module for Apache
5 Summary(pl.UTF-8):   Moduł antihak dla Apache
6 Name:           apache1-mod_%{mod_name}
7 Version:        0.3.1beta
8 Release:        3.3
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:  %{apxs}
18 BuildRequires:  apache1-devel >= 1.3.33-2
19 BuildRequires:  autoconf
20 BuildRequires:  automake
21 BuildRequires:  libtool
22 BuildRequires:  mysql-devel
23 BuildRequires:  rpmbuild(macros) >= 1.268
24 Requires(post,preun):   grep
25 Requires(preun):        sed >= 4.0
26 Requires:       apache1 >= 1.3.33-2
27 Requires:       iptables
28 Requires:       sudo
29 Obsoletes:      apache-mod_antihak <= 0.3.1beta
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
33 %define         _sysconfdir     %(%{apxs} -q SYSCONFDIR 2>/dev/null)
34
35 %description
36 mod_antihak is an Apache Module designed to eliminate the CodeRed and
37 Nimda worm's network bandwidth consumption. We're working to make it
38 as easy as writing a line of text to add more worms! :)
39
40 %description -l pl.UTF-8
41 mod_antihak to moduł Apache służący do eliminowania zapychania sieci
42 przez robaki CodeRed i Nimda. Ponadto trwają prace nad umożliwieniem
43 łatwego dodawania obsługi kolejnych robaków.
44
45 %prep
46 %setup -q -n mod_antihak-0.3.1-beta/src
47 %patch0 -p0
48 %patch1 -p0
49 %patch2 -p1
50
51 %build
52 rm -f tools/missing
53 %{__libtoolize}
54 %{__aclocal}
55 %{__autoconf}
56 %{__automake}
57
58 %configure \
59         CC="%{__cc}" \
60         CFLAGS="%{rpmcflags} -I/usr/include/mysql" \
61         APACHE_APXS=%{apxs} \
62         --with-mysql
63
64 %{__make}
65
66 %install
67 rm -rf $RPM_BUILD_ROOT
68 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d}
69
70 install mod_antihak/mod_antihak.so $RPM_BUILD_ROOT%{_pkglibdir}
71 echo 'LoadModule %{mod_name}_module     modules/mod_%{mod_name}.so' > \
72         $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf
73
74 %clean
75 rm -rf $RPM_BUILD_ROOT
76
77 %post
78 if ! grep -qF "http ALL= NOPASSWD: /sbin/iptables" ; then
79         echo "#http ALL= NOPASSWD: /sbin/iptables" >> /etc/sudoers
80         echo "%{mod_name}: You need to allow apache to run iptables as root,"
81         echo "%{mod_name}: appropriate (commented out) line added to /etc/sudoers;"
82         echo "%{mod_name}: be sure to uncomment it if you want this module to work."
83 fi
84 %service -q apache restart
85
86 %postun
87 if [ "$1" = "0" ]; then
88         if grep -qF "^http ALL= NOPASSWD: /sbin/iptables" /etc/sudoers ; then
89                 sed -i -e '/^http ALL= NOPASSWD: /sbin/iptables$/d' /etc/sudoers
90         fi
91         %service -q apache restart
92 fi
93
94 %files
95 %defattr(644,root,root,755)
96 %doc AUTHORS INSTALL ChangeLog NEWS TODO
97 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf
98 %attr(755,root,root) %{_pkglibdir}/*
This page took 0.073342 seconds and 3 git commands to generate.