summaryrefslogtreecommitdiff
path: root/net-proxy/squidguard
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-proxy/squidguard
reinit the tree, so we can have metadata
Diffstat (limited to 'net-proxy/squidguard')
-rw-r--r--net-proxy/squidguard/Manifest10
-rw-r--r--net-proxy/squidguard/files/blockedsites1
-rw-r--r--net-proxy/squidguard/files/squidGuard.conf.blocksites13
-rw-r--r--net-proxy/squidguard/files/squidGuard.conf.minimal7
-rw-r--r--net-proxy/squidguard/files/squidguard-1.5_beta-gentoo.patch50
-rw-r--r--net-proxy/squidguard/files/squidguard-1.5_beta-protocol.patch130
-rw-r--r--net-proxy/squidguard/metadata.xml8
-rw-r--r--net-proxy/squidguard/squidguard-1.5_beta-r2.ebuild102
8 files changed, 321 insertions, 0 deletions
diff --git a/net-proxy/squidguard/Manifest b/net-proxy/squidguard/Manifest
new file mode 100644
index 000000000000..768deba4cbcd
--- /dev/null
+++ b/net-proxy/squidguard/Manifest
@@ -0,0 +1,10 @@
+AUX blockedsites 8 SHA256 20169b61056128def8ac7b7eb393f7933362392b8d583b610b21bd3ce5c2015f SHA512 5b7ae0ece304235c61be154d285c52a622c82270d8af3447eabb05a3705a1f6987c51cc71a14fe2b75eb48440133674f22e5700630e5a96b3097f8d10ade1479 WHIRLPOOL 0a35f86d989ae69f218dd24c8d76a7182d5ab05fdc6bfc294de2b9f46100f844246ca48fa91a9111a634900b9d29b4271423a70c87fa8722affbaab3f0572bdc
+AUX squidGuard.conf.blocksites 192 SHA256 6fab8600cbc8945f94260c68a5c4743244dd35ce195edaf3da453e284c4f8f3a SHA512 a6bab8318df1937c68c99de188c095b3deb61ae32cc0e96fe5f5652697bafa8f3591a7a239f93d3c3db84a7dfa2dab3f6c3a4e621c4b1a147bc7f1ec2d34fc19 WHIRLPOOL 9d81bc118ada60afdc766e69253dc1673df4d4f09f9b299277fc8addba24f7294d2dfbf622d826961a72ccfa2a6654e3cd329fc50d372774aa05e64ca97581f7
+AUX squidGuard.conf.minimal 61 SHA256 7070372be0dca55ade0a1beea8ac8d0461c38a8f5ef9d0a71ab47a9678f8f5df SHA512 301263fcfaf345c34b5a988ce237bc578fb48f63ab2187b5dd2f146e4cf914bf823fcce49c27f8282e745f3125e32455d9c5a5f425d40ce7785f492663eb959c WHIRLPOOL d134e5e731f64e33b0886daa4e906dab737a079a10433cfdeb616a07b56d1bd86cf2f134aab70eb3541b5be4aea47ba9168d51679bdfc12f2bb545f4459ed664
+AUX squidguard-1.5_beta-gentoo.patch 1562 SHA256 ff9969dfaa5a3f8949b7d6145cb59807c598b9a729ef9bb467c4058903437333 SHA512 bdeb6b5a526200f290ce39e3e9c7f4142eb168ec3c47cf4ec2c6dc713fd9c5915c92ca4188c9bfc8c6795f6f170ade62bca3ace0ccfa5149addb0ae932064f8a WHIRLPOOL 18117355a8c52694b7243f866622ed728ef271828c54193f704bdde1c5e207269336541042a36fa7927437215893846764f2dbe8a2298718b2f3c9ae322b5072
+AUX squidguard-1.5_beta-protocol.patch 4489 SHA256 c9618bc10309455f10d8a87ec4bd1e387d6c947797edf136b8ac0d8b567cb6fa SHA512 f8828d10b7ca55debf5aa80ef7e88741b10e9c566921fc2fd38652080fef025bff91851a14c1ee610fabce2562b1c8ca797dd9ae924a1fcc62ab95cb365ff8b1 WHIRLPOOL 090c986f59d8f6e34b663355d81ccb3a7cad4decf73af75d9ca25ddc17ac6415d6e317e12f00ef58a12e524d6af97aa3059095dd7e5ae213aa773cbcc03751c0
+DIST squidGuard-1.5-beta.tar.gz 1983030 SHA256 ba4b79cd193bd3095f3fd27a6e2fc1b36effc2e12a33e17159d4a51993fb3c8e SHA512 37ddc2ac82596e9d24aac6a610763f2eeb7c15b3a2d7babb85948e1da912aebb1dc85309766f7d8c3d7c22713e24a51f4cdef4520117a03d839662ef2494b6e7 WHIRLPOOL 6f65c6a9b23396a7c4a10f344a20cb4824e0abae451fb95a1b563084d0c9755b20f67a74d991b76a54d239ad3dbc6ba468d3c687fdbd80c31567608a927154fc
+EBUILD squidguard-1.5_beta-r2.ebuild 2276 SHA256 9462a6064adc33e3590840631e5882da42df7cdd4e2bee4095fc2d13af71d092 SHA512 fcfce62692dc0d9cac271cca6cf4a344e4c67d1e9bee780fc508ed46f84ed5ff42098ea929f72b7161f57b4f6165d1e9f45f5ed4ee886861d22e3b82c4ac6391 WHIRLPOOL 55e2502d9547521f78d6baed753ecb3e12bd70765f9aeb2f9cca7820ae028442bd6d68c7de5b7e89d098a580df681cf5762b5b2bbaa19847bb87b8309dd5246b
+MISC ChangeLog 4719 SHA256 5f2f1d47fc39226f077f0624544327f476c2fb02dd3fb51e6448b343f6c4c836 SHA512 91f7f4b217baa3f63a0dd44e520575d8a911a99995d1e7cbb1fc00ba8d29448fe720f797a3c548d9ca7b8f1bfc1f0094bb3d0467c6f139c80d5fde2a3b17573d WHIRLPOOL 2220e93a3a330a5f4bad92b940d47df02362793a9c2e36c6bb866d288a52da2805f6ac617bce075d1f28b59bdb4047b319e9c30e94d6df36049a5c4d99cf77db
+MISC ChangeLog-2015 10580 SHA256 69051cb88d2367465efa4afaf2be6a618ad508f439046503dfd2c4da991ef0a5 SHA512 f960c367c104fe4008529c563ef147b0d1925f4b09c904920dde6676a521b0afd3e40a2ca347afd7c1bcbb2d756bdcfcbfe76f7c4b017f804343d84e15b20202 WHIRLPOOL e8c11a0e893c0c1469cbc890d0b63e28877ec301fb763ea07ad8265aa364470fab2ecba62c0c3471eaa30ff6b35a88bbd25267ac1086630c29f32ee0a3b46da4
+MISC metadata.xml 247 SHA256 fb925313d1ae70feaa6db91150f34a2157b48e884e8f47d773640af149e3744b SHA512 96c55c2979dd6a4c4761fce9b5a0be387b11fcf197ef903d8680ae82f01a2caea93b1238bed1ac96d3eb250744e2149a507e0424ac017b4324f0806a54e72c4a WHIRLPOOL 142b4295733faec48b0ca9eb6d3561799ff743481aabf2b74ecf6d717d972b4961979c7b6bf32b9840cb34e47d22fe2befb9b0ef8ec0d3f28f6416069128d3c7
diff --git a/net-proxy/squidguard/files/blockedsites b/net-proxy/squidguard/files/blockedsites
new file mode 100644
index 000000000000..46279a47eed4
--- /dev/null
+++ b/net-proxy/squidguard/files/blockedsites
@@ -0,0 +1 @@
+sex.com
diff --git a/net-proxy/squidguard/files/squidGuard.conf.blocksites b/net-proxy/squidguard/files/squidGuard.conf.blocksites
new file mode 100644
index 000000000000..eaa8cdeef051
--- /dev/null
+++ b/net-proxy/squidguard/files/squidGuard.conf.blocksites
@@ -0,0 +1,13 @@
+logdir /var/log/squidGuard
+dbhome /etc/squidGuard/db
+
+dest blockedsites {
+ domainlist blockedsites
+}
+
+acl {
+ default {
+ pass !blockedsites all
+ redirect http://www.sample.com/empty.png
+ }
+}
diff --git a/net-proxy/squidguard/files/squidGuard.conf.minimal b/net-proxy/squidguard/files/squidGuard.conf.minimal
new file mode 100644
index 000000000000..3b0ebf55c766
--- /dev/null
+++ b/net-proxy/squidguard/files/squidGuard.conf.minimal
@@ -0,0 +1,7 @@
+logdir /var/log/squidGuard
+
+acl {
+ default {
+ pass all
+ }
+}
diff --git a/net-proxy/squidguard/files/squidguard-1.5_beta-gentoo.patch b/net-proxy/squidguard/files/squidguard-1.5_beta-gentoo.patch
new file mode 100644
index 000000000000..814079764a3f
--- /dev/null
+++ b/net-proxy/squidguard/files/squidguard-1.5_beta-gentoo.patch
@@ -0,0 +1,50 @@
+diff -Nru squidGuard-1.4.orig/Makefile.in squidGuard-1.4/Makefile.in
+--- squidGuard-1.4.orig/Makefile.in 2008-05-17 18:36:44.000000000 +0000
++++ squidGuard-1.4/Makefile.in 2009-01-10 13:02:14.000000000 +0000
+@@ -43,7 +43,7 @@
+ # Dependencies for installing
+ #
+
+-install: install-build install-conf
++install: install-build
+
+ install-conf:
+ @echo Installing configuration file ;
+@@ -85,10 +85,10 @@
+
+ install-build:
+ @echo Installing squidGuard
+- @if [ ! -d $(bindir) ]; then \
+- $(MKINSTALLDIRS) $(bindir) ; \
++ @if [ ! -d "$(INSTDIR)"/$(bindir) ]; then \
++ $(MKINSTALLDIRS) "$(INSTDIR)"/$(bindir) ; \
+ fi ; \
+- cp src/squidGuard $(bindir) || exit 1 ; \
++ cp src/squidGuard "$(INSTDIR)"/$(bindir) || exit 1 ; \
+ echo Done. ;
+
+ clean::
+diff -Nru squidGuard-1.4.orig/src/Makefile.in squidGuard-1.4/src/Makefile.in
+--- squidGuard-1.4.orig/src/Makefile.in 2009-01-03 20:05:39.000000000 +0000
++++ squidGuard-1.4/src/Makefile.in 2009-01-10 13:02:14.000000000 +0000
+@@ -110,6 +110,8 @@
+ mv -f y.tab.c y.tab.c.bison
+ mv -f y.tab.h y.tab.h.bison
+
++sg.y sg.l:
++
+ #
+ # Dependencies for installing
+ #
+@@ -122,8 +124,8 @@
+
+ install.bin:: squidGuard
+ @echo making $@ in `basename \`pwd\``
+- @$(MKDIR) $(bindir) $(logdir) $(cfgdir)
+- $(INSTALL_PROGRAM) squidGuard $(bindir)/squidGuard
++ @$(MKDIR) "$(INSTDIR)"/$(bindir) "$(INSTDIR)"/$(logdir) "$(INSTDIR)"/$(cfgdir)
++ $(INSTALL_PROGRAM) squidGuard "$(INSTDIR)"/$(bindir)/squidGuard
+
+ uninstall.bin::
+ @echo making $@ in `basename \`pwd\``
+diff -Nru squidGuard-1.4.orig/src/sgDb.c squidGuard-1.4/src/sgDb.c
diff --git a/net-proxy/squidguard/files/squidguard-1.5_beta-protocol.patch b/net-proxy/squidguard/files/squidguard-1.5_beta-protocol.patch
new file mode 100644
index 000000000000..289fc7563b72
--- /dev/null
+++ b/net-proxy/squidguard/files/squidguard-1.5_beta-protocol.patch
@@ -0,0 +1,130 @@
+Patch for compatibility with new(>=3.4) Squid helper protocol
+
+Bugreport: http://bugs.squid-cache.org/show_bug.cgi?id=3978
+
+diff -ur squidGuard-1.5-beta.orig/src/main.c squidGuard-1.5-beta/src/main.c
+--- squidGuard-1.5-beta.orig/src/main.c 2013-12-12 11:47:31.000000000 +1300
++++ squidGuard-1.5-beta/src/main.c 2013-12-12 11:50:38.000000000 +1300
+@@ -185,7 +185,7 @@
+ sgReloadConfig();
+ }
+ if(failsafe_mode) {
+- puts("");
++ puts("ERR message=\"squidGuard failsafe mode\"");
+ fflush(stdout);
+ if(sig_hup){
+ sgReloadConfig();
+@@ -194,7 +194,7 @@
+ }
+ if(parseLine(buf,&squidInfo) != 1){
+ sgLogError("ERROR: Error parsing squid line: %s",buf);
+- puts("");
++ puts("BH message=\"squidGuard error parsing squid line\"");
+ }
+ else {
+ src = Source;
+@@ -206,14 +206,14 @@
+ acl = sgAclCheckSource(src);
+ if((redirect = sgAclAccess(src,acl,&squidInfo)) == NULL){
+ if(src == NULL || src->cont_search == 0){
+- puts("");
++ puts("ERR");
+ break;
+ } else
+ if(src->next != NULL){
+ src = src->next;
+ continue;
+ } else {
+- puts("");
++ puts("ERR");
+ break;
+ }
+ } else {
+@@ -228,6 +228,10 @@
+ fprintf(stdout,"%s %s/%s %s %s\n",redirect,squidInfo.src,
+ squidInfo.srcDomain,squidInfo.ident,
+ squidInfo.method);
++ if (isdigit(redirect[0]) && isdigit(redirect[1]) && isdigit(redirect[2]) && redirect[3]==':') {
++ fprintf(stdout,"OK status=%c%c%c url=\"%s\"\n", redirect[0], redirect[1], redirect[2], &redirect[4]);
++ } else
++ fprintf(stdout,"OK rewrite-url=\"%s\"\n",redirect);
+ /* sgLogDebug("DEBUG: %s %s/%s %s %s\n",redirect,squidInfo.src,squidInfo.srcDomain,squidInfo.ident,squidInfo.method); */
+ break;
+ }
+diff -ur squidGuard-1.5-beta.orig/src/main.c.in squidGuard-1.5-beta/src/main.c.in
+--- squidGuard-1.5-beta.orig/src/main.c.in 2013-12-12 11:47:31.000000000 +1300
++++ squidGuard-1.5-beta/src/main.c.in 2013-12-12 11:53:18.000000000 +1300
+@@ -185,7 +185,7 @@
+ sgReloadConfig();
+ }
+ if(failsafe_mode) {
+- puts("");
++ puts("ERR message=\"squidGuard failsafe mode\"");
+ fflush(stdout);
+ if(sig_hup){
+ sgReloadConfig();
+@@ -194,7 +194,7 @@
+ }
+ if(parseLine(buf,&squidInfo) != 1){
+ sgLogError("ERROR: Error parsing squid line: %s",buf);
+- puts("");
++ puts("BH message=\"squidGuard error parsing squid line\"");
+ }
+ else {
+ src = Source;
+@@ -206,14 +206,14 @@
+ acl = sgAclCheckSource(src);
+ if((redirect = sgAclAccess(src,acl,&squidInfo)) == NULL){
+ if(src == NULL || src->cont_search == 0){
+- puts("");
++ puts("ERR");
+ break;
+ } else
+ if(src->next != NULL){
+ src = src->next;
+ continue;
+ } else {
+- puts("");
++ puts("ERR");
+ break;
+ }
+ } else {
+@@ -225,9 +225,11 @@
+ squidInfo.ident[0] = '-';
+ squidInfo.ident[1] = '\0';
+ }
+- fprintf(stdout,"%s %s/%s %s %s\n",redirect,squidInfo.src,
+- squidInfo.srcDomain,squidInfo.ident,
+- squidInfo.method);
++ if (isdigit(redirect[0]) && isdigit(redirect[1]) && isdigit(redirect[2]) && redirect[3]==':') {
++ fprintf(stdout,"OK status=%c%c%c url=\"%s\"\n", redirect[0], redirect[1], redirect[2], &redirect[4]);
++ } else
++ fprintf(stdout,"OK rewrite-url=\"%s\"\n",redirect);
++
+ /* sgLogDebug("DEBUG: %s %s/%s %s %s\n",redirect,squidInfo.src,squidInfo.srcDomain,squidInfo.ident,squidInfo.method); */
+ break;
+ }
+diff -ur squidGuard-1.5-beta.orig/src/sgDiv.c squidGuard-1.5-beta/src/sgDiv.c
+--- squidGuard-1.5-beta.orig/src/sgDiv.c 2013-12-12 11:47:31.000000000 +1300
++++ squidGuard-1.5-beta/src/sgDiv.c 2013-12-12 11:48:36.000000000 +1300
+@@ -782,7 +782,7 @@
+ }
+ sgLogError("ERROR: Going into emergency mode");
+ while(fgets(buf, MAX_BUF, stdin) != NULL){
+- puts("");
++ puts("ERR");
+ fflush(stdout);
+ }
+ sgLogError("ERROR: Ending emergency mode, stdin empty");
+diff -ur squidGuard-1.5-beta.orig/src/sgDiv.c.in squidGuard-1.5-beta/src/sgDiv.c.in
+--- squidGuard-1.5-beta.orig/src/sgDiv.c.in 2013-12-12 11:47:31.000000000 +1300
++++ squidGuard-1.5-beta/src/sgDiv.c.in 2013-12-12 11:48:36.000000000 +1300
+@@ -782,7 +782,7 @@
+ }
+ sgLogError("ERROR: Going into emergency mode");
+ while(fgets(buf, MAX_BUF, stdin) != NULL){
+- puts("");
++ puts("ERR");
+ fflush(stdout);
+ }
+ sgLogError("ERROR: Ending emergency mode, stdin empty");
diff --git a/net-proxy/squidguard/metadata.xml b/net-proxy/squidguard/metadata.xml
new file mode 100644
index 000000000000..5b159fbcadd1
--- /dev/null
+++ b/net-proxy/squidguard/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>pinkbyte@gentoo.org</email>
+ <name>Sergey Popov</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/net-proxy/squidguard/squidguard-1.5_beta-r2.ebuild b/net-proxy/squidguard/squidguard-1.5_beta-r2.ebuild
new file mode 100644
index 000000000000..235a6ac00ed2
--- /dev/null
+++ b/net-proxy/squidguard/squidguard-1.5_beta-r2.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+WANT_AUTOMAKE=none
+
+inherit autotools db-use eutils user
+
+MY_P="squidGuard-${PV/_/-}"
+
+DESCRIPTION="Combined filter, redirector and access controller plugin for Squid"
+HOMEPAGE="http://www.squidguard.org"
+SRC_URI="http://www.squidguard.org/Downloads/Devel/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ppc ppc64 sparc x86"
+
+IUSE="ldap"
+
+RDEPEND="|| (
+ sys-libs/db:4.8
+ sys-libs/db:4.7
+ sys-libs/db:4.6
+ sys-libs/db:4.5
+ sys-libs/db:4.4
+ sys-libs/db:4.3
+ sys-libs/db:4.2
+ )
+ ldap? ( net-nds/openldap:0 )"
+
+DEPEND="${RDEPEND}
+ sys-devel/bison:0
+ sys-devel/flex:0"
+
+S="${WORKDIR}/${MY_P}"
+
+suitable_db_version() {
+ local tested_slots="4.8 4.7 4.6 4.5 4.4 4.3 4.2"
+ for ver in ${tested_slots}; do
+ if [[ -n $(db_findver sys-libs/db:${ver}) ]]; then
+ echo ${ver}
+ return 0
+ fi
+ done
+ die "No suitable BerkDB versions found, aborting"
+}
+
+pkg_setup() {
+ enewgroup squid
+ enewuser squid -1 -1 /var/cache/squid squid
+}
+
+src_prepare() {
+ mv configure.in configure.ac || die
+ epatch \
+ "${FILESDIR}/${P}-gentoo.patch" \
+ "${FILESDIR}/${P}-protocol.patch"
+
+ # Link only with specific BerkDB versions
+ db_version="$(suitable_db_version)"
+ sed -i -e "/\$LIBS -ldb/s/-ldb/-l$(db_libname ${db_version})/" configure.ac || die
+
+ eapply_user
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with ldap) \
+ --with-db-inc="$(db_includedir ${db_version})" \
+ --with-sg-config=/etc/squidGuard/squidGuard.conf \
+ --with-sg-logdir=/var/log/squidGuard
+}
+
+src_install() {
+ emake prefix="/usr" INSTDIR="${D}" install
+
+ keepdir /var/log/squidGuard
+ fowners squid:squid /var/log/squidGuard
+
+ insinto /etc/squidGuard/sample
+ doins "${FILESDIR}"/squidGuard.conf.*
+ insinto /etc/squidGuard/sample/db
+ doins "${FILESDIR}"/blockedsites
+
+ dodoc ANNOUNCE CHANGELOG README
+ docinto html
+ dodoc doc/*.html
+ docinto text
+ dodoc doc/*.txt
+}
+
+pkg_postinst() {
+ einfo "To enable squidGuard, add the following lines to /etc/squid/squid.conf:"
+ einfo " url_rewrite_program /usr/bin/squidGuard"
+ einfo " url_rewrite_children 10"
+ einfo ""
+ einfo "Remember to edit /etc/squidGuard/squidGuard.conf first!"
+ einfo "Examples can be found in /etc/squidGuard/sample/"
+}