File havp.spec of Package havp

Summary: HTTP anti-virus proxy filter
Name: havp
Version: 0.92a
Release: 1
License: GPL
Group: System Environment/Daemons
URL: http://www.server-side.de/

Packager: Dag Wieers <dag@wieers.com>, Joerg Steffens

Source: http://www.server-side.de/download/havp-%{version}.tar.gz
Source1: havp
Source2: havp.logrotate
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

#BuildRequires: httpd-devel, bzip2-devel, gmp-devel, curl-devel, clamav-devel, openssl-devel
#BuildRequires: bzip2-devel, gmp-devel, curl-devel, clamav-devel, openssl-devel
BuildRequires: perl pam-modules gzip tar patch gcc gcc-c++ binutils glibc-devel make libstdc++-devel 
BuildRequires: bzip2 curl-devel clamav openssl-devel pwdutils

%description
HAVP (HTTP AntiVirus proxy) is a proxy with an anti-virus filter.
It does not cache or filter content. At the moment the complete
traffic is scanned. The reason for this is the chance of malicious
code in nearly every filetype e.g. HTML (JavaScript) or Jpeg.

I aim to stop especially dialer or browser exploits. But writing
a http Anti Virus Proxy is a real dilemma! Huge downloads are
a problem for virus scanning proxies. A Client should not receive
data which is unchecked by the virus scanner, but big downloads
should not timeout.

%prep
%setup
#%patch0 -p0 -b .init

%{__perl} -pi.orig \
	-e 's|^# (TEMPLATEPATH) .+$|$1 /etc/havp/templates/de|;' \
	-e 's|^# (WHITELIST) .+$|$1 /etc/havp/whitelist|;' \
	-e 's|^# (BLACKLIST) .+$|$1 /etc/havp/blacklist|;' \
	etc/havp/havp.config

%build
%configure \
	--enable-ssl-tunnel

%{__make} %{?_smp_mflags}
%{__rm} etc/havp/havp.config.in


%install
%{__rm} -rf %{buildroot}
%{__install} -Dp -m0755 havp/havp %{buildroot}%{_sbindir}/havp
%{__install} -Dp -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/havp
ln -s %{_initrddir}/havp %{buildroot}/%{_sbindir}/rchavp 

%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/havp/
%{__cp} -r etc/havp/*  %{buildroot}%{_sysconfdir}/havp/
%{__install} -Dp -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/havp

%{__install} -d -m0755 %{buildroot}%{_localstatedir}/log/havp/
%{__install} -d -m0755 %{buildroot}%{_localstatedir}/run/havp/
%{__install} -d -m0755 %{buildroot}%{_localstatedir}/spool/havp/

%clean
%{__rm} -rf %{buildroot}

%pre
if ! getent group havp &>/dev/null; then
    groupadd -r havp  || \
        %logmsg "Unexpected error adding group \"havp\". Aborting installation."
fi
if ! getent passwd havp &>/dev/null; then
	/usr/sbin/useradd -r -d %{_localstatedir}/log/havp -s /bin/sh -c "havp" havp || \
		%logmsg "Unexpected error adding user \"havp\". Aborting installation."
fi

#%post
#/sbin/chkconfig --add havp

%preun
if [ $1 -eq 0 ]; then
	#/sbin/service havp stop &>/dev/null || :
	/sbin/chkconfig --del havp
fi

%postun
if [ $1 -eq 0 ]; then
	/usr/sbin/userdel  havp || %logmsg "User \"havp\" could not be deleted."
    /usr/sbin/groupdel havp || %logmsg "Group \"havp\" could not be deleted."
fi

%files
%defattr(-, root, root, 0755)
%doc ChangeLog COPYING INSTALL update-conf 
%config(noreplace) %{_sysconfdir}/havp/
%config %{_sysconfdir}/logrotate.d/havp
%config %{_initrddir}/havp
%{_sbindir}/havp
%{_sbindir}/rchavp

%defattr(-, havp, havp, 0755)
%{_localstatedir}/log/havp/
%{_localstatedir}/run/havp/
%{_localstatedir}/spool/havp/

%changelog
* Tue Nov 11 2010 Joerg Steffens - 0.92a
- Add missing dot to sourceforge for safety

* Thu Jul 26 2010 Joerg Steffens - 0.92
- Add SCANMIME and SKIPMIME options
- Add TIMEFORMAT option
- Add VIRUSLOG option
- Add PARENTUSER/PARENTPASSWORD (thanks to James Brotchie)
- DISABLELOCKINGFOR default has changed in favor of ClamAV 0.96, it only contains AVG:ALL now

* Thu Apr 12 2010 Joerg Steffens - 0.91
- Updates to release 0.91

* Thu Nov 20 2008 Joerg Steffens - 0.89
- Updates to release 0.89

* Mon Mar 17 2008 Joerg Steffens - 0.87
- Updates to release 0.87
- adapted for SLES9
- adapted to German (de) template files

* Mon Jul 23 2007 Dries Verachtert <dries@ulyssis.org> - 0.86-1 - 5633/dries
- Updated to release 0.86.

* Tue Aug 22 2006 Dag Wieers <dag@wieers.com> - 0.7.9-1
- Cosmetic changes.

* Wed May 31 2006 Bernard 'Tux' Lheureux <tux at portalinux dot org> 0.7.9-2
- Corrected the specfile to make it installable on CentOS 4.x
- Created and applied some patches to make it chkconfig compatible
- Created and applied a patch to make config reflect the correct location of the files

* Tue May 30 2006 Jim Perrin <jperrin at gmail dot com> 0.7.9-1
- Initial build for CentOS, 
- Specfile generation... still some work to do...
openSUSE Build Service is sponsored by