SF.net SVN: gar:[23531] csw/mgar/pkg/squidguard/trunk
dmichelsen at users.sourceforge.net
dmichelsen at users.sourceforge.net
Thu May 1 16:14:27 CEST 2014
Revision: 23531
http://sourceforge.net/p/gar/code/23531
Author: dmichelsen
Date: 2014-05-01 14:14:24 +0000 (Thu, 01 May 2014)
Log Message:
-----------
squidguard/trunk: Allow for new syntax of squid helpers as reported in squid bug #3978
Modified Paths:
--------------
csw/mgar/pkg/squidguard/trunk/Makefile
Added Paths:
-----------
csw/mgar/pkg/squidguard/trunk/files/0001-Allow-options-for-LEX.patch
csw/mgar/pkg/squidguard/trunk/files/bug3978-attachment2988.patch
Modified: csw/mgar/pkg/squidguard/trunk/Makefile
===================================================================
--- csw/mgar/pkg/squidguard/trunk/Makefile 2014-05-01 06:28:58 UTC (rev 23530)
+++ csw/mgar/pkg/squidguard/trunk/Makefile 2014-05-01 14:14:24 UTC (rev 23531)
@@ -10,40 +10,38 @@
MASTER_SITES = http://squidguard.org/Downloads/
MASTER_SITES += http://squidguard.org/Downloads/Patches/1.4/
+
DISTNAME = squidGuard-$(PKGVERSION)
DISTFILES = $(DISTNAME).tar.gz
+PATCHFILES += 0001-Allow-options-for-LEX.patch
+
# These files do patch the source, but they are not in "patch-format"
SQUIDGUARDPATCHES += squidGuard-1.4-patch-20091015.tar.gz
SQUIDGUARDPATCHES += squidGuard-1.4-patch-20091019.tar.gz
DISTFILES += $(SQUIDGUARDPATCHES)
NOEXTRACT += $(SQUIDGUARDPATCHES)
+# This patch is for the new Squid helper format
+# http://bugs.squid-cache.org/show_bug.cgi?id=3978
+DISTFILES += bug3978-attachment2988.patch
+
# File name regex to get notifications about upstream software releases
UFILES_REGEX = $(NAME)-(\d+(?:\.\d+)*).tar.gz
VENDOR_URL = http://squidguard.org/
+BUILD_DEP_PKGS += CSWbison
+BUILD_DEP_PKGS += CSWflex
+BUILD_DEP_PKGS += CSWbdb48devel
+BUILD_DEP_PKGS += CSWopenldap-dev
+
PACKAGES += CSWsquidguard
SPKG_DESC_CSWsquidguard = URL redirector used to use blacklists with the proxysoftware Squid
# PKGFILES is catchall
RUNTIME_DEP_PKGS_CSWsquidguard += CSWbdb48
RUNTIME_DEP_PKGS_CSWsquidguard += CSWlibldap2-4-2
-# Just docs, leave for now
-CHECKPKG_OVERRIDES_CSWsquidguard += file-with-bad-content|/usr/local|root/opt/csw/share/doc/squidguard/configure.txt
-CHECKPKG_OVERRIDES_CSWsquidguard += file-with-bad-content|/usr/local|root/opt/csw/share/doc/squidguard/features.txt
-CHECKPKG_OVERRIDES_CSWsquidguard += file-with-bad-content|/usr/local|root/opt/csw/share/doc/squidguard/features.html
-CHECKPKG_OVERRIDES_CSWsquidguard += file-with-bad-content|/usr/local|root/opt/csw/share/doc/squidguard/faq.txt
-CHECKPKG_OVERRIDES_CSWsquidguard += file-with-bad-content|/usr/local|root/opt/csw/share/doc/squidguard/installation.html
-CHECKPKG_OVERRIDES_CSWsquidguard += file-with-bad-content|/usr/local|root/opt/csw/share/doc/squidguard/configuration.txt
-CHECKPKG_OVERRIDES_CSWsquidguard += file-with-bad-content|/usr/local|root/opt/csw/share/doc/squidguard/install.txt
-CHECKPKG_OVERRIDES_CSWsquidguard += file-with-bad-content|/usr/local|root/opt/csw/share/doc/squidguard/configure.html
-CHECKPKG_OVERRIDES_CSWsquidguard += file-with-bad-content|/usr/local|root/opt/csw/share/doc/squidguard/configuration.html
-CHECKPKG_OVERRIDES_CSWsquidguard += file-with-bad-content|/usr/local|root/opt/csw/share/doc/squidguard/install.html
-CHECKPKG_OVERRIDES_CSWsquidguard += file-with-bad-content|/usr/local|root/opt/csw/share/doc/squidguard/faq.html
-CHECKPKG_OVERRIDES_CSWsquidguard += file-with-bad-content|/usr/local|root/opt/csw/share/doc/squidguard/installation.txt
-
REINPLACEMENTS += nochown
REINPLACE_MATCH_nochown = (.*)(chown.*)
REINPLACE_WITH_nochown = \1\# \2
@@ -66,6 +64,9 @@
CONFIGURE_ARGS += --with-sg-logdir=$(SQUIDGUARD_LOG)
CONFIGURE_ARGS += --with-sg-dbhome=$(SQUIDGUARD_DB)
+EXTRA_CONFIGURE_EXPORTS += LEX
+CONFIGURE_ENV_LEX = $(bindir_install)/flex --noansi-definitions
+
PRESERVECONF += $(SQUIDGUARD_CONF)
MIGRATE_FILES += squidGuard.conf
@@ -85,12 +86,14 @@
include gar/category.mk
-post-extract-modulated:
+post-extract:
-gzip -c -d $(DOWNLOADDIR)/squidGuard-1.4-patch-20091015.tar.gz | (cd $(WORKSRC) && tar xvf -)
-gzip -c -d $(DOWNLOADDIR)/squidGuard-1.4-patch-20091019.tar.gz | (cd $(WORKSRC) && tar xvf -)
+ cd $(WORKSRC) && gpatch -p1 <../bug3978-attachment2988.patch
+ cd $(WORKSRC)/test && perl -i.orig -npe 'if(/^$$/){s/^$$/ERR/}else{s/([^ ]*).*/OK rewrite-url="$$1"/}' test1.expected test2.expected
@$(MAKECOOKIE)
-post-install-modulated:
+post-install:
ginstall -d $(DESTDIR)$(sharedstatedir)/doc/squidguard
ginstall $(WORKSRC)/doc/* $(DESTDIR)$(sharedstatedir)/doc/squidguard
@$(MAKECOOKIE)
Added: csw/mgar/pkg/squidguard/trunk/files/0001-Allow-options-for-LEX.patch
===================================================================
--- csw/mgar/pkg/squidguard/trunk/files/0001-Allow-options-for-LEX.patch (rev 0)
+++ csw/mgar/pkg/squidguard/trunk/files/0001-Allow-options-for-LEX.patch 2014-05-01 14:14:24 UTC (rev 23531)
@@ -0,0 +1,25 @@
+From f6380127e08a6cfa0f20169eb9166d2c71e11649 Mon Sep 17 00:00:00 2001
+From: Dagobert Michelsen <dam at opencsw.org>
+Date: Thu, 1 May 2014 15:45:40 +0200
+Subject: [PATCH] Allow options for LEX
+
+---
+ src/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Makefile.in b/src/Makefile.in
+index 44754ec..9117e1b 100644
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -77,7 +77,7 @@ y.tab.o: y.tab.c y.tab.h sg.h sgEx.h
+ $(COMPILE) -c y.tab.c
+
+ lex.yy.c: sg.l sg.h
+- @if [ $(LEX) != ":" ]; then \
++ @if [ "$(LEX)" != ":" ]; then \
+ $(LEX) sg.l ; \
+ else \
+ echo " " ; \
+--
+1.8.4.1
+
Added: csw/mgar/pkg/squidguard/trunk/files/bug3978-attachment2988.patch
===================================================================
--- csw/mgar/pkg/squidguard/trunk/files/bug3978-attachment2988.patch (rev 0)
+++ csw/mgar/pkg/squidguard/trunk/files/bug3978-attachment2988.patch 2014-05-01 14:14:24 UTC (rev 23531)
@@ -0,0 +1,76 @@
+diff -urN squidGuard-1.4.orig/src/main.c squidGuard-1.4.upgraded/src/main.c
+--- squidGuard-1.4.orig/src/main.c 2013-12-11 17:42:15.000000000 +1300
++++ squidGuard-1.4.upgraded/src/main.c 2013-12-11 19:04:09.000000000 +1300
+@@ -175,7 +175,7 @@
+ sgReloadConfig();
+ }
+ if(failsafe_mode) {
+- puts("");
++ puts("ERR message=\"squidGuard failsafe mode\"");
+ fflush(stdout);
+ if(sig_hup){
+ sgReloadConfig();
+@@ -184,7 +184,7 @@
+ }
+ if(parseLine(buf,&squidInfo) != 1){
+ sgLogError("Error parsing squid line: %s",buf);
+- puts("");
++ puts("BH message=\"squidGuard error parsing squid line\"");
+ }
+ else {
+ src = Source;
+@@ -196,14 +196,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 {
+@@ -215,9 +215,10 @@
+ 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);
+ /* sgLogError("%s %s/%s %s %s\n",redirect,squidInfo.src,squidInfo.srcDomain,squidInfo.ident,squidInfo.method); */
+ break;
+ }
+diff -urN squidGuard-1.4.orig/src/sgDiv.c squidGuard-1.4.upgraded/src/sgDiv.c
+--- squidGuard-1.4.orig/src/sgDiv.c 2013-12-11 17:42:15.000000000 +1300
++++ squidGuard-1.4.upgraded/src/sgDiv.c 2013-12-11 18:58:33.000000000 +1300
+@@ -771,7 +771,7 @@
+ }
+ sgLogError("Going into emergency mode");
+ while(fgets(buf, MAX_BUF, stdin) != NULL){
+- puts("");
++ puts("ERR");
+ fflush(stdout);
+ }
+ sgLogError("ending emergency mode, stdin empty");
+diff -urN squidGuard-1.4.orig/src/sgDiv.c.in squidGuard-1.4.upgraded/src/sgDiv.c.in
+--- squidGuard-1.4.orig/src/sgDiv.c.in 2013-12-11 17:42:15.000000000 +1300
++++ squidGuard-1.4.upgraded/src/sgDiv.c.in 2013-12-11 18:58:40.000000000 +1300
+@@ -782,7 +782,7 @@
+ }
+ sgLogError("Going into emergency mode");
+ while(fgets(buf, MAX_BUF, stdin) != NULL){
+- puts("");
++ puts("ERR");
+ fflush(stdout);
+ }
+ sgLogError("ending emergency mode, stdin empty");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list