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