%define name mod_antihak %define version 0.3.1c %define srcver 0.3.1-beta %define apache_version 1.3.33 %define release 14mdk Summary: Antihak module for Apache Name: %{name} Version: %{version} Release: %{release} Source0: http://prdownloads.sourceforge.net/apantihak/%{name}-%{srcver}.tar.bz2 Group: System/Servers License: GPL URL: http://apantihak.sourceforge.net/ Patch0: mod_antihak-iptables.patch.bz2 Patch1: mod_antihak-0.3.1-beta-locations.diff.bz2 Patch2: mod_antihak-0.3.1b-server.patch.bz2 Prereq: apache = %{apache_version} Prereq: apache-common >= %{apache_version} Prereq: apache-conf >= %{apache_version} BuildRequires: apache-devel BuildRequires: autoconf2.5 BuildRequires: automake1.7 #BuildRequires: MySQL-devel Requires: iptables Requires: sudo BuildRoot: %{_tmppath}/%{name}-buildroot %description mod_antihak is an Apache Module designed to eliminate the CodeRed and Nimda worm's network bandwidth consumption. We're working to make it as easy as writing a line of text to add more worms! :) %prep %setup -q -n %name-%srcver cd src; mv * .. ; cd .. ; rmdir src pwd %patch0 -p0 %patch1 -p0 %patch2 -p0 %build export WANT_AUTOCONF_2_5=1 rm -f configure; libtoolize --copy --force; aclocal-1.7; autoconf; automake-1.7 --add-missing export APACHE_APXS="%{_sbindir}/apxs" %configure2_5x \ --with-apache=%{_prefix} # --with-mysql=%{_prefix} %make %install [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} install -d %{buildroot}/%{_libdir}/apache-extramodules install mod_antihak/mod_antihak.so %{buildroot}/%{_libdir}/apache-extramodules/ chmod 644 AUTHORS COPYING ChangeLog INSTALL NEWS TODO %clean [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} %pre #Check config file sanity if [ -e %{_sbindir}/ap13chkconfig ]; then %{_sbindir}/ap13chkconfig;fi %post if [ $1 = "1" ]; then if [ `fgrep "apache ALL= NOPASSWD: /sbin/iptables" /etc/sudoers | wc -l` = 0 ] then echo "apache ALL= NOPASSWD: /sbin/iptables" >> /etc/sudoers fi #We're in Install mode, add module to the config files for config in %{_sysconfdir}/httpd/conf/{httpd,httpd-perl}.conf; do if [ -x %{_sbindir}/advxaddmod -a -e $config ]; then %{_sbindir}/advxaddmod $config \ extramodules/mod_antihak.so mod_antihak.c antihak_module fi done if [ -e %{_sbindir}/ADVXctl ]; then %{_sbindir}/ADVXctl update;fi fi if [ $1 -gt 1 ]; then #We're in *upgrade mode*. Since we can't be sure the configuration files #are sane, remove module from the conf files to clean them, re-add again #in a way that the older module we're replacing won't try to erase (the #post scripts were broken on some packages), and finally clean the module #specific config file so it's compatible with the upgrade. for config in %{_sysconfdir}/httpd/conf/{httpd,httpd-perl}.conf; do if [ -x %{_sbindir}/advxdelmod -a -e $config ]; then %{_sbindir}/advxdelmod $config \ extramodules/mod_antihak.so mod_antihak.c antihak_module \ $config fi if [ -x %{_sbindir}/advxaddmod -a -e $config ]; then %{_sbindir}/advxaddmod $config \ extramodules/mod_antihak.so mod_antihak.c antihak_module fi done if [ -e %{_sbindir}/ADVXctl ]; then %{_sbindir}/ADVXctl update;fi fi %postun if [ $1 = "0" ]; then if [ `fgrep "apache ALL= NOPASSWD: /sbin/iptables" /etc/sudoers | wc -l` != 0 ] then alias FIXME="perl -pi -e" FIXME 's|apache ALL= NOPASSWD: /sbin/iptables\n||' /etc/sudoers fi for config in %{_sysconfdir}/httpd/conf/{httpd,httpd-perl}.conf; do if [ -x %{_sbindir}/advxdelmod -a -e $config ]; then %{_sbindir}/advxdelmod $config \ extramodules/mod_antihak.so mod_antihak.c antihak_module fi done if [ -e %{_sbindir}/ADVXctl ]; then %{_sbindir}/ADVXctl update;fi fi %files %defattr(-,root,root) %doc AUTHORS COPYING ChangeLog INSTALL NEWS TODO %{_libdir}/apache-extramodules/mod_antihak.so %changelog * Tue Feb 15 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 0.3.1c-14mdk - spec file cleanups, remove the ADVX-build stuff * Sun Nov 21 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 0.3.1c-13mdk - built for apache 1.3.33 * Thu Jun 10 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 0.3.1c-12mdk - built for apache 1.3.31 * Sun Nov 09 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.3.1c-11mdk - built for apache 1.3.29 * Tue Sep 16 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 0.3.1c-10mdk - rebuild with apache 1.3.28 * Thu Feb 13 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 0.3.1c-9mdk - new macros from ADVX-build - add no-exeext to Makefile.am to make automake happy. * Sat Dec 07 2002 Olivier Thauvin <thauvin@aerov.jussieu.fr> 0.3.1beta-8mdk - Don't hardcore %%apache_version, get from system on build * Fri Nov 8 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 0.3.1beta-7mdk - Rebuild for Cooker * Mon Oct 28 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 0.3.1beta-6mdk - New version * Wed Jun 26 2002 Christian Belisle <cbelisle@mandrakesoft.com> 0.3.1beta-5mdk - rebuild against new apache. * Mon Apr 15 2002 Christian Belisle <cbelisle@mandrakesoft.com> 0.3.1beta-4mdk - Apache 1.3.24 - Fix BuildRequires. - Include Patch2 to know if the module is loaded or not. * Tue Feb 05 2002 Christian Belisle <cbelisle@mandrakesoft.com> 0.3.1beta-3mdk - rebuild against new apache. - give the right path for apxs (patch1). * Tue Dec 25 2001 Stefan van der Eijk <stefan@eijk.nu> 0.3.1beta-2mdk - fix bug in calling iptables - fix %%post and %%postun * Mon Dec 24 2001 Stefan van der Eijk <stefan@eijk.nu> 0.3.1beta-1mdk - first Mandrake version