]> git.pld-linux.org Git - packages/apache1-mod_antihak.git/blobdiff - apache1-mod_antihak.spec
- use apache1(EAPI) for runtime dep
[packages/apache1-mod_antihak.git] / apache1-mod_antihak.spec
index 1fa3ecd85ef5352e140744d30a9a88d9cb5537b6..f8a1931a29c5efd0b6f8c22c86b086b000fff9b9 100644 (file)
@@ -1,99 +1,97 @@
-
+%define apxs   /usr/sbin/apxs1
+%define        mod_name        antihak
+%define                tar_ver 0.3.1-beta
 Summary:       Antihak module for Apache
-Name:          apache-mod_antihak
+Summary(pl.UTF-8):     Moduł antihak dla Apache
+Name:          apache1-mod_%{mod_name}
 Version:       0.3.1beta
-Release:       2
+Release:       3.4
 License:       GPL
-Packager:   glen <glen@delfi.ee>
 Group:         Networking/Daemons
-Group(de):     Netzwerkwesen/Server
-Group(pl):     Sieciowe/Serwery
-Source0:       http://prdownloads.sourceforge.net/apantihak/mod_antihak-0.3.1-beta.tar.bz2
-Patch0:                mod_antihak-iptables.patch.bz2
-Patch1:                mod_antihak-am.patch
-BuildRequires: apache-devel
-Requires:      apache >= 1.3.1
+Source0:       http://dl.sourceforge.net/apantihak/mod_antihak-%{tar_ver}.tar.gz
+# Source0-md5: 38f22f5b5662e8dd7318c42fa96fb083
+Patch0:                %{name}-iptables.patch
+Patch1:                %{name}-am.patch
+Patch2:                %{name}-mysql-API.patch
+URL:           http://sourceforge.net/projects/apantihak/
+BuildRequires: apache1-devel >= 1.3.39
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: libtool
+BuildRequires: mysql-devel
+BuildRequires: rpmbuild(macros) >= 1.268
+Requires(post,preun):  grep
+Requires(preun):       sed >= 4.0
+Requires:      apache1(EAPI)
+Requires:      iptables
+Requires:      sudo
+Obsoletes:     apache-mod_antihak <= 0.3.1beta
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-Requires:   iptables sudo
 
-%define         _libexecdir     %{_libdir}/apache
-%define         _htmldocdir     /home/httpd/manual/mod
+%define                _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
+%define                _sysconfdir     %(%{apxs} -q SYSCONFDIR 2>/dev/null)
 
 %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! :)
+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! :)
+
+%description -l pl.UTF-8
+mod_antihak to moduł Apache służący do eliminowania zapychania sieci
+przez robaki CodeRed i Nimda. Ponadto trwają prace nad umożliwieniem
+łatwego dodawania obsługi kolejnych robaków.
 
 %prep
-%setup -q -n mod_antihak-0.3.1-beta
-cd src
+%setup -q -n mod_antihak-0.3.1-beta/src
 %patch0 -p0
 %patch1 -p0
+%patch2 -p1
 
 %build
-cd src
-
-rm tools/missing
-libtoolize --copy --force
-aclocal
-autoconf
-automake -a -c
+rm -f tools/missing
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__automake}
 
 %configure \
-       CC=gcc \
-       CFLAGS="${CFLAGS:-%optflags} -I/usr/include/mysql" \
-       APACHE_APXS=/usr/sbin/apxs \
+       CC="%{__cc}" \
+       CFLAGS="%{rpmcflags} -I/usr/include/mysql" \
+       APACHE_APXS=%{apxs} \
        --with-mysql
 
-make
+%{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_libexecdir},%{_htmldocdir}}
-
-cd src
+install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d}
 
-install mod_antihak/mod_antihak.so $RPM_BUILD_ROOT%{_libexecdir}
+install mod_antihak/mod_antihak.so $RPM_BUILD_ROOT%{_pkglibdir}
+echo 'LoadModule %{mod_name}_module    modules/mod_%{mod_name}.so' > \
+       $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf
 
-gzip -9nf AUTHORS COPYING ChangeLog INSTALL NEWS TODO
+%clean
+rm -rf $RPM_BUILD_ROOT
 
 %post
-if [ `fgrep "http ALL= NOPASSWD: /sbin/iptables" /etc/sudoers | wc -l` = 0 ]
-then
-       echo "http ALL= NOPASSWD: /sbin/iptables" >> /etc/sudoers
-fi
-
-%{_sbindir}/apxs -e -a -n antihak %{_libexecdir}/mod_antihak.so 1>&2
-if [ -f /var/lock/subsys/httpd ]; then
-       /etc/rc.d/init.d/httpd restart 1>&2
-else
-       echo "Run \"/etc/rc.d/init.d/httpd start\" to start apache http daemon."
+if ! grep -qF "http ALL= NOPASSWD: /sbin/iptables" ; then
+       echo "#http ALL= NOPASSWD: /sbin/iptables" >> /etc/sudoers
+       echo "%{mod_name}: You need to allow apache to run iptables as root,"
+       echo "%{mod_name}: appropriate (commented out) line added to /etc/sudoers;"
+       echo "%{mod_name}: be sure to uncomment it if you want this module to work."
 fi
+%service -q apache restart
 
-%preun
+%postun
 if [ "$1" = "0" ]; then
-       if [ `fgrep "http ALL= NOPASSWD: /sbin/iptables" /etc/sudoers | wc -l` != 0 ]
-       then
-               perl -pi -e "s|http ALL= NOPASSWD: /sbin/iptables\n||" /etc/sudoers
-       fi
-
-       %{_sbindir}/apxs -e -A -n antihak %{_libexecdir}/mod_antihak.so 1>&2
-       if [ -f /var/lock/subsys/httpd ]; then
-               /etc/rc.d/init.d/httpd restart 1>&2
+       if grep -qF "^http ALL= NOPASSWD: /sbin/iptables" /etc/sudoers ; then
+               sed -i -e '/^http ALL= NOPASSWD: /sbin/iptables$/d' /etc/sudoers
        fi
+       %service -q apache restart
 fi
 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
 %files
 %defattr(644,root,root,755)
-%doc src/{AUTHORS,COPYING,ChangeLog,INSTALL,NEWS,TODO}.gz
-%attr(755,root,root) %{_libexecdir}/*
-
-%changelog
-* Wed Jan 09 2002 glen <glen@delfi.ee>
-- added /etc/sudoers editing
-
-* Wed Jan 09 2002 glen <glen@delfi.ee>
-- built PLD package, based on PLD apache-mod_fastcgi and mandrake's mod_antihack
+%doc AUTHORS INSTALL ChangeLog NEWS TODO
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf
+%attr(755,root,root) %{_pkglibdir}/*
This page took 0.073462 seconds and 4 git commands to generate.