From 3f23b0b54b20a6890ea63e677333dd6bbe3cf9e9 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Fri, 23 Apr 2010 00:44:23 +1200 Subject: [PATCH] Author: Francesco Chemolli Improved helper configlets for wider compatibility. * Add configlet tests for building the DB basic auth helper * Improved detection of samba prefix for wbinfo_group and SMB * Also check for SASL shared libraries in SASL helper * Distribute the config.test files to enable auto-build properly --- helpers/basic_auth/DB/Makefile.am | 3 ++- helpers/basic_auth/DB/config.test | 7 +++++++ helpers/basic_auth/LDAP/Makefile.am | 2 +- helpers/basic_auth/MSNT/Makefile.am | 11 ++--------- helpers/basic_auth/NCSA/Makefile.am | 2 +- helpers/basic_auth/PAM/Makefile.am | 2 +- helpers/basic_auth/POP3/Makefile.am | 3 ++- helpers/basic_auth/SASL/Makefile.am | 2 +- helpers/basic_auth/SASL/config.test | 3 +++ helpers/basic_auth/SMB/Makefile.am | 2 +- helpers/basic_auth/SMB/config.test | 9 ++++++--- helpers/basic_auth/YP/Makefile.am | 2 ++ helpers/basic_auth/getpwnam/Makefile.am | 2 ++ helpers/basic_auth/mswin_sspi/Makefile.am | 2 +- helpers/basic_auth/multi-domain-NTLM/Makefile.am | 3 ++- helpers/basic_auth/squid_radius_auth/Makefile.am | 2 +- helpers/basic_auth/squid_radius_auth/config.test | 0 helpers/digest_auth/eDirectory/Makefile.am | 2 ++ helpers/digest_auth/ldap/Makefile.am | 2 ++ helpers/digest_auth/password/Makefile.am | 2 ++ helpers/external_acl/ip_user/Makefile.am | 11 ++--------- helpers/external_acl/ldap_group/Makefile.am | 10 +--------- helpers/external_acl/mswin_ad_group/Makefile.am | 11 +---------- helpers/external_acl/mswin_lm_group/Makefile.am | 2 +- helpers/external_acl/session/Makefile.am | 10 +--------- helpers/external_acl/unix_group/Makefile.am | 10 +--------- helpers/external_acl/wbinfo_group/Makefile.am | 10 +--------- helpers/external_acl/wbinfo_group/config.test | 16 ++++++++++------ helpers/negotiate_auth/mswin_sspi/Makefile.am | 2 +- helpers/ntlm_auth/fakeauth/Makefile.am | 10 ++-------- helpers/ntlm_auth/mswin_sspi/Makefile.am | 8 +------- helpers/ntlm_auth/no_check/Makefile.am | 4 ++-- helpers/ntlm_auth/smb_lm/Makefile.am | 6 ++---- 33 files changed, 67 insertions(+), 106 deletions(-) create mode 100644 helpers/basic_auth/DB/config.test mode change 100644 => 100755 helpers/basic_auth/squid_radius_auth/config.test diff --git a/helpers/basic_auth/DB/Makefile.am b/helpers/basic_auth/DB/Makefile.am index 0ac34f27d7..39344369d3 100644 --- a/helpers/basic_auth/DB/Makefile.am +++ b/helpers/basic_auth/DB/Makefile.am @@ -11,7 +11,8 @@ CLEANFILES = squid_db_auth squid_db_auth.8 do_subst = sed -e 's,[@]PERL[@],$(PERL),g' man_MANS = squid_db_auth.8 EXTRA_DIST = passwd.sql \ - squid_db_auth.in + squid_db_auth.in \ + config.test squid_db_auth.8: squid_db_auth pod2man squid_db_auth squid_db_auth.8 diff --git a/helpers/basic_auth/DB/config.test b/helpers/basic_auth/DB/config.test new file mode 100644 index 0000000000..387b7b1185 --- /dev/null +++ b/helpers/basic_auth/DB/config.test @@ -0,0 +1,7 @@ +#!/bin/sh + +## Test: do we have perl to build the helper scripts? +## Test: do we have pod2man to build the manual? +perl --version >/dev/null && echo | pod2man >/dev/null + +exit $? diff --git a/helpers/basic_auth/LDAP/Makefile.am b/helpers/basic_auth/LDAP/Makefile.am index 11af8a29af..4167f4bd6f 100644 --- a/helpers/basic_auth/LDAP/Makefile.am +++ b/helpers/basic_auth/LDAP/Makefile.am @@ -10,8 +10,8 @@ include $(top_srcdir)/src/Common.am libexec_PROGRAMS = squid_ldap_auth man_MANS = squid_ldap_auth.8 -EXTRA_DIST = squid_ldap_auth.8 squid_ldap_auth_SOURCES = squid_ldap_auth.c +EXTRA_DIST = basic_ldap_auth.8 config.test LDADD = \ $(top_builddir)/compat/libcompat.la \ diff --git a/helpers/basic_auth/MSNT/Makefile.am b/helpers/basic_auth/MSNT/Makefile.am index 6d76ddcc84..9e30ba9c26 100644 --- a/helpers/basic_auth/MSNT/Makefile.am +++ b/helpers/basic_auth/MSNT/Makefile.am @@ -1,11 +1,3 @@ -# -# Makefile for the Squid Object Cache server -# -# $Id$ -# -# Uncomment and customize the following to suit your needs: -# - include $(top_srcdir)/src/Common.am MSNTAUTH_CONF = $(sysconfdir)/msntauth.conf @@ -25,7 +17,8 @@ EXTRA_DIST = \ COPYING-2.0 \ msntauth.conf.default \ msntauth-v2.0.lsm \ - README.html + README.html \ + config.test sysconf_DATA = \ msntauth.conf.default diff --git a/helpers/basic_auth/NCSA/Makefile.am b/helpers/basic_auth/NCSA/Makefile.am index 08ef3d72de..3a3be1ebe3 100644 --- a/helpers/basic_auth/NCSA/Makefile.am +++ b/helpers/basic_auth/NCSA/Makefile.am @@ -11,7 +11,7 @@ include $(top_srcdir)/src/Common.am libexec_PROGRAMS = ncsa_auth ncsa_auth_SOURCES = ncsa_auth.c crypt_md5.c crypt_md5.h man_MANS = ncsa_auth.8 -EXTRA_DIST = ncsa_auth.8 +EXTRA_DIST = ncsa_auth.8 config.test LDADD = \ $(top_builddir)/compat/libcompat.la \ -L$(top_builddir)/lib -lmiscutil \ diff --git a/helpers/basic_auth/PAM/Makefile.am b/helpers/basic_auth/PAM/Makefile.am index c6a65aec56..053f11ac21 100644 --- a/helpers/basic_auth/PAM/Makefile.am +++ b/helpers/basic_auth/PAM/Makefile.am @@ -9,7 +9,7 @@ include $(top_srcdir)/src/Common.am man_MANS = pam_auth.8 -EXTRA_DIST = pam_auth.8 +EXTRA_DIST = pam_auth.8 config.test libexec_PROGRAMS = pam_auth ## we need our local files too (but avoid -I. at all costs) diff --git a/helpers/basic_auth/POP3/Makefile.am b/helpers/basic_auth/POP3/Makefile.am index a41a181286..20cf88ce78 100644 --- a/helpers/basic_auth/POP3/Makefile.am +++ b/helpers/basic_auth/POP3/Makefile.am @@ -10,4 +10,5 @@ libexec_SCRIPTS = \ pop3.pl EXTRA_DIST = \ - pop3.pl + pop3.pl \ + config.test diff --git a/helpers/basic_auth/SASL/Makefile.am b/helpers/basic_auth/SASL/Makefile.am index d30bf67182..1ff41e9fca 100644 --- a/helpers/basic_auth/SASL/Makefile.am +++ b/helpers/basic_auth/SASL/Makefile.am @@ -19,4 +19,4 @@ LDADD = \ $(LIBSASL) \ $(XTRA_LIBS) -EXTRA_DIST = squid_sasl_auth squid_sasl_auth.conf +EXTRA_DIST = squid_sasl_auth squid_sasl_auth.conf config.test diff --git a/helpers/basic_auth/SASL/config.test b/helpers/basic_auth/SASL/config.test index 7f4b817f33..34e5befe55 100755 --- a/helpers/basic_auth/SASL/config.test +++ b/helpers/basic_auth/SASL/config.test @@ -6,5 +6,8 @@ if [ -f /usr/include/sasl.h -o -f /usr/include/sasl/sasl.h ]; then if [ -f /usr/lib/libsasl.la -o -f /usr/lib/libsasl2.la ]; then exit 0 fi + if [ -f /usr/lib/libsasl.so -o -f /usr/lib/libsasl2.so ]; then + exit 0 + fi fi exit 1 diff --git a/helpers/basic_auth/SMB/Makefile.am b/helpers/basic_auth/SMB/Makefile.am index 82aa4b42ea..acf5cc9b77 100644 --- a/helpers/basic_auth/SMB/Makefile.am +++ b/helpers/basic_auth/SMB/Makefile.am @@ -22,7 +22,7 @@ SMB_AUTH_HELPER_PATH = $(libexecdir)/$(SMB_AUTH_HELPER) libexec_SCRIPTS = $(SMB_AUTH_HELPER) libexec_PROGRAMS = smb_auth smb_auth_CFLAGS = -DSAMBAPREFIX=\"$(SAMBAPREFIX)\" -DHELPERSCRIPT=\"$(SMB_AUTH_HELPER_PATH)\" -EXTRA_DIST = smb_auth.sh COPYING-2.0 +EXTRA_DIST = smb_auth.sh COPYING-2.0 config.test ## we need our local files too (but avoid -I. at all costs) INCLUDES += -I$(srcdir) diff --git a/helpers/basic_auth/SMB/config.test b/helpers/basic_auth/SMB/config.test index 5b11788d17..f41b21fd12 100755 --- a/helpers/basic_auth/SMB/config.test +++ b/helpers/basic_auth/SMB/config.test @@ -1,5 +1,8 @@ #!/bin/sh -if [ -x ${SAMBAPREFIX:-/usr/local/samba}/bin/smbclient ]; then - exit 0 -fi +for prefix in ${SAMBAPREFIX} /usr/local /opt /opt/samba /usr/local/samba /usr +do + if [ -x ${prefix}/bin/smbclient ]; then + exit 0 + fi +done exit 1 diff --git a/helpers/basic_auth/YP/Makefile.am b/helpers/basic_auth/YP/Makefile.am index 79f5561a69..793db87559 100644 --- a/helpers/basic_auth/YP/Makefile.am +++ b/helpers/basic_auth/YP/Makefile.am @@ -18,3 +18,5 @@ LDADD = \ -L$(top_builddir)/lib -lmiscutil \ $(CRYPTLIB) \ $(XTRA_LIBS) + +EXTRA_DIST = config.test diff --git a/helpers/basic_auth/getpwnam/Makefile.am b/helpers/basic_auth/getpwnam/Makefile.am index c733abd628..badab99364 100644 --- a/helpers/basic_auth/getpwnam/Makefile.am +++ b/helpers/basic_auth/getpwnam/Makefile.am @@ -20,3 +20,5 @@ LDADD = \ -L$(top_builddir)/lib -lmiscutil \ $(CRYPTLIB) \ $(XTRA_LIBS) + +EXTRA_DIST = config.test diff --git a/helpers/basic_auth/mswin_sspi/Makefile.am b/helpers/basic_auth/mswin_sspi/Makefile.am index 4d915d5449..14eeccbfcb 100644 --- a/helpers/basic_auth/mswin_sspi/Makefile.am +++ b/helpers/basic_auth/mswin_sspi/Makefile.am @@ -21,4 +21,4 @@ LDADD = \ ## we need our local files too (but avoid -I. at all costs) INCLUDES += -I$(srcdir) -EXTRA_DIST = readme.txt +EXTRA_DIST = readme.txt config.test diff --git a/helpers/basic_auth/multi-domain-NTLM/Makefile.am b/helpers/basic_auth/multi-domain-NTLM/Makefile.am index 364248f0bb..f0cf3305d7 100644 --- a/helpers/basic_auth/multi-domain-NTLM/Makefile.am +++ b/helpers/basic_auth/multi-domain-NTLM/Makefile.am @@ -11,4 +11,5 @@ libexec_SCRIPTS = \ EXTRA_DIST = \ smb_auth.pl \ - README.txt + README.txt \ + config.test diff --git a/helpers/basic_auth/squid_radius_auth/Makefile.am b/helpers/basic_auth/squid_radius_auth/Makefile.am index 34be3078ad..14e0d51e5c 100644 --- a/helpers/basic_auth/squid_radius_auth/Makefile.am +++ b/helpers/basic_auth/squid_radius_auth/Makefile.am @@ -10,7 +10,7 @@ include $(top_srcdir)/src/Common.am libexec_PROGRAMS = squid_radius_auth man_MANS = squid_radius_auth.8 -EXTRA_DIST = squid_radius_auth.8 +EXTRA_DIST = squid_radius_auth.8 config.test squid_radius_auth_SOURCES = \ squid_rad_auth.c \ radius.h \ diff --git a/helpers/basic_auth/squid_radius_auth/config.test b/helpers/basic_auth/squid_radius_auth/config.test old mode 100644 new mode 100755 diff --git a/helpers/digest_auth/eDirectory/Makefile.am b/helpers/digest_auth/eDirectory/Makefile.am index 82af4fe443..0e3f252989 100644 --- a/helpers/digest_auth/eDirectory/Makefile.am +++ b/helpers/digest_auth/eDirectory/Makefile.am @@ -28,3 +28,5 @@ LDADD = \ $(CRYPTLIB) \ $(XTRA_LIBS) \ $(SSLLIB) + +EXTRA_DIST = config.test diff --git a/helpers/digest_auth/ldap/Makefile.am b/helpers/digest_auth/ldap/Makefile.am index 7d57e771dd..c1db8bd36e 100644 --- a/helpers/digest_auth/ldap/Makefile.am +++ b/helpers/digest_auth/ldap/Makefile.am @@ -26,3 +26,5 @@ LDADD = \ $(CRYPTLIB) \ $(XTRA_LIBS) \ $(SSLLIB) + +EXTRA_DIST = config.test diff --git a/helpers/digest_auth/password/Makefile.am b/helpers/digest_auth/password/Makefile.am index a2312086a0..681f0d677b 100644 --- a/helpers/digest_auth/password/Makefile.am +++ b/helpers/digest_auth/password/Makefile.am @@ -24,3 +24,5 @@ LDADD = \ $(CRYPTLIB) \ $(XTRA_LIBS) \ $(SSLLIB) + +EXTRA_DIST = config.test diff --git a/helpers/external_acl/ip_user/Makefile.am b/helpers/external_acl/ip_user/Makefile.am index 035056874a..5e53d10893 100644 --- a/helpers/external_acl/ip_user/Makefile.am +++ b/helpers/external_acl/ip_user/Makefile.am @@ -1,11 +1,3 @@ -# -# Makefile for the ip_user external_acl helper by Rodrigo Campos -# -# $Id$ -# -# Uncomment and customize the following to suit your needs: -# - include $(top_srcdir)/src/Common.am ## we need our local files too (but avoid -I. at all costs) @@ -24,7 +16,8 @@ EXTRA_DIST = \ example.conf \ example-deny_all_but.conf \ license \ - README + README \ + config.test LDADD = \ $(top_builddir)/compat/libcompat.la \ diff --git a/helpers/external_acl/ldap_group/Makefile.am b/helpers/external_acl/ldap_group/Makefile.am index fcaf332802..b120502c63 100644 --- a/helpers/external_acl/ldap_group/Makefile.am +++ b/helpers/external_acl/ldap_group/Makefile.am @@ -1,11 +1,3 @@ -# -# Makefile for the Squid LDAP authentication helper -# -# $Id$ -# -# Uncomment and customize the following to suit your needs: -# - include $(top_srcdir)/src/Common.am ## we need our local files too (but avoid -I. at all costs) @@ -14,7 +6,7 @@ INCLUDES += -I$(srcdir) libexec_PROGRAMS = squid_ldap_group man_MANS = squid_ldap_group.8 -EXTRA_DIST = squid_ldap_group.8 +EXTRA_DIST = squid_ldap_group.8 config.test squid_ldap_group_SOURCES = squid_ldap_group.c LDADD = \ diff --git a/helpers/external_acl/mswin_ad_group/Makefile.am b/helpers/external_acl/mswin_ad_group/Makefile.am index 049a008090..8916aba815 100644 --- a/helpers/external_acl/mswin_ad_group/Makefile.am +++ b/helpers/external_acl/mswin_ad_group/Makefile.am @@ -1,12 +1,3 @@ -# -# Makefile for the Squid Object Cache server -# -# $Id$ -# -# Uncomment and customize the following to suit your needs: -# - - libexec_PROGRAMS = mswin_check_ad_group mswin_check_ad_group_SOURCES = mswin_check_ad_group.c mswin_check_ad_group.h @@ -23,4 +14,4 @@ LDADD = \ -lntdll \ $(XTRA_LIBS) -EXTRA_DIST = readme.txt +EXTRA_DIST = readme.txt config.test diff --git a/helpers/external_acl/mswin_lm_group/Makefile.am b/helpers/external_acl/mswin_lm_group/Makefile.am index 414fc5833c..478b6fa407 100644 --- a/helpers/external_acl/mswin_lm_group/Makefile.am +++ b/helpers/external_acl/mswin_lm_group/Makefile.am @@ -24,4 +24,4 @@ LDADD = \ -lntdll \ $(XTRA_LIBS) -EXTRA_DIST = readme.txt +EXTRA_DIST = readme.txt config.test diff --git a/helpers/external_acl/session/Makefile.am b/helpers/external_acl/session/Makefile.am index e725cff2e7..36cc2872d4 100644 --- a/helpers/external_acl/session/Makefile.am +++ b/helpers/external_acl/session/Makefile.am @@ -1,11 +1,3 @@ -# -# Makefile for the Squid LDAP authentication helper -# -# $Id$ -# -# Uncomment and customize the following to suit your needs: -# - include $(top_srcdir)/src/Common.am ## we need our local files too (but avoid -I. at all costs) @@ -14,7 +6,7 @@ INCLUDES += -I$(srcdir) libexec_PROGRAMS = squid_session man_MANS = squid_session.8 -EXTRA_DIST = squid_session.8 +EXTRA_DIST = squid_session.8 config.test squid_session_SOURCES = squid_session.c LDADD = \ diff --git a/helpers/external_acl/unix_group/Makefile.am b/helpers/external_acl/unix_group/Makefile.am index dbb612bb4f..916a4ca942 100644 --- a/helpers/external_acl/unix_group/Makefile.am +++ b/helpers/external_acl/unix_group/Makefile.am @@ -1,11 +1,3 @@ -# -# Makefile for the Squid LDAP authentication helper -# -# $Id$ -# -# Uncomment and customize the following to suit your needs: -# - include $(top_srcdir)/src/Common.am ## we need our local files too (but avoid -I. at all costs) @@ -14,7 +6,7 @@ INCLUDES += -I$(srcdir) libexec_PROGRAMS = squid_unix_group man_MANS = squid_unix_group.8 -EXTRA_DIST = squid_unix_group.8 +EXTRA_DIST = squid_unix_group.8 config.test squid_unix_group_SOURCES = check_group.c LDADD = \ diff --git a/helpers/external_acl/wbinfo_group/Makefile.am b/helpers/external_acl/wbinfo_group/Makefile.am index 6de527bb95..3bcc752b6f 100644 --- a/helpers/external_acl/wbinfo_group/Makefile.am +++ b/helpers/external_acl/wbinfo_group/Makefile.am @@ -1,12 +1,4 @@ -# -# Makefile for the Squid LDAP authentication helper -# -# $Id$ -# -# Uncomment and customize the following to suit your needs: -# - libexec_SCRIPTS = wbinfo_group.pl #man_MANS = squid_wbinfo_group.8 #EXTRA_DIST = squid_wbinfo_group.8 -EXTRA_DIST = wbinfo_group.pl +EXTRA_DIST = wbinfo_group.pl config.test diff --git a/helpers/external_acl/wbinfo_group/config.test b/helpers/external_acl/wbinfo_group/config.test index b9af8921e5..fdaf038639 100755 --- a/helpers/external_acl/wbinfo_group/config.test +++ b/helpers/external_acl/wbinfo_group/config.test @@ -1,8 +1,12 @@ #!/bin/sh -if [ -x ${SAMBAPREFIX:-/usr/local/samba}/bin/wbinfo -a -x /usr/bin/perl ]; then - exit 0 -fi -if [ -x /usr/bin/wbinfo -a -x /usr/bin/perl ]; then - exit 0 -fi + +for sambaprefix in ${SAMBAPREFIX} /usr/local /opt /opt/samba /usr/local/samba /usr +do + for perlprefix in /usr /usr/local /opt /opt/perl + do + if [ -x $sambaprefix/bin/wbinfo -a -x $perlprefix/bin/perl ]; then + exit 0 + fi + done +done exit 1 diff --git a/helpers/negotiate_auth/mswin_sspi/Makefile.am b/helpers/negotiate_auth/mswin_sspi/Makefile.am index e0025761c4..0599adaddf 100644 --- a/helpers/negotiate_auth/mswin_sspi/Makefile.am +++ b/helpers/negotiate_auth/mswin_sspi/Makefile.am @@ -16,4 +16,4 @@ mswin_negotiate_auth_SOURCES = libnegotiatessp.c negotiate_auth.c negotiate.h LDADD = -L$(top_builddir)/lib -lsspwin32 -ladvapi32 -lmiscutil $(XTRA_LIBS) -EXTRA_DIST = readme.txt +EXTRA_DIST = readme.txt config.test diff --git a/helpers/ntlm_auth/fakeauth/Makefile.am b/helpers/ntlm_auth/fakeauth/Makefile.am index 8e8f102949..d9c85c7f5b 100644 --- a/helpers/ntlm_auth/fakeauth/Makefile.am +++ b/helpers/ntlm_auth/fakeauth/Makefile.am @@ -1,11 +1,3 @@ -# -# Makefile for the Squid Object Cache server -# -# $Id$ -# -# Uncomment and customize the following to suit your needs: -# - include $(top_srcdir)/src/Common.am libexec_PROGRAMS = fakeauth_auth @@ -19,3 +11,5 @@ LDADD = \ -L$(top_builddir)/lib -lmiscutil \ $(CRYPTLIB) \ $(XTRA_LIBS) + +EXTRA_DIST = config.test diff --git a/helpers/ntlm_auth/mswin_sspi/Makefile.am b/helpers/ntlm_auth/mswin_sspi/Makefile.am index 0e5b9e6013..86c0adfe15 100644 --- a/helpers/ntlm_auth/mswin_sspi/Makefile.am +++ b/helpers/ntlm_auth/mswin_sspi/Makefile.am @@ -1,9 +1,3 @@ -# -# Makefile for the Squid Object Cache server -# -# $Id$ -# - include $(top_srcdir)/src/Common.am libexec_PROGRAMS = mswin_ntlm_auth @@ -21,4 +15,4 @@ LDADD = \ -ladvapi32 \ $(XTRA_LIBS) -EXTRA_DIST = readme.txt +EXTRA_DIST = readme.txt config.test diff --git a/helpers/ntlm_auth/no_check/Makefile.am b/helpers/ntlm_auth/no_check/Makefile.am index fdfc314741..305888add3 100644 --- a/helpers/ntlm_auth/no_check/Makefile.am +++ b/helpers/ntlm_auth/no_check/Makefile.am @@ -10,5 +10,5 @@ libexec_SCRIPTS = no_check.pl EXTRA_DIST = \ no_check.pl \ - README.no_check_ntlm_auth - + README.no_check_ntlm_auth \ + config.test diff --git a/helpers/ntlm_auth/smb_lm/Makefile.am b/helpers/ntlm_auth/smb_lm/Makefile.am index afeb4932c7..1222348955 100644 --- a/helpers/ntlm_auth/smb_lm/Makefile.am +++ b/helpers/ntlm_auth/smb_lm/Makefile.am @@ -1,7 +1,3 @@ -# -# Makefile for the Squid Object Cache server -# - include $(top_srcdir)/src/Common.am SUBDIRS = smbval @@ -20,3 +16,5 @@ LDADD = \ smbval/libsmbvalid.a \ $(CRYPTLIB) \ $(XTRA_LIBS) + +EXTRA_DIST = config.test -- 2.47.3