Makefile 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. # $OpenBSD: Makefile,v 1.198 2017/06/03 21:04:49 sthen Exp $
  2. COMMENT-main= WWW and FTP proxy cache and accelerator
  3. COMMENT-ldap= LDAP authentication/ACL support for Squid
  4. COMMENT-ntlm= NTLM authentication/ACL support for Squid
  5. V= 3.5.26
  6. DISTNAME= squid-$V
  7. EXTRACT_SUFX= .tar.xz
  8. PKGNAME-main= squid-$V
  9. PKGNAME-ldap= squid-ldap-$V
  10. PKGNAME-ntlm= squid-ntlm-$V
  11. CATEGORIES= www
  12. HOMEPAGE= http://www.squid-cache.org/
  13. MAINTAINER= Stuart Henderson <sthen@openbsd.org>
  14. # GPLv2+
  15. PERMIT_PACKAGE_CDROM= Yes
  16. WANTLIB += c m nettle pthread
  17. cWANTLIB= ${WANTLIB} ${LIBECXX} ffi gmp gnutls hogweed iconv
  18. cWANTLIB+= idn2 intl p11-kit tasn1 unistring z
  19. # bzr repository at https://code.launchpad.net/squid
  20. MASTER_SITES= ${HOMEPAGE}Versions/v${V:C/^([0-9]).*/\1/}/${V:C/([0-9.]{3}).*/\1/}/ \
  21. http://ftp.mirrorservice.org/sites/ftp.squid-cache.org/pub/archive/${V:C/([0-9.]{3}).*/\1/}/
  22. # C++11
  23. COMPILER = gcc
  24. LIB_DEPENDS+= security/gnutls
  25. BUILD_DEPENDS+= devel/cppunit
  26. SEPARATE_BUILD= Yes
  27. CONFIGURE_STYLE= autoconf
  28. AUTOCONF_VERSION= 2.69
  29. MODGNU_CONFIG_GUESS_DIRS= ${WRKSRC}/cfgaux
  30. CONFIGURE_ARGS= --disable-strict-error-checking \
  31. --disable-arch-native \
  32. --enable-ssl-crtd
  33. EXTERNAL_ACL= SQL_session file_userip time_quota \
  34. unix_group wbinfo_group # kerberos_ldap_group (sasl/gssapi)
  35. WANTLIB-main += ${cWANTLIB} crypto db ssl
  36. LIB_DEPENDS-main += ${LIB_DEPENDS} \
  37. databases/db/v4 \
  38. devel/gettext \
  39. security/libnettle
  40. SYSCONFDIR= ${BASESYSCONFDIR}/squid
  41. LOCALSTATEDIR= ${BASELOCALSTATEDIR}/squid
  42. MULTI_PACKAGES= -main -ldap -ntlm
  43. PSEUDO_FLAVORS= no_ldap no_ntlm
  44. FLAVOR?=
  45. .include <bsd.port.arch.mk>
  46. CONFIGURE_ARGS+= --datadir="${PREFIX}/share/squid" \
  47. --libexecdir="${PREFIX}/libexec/squid" \
  48. --disable-loadable-modules \
  49. --enable-arp-acl \
  50. --enable-auth \
  51. --enable-delay-pools \
  52. --enable-follow-x-forwarded-for \
  53. --enable-forw-via-db \
  54. --enable-http-violations \
  55. --enable-icap-client \
  56. --enable-ipv6 \
  57. --enable-referer-log \
  58. --enable-removal-policies="lru heap" \
  59. --enable-ssl \
  60. --enable-ssl-crtd \
  61. --with-openssl \
  62. --enable-storeio="aufs ufs diskd" \
  63. --with-default-user="_squid" \
  64. --with-filedescriptors=8192 \
  65. --with-krb5-config=no \
  66. --with-pidfile="/var/run/squid.pid" \
  67. --with-pthreads \
  68. --with-swapdir="${LOCALSTATEDIR}/cache"
  69. # "rock" not in --enable-storeio list due to an error at startup:
  70. # FATAL: Rock cache_dir at /var/squid/rock/rock failed to open db file: (40) Message too long"
  71. # PF transparent support requires access to /dev/pf to retrieve the original
  72. # source address; ipfw-transparent (which requires divert-to) uses an
  73. # unprivileged getsockname() call instead.
  74. CONFIGURE_ARGS+= --disable-pf-transparent \
  75. --enable-ipfw-transparent
  76. # not just defaulting to build all external-acl-helpers as
  77. # kerberos_ldap_group fails
  78. CONFIGURE_ARGS+= --enable-external-acl-helpers="${EXTERNAL_ACL}"
  79. CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include" \
  80. LDFLAGS="-L${LOCALBASE}/lib" \
  81. ac_cv_header_et_com_err_h=false \
  82. ac_cv_header_security_pam_appl_h=false \
  83. ac_cv_header_execinfo_h=false
  84. E= ${TRUEPREFIX}/share/examples/squid
  85. FAKE_FLAGS= sysconfdir=$E \
  86. DEFAULT_CONFIG_FILE=$E/squid.conf \
  87. DEFAULT_MIME_TABLE=$E/mime.conf
  88. TEST_DEPENDS= devel/cppunit
  89. .if ${BUILD_PACKAGES:M-ldap}
  90. EXTERNAL_ACL+= LDAP_group eDirectory_userip
  91. .endif
  92. RUN_DEPENDS-ldap= ${BASE_PKGPATH}
  93. LIB_DEPENDS-ldap+= ${LIB_DEPENDS} databases/openldap
  94. WANTLIB-ldap += ${cWANTLIB} crypto lber-2.4 ldap-2.4 sasl2 ssl
  95. RUN_DEPENDS-ntlm= net/samba ${BASE_PKGPATH}
  96. LIB_DEPENDS-ntlm += security/libnettle
  97. pre-build:
  98. @cd ${WRKSRC}; \
  99. perl -pi -e 's,/usr/local,${LOCALBASE},g' \
  100. helpers/external_acl/wbinfo_group/ext_wbinfo_group_acl.pl.in \
  101. helpers/*/*/config.test \
  102. src/squid.8.in
  103. post-install:
  104. rm -rf ${WRKINST}/var/squid
  105. cd ${PREFIX}/share/examples/squid; \
  106. rm -f mime.conf squid.conf cachemgr.conf errorpage.css msntauth.conf
  107. @# remove unwanted auth helpers; msnt_multi_domain needs Authen::Smb
  108. @# (not ported), others are risky (typically accessing master.passwd
  109. @# which needs root).
  110. .for i in basic_msnt_multi_domain_auth basic_getpwnam_auth basic_pam_auth basic_sasl_auth
  111. rm -f ${PREFIX}/libexec/squid/$i ${PREFIX}/man/man8/$i.8
  112. .endfor
  113. ${INSTALL_DATA_DIR} ${PREFIX}/share/snmp/mibs
  114. -cd ${PREFIX}/share; mv squid/mib.txt snmp/mibs/SQUID-MIB.txt
  115. .include <bsd.port.mk>