Add ntlm flavor for NTLM authentication

Fix pthread linkage
Fix default path for errors directory
Switch to pkg-readmes
Add an rcscript

OK giovanni@, Brad (MAINTAINER)
This commit is contained in:
dcoppa 2010-11-26 13:45:04 +00:00
parent f8a043de1e
commit 81599f251c
10 changed files with 119 additions and 19 deletions

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.107 2010/11/22 08:36:54 espie Exp $
# $OpenBSD: Makefile,v 1.108 2010/11/26 13:45:04 dcoppa Exp $
COMMENT= WWW and FTP proxy cache and accelerator
DISTNAME= squid-2.7.STABLE9
REVISION= 0
CATEGORIES= www
MASTER_SITES= ${HOMEPAGE}/Versions/v2/2.7/
DIST_SUBDIR= squid
@ -21,7 +22,7 @@ WANTLIB= asn1 c com_err crypto krb5 gssapi m pthread ssl
SQUIDDIR?= /var/squid
SUBST_VARS= SQUIDDIR
FLAVORS= ldap snmp
FLAVORS= ldap ntlm snmp
FLAVOR?=
.include <bsd.own.mk>
@ -31,6 +32,7 @@ FLAVOR?=
PATCH_LIST= patch-* gcc-*
.endif
AUTH= basic digest
BASIC_AUTH= NCSA YP
DIGEST_AUTH= password
EXTERNAL_ACL= ip_user unix_group
@ -41,7 +43,7 @@ AUTOCONF_VERSION= 2.62
CONFIGURE_STYLE= autoconf
MODGNU_CONFIG_GUESS_DIRS=${WRKSRC}/cfgaux
CONFIGURE_ARGS+=--datadir="${PREFIX}/share/squid" \
--enable-auth="basic digest" \
--enable-auth="${AUTH}" \
--enable-arp-acl \
--enable-basic-auth-helpers="${BASIC_AUTH}" \
--enable-digest-auth-helpers="${DIGEST_AUTH}" \
@ -56,7 +58,6 @@ CONFIGURE_ARGS+=--datadir="${PREFIX}/share/squid" \
--with-pthreads \
--localstatedir="${SQUIDDIR}" \
--enable-follow-x-forwarded-for
USE_GROFF = Yes
.if ${FLAVOR:L:Mldap}
BASIC_AUTH+= LDAP
@ -68,10 +69,22 @@ CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
.endif
.if ${FLAVOR:L:Mntlm}
AUTH+= ntlm
BASIC_AUTH+= SMB
EXTERNAL_ACL+= wbinfo_group
RUN_DEPENDS+= net/samba,ads
CONFIGURE_ARGS+=--enable-ntlm-auth-helpers="fakeauth SMB"
.endif
.if${FLAVOR:L:Msnmp}
CONFIGURE_ARGS+=--enable-snmp
.endif
pre-build:
@${SUBST_CMD} ${WRKSRC}/src/defines.h \
${WRKSRC}/helpers/external_acl/wbinfo_group/wbinfo_group.pl
post-install:
@chown -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/share/examples/squid
@find ${PREFIX}/share/examples/squid/errors \

@ -1,7 +1,24 @@
$OpenBSD: patch-configure_in,v 1.29 2010/06/18 10:32:17 sthen Exp $
--- configure.in.orig Tue Mar 16 20:10:12 2010
+++ configure.in Thu Jun 17 22:13:14 2010
@@ -2350,18 +2350,6 @@ dnl during compile.
$OpenBSD: patch-configure_in,v 1.30 2010/11/26 13:45:04 dcoppa Exp $
--- configure.in.orig Wed Mar 17 01:10:12 2010
+++ configure.in Tue Nov 23 10:08:37 2010
@@ -2216,7 +2216,7 @@ dnl We use pthreads when doing ASYNC I/O
if test "$with_pthreads" = "yes"; then
CFLAGS="$CFLAGS -D_REENTRANT"
case "$host" in
- i386-unknown-freebsd*)
+ i386-unknown-freebsd*|*-unknown-openbsd*)
if test "$GCC" = "yes" ; then
if test -z "$PRESET_LDFLAGS"; then
LDFLAGS="$LDFLAGS -pthread"
@@ -2231,7 +2231,6 @@ if test "$with_pthreads" = "yes"; then
fi
;;
esac
- AC_CHECK_LIB(pthread, pthread_create)
fi
dnl Check for librt
@@ -2350,18 +2349,6 @@ dnl during compile.
;;
esac
@ -20,7 +37,7 @@ $OpenBSD: patch-configure_in,v 1.29 2010/06/18 10:32:17 sthen Exp $
# Recommended by Balint Nagy Endre <bne@CareNet.hu>
case "$host" in
*-univel-sysv4.2MP)
@@ -2906,12 +2894,14 @@ AC_ARG_WITH(maxfd,
@@ -2906,12 +2893,14 @@ AC_ARG_WITH(maxfd,
;;
esac
])

@ -0,0 +1,12 @@
$OpenBSD: patch-helpers_basic_auth_SMB_Makefile_in,v 1.1 2010/11/26 13:45:04 dcoppa Exp $
--- helpers/basic_auth/SMB/Makefile.in.orig Sun Mar 14 21:27:12 2010
+++ helpers/basic_auth/SMB/Makefile.in Tue Nov 23 15:10:11 2010
@@ -227,7 +227,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SMB_AUTH_HELPER = smb_auth.sh
-SAMBAPREFIX = /usr/local/samba
+SAMBAPREFIX = ${LOCALBASE}
SMB_AUTH_HELPER_PATH = $(libexecdir)/$(SMB_AUTH_HELPER)
libexec_SCRIPTS = $(SMB_AUTH_HELPER)
smb_auth_CFLAGS = -DSAMBAPREFIX=\"$(SAMBAPREFIX)\" -DHELPERSCRIPT=\"$(SMB_AUTH_HELPER_PATH)\"

@ -0,0 +1,22 @@
$OpenBSD: patch-helpers_external_acl_wbinfo_group_wbinfo_group_pl,v 1.1 2010/11/26 13:45:04 dcoppa Exp $
--- helpers/external_acl/wbinfo_group/wbinfo_group.pl.orig Mon Nov 15 20:11:59 2010
+++ helpers/external_acl/wbinfo_group/wbinfo_group.pl Mon Nov 15 20:12:56 2010
@@ -45,14 +45,14 @@ sub debug {
#
sub check {
local($user, $group) = @_;
- $groupSID = `wbinfo -n "$group" | cut -d" " -f1`;
+ $groupSID = `${LOCALBASE}/bin/wbinfo -n "$group" | cut -d" " -f1`;
chop $groupSID;
- $groupGID = `wbinfo -Y "$groupSID"`;
+ $groupGID = `${LOCALBASE}/bin/wbinfo -Y "$groupSID"`;
chop $groupGID;
&debug( "User: -$user-\nGroup: -$group-\nSID: -$groupSID-\nGID: -$groupGID-");
return 'ERR' if($groupGID eq ""); # Verify if groupGID variable is empty.
- return 'ERR' if(`wbinfo -r \Q$user\E` eq ""); # Verify if "wbinfo -r" command returns no value.
- return 'OK' if(`wbinfo -r \Q$user\E` =~ /^$groupGID$/m);
+ return 'ERR' if(`${LOCALBASE}/bin/wbinfo -r \Q$user\E` eq ""); # Verify if "wbinfo -r" command returns no value.
+ return 'OK' if(`${LOCALBASE}/bin/wbinfo -r \Q$user\E` =~ /^$groupGID$/m);
return 'ERR';
}

@ -0,0 +1,12 @@
$OpenBSD: patch-src_defines_h,v 1.1 2010/11/26 13:45:04 dcoppa Exp $
--- src/defines.h.orig Tue Nov 23 15:08:29 2010
+++ src/defines.h Tue Nov 23 15:09:48 2010
@@ -259,7 +259,7 @@
/* were to look for errors if config path fails */
#ifndef DEFAULT_SQUID_ERROR_DIR
-#define DEFAULT_SQUID_ERROR_DIR "/usr/local/squid/etc/errors"
+#define DEFAULT_SQUID_ERROR_DIR "${PREFIX}/share/squid/errors"
#endif
/* gb_type operations */

@ -12,5 +12,6 @@ By using the lightweight Internet Cache Protocol, Squid caches can be
arranged in a hierarchy or mesh for additional bandwidth savings.
Flavors:
ldap - Support for LDAP
snmp - Support for SNMP
ldap - Support for LDAP
ntlm - Support for NTLM
snmp - Support for SNMP

6
www/squid/pkg/PFRAG.ntlm Normal file

@ -0,0 +1,6 @@
@comment $OpenBSD: PFRAG.ntlm,v 1.1 2010/11/26 13:45:04 dcoppa Exp $
@bin libexec/fakeauth_auth
@bin libexec/ntlm_auth
@bin libexec/smb_auth
libexec/smb_auth.sh
libexec/wbinfo_group.pl

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.30 2009/02/08 15:04:33 sthen Exp $
@comment $OpenBSD: PLIST,v 1.31 2010/11/26 13:45:04 dcoppa Exp $
@pkgpath www/squid,transparent
@pkgpath www/squid,snmp,transparent
@newgroup _squid:515
@ -20,7 +20,9 @@ bin/RunCache
@man man/man8/squid.8
@man man/man8/squid_unix_group.8
%%ldap%%
%%ntlm%%
@bin sbin/squid
share/doc/pkg-readmes/${FULLPKGNAME}
share/examples/squid/
@sample ${SYSCONFDIR}/squid/
share/examples/squid/errors/
@ -2207,3 +2209,4 @@ share/examples/squid/squid.conf
@unexec rm -f /var/run/squid.pid
@extraunexec rm -rf ${SQUIDDIR}
@comment share/examples/squid/squid.conf.default
@rcscript ${RCDIR}/squid

@ -1,4 +1,6 @@
NOTES ON OpenBSD POST-INSTALLATION OF SQUID 2.7
$OpenBSD: README,v 1.1 2010/11/26 13:45:04 dcoppa Exp $
Notes on OpenBSD post-installation of Squid
The local (OpenBSD) differences are:
- configuration files are in ${SYSCONFDIR}/squid
@ -13,9 +15,3 @@ The local (OpenBSD) differences are:
Please remember to initialize the cache by running "squid -z" before
trying to run Squid for the first time.
You can also edit /etc/rc.local so that Squid is started automatically:
if [ -x ${PREFIX}/sbin/squid ]; then
echo -n ' squid'; ${PREFIX}/sbin/squid
fi

18
www/squid/pkg/squid.rc Normal file

@ -0,0 +1,18 @@
#!/bin/sh
#
# $OpenBSD: squid.rc,v 1.1 2010/11/26 13:45:04 dcoppa Exp $
. /etc/rc.d/rc.subr
daemon="${TRUEPREFIX}/sbin/squid"
pexp="${TRUEPREFIX}/sbin/squid"
rc_stop() {
${daemon} -k shutdown
}
rc_reload() {
${daemon} -k reconfigure
}
rc_cmd $1