Sophie

Sophie

distrib > Mandriva > 2006.0 > i586 > by-pkgid > f8239d976fa9bcbd832e554cae601764 > files > 2

apache-mod_clamav-2.0.54_0.21-2mdk.src.rpm

#Module-Specific definitions
%define mod_version 0.21
%define mod_name mod_clamav
%define mod_conf 86_%{mod_name}.conf
%define mod_so %{mod_name}.so
%define sourcename %{mod_name}-%{mod_version}

%define apache_version 2.0.54

# Standard Module Definitions
%define name apache-%{mod_name}
%define version %{apache_version}_%{mod_version}

Summary:	Clam virus scanning filter DSO for apache
Name:		%{name}
Version:	%{version}
Release:	%mkrel 2
Group:		System/Servers
License:	GPL
URL:		http://software.othello.ch/mod_clamav/
Source0:	%{sourcename}.tar.bz2
Source1:	%{mod_conf}.bz2
Requires:	clamd
Requires:	clamav
Requires:	clamav-db
BuildRequires:	clamav-devel
BuildRequires:	zlib-devel
BuildRequires:	bzip2-devel
BuildRequires:	gmp-devel
Requires(pre): rpm-helper
Requires(postun): rpm-helper
Requires(pre):	apache-conf >= 2.0.54
Requires(pre):	apache >= %{apache_version}
Requires:	apache-conf >= 2.0.54
Requires:	apache >= %{apache_version}
BuildRequires:	apache-devel >= %{apache_version}
BuildRequires:	file
Provides:	apache2-mod_clamav
Obsoletes:	apache2-mod_clamav
BuildRoot:	%{_tmppath}/%{name}-%{version}-buildroot

%description
%{mod_name} is an apache 2 filter module to allow virus checking
of all HTTP all reply data. By adding the filter to the Proxy
location, all requests mediated by an apache proxy can be scanned
for viruses.

%prep

%setup -q -n %{sourcename}

# strip away annoying ^M
find . -type f|xargs file|grep 'CRLF'|cut -d: -f1|xargs perl -p -i -e 's/\r//'
find . -type f|xargs file|grep 'text'|cut -d: -f1|xargs perl -p -i -e 's/\r//'

%build

# not used with make
%configure2_5x --with-apxs=%{_sbindir}/apxs

#%{_sbindir}/apxs -DCLAMAV_DEBUG=\"1\" -c %{mod_name}.c -Wl,-lclamav -lbz2 -lz  -lpthread
%{_sbindir}/apxs -c %{mod_name}.c -Wl,-lclamav -lbz2 -lz -lpthread -lgmp

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

install -d %{buildroot}%{_libdir}/apache-extramodules
install -d %{buildroot}%{_sysconfdir}/httpd/modules.d
install -d %{buildroot}/var/spool/%{mod_name}

install -m0755 .libs/*.so %{buildroot}%{_libdir}/apache-extramodules/
bzcat %{SOURCE1} > %{buildroot}%{_sysconfdir}/httpd/modules.d/%{mod_conf}

install -d %{buildroot}%{_var}/www/html/addon-modules
ln -s ../../../..%{_docdir}/%{name}-%{version} %{buildroot}%{_var}/www/html/addon-modules/%{name}-%{version}

%post
if [ -f %{_var}/lock/subsys/httpd ]; then
    %{_initrddir}/httpd restart 1>&2;
fi

%postun
if [ "$1" = "0" ]; then
    if [ -f %{_var}/lock/subsys/httpd ]; then
	%{_initrddir}/httpd restart 1>&2
    fi
fi

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog README TODO mod_clamav.html
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/modules.d/%{mod_conf}
%attr(0755,root,root) %{_libdir}/apache-extramodules/%{mod_so}
%{_var}/www/html/addon-modules/*
%attr(0755,apache,apache) %dir /var/spool/%{mod_name}

%changelog
* Sat Jul 30 2005 Oden Eriksson <oeriksson@mandriva.com> 2.0.54_0.21-2mdk
- fix deps

* Thu Jun 02 2005 Oden Eriksson <oeriksson@mandriva.com> 2.0.54_0.21-1mdk
- rename the package
- the conf.d directory is renamed to modules.d
- use new rpm-4.4.x pre,post magic

* Sun Mar 20 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_0.21-4mdk
- use the %%mkrel macro

* Mon Feb 28 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_0.21-3mdk
- fix %%post and %%postun to prevent double restarts
- fix bug #6574

* Wed Feb 16 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_0.21-2mdk
- spec file cleanups, remove the ADVX-build stuff

* Tue Feb  8 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_0.21-1mdk
- rebuilt for apache 2.0.53

* Mon Oct 18 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.52_0.21-2mdk
- rebuilt against latest clamav libs

* Tue Sep 28 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.52_0.21-1mdk
- built for apache 2.0.52

* Thu Sep 16 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.51_0.21-1mdk
- built for apache 2.0.51

* Mon Jul 12 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.50_0.21-1mdk
- built for apache 2.0.50
- remove redundant provides

* Mon Jun 14 2004 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.49_0.21-1mdk
- 0.21
- built for apache 2.0.49

* Tue Mar 23 2004 Michael Scherer <misc@mandrake.org> 2.0.48_0.19-1mdk 
- 0.19

* Fri Mar 19 2004 Michael Scherer <misc@mandrake.org> 2.0.48_0.18-1mdk
- 0.18
- added testing instruction in configuration file

* Fri Nov 28 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.48_0.12-1mdk
- 0.12

* Fri Nov 14 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.48_0.9-1mdk
- 0.9

* Fri Nov 14 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.48_0.8-2mdk
- rebuilt against latest clamav libs

* Wed Nov 05 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.48_0.8-1mdk
- built for apache 2.0.48
- fix invalid-build-requires
- fix explicit-lib-dependency

* Wed Aug 27 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.47_0.8-2mdk
- rebuilt against latest clamav libs

* Thu Jul 10 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.47_0.8-1mdk
- rebuilt against latest apache2, requires and buildrequires

* Mon Jun 30 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.46_0.8-1mdk
- 0.8
- fixed linking
- fixed requires & buildrequires
- added access policy to S1

* Tue Jun 24 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.46_0.7-2mdk
- rebuilt aganst new clamav

* Sat May 31 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.46_0.7-1mdk
- rebuilt for apache v2.0.46
- buildprereq ADVX-build >= 9.2

* Tue Apr 08 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.45_0.7-1mdk
- cosmetic rebuild for apache v2.0.45 

* Sun Mar 02 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.44_0.7-1mdk
- 0.7
- drop P0

* Sun Mar 02 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.43_0.5-1mdk
- initial cooker contrib