%define new_name dansguardian %define their_version 2.7.2-0 %define AV_version 2.7.1-0 Summary: A content filtering web proxy. Name: DansGuardian Version: 2.7.2 Release: 0.0.2mdk License: GPL Group: System/Servers Source0: http://www.dansguardian.org/downloads/2/%{name}-%{their_version}.source.tar.bz2 Source1: %{new_name}.init Patch0: %{name}-2.4.6-64bit.patch.bz2 Patch1: %{name}-2.4.6-no-static-libz.patch.bz2 Patch2: http://www.pcxperience.org/dgvirus/patches/DG2.4/%{name}-%{AV_version}-AntiVirus-4.1.patch.bz2 Url: http://www.dansguardian.org BuildRoot: %{_tmppath}/%{new_name}-buildroot BuildRequires: perl-devel BuildRequires: zlib-devel Prereq: rpm-helper Requires: apache-common squid perl-Mail-Sender %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. This is DansGuardian with http://www.pcxperience.org Anti-Virus Plugin. %prep %setup -q -n %{name}-%{their_version} %patch0 -p1 %patch1 -p1 -b .no-static-libz #%patch2 -p1 -b .antivirus %build CFLAGS="$RPM_OPT_FLAGS" \ CXXFLAGS="$RPM_OPT_FLAGS" \ ./configure --prefix= --bindir=%_bindir --sbindir=%_sbindir \ --sysconfdir=/etc/%new_name/ --sysvdir=%_initrddir \ --logdir=/var/log/%new_name/ --piddir=/var/run/ \ --runas_usr=squid --runas_grp=squid \ --mandir=%_mandir --cgidir=/var/www/cgi-bin #--mandir=%_mandir --cgidir=/var/www-naat/squidGuard make OPTIMISE="$RPM_OPT_FLAGS" WARNING="-Wall -Wno-deprecated" %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/%{_sbindir} mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man8 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/%{new_name} mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d mkdir -p $RPM_BUILD_ROOT/var/log/dansguardian mkdir -p $RPM_BUILD_ROOT/var/spool/MailScanner/quarantine mkdir -p $RPM_BUILD_ROOT/%{_initrddir} mkdir -p $RPM_BUILD_ROOT/var/www/cgi-bin install dansguardian $RPM_BUILD_ROOT/%{_sbindir}/dansguardian #original line for the antivirus patch #install dansguardian.conf banneduserlist bannediplist bannedphraselist \ # bannedextensionlist bannedmimetypelist bannedsitelist bannedurllist \ # bannedregexpurllist exceptionsitelist exceptionuserlist exceptioniplist\ # exceptionurllist exceptionphraselist pics logrotation \ # template.html weighted* \ # virusscanner virusscanner.conf logger.pl config.pl sweep.pl \ # exceptionvirusextensionlist exceptionvirusmimetypelist \ # $RPM_BUILD_ROOT/%{_sysconfdir}/%{new_name}/ install dansguardian.conf banneduserlist bannediplist bannedphraselist \ bannedextensionlist bannedmimetypelist bannedsitelist bannedurllist \ bannedregexpurllist exceptionsitelist exceptionuserlist exceptioniplist\ exceptionurllist exceptionphraselist pics contentregexplist logrotation \ template.html weighted* \ $RPM_BUILD_ROOT/%{_sysconfdir}/%{new_name}/ cp -a phraselists languages $RPM_BUILD_ROOT/%{_sysconfdir}/%{new_name}/ rm -rf $RPM_BUILD_ROOT/%{_sysconfdir}/%{new_name}/weighted*.in install %{SOURCE1} $RPM_BUILD_ROOT/%{_initrddir}/dansguardian install dansguardian.pl $RPM_BUILD_ROOT/var/www/cgi-bin/dansguardian.pl install -m 644 dansguardian.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/dansguardian.8.gz install dansguardian.pl $RPM_BUILD_ROOT/var/www/cgi-bin/ install -m 644 dansguardian.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/ cat << EOF >>$RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/dansguardian /var/log/dansguardian/access.log { rotate 5 weekly sharedscripts prerotate service dansguardian stop endscript postrotate service dansguardian start endscript } EOF find $RPM_BUILD_ROOT/ -type f -print | sed "s@^$RPM_BUILD_ROOT@@g" | grep -v "\.conf" | grep -v "banned" | grep -v "exception" | grep -v "pics" | grep -v "template\.html" | grep -v "weightedphraselist" | grep -v "var\/log\/dansguardian" | grep -v "phraselists" > dansguardian-virus-%{version}-filelist if [ "$(cat dansguardian-virus-%{version}-filelist)X" = "X" ] ; then echo "ERROR: EMPTY FILE LIST" exit -1 fi %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 echo -e " 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 " %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) #%doc README INSTALL LICENSE AntiVirusINSTALL %doc README INSTALL LICENSE %defattr(0600,squid,squid) %config(noreplace) %{_sysconfdir}/%{new_name}/* %defattr(755,root,root) %{_sbindir}/%{new_name} %{_mandir}/man8/* %config(noreplace) %{_initrddir}/dansguardian %defattr(0755,apache,apache) /var/www/cgi-bin/dansguardian.pl /var/spool/MailScanner/quarantine %defattr(-,squid,squid) /var/log/dansguardian/ %{_sysconfdir}/logrotate.d/dansguardian %changelog * 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.