Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 7e4765023e214109c95fd809e6317890 > files > 6

dansguardian-2.10.1.1-9.mga3.src.rpm

%define clamav 0
# commandline overrides:
# rpm -ba|--rebuild --with 'xxx'
%{?_with_clamav: %{expand: %%global clamav 1}}
%{?_without_clamav: %{expand: %%global clamav 0}}


Summary:	A content filtering web proxy
Name:		dansguardian
Version:	2.10.1.1
Release:	%mkrel 9
License:	GPL
Group:		System/Servers
URL:		http://www.dansguardian.org
Source0:	http://www.dansguardian.org/downloads/2/dansguardian-%{version}.tar.gz
Source1:	dansguardian.service
Source2:	languages.tar.bz2
Patch0:		dansguardian-mdv_conf.diff
Patch1: 	dansguardian-2.10.0.3-gcc44.patch
Patch2:		dansguardian-2.10.1.1-gcc47.patch
BuildRequires:	zlib-devel
BuildRequires:	pcreposix-devel
BuildRequires:	libesmtp-devel
%if %{clamav}
BuildRequires:	clamav-devel
%endif

Requires(post): rpm-helper
Requires(preun): rpm-helper
Requires(pre): rpm-helper
Requires(postun): rpm-helper
Requires:	sendmail-command
Suggests:	webproxy webserver c-icap-server
Provides:	DansGuardian = %{version}-%{release}

%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.

%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1 -b .gcc47

# mdv design
pushd data
    tar -jxf %{SOURCE2}
popd

%build
%serverbuild

%configure2_5x \
    --localstatedir=/var/lib \
    --enable-pcre=yes \
%if %{clamav}
    --enable-clamav=yes \
%else
    --enable-clamav=no \
%endif
    --enable-clamd=yes \
    --enable-icap=yes \
    --enable-kavd=no \
    --enable-commandline=yes \
    --enable-fancydm=yes \
    --enable-trickledm=yes \
    --enable-ntlm=yes \
    --enable-email=yes \
    --enable-orig-ip=yes \
    --with-proxyuser=%{name} \
    --with-proxygroup=%{name} \
    --with-logdir=/var/log/%{name} \
    --with-piddir=/run \
    --with-sysconfsubdir=%{name}

%make

%install
install -d %{buildroot}%{_sysconfdir}/logrotate.d
install -d %{buildroot}/var/log/%{name}
install -d %{buildroot}/var/www/cgi-bin
install -d %{buildroot}/var/lib/%{name}/tmp

%makeinstall_std

# cleanup
rm -rf %{buildroot}%{_datadir}/doc/dansguardian*

install -Dpm 644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service

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

install -m0755 data/dansguardian.pl %{buildroot}/var/www/cgi-bin/

# make sure this file is present
echo "localhost" >> %{buildroot}%{_sysconfdir}/%{name}/lists/exceptionfileurllist

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

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

cat > README.urpmi << EOF
Make sure to change your /etc/%{name}/%{name}.conf to reflect your own settings.
Special attention must be given to the port that the proxy server is listening to,
the port that %{name} will listen to and to the web url to the %{name}.pl cgi-script.

Author: Daniel Barron
daniel@jadeb.com
EOF

touch %{buildroot}/var/log/%{name}/access.log

# cleanup
rm -rf %{buildroot}%{_datadir}/%{name}/scripts

%pre
%_pre_useradd %{name} /var/lib/%{name} /bin/false

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

%post
%create_ghostfile /var/log/%{name}/access.log %{name} %{name} 644
%_post_service %{name}

%postun
%_postun_userdel %{name}

%files -f %{name}.filelist
%doc AUTHORS COPYING README README.urpmi
%doc doc/AuthPlugins doc/ContentScanners doc/DownloadManagers
%doc doc/FAQ doc/FAQ.html doc/Plugins
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%{_unitdir}/%{name}.service
%attr(0755,root,root) %{_sbindir}/%{name}
%{_datadir}/%{name}
%attr(0755,root,root) /var/www/cgi-bin/%{name}.pl
%dir %attr(0755,%{name},%{name}) /var/log/%{name}
%dir %attr(0755,%{name},%{name}) /var/lib/%{name}
%dir %attr(0755,%{name},%{name}) /var/lib/%{name}/tmp
%ghost %attr(0644,%{name},%{name}) /var/log/%{name}/access.log
%attr(0644,root,root) %{_mandir}/man8/*


%changelog

* Fri Jan 11 2013 umeabot <umeabot> 2.10.1.1-9.mga3
+ Revision: 348567
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Sat Dec 01 2012 fwang <fwang> 2.10.1.1-8.mga3
+ Revision: 323736
- rebuild for new pcre

* Tue Aug 07 2012 sander85 <sander85> 2.10.1.1-7.mga3
+ Revision: 279753
- Add patch from Fedora to fix build with gcc 4.7.
- Drop SysVinit support.
- Add systemd support from Fedora.

* Thu Mar 03 2011 ennael <ennael> 2.10.1.1-6.mga1
+ Revision: 62871
- clean spec file
- imported package dansguardian