]> git.pld-linux.org Git - packages/apache1-mod_antihak.git/blob - apache1-mod_antihak.spec
- release 3
[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 Group(cs):      Sí»ové/Démoni
10 Group(da):      Netværks/Dæmoner
11 Group(de):      Netzwerkwesen/Server
12 Group(es):      Red/Servidores
13 Group(fr):      Réseau/Serveurs
14 Group(is):      Net/Púkar
15 Group(it):      Rete/Demoni
16 Group(no):      Nettverks/Daemoner
17 Group(pl):      Sieciowe/Serwery
18 Group(pt):      Rede/Servidores
19 Group(ru):      óÅÔØ/äÅÍÏÎÙ
20 Group(sl):      Omre¾ni/Stre¾niki
21 Group(sv):      Nätverk/Demoner
22 Group(uk):      íÅÒÅÖÁ/äÅÍÏÎÉ
23 Source0:        ftp://ftp.sourceforge.net/pub/sourceforge/apantihak/mod_antihak-0.3.1-beta.tar.gz
24 Patch0:         mod_antihak-iptables.patch
25 Patch1:         mod_antihak-am.patch
26 BuildRequires:  automake
27 BuildRequires:  autoconf
28 BuildRequires:  apache(EAPI)-devel
29 BuildRequires:  libtool
30 BuildRequires:  mysql-devel
31 BuildRequires:  %{apxs}
32 Requires:       apache(EAPI) >= 1.3.1
33 Requires:       iptables
34 Requires:       sudo
35 Prereq:         %{_sbindir}/apxs
36 Prereq:         grep
37 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39 %define         _libexecdir     %{_libdir}/apache
40 %define         _htmldocdir     /home/httpd/manual/mod
41
42 %description
43 mod_antihak is an Apache Module designed to eliminate the CodeRed and
44 Nimda worm's network bandwidth consumption. We're working to make it
45 as easy as writing a line of text to add more worms! :)
46
47 %description -l pl
48 mod_antihak to modu³ Apache s³u¿±cy do eliminowania zapychania sieci
49 przez robaki CodeRed i Nimda. Ponadto trwaj± prace nad umo¿liwieniem
50 ³atwego dodawania obs³ugi kolejnych robaków.
51
52 %prep
53 %setup -q -n mod_antihak-0.3.1-beta
54 cd src
55 %patch0 -p0
56 %patch1 -p0
57
58 %build
59 cd src
60
61 rm -f tools/missing
62 libtoolize --copy --force
63 aclocal
64 autoconf
65 automake -a -c
66
67 %configure \
68         CC=%{__cc} \
69         CFLAGS="%{rpmcflags} -I/usr/include/mysql" \
70         APACHE_APXS=%{apxs} \
71         --with-mysql
72
73 %{__make}
74
75 %install
76 rm -rf $RPM_BUILD_ROOT
77 install -d $RPM_BUILD_ROOT{%{_libexecdir},%{_htmldocdir}}
78
79 cd src
80
81 install mod_antihak/mod_antihak.so $RPM_BUILD_ROOT%{_libexecdir}
82
83 gzip -9nf AUTHORS INSTALL ChangeLog NEWS TODO
84
85 %post
86 if [ `fgrep "http ALL= NOPASSWD: /sbin/iptables" /etc/sudoers | wc -l` = 0 ] then
87         echo "http ALL= NOPASSWD: /sbin/iptables" >> /etc/sudoers
88 fi
89
90 %{_sbindir}/apxs -e -a -n antihak %{_libexecdir}/mod_antihak.so 1>&2
91 if [ -f /var/lock/subsys/httpd ]; then
92         /etc/rc.d/init.d/httpd restart 1>&2
93 else
94         echo "Run \"/etc/rc.d/init.d/httpd start\" to start apache http daemon."
95 fi
96
97 %preun
98 if [ "$1" = "0" ]; then
99         if [ `fgrep "http ALL= NOPASSWD: /sbin/iptables" /etc/sudoers | wc -l` != 0 ]
100         then
101                 grep -v '^http ALL= NOPASSWD: /sbin/iptables$' /etc/sudoers \
102                         > /etc/sudoers.rpmnew-antihak
103                 mv -f /etc/sudoers.rpmnew-antihak /etc/sudoers
104         fi
105
106         %{_sbindir}/apxs -e -A -n antihak %{_libexecdir}/mod_antihak.so 1>&2
107         if [ -f /var/lock/subsys/httpd ]; then
108                 /etc/rc.d/init.d/httpd restart 1>&2
109         fi
110 fi
111
112 %clean
113 rm -rf $RPM_BUILD_ROOT
114
115 %files
116 %defattr(644,root,root,755)
117 %doc src/*.gz
118 %attr(755,root,root) %{_libexecdir}/*
This page took 0.469876 seconds and 3 git commands to generate.