Friday, November 30, 2007

Squid-ldap OpenBSD 4.2

Edit /usr/ports/www/squid/Makefile
CONFIGURE_ARGS+=--datadir="${PREFIX}/share/squid"
--enable-auth="basic digest"
--enable-arp-acl
--enable-basic-auth-helpers="NCSA YP LDAP"
--enable-digest-auth-helpers="password"
--enable-external-acl-helpers="ip_user unix_group"
--enable-removal-policies="lru heap"
--enable-ssl
--enable-delay-pools
--enable-storeio="ufs diskd null"
--localstatedir="${SQUIDDIR}"

then do make and you'll got error like this:
[PATH_TO_SQUID_WORKDIR]/squid-2.6.STABLE13/helpers/basic_auth/LDAP/squid_ldap_auth.c:704:
warning: assignment makes pointer from integer without a cast
[PATH_TO_SQUID_WORKDIR]/squid-2.6.STABLE13/helpers/basic_auth/LDAP/squid_ldap_auth.c:740: error:
`LDAP_COMPARE_TRUE' undeclared (first use in this function)
*** Error code 1

edit [PATH_TO_SQUID_WORKDIR]/build-i386/helpers/basic_auth/LDAP/Makefile, add & change the configuration to:
[PATH_TO_SQUID_WORKDIR]/build-i386/helpers/basic_auth/LDAP/Makefile
---------------
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I/usr/local/include
LDADD = -L$(top_builddir)/lib -lmiscutil $(LIB_LDAP) $(LIB_LBER) $(XTRA_LIBS) /usr/local/lib/libldap-2.3.so.9.1
-L[PATH_TO_SQUID_WORKDIR]/build-i386/helpers/external_acl/ldap_group/Makefile
------------------------
LDADD = -L$(top_builddir)/lib -lmiscutil $(LIB_LDAP) $(LIB_LBER) -lm /usr/local/lib/libldap-2.3.so.9.1 -L/usr/local/lib
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I/usr/local/include

Then do 'make'
: warning: strcat() is almost always misused, please use strlcat()
if cc -DHAVE_CONFIG_H -I. -I[PATH_TO_SQUID_WORKDIR]/squid-2.6.STABLE13/tools -I../include -I. -I[PATH_TO_SQUID_WORKDIR]/squid-2.6.STABLE13/tools -I../include -I[PATH_TO_SQUID_WORKDIR]/squid-2.6.STABLE13/include -I[PATH_TO_SQUID_WORKDIR]/squid-2.6.STABLE13/lib/libTrie/include -DDEFAULT_CACHEMGR_CONFIG="/etc/cachemgr.conf" -O2 -pipe -MT cachemgr__CGIEXT_-cachemgr.o -MD -MP -MF ".deps/cachemgr__CGIEXT_-cachemgr.Tpo" -c -o cachemgr__CGIEXT_-cachemgr.o `test -f 'cachemgr.c' || echo '/usr/ports/www/squid/w-squid-2.6.STABLE13/squid-2.6.STABLE13/tools/'`cachemgr.c; then mv -f ".deps/cachemgr__CGIEXT_-cachemgr.Tpo" ".deps/cachemgr__CGIEXT_-cachemgr.Po"; else rm -f ".deps/cachemgr__CGIEXT_-cachemgr.Tpo"; exit 1; fi
cc -O2 -pipe -g -o cachemgr.cgi -static cachemgr__CGIEXT_-cachemgr.o -L../lib -lmiscutil -lm
../lib/libmiscutil.a(rfc1738.o)(.text+0xe0): In function `rfc1738_do_escape':
: warning: sprintf() is often misused, please use snprintf()

Copy [PATH_TO_SQUID_WORKDIR]/build-i386/helpers/basic_auth/LDAP/squid_ldap_auth to /usr/local/libexec

0 comments:

Post a Comment