Sophie

Sophie

distrib > Mandriva > 2006.0 > i586 > media > main-src > by-pkgid > 61f3c09bc99c6f117b79761686bb6745 > files > 1

DansGuardian-2.8.0.6-1mdk.src.rpm

%define build_clamav 0
%{?_with_clamav: %{expand: %%global build_clamav 1}}
%{?_without_clamav: %{expand: %%global build_clamav 0}}

%define new_name dansguardian
%define AV_version 6.3.8

Summary:	A content filtering web proxy
Name:		DansGuardian
Version:	2.8.0.6
Release:	%mkrel 1
License:	GPL
Group:		System/Servers
URL:		http://www.dansguardian.org
Source0:	http://www.dansguardian.org/downloads/2/dansguardian-%{version}.source.tar.bz2
Source1:	dansguardian.init
Patch0:		dansguardian-2.8.0.4-no-static-libz.diff.bz2
# (oe) http://www.harvest.com.br/asp/afn/dg.nsf
Patch3:		dansguardian-2.8.0.4-antivirus-%{AV_version}.diff.bz2
BuildRequires:	zlib-devel
%if %{build_clamav}
BuildRequires:	clamav-devel libesmtp5-devel
%endif
Requires(pre): rpm-helper
Requires(postun): rpm-helper
Requires(pre):	squid
Requires:	webserver 
BuildRoot:	%{_tmppath}/%{new_name}-buildroot

%description
DansGuardian is a filtering proxy for Linux, FreeBSD, OpenBSD and Solaris. 
It filters using multiple methods. These methods include URL and domain 
filtering, content phrase filtering, PICS filtering, MIME filtering, file
extension filtering, POST filtering.

The content phrase filtering will check for pages that contain profanities
and phrases often associated with pornography and other undesirable content.
The POST filtering allows you to block or limit web upload.  The URL and 
domain filtering is able to handle huge lists and is significantly faster
than squidGuard.

The filtering has configurable domain, user and ip exception lists. 
SSL Tunneling is supported.

You can build %{name} with some conditional build swithes;

(ie. use with rpm --rebuild):

--with[out] clamav	ClamAV support (disabled)

%if %{build_clamav}
This is DansGuardian with http://www.pcxperience.org Anti-Virus
Plugin v%{AV_version} built with ClamAV support. The Anti-Virus
patch is now maintained by Aecio F. Neto at:

http://www.harvest.com.br/asp/afn/dg.nsf
%endif

%prep

%setup -q -n dansguardian-%{version}
%patch0 -p0
%if %{build_clamav}
%patch3 -p1
%endif

%build

export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"

./configure \
    --installprefix=%{_prefix} \
    --bindir=%{_bindir}/ \
    --sysconfdir=%{_sysconfdir}/%{new_name}/ \
    --sysvdir=%{_initrddir}/ \
    --cgidir=/var/www/cgi-bin/ \
    --mandir=%{_mandir}/ \
    --logdir=/var/log/%{new_name}/ \
    --runas_usr=squid \
    --runas_grp=squid \
    --piddir=/var/run \
    --logrotatedir=%{_sysconfdir}/logrotate.d/

%make OPTIMISE="%{optflags}" WARNING="-Wall -Wno-deprecated"

%install
rm -rf %{buildroot}

install -d %{buildroot}%{_sbindir}
install -d %{buildroot}%{_mandir}/man8
install -d %{buildroot}%{_sysconfdir}/%{new_name}
install -d %{buildroot}%{_sysconfdir}/logrotate.d
install -d %{buildroot}%{_initrddir}
install -d %{buildroot}/var/log/dansguardian
install -d %{buildroot}/var/spool/MailScanner/quarantine
install -d %{buildroot}/var/www/cgi-bin

install -d bin
PATH=$PWD/bin:$PATH
ln -sf /bin/true bin/chown

make install INSTALLPREFIX=%{buildroot} CHKCONF=nowhere
mv %{buildroot}%{_bindir}/* %{buildroot}%{_sbindir}
install %{SOURCE1} %{buildroot}%{_initrddir}/dansguardian

cat << EOF > %{buildroot}%{_sysconfdir}/logrotate.d/dansguardian
/var/log/dansguardian/access.log {
    rotate 5
    weekly
    sharedscripts
    prerotate
	service dansguardian stop
    endscript
    postrotate
	service dansguardian start
    endscript
}
EOF

# construct file lists
find %{buildroot}%{_sysconfdir}/%{new_name} -type d | \
    sed -e "s|%{buildroot}||" | sed -e 's/^/%attr(0755,squid,squid) %dir /' > %{name}.filelist

find %{buildroot}%{_sysconfdir}/%{new_name} -type f | grep -v "\.orig" | \
    sed -e "s|%{buildroot}||" | sed -e 's/^/%attr(0640,squid,squid) %config(noreplace) /' >> %{name}.filelist

cat > README.urpmi << EOF
Be sure to change your /etc/dansguardian/dansguardian.conf to reflect your own 
settings.
Special attention must be given to the port that squid listens on, 
the port that dansguardian will listen to and to the web url to the
dansguardian.pl cgi-script.

Author: Daniel Barron
daniel@jadeb.com
EOF

%preun
%{_preun_service dansguardian}
if [ $1 = 0 ] ; then
    rm -f /var/log/dansguardian/*
fi

%post
%{_post_service dansguardian}
touch /var/log/dansguardian/access.log
chown -R squid:squid /var/log/dansguardian
chmod -R u+rw /var/log/dansguardian
chmod u+rwx /var/log/dansguardian

%clean
rm -rf %{buildroot}

%files -f %{name}.filelist
%defattr(-,root,root)
%doc README INSTALL LICENSE README.urpmi
%attr(0644,squid,squid) %{_sysconfdir}/logrotate.d/dansguardian
%attr(0755,root,root) %{_initrddir}/dansguardian
%attr(0755,root,root) %{_sbindir}/%{new_name}
%attr(0644,root,root) %{_mandir}/man8/*
%attr(0755,root,root) /var/www/cgi-bin/dansguardian.pl
%attr(0755,apache,apache) /var/spool/MailScanner/quarantine
%attr(0755,squid,squid) /var/log/dansguardian

%changelog
* Sun Aug 14 2005 Oden Eriksson <oeriksson@mandriva.com> 2.8.0.6-1mdk
- 2.8.0.6 (Major bugfixes)
- fix deps
- drop the gcc4 patch (P1), it's implemented upstream

* Fri Jun 17 2005 Oden Eriksson <oeriksson@mandriva.com> 2.8.0.4-2mdk
- gcc4 fix (Frederic Lepied)
- use the %%mkrel macro
- require webserver instead of explicitly apache
- drop the requirement for perl-Mail-Sender and perl-devel
- re-added the clamav support but with a twist (P3)

* Sat Jun 11 2005 Oden Eriksson <oeriksson@mandriva.com> 2.8.0.4-1mdk
- 2.8.0.4
- drop upstream applied patches
- rediffed P0

* Tue Mar 29 2005 Frederic Lepied <flepied@mandrakesoft.com> 2.7.7.8-3mdk
- fixed some rpmlint reports
- parallel build
- rebuild to fix logrotate entry (bug #13729)

* Thu Jun 10 2004 Florin <florin@mandrakesoft.com> 2.7.7.8-2mdk
- add dan moinescu patches (perf improvement, etc)
- add the mad3 patch (clamav antivirus, etc)
- integrate the no-static-libz patch in mad3 for the moment

* Thu Jun  3 2004 Frederic Lepied <flepied@mandrakesoft.com> 2.7.7.8-1mdk
- 2.7.7-8
- removed patch0 (integrated upstream)

* Fri Aug 22 2003 Florin <florin@mandrakesoft.com> 2.7.2-0.0.2mdk
- add missing contentregexplist file and languages directory

* Wed Aug 06 2003 Florin <florin@mandrakesoft.com> 2.7.2-0.0.1mdk
- 2.7.2-0

* Tue Jun 24 2003 Florin <florin@mandrakesoft.com> 2.7.1-0.1.1mdk
- 2.7.1-1
- comment out the antivirus patch (not updated yet)

* Sun May 11 2003 Stefan van der Eijk <stefan@eijk.nu> 2.4.6-0.8.2mdk
- BuildRequires

* Mon Jan 20 2003 Florin <florin@mandrakesoft.com> 2.4.6-0.8.1mdk
- 2.4.6-8
- add the antivirus patch (thx to J. A. Pattie & F. J. Felix)
- add Prereq on rpm-helper to make rpmlint happy

* Tue Nov 26 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 2.4.6-0.6.3mdk
- Patch1: Don't statically link in with libz if we already requested
  the DSO version. And anyway, never explicitly link things with
  /usr/lib/<lib>.a, use -Wl,-Bstatic <lib> -Wl,-Bdynamic if you want.

* Mon Oct 28 2002 Florin <florin@mandrakesoft.com> 2.4.6-0.6.2mdk
- add the phraselists directory 

* Mon Oct 28 2002 Florin <florin@mandrakesoft.com> 2.4.6-0.6.1mdk
- 1.4.6-6
- update the 64 bit patch

* Tue Oct 15 2002 Florin <florin@mandrakesoft.com> 2.4.6-0.3.1mdk
- 2.4.6-3

* Tue Oct 1 2002 Florin <florin@mandrakesoft.com> 2.4.5-0.2.1mdk
- 2.4.5-2
- add missing conf files & the man page
- add the template and weighted files
- simplify the spec file

* Wed Aug 14 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 2.2.7-5mdk
- Automated rebuild with gcc 3.2-0.3mdk

* Thu Jul 25 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 2.2.7-4mdk
- Automated rebuild with gcc3.2

* Mon Jun 24 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 2.2.7-3mdk
- Patch2: C++ fixes (namespace std does not have global scope)

* Thu Mar 21 2002 Florin <florin@mandrakesoft.com> 2.2.7-2mdk
- fix the logrotation file (thx to Grim Beorn)

* Thu Mar 14 2002 Florin <florin@mandrakesoft.com> 2.2.7-1mdk
- 2.2.7

* Wed Feb 27 2002 Florin <florin@mandrakesoft.com> 2.2.6-1mdk
- 2.2.6

* Tue Feb 26 2002 Florin <florin@mandrakesoft.com> 2.2.5-2mdk
- add the running patch

* Wed Feb 13 2002 Florin <florin@mandrakesoft.com> 2.2.5-1mdk
- 2.2.5
- squid.squid instead of nobody.nobody

* Thu Jan 31 2002 Florin <florin@mandrakesoft.com> 2.2.3-3mdk
- use the right arguments in configure (it works again now)

* Sat Jan 26 2002 Jeff Garzik <jgarzik@mandrakesoft.com> 2.2.3-2mdk
- Fix build on 64-bit hosts
- Build with MDK cflags
- Pass additional arguments to ./configure (copied from %%configure)

* Mon Jan 14 2002 Florin <florin@mandrakesoft.com> 2.2.3-1mdk
- 2.2.3

* Mon Jan  7 2002 Stefan van der Eijk <stefan@eijk.nu> 2.2.2-1mdk
- 2.2.2
- Add BuildRequires

* Fri Nov 30 2001 Florin <florin@mandrakesoft.com> 2.2.1-1mdk
- use macros, variables
- fix the description
- fix the doc section
- remove useless "cd"s
- add Url tag
- bzip2 sources 
- use configure
- use /war/www/cgi-bin for cgi-dir in configure
- the cgi script is now own by apache.apache
- add requires on apache-common
- fix the package Group 
- fiw some permissions
- remove the RPM_BUILD_ROOT from post
- add preun section 
- add the _preun_service and _postun_service variables
- use _mandir for the man dir
- modify the initscript (add it as SOURCE1}

* Sun Nov 18 2001 Glen Stewart <glen_stewart@associate.com>
New 2.2.0 release.