File squidguard-blacklists.spec of Package squidguard-blacklists

#
# spec file for package squidguard-blacklists
#
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#

Name:           squidguard-blacklists
License:        GNU Public License
Group:          Productivity/Networking/Web/Proxy
Autoreqprov:    no
Summary:        Blacklists for squidGuard
Version:        1.0
Release:        0
Source:         squidguard-blacklists-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  pwdutils squid squidGuard
Prereq:         squid squidGuard coreutils
Vendor:         openSUSE-Education

%description
Blacklists for the for squidGuard

%prep
%setup -q

%build

%install
/usr/sbin/useradd -r -o -g nogroup -u 31 -s /bin/false -c "WWW-proxy squid" -d /var/cache/squid squid 2> /dev/null || :
cp -a * %buildroot/
if [ -f %buildroot/etc/squidGuard.conf ]; then
 mv %buildroot/etc/squidGuard.conf %buildroot/etc/squidGuard.conf.old
fi
sed -e "s#dbhome.*#dbhome %buildroot/var/lib/squidGuard/db#" %buildroot/etc/squidGuard.conf.in > %buildroot/etc/squidGuard.conf
# mkdir -p /var/log/squidGuard/
/usr/sbin/squidGuard -c %buildroot/etc/squidGuard.conf -C all
find %buildroot/var/lib/squidGuard/db -type f -name urls -exec rm {} \;
find %buildroot/var/lib/squidGuard/db -type f -name domains -exec rm {} \;
rm %buildroot/etc/squidGuard.conf

%pre
if [ -f etc/squidGuard.conf ]; then
	echo "Moving etc/squidGuard.conf to etc/squidGuard.conf-`date "+%Y%m%d"`"
	mv etc/squidGuard.conf etc/squidGuard.conf-`date "+%Y%m%d"`
fi

%post
# /usr/sbin/squidGuard -c /etc/squid/squidguard.conf -C all
#/bin/chmod 750 `find /var/lib/squidGuard/ -type d`
#/bin/chmod 640 `find /var/lib/squidGuard/ -type f`
#/bin/chown -R squid:nogroup /var/lib/squidGuard
if [ -f etc/squidGuard.conf.in ]; then
	cp etc/squidGuard.conf.in etc/squidGuard.conf
fi
%restart_on_update squid

%postun
%restart_on_update squid

%files 
%defattr(-,root,root)
/etc/squid/*
/usr/sbin/get_blacklist
/etc/squidGuard.conf.in
%defattr(640,squid,nogroup)
%dir %attr(750,squid,nogroup) /var/lib/squidGuard/db/custom
%dir %attr(750,squid,nogroup) /var/lib/squidGuard/db/custom/good
%dir %attr(750,squid,nogroup) /var/lib/squidGuard/db/custom/bad
%dir %attr(750,squid,nogroup) /var/lib/squidGuard/db/squidguard-blacklists
%dir %attr(750,squid,nogroup) /var/lib/squidGuard/db/squidguard-blacklists/*
/var/lib/squidGuard/db/squidguard-blacklists/*/*.db
/var/lib/squidGuard/db/squidguard-blacklists/*/expressions
%config(noreplace) /var/lib/squidGuard/db/custom/good/*
%config(noreplace) /var/lib/squidGuard/db/custom/bad/*

%changelog
* Sun May 20 2007 - lrupp@suse.de
- initial version 1.0
openSUSE Build Service is sponsored by