Created
May 20, 2011 14:49
-
-
Save wheresalice/983064 to your computer and use it in GitHub Desktop.
Build scripts for Squidguard 1.4 with LDAP support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sgversion=`awk '/Version/ {print $2;}' squidguard.spec` | |
wget -c `awk '/Source/ {print $2;}' squidguard.spec | sed s/%{version}/$sgversion/g` | |
cp squidGuard-$sgversion.tar.gz ~/rpmbuild/SOURCES/squidGuard-$sgversion.tar.gz | |
rpmbuild -ba squidguard.spec | |
sgrelease=`awk '/Release/ {print $2;}' squidguard.spec | cut -c 1` | |
cp ~/rpmbuild/RPMS/*/squidguard-$sgversion-$sgrelease.*.rpm . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Authority: CG | |
# Upstream: <squidguard$squidguard,org> | |
%define real_name squidGuard | |
%define dbhomedir %{_localstatedir}/lib/squidguard | |
Summary: Combined filter, redirector and access controller plugin for squid | |
Name: squidguard | |
Version: 1.4 | |
Release: 1%{?dist} | |
License: GPL | |
Group: System Environment/Daemons | |
URL: http://www.squidguard.org | |
Packager: Alice Kaerast <alice@kaerast.info> | |
Vendor: Computer Gentle Repository, http://www.computergentle.com | |
Source: http://www.squidguard.org/Downloads/squidGuard-%{version}.tar.gz | |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root | |
BuildRequires: bison, flex, perl | |
BuildRequires: db4-devel, openldap-devel | |
Requires: squid | |
Obsoletes: squidGuard | |
Provides: squidGuard | |
%description | |
squidGuard is a combined filter, redirector and access controller | |
plugin for squid. squidGuard can be used to limit or block access | |
users to a list of webservers, based on keywords. | |
%prep | |
%setup -n %{real_name}-%{version} | |
%{__perl} -pi.orig -e ' | |
s|^(dbhome) .+$|$1 \@sg_dbhome\@|; | |
s|^(logdir) .+$|$1 \@sg_logdir\@|; | |
' samples/sample.conf.in | |
%{__perl} -pi.orig -e ' | |
s|\$\(logdir\)|\$(localstatedir)/log/squidguard|; | |
s|\$\(cfgdir\)|\$(sysconfdir)/squid|; | |
' src/Makefile.in | |
%{__perl} -pi.orig -e ' | |
s|chown|#chown|g; | |
' Makefile.in | |
%{__cat} <<EOF >%{name}.logrotate | |
%{_localstatedir}/log/squid/squidguard.log { | |
missingok | |
copytruncate | |
notifempty | |
} | |
EOF | |
%build | |
%configure \ | |
--with-sg-config="%{_sysconfdir}/squid/squidguard.conf" \ | |
--with-sg-logdir="%{_localstatedir}/log/squidguard" \ | |
--with-sg-dbhome="%{dbhomedir}" \ | |
--with-ldap=yes \ | |
--with-ldap-lib=/usr | |
%{__make} %{?_smp_mflags} \ | |
LIBS="-ldb -lpthread -lldap" | |
%install | |
%{__rm} -rf %{buildroot} | |
%{__install} -d %{buildroot}%{_sysconfdir}/squid | |
%{__make} install DESTDIR="%{buildroot}" \ | |
prefix="%{buildroot}%{_prefix}" \ | |
exec_prefix="%{buildroot}%{_prefix}" \ | |
logdir="%{buildroot}%{_localstatedir}/log/squidguard" \ | |
configfile="%{buildroot}%{_sysconfdir}/squid/squidguard.conf" | |
%{__install} -Dp -m0644 squidguard.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/squidguard | |
#{__install} -Dp -m0644 samples/sample.conf %{buildroot}%{_sysconfdir}/squid/squidguard.conf | |
%{__ln_s} -f squidGuard %{buildroot}%{_bindir}/squidguard | |
%{__install} -d -m0755 \ | |
%{buildroot}%{dbhomedir} \ | |
%{buildroot}%{_localstatedir}/log/squidguard/ | |
%clean | |
%{__rm} -rf %{buildroot} | |
%files | |
%defattr(-, root, root, 0755) | |
%doc samples/sample.conf samples/squidGuard-simple.cgi samples/squidGuard.cgi | |
%doc doc/*.gif doc/*.html doc/*.txt | |
%config(noreplace) %{_sysconfdir}/squid/ | |
%config %{_sysconfdir}/logrotate.d/squidguard | |
%{_bindir}/squidGuard | |
%{_bindir}/squidguard | |
%{dbhomedir} | |
#%{_localstatedir}/log/squidguard/ | |
%changelog | |
* Wed May 25 2011 Alice Kaerast <alice@kaerast.info> - 1.4-1 | |
- Upgraded to release 1.4. | |
* Tue Mar 30 2010 Yury V. Zaytsev <yury@shurup.com> - 1.3-2 - 8724/yury | |
- Cleanups. | |
* Sun Apr 20 2008 Dries Verachtert <dries@ulyssis.org> - 1.3-1 | |
- Updated to release 1.3. | |
* Sat Apr 08 2006 Dries Verachtert <dries@ulyssis.org> - 1.2.0-2.2 | |
- Rebuild for Fedora Core 5. | |
* Tue Mar 09 2004 Dag Wieers <dag@wieers.com> - 1.2.0-2 | |
- Added patch for db4 (RHEL3 and RHFC1). (Tom Gordon) | |
* Sat Apr 12 2003 Dag Wieers <dag@wieers.com> - 1.2.0-1 | |
- Removed the default blacklists. | |
* Thu Jan 09 2003 Dag Wieers <dag@wieers.com> - 1.2.0-0 | |
- Initial package. (using DAR) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment