1 %define blist_ver 20050604
3 Summary: Filter, redirector and access controller plugin for Squid
4 Summary(pl): Wtyczka z filtrem, przekierowywaniem i kontrolerem dostêpu dla Squida
6 Version: %{ver}_%{blist_ver}
10 Group: Networking/Daemons
11 Source0: ftp://ftp.teledanmark.no/pub/www/proxy/squidGuard/%{name}-%{ver}.tar.gz
12 # Source0-md5: c6e2e9112fdbda0602656f94c1ce31fd
14 Source2: ftp://ftp.teledanmark.no/pub/www/proxy/squidGuard/contrib/blacklists-%{blist_ver}.tar.gz
15 # Source2-md5: faffe58ff39c2dba0f99ca11588d817d
16 Patch0: %{name}-makefile.patch
17 Patch1: %{name}-1.2.0-db4.patch
18 Patch2: %{name}-1.2.0-db41.patch
19 Patch3: %{name}-1.2.0-db42.patch
20 URL: http://www.squidguard.org/
21 BuildRequires: autoconf
22 BuildRequires: automake
23 BuildRequires: db-devel
24 BuildRequires: gettext-devel
25 BuildRequires: libtool
27 Requires(post,preun): grep
28 Requires(post,preun): squid
29 Requires(preun): fileutils
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 %define _sysconfdir /etc/%{name}
34 %define _datadir %{_sysconfdir}
37 SquidGuard is a combined filter, redirector and access controller
38 plugin for Squid. It is free, very flexible, extremely fast, easily
39 installed, portable. SquidGuard can be used to:
40 - limit the web access for some users to a list of accepted/well known
41 web servers and/or URLs only,
42 - block access to some listed or blacklisted web servers and/or URLs
44 - block access to URLs matching a list of regular expressions or words
46 - enforce the use of domainnames/prohibit the use of IP address in
48 - redirect blocked URLs to an "intelligent" CGI based info page,
49 - redirect unregistered user to a registration form,
50 - redirect popular downloads like Netscape, MSIE etc. to local copies,
51 - redirect banners to an empty GIF,
52 - have different access rules based on time of day, day of the week,
54 - have different rules for different user groups.
56 Neither squidGuard nor Squid can be used to:
57 - filter/censor/edit text inside documents,
58 - filter/censor/edit embeded scripting languages like JavaScript or
62 SquidGuard jest wtyczk± dla Squida bêd±c± po³±czonym filtrem,
63 przekierowywaniem i kontrolerem dostêpu. Jest darmowy, elastyczny,
64 bardzo szybki, ³atwo instalowalny, przeno¶ny. Mo¿e byæ u¿ywany do:
65 - ograniczenia dostêpu do WWW dla niektórych u¿ytkowników na podstawie
66 listy akceptowanych serwerów lub URL-i,
67 - blokowania dostêpu do niektórych serwerów lub URL-i dla niektórych
69 - blokowania dostêpu do URL na podstawie wyra¿eñ regularnych lub
70 s³ów dla niektórych u¿ytkowników,
71 - narzucenia u¿ywania nazw domen/zabronienia u¿ywania adresów IP w
73 - przekierowania zablokowanych URL-i na "inteligentn±" stronê
75 - przekierowania niezarejestrowanych u¿ytkowników do formularza
77 - przekierowania ¶ci±gania popularnego oprogramowania (Netscape, MSIE)
79 - przekierowania bannerów na puste GIF-y,
80 - uzale¿nienia regu³ dostêpu w zale¿no¶ci od pory dnia, dnia tygodnia,
82 - ró¿nych regu³ dostêpu dla ró¿nych grup u¿ytkowników.
84 Natomiast ani squidGuard ani Squid nie mo¿e byæ u¿yty do:
85 - filtrowania/cenzurowania/edycji tekstu wewn±trz dokumentu,
86 - filtrowania/cenzurowania/edycji osadzonych w HTML skryptów
87 (JavaScript, VBscript...)
90 %setup -q -n %{name}-%{ver}
102 --with-sg-logdir=/var/log/%{name} \
103 --with-sg-config=%{_sysconfdir}/squidGuard.conf \
104 --with-sg-dbhome=%{_sysconfdir}/db \
110 rm -rf $RPM_BUILD_ROOT
111 install -d $RPM_BUILD_ROOT{/var/log/%{name},%{_bindir}} \
112 $RPM_BUILD_ROOT%{_sysconfdir}/db/{advertising,bannedsource,banneddestination} \
113 $RPM_BUILD_ROOT%{_sysconfdir}/db/{timerestriction,lansource,privilegedsource}
115 install src/squidGuard $RPM_BUILD_ROOT%{_bindir}
117 touch $RPM_BUILD_ROOT%{_sysconfdir}/db/advertising/{domains,urls}
118 touch $RPM_BUILD_ROOT%{_sysconfdir}/db/banneddestination/{domains,urls,expressions}
119 touch $RPM_BUILD_ROOT%{_sysconfdir}/db/bannedsource/ips
120 touch $RPM_BUILD_ROOT%{_sysconfdir}/db/lansource/lan
121 touch $RPM_BUILD_ROOT%{_sysconfdir}/db/timerestriction/lan
122 touch $RPM_BUILD_ROOT%{_sysconfdir}/db/privilegedsource/ips
124 touch $RPM_BUILD_ROOT/var/log/%{name}/%{name}.{log,error}
126 tar zxf %{SOURCE2} -C $RPM_BUILD_ROOT%{_sysconfdir}/db
127 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}
130 rm -f $(find $RPM_BUILD_ROOT%{_sysconfdir}/db -name *diff -type f)
133 rm -rf $RPM_BUILD_ROOT
136 if [ -f /etc/squid/squid.conf ] && \
137 ! grep -q "^redirect_program.*%{_bindir}/%{name}" /etc/squid/squid.conf; then
138 echo "redirect_program /usr/bin/squidGuard -c /etc/squidGuard/squidGuard.conf" >>/etc/squid/squid.conf
139 if [ -f /var/lock/subsys/squid ]; then
140 /etc/rc.d/init.d/squid reload 1>&2
145 if [ -f /etc/squid/squid.conf ]; then
147 grep -E -v "^redirect_program.*%{_bindir}/%{name}" /etc/squid/squid.conf > \
148 /etc/squid/squid.conf.tmp
149 mv -f /etc/squid/squid.conf.tmp /etc/squid/squid.conf
150 chown root:squid /etc/squid/squid.conf
151 if [ -f /var/lock/subsys/squid ]; then
152 /etc/rc.d/init.d/squid reload 1>&2
157 %defattr(644,root,root,755)
158 %doc README ANNOUNCE samples/* doc/*.{html,gif,txt}
159 %doc contrib/{squidGuardRobot/{squidGuardRobot,RobotUserAgent.pm},sgclean/sgclean,hostbyname/hostbyname}
160 %attr(755,root,root) %{_bindir}/*
161 %attr(750,root,squid) %dir %{_sysconfdir}
162 %attr(640,root,squid) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/squidGuard.conf
164 %attr(770,root,squid) %dir /var/log/%{name}
165 %attr(640,squid,squid) %ghost /var/log/%{name}/*