From d49600aa375738d73a0e360d3d3fb16670f033ae Mon Sep 17 00:00:00 2001 From: John Marino Date: Wed, 8 Jul 2015 09:30:17 +0000 Subject: [PATCH] www/squid: Support DragonFly SHM segments Out of the box, squid would not run on dragonfly due to its handling of SHM segments. On DragonFly, SHM segments are always treated as files but on FreeBSD it depends on whether or not application is inside a jail. In any case, the case for DragonFly was no supported, so it has been added via patch. This also requires the return of /var/run/squid directory which is where the SHM files are stored (defined by localstatedir and supported by RC script). The RC script would define this directory if missing, but let's make sure it is always available. PR: 201405 Submitted by: marino Approved by: maintainer (timp87/gmail) --- www/squid/Makefile | 1 - www/squid/files/patch-compat_shm.cc | 11 +++++++++++ www/squid/pkg-plist | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 www/squid/files/patch-compat_shm.cc diff --git a/www/squid/Makefile b/www/squid/Makefile index 8b4806c52951..aa6c192fdf42 100644 --- a/www/squid/Makefile +++ b/www/squid/Makefile @@ -355,7 +355,6 @@ post-install: @${MKDIR} ${STAGEDIR}${DOCSDIR} (cd ${WRKSRC} && ${INSTALL_DATA} ${MYDOCS} ${STAGEDIR}${DOCSDIR}) ${MKDIR} ${STAGEDIR}/var/squid/logs - ${RMDIR} ${STAGEDIR}/var/run/squid .include diff --git a/www/squid/files/patch-compat_shm.cc b/www/squid/files/patch-compat_shm.cc new file mode 100644 index 000000000000..2fd035f960ef --- /dev/null +++ b/www/squid/files/patch-compat_shm.cc @@ -0,0 +1,11 @@ +--- compat/shm.cc.orig 2015-05-28 11:06:38 UTC ++++ compat/shm.cc +@@ -29,6 +29,8 @@ shm_portable_segment_name_is_path() + size_t len = sizeof(jailed); + ::sysctlbyname("security.jail.jailed", &jailed, &len, NULL, 0); + return !jailed; ++#elif defined (__DragonFly__) ++ return true; + #else + return false; + #endif diff --git a/www/squid/pkg-plist b/www/squid/pkg-plist index 66076733b506..3adb97f8c83a 100644 --- a/www/squid/pkg-plist +++ b/www/squid/pkg-plist @@ -2176,6 +2176,7 @@ sbin/purge sbin/squid sbin/squidclient @dir(squid,squid,750) /var/log/squid +@dir(squid,squid,750) /var/run/squid @dir(squid,squid,750) /var/squid @dir(squid,squid,750) /var/squid/cache @dir(squid,squid,750) /var/squid/logs