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