diff --git a/ports/openldap/m4.patch b/ports/openldap/m4.patch new file mode 100644 index 00000000000000..4df7e91a6d9623 --- /dev/null +++ b/ports/openldap/m4.patch @@ -0,0 +1,12 @@ +diff --git a/configure.ac b/configure.ac +index 71dd7a6..6741ec6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -38,6 +38,7 @@ m4_ifndef([PKG_PREREQ], + + AC_CONFIG_AUX_DIR(build)dnl + AC_CONFIG_MACRO_DIRS([build]) ++AC_CONFIG_MACRO_DIR([m4]) + + eval `$ac_aux_dir/version.sh` + if test -z "$OL_STRING"; then diff --git a/ports/openldap/openssl.patch b/ports/openldap/openssl.patch new file mode 100644 index 00000000000000..d04dfe8e80b40a --- /dev/null +++ b/ports/openldap/openssl.patch @@ -0,0 +1,35 @@ +diff --git a/configure.ac b/configure.ac +index 626d024..e97f548 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1223,6 +1223,9 @@ fi + + ol_link_tls=no + if test $ol_with_tls = openssl || test $ol_with_tls = auto ; then ++ PKG_CHECK_MODULES(OPENSSL, openssl >= 1.1.1, [have_openssl=yes], [AC_MSG_FAILURE([OpenSSL is required])]) ++ CFLAGS="${OPENSSL_CFLAGS} ${CFLAGS}" ++ ac_cv_lib_ssl_SSL_export_keying_material_early=yes + AC_CHECK_HEADERS(openssl/ssl.h) + + if test $ac_cv_header_openssl_ssl_h = yes ; then +@@ -1245,7 +1248,8 @@ if test $ol_with_tls = openssl || test $ol_with_tls = auto ; then + AC_DEFINE(HAVE_OPENSSL, 1, + [define if you have OpenSSL]) + +- TLS_LIBS="-lssl -lcrypto" ++ TLS_LIBS="${OPENSSL_LIBS}" ++ AC_SUBST(TLS_MODULE, openssl, [TLS pkg-config module]) + fi + fi + fi +diff --git a/libraries/libldap/ldap.pc.in b/libraries/libldap/ldap.pc.in +index 3f7dd46..43b2e52 100644 +--- a/libraries/libldap/ldap.pc.in ++++ b/libraries/libldap/ldap.pc.in +@@ -10,4 +10,5 @@ Version: @VERSION@ + Requires: lber + Cflags: -I${includedir} + Libs: -L${libdir} -lldap +-Libs.private: @LIBS@ @SASL_LIBS@ @TLS_LIBS@ @AUTH_LIBS@ ++Libs.private: @LIBS@ @SASL_LIBS@ @AUTH_LIBS@ ++Requires.private: @TLS_MODULE@ diff --git a/ports/openldap/portfile.cmake b/ports/openldap/portfile.cmake new file mode 100644 index 00000000000000..dd617ce45edeba --- /dev/null +++ b/ports/openldap/portfile.cmake @@ -0,0 +1,66 @@ +vcpkg_download_distfile(ARCHIVE + URLS "https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.5.13.tgz" + FILENAME "openldap-2.5.13.tgz" + SHA512 30fdc884b513c53169910eec377c2ad05013b9f06bab3123d50d028108b24548791f7f47f18bcb3a2b4868edeab02c10d81ffa320c02d7b562f2e8f2fa25d6c9 +) + +vcpkg_list(SET EXTRA_PATCHES) + +# Check autoconf version < 2.70 +execute_process(COMMAND autoconf --version OUTPUT_VARIABLE AUTOCONF_VERSION_STR) +if(NOT "${AUTOCONF_VERSION_STR}" STREQUAL "" AND "${AUTOCONF_VERSION_STR}" MATCHES ".*2\\.[0-6].*") + vcpkg_list(APPEND EXTRA_PATCHES m4.patch) +endif() + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE "${ARCHIVE}" + PATCHES + openssl.patch + subdirs.patch + ${EXTRA_PATCHES} +) + +vcpkg_list(SET FEATURE_OPTIONS) +if("tools" IN_LIST FEATURES) + vcpkg_list(APPEND FEATURE_OPTIONS --enable-tools) +endif() + +if("cyrus-sasl" IN_LIST FEATURES) + vcpkg_list(APPEND FEATURE_OPTIONS --with-cyrus-sasl) +else() + vcpkg_list(APPEND FEATURE_OPTIONS --without-cyrus-sasl) +endif() + +# Disable build environment details in binaries +set(ENV{SOURCE_DATE_EPOCH} "1659614616") + +vcpkg_configure_make( + SOURCE_PATH "${SOURCE_PATH}" + DISABLE_VERBOSE_FLAGS + AUTOCONFIG + OPTIONS + ${FEATURE_OPTIONS} + --disable-cleartext + --disable-mdb + --disable-relay + --disable-slapd + --disable-syncprov + --with-tls=openssl + --without-systemd + --without-fetch + --without-argon2 + ac_cv_lib_iodbc_SQLDriverConnect=no + ac_cv_lib_odbc_SQLDriverConnect=no + ac_cv_lib_odbc32_SQLDriverConnect=no +) + +vcpkg_build_make(BUILD_TARGET depend LOGFILE_ROOT depend) +vcpkg_install_make() +vcpkg_fixup_pkgconfig() +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/openldap/subdirs.patch b/ports/openldap/subdirs.patch new file mode 100644 index 00000000000000..633a2542cb9571 --- /dev/null +++ b/ports/openldap/subdirs.patch @@ -0,0 +1,34 @@ +diff --git a/Makefile.in b/Makefile.in +index 5c6bec0..c654210 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -13,7 +13,11 @@ + ## top-level directory of the distribution or, alternatively, at + ## . + +-SUBDIRS= include libraries clients servers tests doc ++ifeq ($(patsubst %/debug,DEBUG,$(prefix)),DEBUG) ++SUBDIRS= include libraries ++else ++SUBDIRS= include libraries @TOOLS_SUBDIRS@ ++endif + CLEANDIRS= + INSTALLDIRS= + +diff --git a/configure.ac b/configure.ac +index e97f548..71dd7a6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -235,6 +235,12 @@ dnl OL_ARG_ENABLE(referrals,[AS_HELP_STRING([--enable-referrals], [enable LDAPv2 + ol_enable_referrals=${ol_enable_referrals-no} + OL_ARG_ENABLE(ipv6, [AS_HELP_STRING([--enable-ipv6], [enable IPv6 support])], auto)dnl + OL_ARG_ENABLE(local, [AS_HELP_STRING([--enable-local], [enable AF_LOCAL (AF_UNIX) socket support])], auto)dnl ++OL_ARG_ENABLE(tools, [AS_HELP_STRING([--enable-tools], [Build client tools])],no,[no yes]) ++TOOLS_SUBDIRS="" ++if test "$ol_enable_tools" = "yes" ; then ++ TOOLS_SUBDIRS="clients" ++fi ++AC_SUBST(TOOLS_SUBDIRS) + + dnl ---------------------------------------------------------------- + dnl General "with" options diff --git a/ports/openldap/usage b/ports/openldap/usage new file mode 100644 index 00000000000000..6777fcdda3f919 --- /dev/null +++ b/ports/openldap/usage @@ -0,0 +1,6 @@ +The package openldapp can be imported via CMake FindPkgConfig module: + + find_package(PkgConfig) + pkg_check_modules(OPENLDAP REQUIRED IMPORTED_TARGET ldap) + + target_link_libraries(main PRIVATE PkgConfig::OPENLDAP) diff --git a/ports/openldap/vcpkg.json b/ports/openldap/vcpkg.json new file mode 100644 index 00000000000000..ef517374780882 --- /dev/null +++ b/ports/openldap/vcpkg.json @@ -0,0 +1,19 @@ +{ + "name": "openldap", + "version": "2.5.13", + "description": "OpenLDAP Software is an open source implementation of the Lightweight Directory Access Protocol.", + "homepage": "https://www.openldap.org/software/", + "license": "OLDAP-2.8", + "supports": "!windows, (mingw & !x86)", + "dependencies": [ + "openssl" + ], + "features": { + "cyrus-sasl": { + "description": "with Cyrus SASL support" + }, + "tools": { + "description": "Enable client tools" + } + } +} diff --git a/versions/baseline.json b/versions/baseline.json index d50db78ca9d99f..b232e506f19572 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5240,6 +5240,10 @@ "baseline": "2.5.0", "port-version": 0 }, + "openldap": { + "baseline": "2.5.13", + "port-version": 0 + }, "openmama": { "baseline": "6.3.1", "port-version": 1 diff --git a/versions/o-/openldap.json b/versions/o-/openldap.json new file mode 100644 index 00000000000000..293f8b15af4de4 --- /dev/null +++ b/versions/o-/openldap.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "63f4c67d336142daba83711983e54a8954794331", + "version": "2.5.13", + "port-version": 0 + } + ] +}