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