diff options
author | madpilot <madpilot@FreeBSD.org> | 2014-09-20 05:33:26 +0800 |
---|---|---|
committer | madpilot <madpilot@FreeBSD.org> | 2014-09-20 05:33:26 +0800 |
commit | 96d46ebb0295d59f95ecd34293770f3f0569a1aa (patch) | |
tree | 641d292e72ef194eec0971aad34d6a4ce4482fe0 /www | |
parent | 7e7f07914c55318273716be2290b96486157fc3c (diff) | |
download | freebsd-ports-gnome-96d46ebb0295d59f95ecd34293770f3f0569a1aa.tar.gz freebsd-ports-gnome-96d46ebb0295d59f95ecd34293770f3f0569a1aa.tar.zst freebsd-ports-gnome-96d46ebb0295d59f95ecd34293770f3f0569a1aa.zip |
- Import patch from upstream to allow squidguard to work correctly
with squid 3.4 [1]
- Put back the option to choose on which squid version to depend,
which also controls if the above patch is applied, to allow using
squid33 until it expires
- While here, take advantage of option helpers to simplify Makefile
a little
- Canonicalize patch filenames
PR: 193771 [1]
Submitted by: adrik@salesmanager.nl
Diffstat (limited to 'www')
-rw-r--r-- | www/squidguard/Makefile | 20 | ||||
-rw-r--r-- | www/squidguard/files/extrapatch-squid34 | 76 | ||||
-rw-r--r-- | www/squidguard/files/patch-samples__sample.conf.in (renamed from www/squidguard/files/patch-sample_sample.conf.in) | 0 | ||||
-rw-r--r-- | www/squidguard/files/patch-src__main.c (renamed from www/squidguard/files/patch-src_main.c) | 0 | ||||
-rw-r--r-- | www/squidguard/files/patch-src__sgDb.c (renamed from www/squidguard/files/patch-src_sgDB.c) | 0 |
5 files changed, 87 insertions, 9 deletions
diff --git a/www/squidguard/Makefile b/www/squidguard/Makefile index 4286716135c6..4a8aa15eb060 100644 --- a/www/squidguard/Makefile +++ b/www/squidguard/Makefile @@ -2,7 +2,7 @@ PORTNAME= squidGuard PORTVERSION= 1.4 -PORTREVISION= 14 +PORTREVISION= 15 CATEGORIES= www MASTER_SITES= http://www.squidguard.org/Downloads/:a \ http://www.squidguard.org/Downloads/Contrib/:b @@ -17,8 +17,6 @@ COMMENT= Fast redirector for squid LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING -RUN_DEPENDS= ${LOCALBASE}/sbin/squid:${PORTSDIR}/www/squid - USE_BDB= yes GNU_CONFIGURE= yes CONFIGURE_ARGS= --with-db-inc=${BDB_INCLUDE_DIR} \ @@ -44,12 +42,22 @@ SUB_FILES= pkg-deinstall pkg-message SUB_LIST= PORTNAME=${PORTNAME} OPTIONS_DEFINE= DNS_BL DOCS EXAMPLES LDAP QUOTE_STRING +OPTIONS_SINGLE= SV +OPTIONS_SINGLE_SV= SQUID34 SQUID33 +OPTIONS_DEFAULT= SQUID34 EXAMPLES_DESC= Install sample blacklists DNS_BL_DESC= Enable DNS based blacklists QUOTE_STRING_DESC= Add quoted string patch +SQUID33_DESC= Depend on Squid 3.3 (DEPERCATED) +SQUID34_DESC= Depend on Squid 3.4 OPTIONS_SUB= yes +SQUID33_RUN_DEPENDS= ${LOCALBASE}/sbin/squid:${PORTSDIR}/www/squid33 +SQUID34_RUN_DEPENDS= ${LOCALBASE}/sbin/squid:${PORTSDIR}/www/squid +SQUID34_EXTRA_PATCHES= ${FILESDIR}/extrapatch-squid34:-p1 +QUOTE_STRING_EXTRA_PATCHES= ${DISTDIR}/squidGuard-1.4-quoted_string_support.diff:-p2 +DNS_BL_EXTRA_PATCHES= ${DISTDIR}/squidGuard-1.4-dnsbl.patch:-p1 LDAP_CONFIGURE_ON= --with-ldap LDAP_CONFIGURE_OFF= --without-ldap LDAP_LDFLAGS= -L${LOCALBASE}/lib @@ -71,12 +79,6 @@ post-patch: ${REINPLACE_CMD} -E -e 's,(db_version),\1_4002,g' \ ${WRKSRC}/configure ; \ fi -.if ${PORT_OPTIONS:MQUOTE_STRING} - ${PATCH} -d ${WRKSRC} --forward --quiet -p2 <${DISTDIR}/squidGuard-1.4-quoted_string_support.diff -.endif -.if ${PORT_OPTIONS:MDNS_BL} - ${PATCH} -d ${WRKSRC} --forward --quiet -p1 <${DISTDIR}/squidGuard-1.4-dnsbl.patch -.endif post-build: .if ${PORT_OPTIONS:MEXAMPLES} diff --git a/www/squidguard/files/extrapatch-squid34 b/www/squidguard/files/extrapatch-squid34 new file mode 100644 index 000000000000..a9ef0681ab22 --- /dev/null +++ b/www/squidguard/files/extrapatch-squid34 @@ -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"); diff --git a/www/squidguard/files/patch-sample_sample.conf.in b/www/squidguard/files/patch-samples__sample.conf.in index 843f8e8db421..843f8e8db421 100644 --- a/www/squidguard/files/patch-sample_sample.conf.in +++ b/www/squidguard/files/patch-samples__sample.conf.in diff --git a/www/squidguard/files/patch-src_main.c b/www/squidguard/files/patch-src__main.c index 29e243171aa8..29e243171aa8 100644 --- a/www/squidguard/files/patch-src_main.c +++ b/www/squidguard/files/patch-src__main.c diff --git a/www/squidguard/files/patch-src_sgDB.c b/www/squidguard/files/patch-src__sgDb.c index 47e600da11d0..47e600da11d0 100644 --- a/www/squidguard/files/patch-src_sgDB.c +++ b/www/squidguard/files/patch-src__sgDb.c |