]> git.pld-linux.org Git - packages/squidGuard.git/blob - squidGuard.spec
- updated blacklist to 20050604 ; STBR
[packages/squidGuard.git] / squidGuard.spec
1 %define         blist_ver 20050604
2 %define         ver 1.2.0
3 Summary:        Filter, redirector and access controller plugin for Squid
4 Summary(pl):    Wtyczka z filtrem, przekierowywaniem i kontrolerem dostêpu dla Squida
5 Name:           squidGuard
6 Version:        %{ver}_%{blist_ver}
7 Release:        1
8 Epoch:          2
9 License:        GPL
10 Group:          Networking/Daemons
11 Source0:        ftp://ftp.teledanmark.no/pub/www/proxy/squidGuard/%{name}-%{ver}.tar.gz
12 # Source0-md5:  c6e2e9112fdbda0602656f94c1ce31fd
13 Source1:        %{name}.conf
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
26 BuildRequires:  flex
27 Requires(post,preun):   grep
28 Requires(post,preun):   squid
29 Requires(preun):        fileutils
30 Requires:       squid
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %define         _sysconfdir     /etc/%{name}
34 %define         _datadir        %{_sysconfdir}
35
36 %description
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
43   for some users,
44 - block access to URLs matching a list of regular expressions or words
45   for some users,
46 - enforce the use of domainnames/prohibit the use of IP address in
47   URLs,
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,
53   date etc,
54 - have different rules for different user groups.
55
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
59   VBscript inside HTML.
60
61 %description -l pl
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
68   u¿ytkowników,
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
72   URL-ach,
73 - przekierowania zablokowanych URL-i na "inteligentn±" stronê
74   informacyjn± w CGI,
75 - przekierowania niezarejestrowanych u¿ytkowników do formularza
76   rejestracyjnego,
77 - przekierowania ¶ci±gania popularnego oprogramowania (Netscape, MSIE)
78   na lokalne kopie,
79 - przekierowania bannerów na puste GIF-y,
80 - uzale¿nienia regu³ dostêpu w zale¿no¶ci od pory dnia, dnia tygodnia,
81   daty itp.,
82 - ró¿nych regu³ dostêpu dla ró¿nych grup u¿ytkowników.
83
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...)
88
89 %prep
90 %setup -q -n %{name}-%{ver}
91 %patch0 -p1
92 %patch1 -p1
93 %patch2 -p0
94 %patch3 -p1
95
96 %build
97 %{__libtoolize}
98 %{__gettextize}
99 %{__aclocal}
100 %{__autoconf}
101 %configure \
102         --with-sg-logdir=/var/log/%{name} \
103         --with-sg-config=%{_sysconfdir}/squidGuard.conf \
104         --with-sg-dbhome=%{_sysconfdir}/db \
105         --with-db=%{_prefix}
106
107 %{__make}
108
109 %install
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}
114
115 install src/squidGuard $RPM_BUILD_ROOT%{_bindir}
116
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
123
124 touch $RPM_BUILD_ROOT/var/log/%{name}/%{name}.{log,error}
125
126 tar zxf %{SOURCE2} -C $RPM_BUILD_ROOT%{_sysconfdir}/db
127 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}
128 rm -rf samples/dest
129
130 rm -f $(find $RPM_BUILD_ROOT%{_sysconfdir}/db -name *diff -type f)
131
132 %clean
133 rm -rf $RPM_BUILD_ROOT
134
135 %post
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
141                 fi
142 fi
143
144 %preun
145 if [ -f /etc/squid/squid.conf ]; then
146         umask 027
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
153         fi
154 fi
155
156 %files
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
163 %{_sysconfdir}/db
164 %attr(770,root,squid) %dir /var/log/%{name}
165 %attr(640,squid,squid) %ghost /var/log/%{name}/*
This page took 0.183279 seconds and 3 git commands to generate.