Name libsasl2-2
Description Cyrus SASL - authentication abstraction library
Version 2.1.28+dfsg1-5ubuntu3.1
Package Base cyrus-sasl2
Homepage https://www.cyrusimap.org/sasl/
Maintainers ['Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>']
Contributors ['Ondřej Surý <ondrej@debian.org>,']
Distro-repo https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/tree/?h=ubuntu/noble
Sources ['https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/../?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0001-plugins-digestmd5-Remove-debug-log-mech-free.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0002-Use-etc-sasldb2-instead-of-.-sasldb-in-the-testsuite.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0003-Update-saslauthd.conf-location-in-documentation.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0004-Include-dbconverter-2-in-sbin_PROGRAMS-and-set-defau.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0005-Fix-time-check.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0006-Makefile.am-Set-date-in-man-pages.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0007-Self-reference-pluginviewer-man-as-saslpluginviewer.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0008-Don-t-overwrite-PIC-objects-with-non-PIC-variant.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0009-Look-for-generic-Berkeley-DB-first.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0010-Add-sasldbconverter2.8.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0011-honor-log_level-option-on-clients-too.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0012-Make-the-libsasl2-symbols-versioned.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0013-Don-t-use-la-files-for-opening-plugins.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0014-Prevent-recreating-of-md5global.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0015-Replace-MD5-with-OpenSSL-legacy-implementation.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0016-saslauthd-Replace-MD5-with-OpenSSL-EVP-implementation.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0017-Just-completely-remove-libobj-from-autotools-files.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0018-Temporary-multiarch-fixes.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0019-Add-reference-to-LDAP_SASLAUTHD-file-to-the-saslauth.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0020-Exclude-md5global.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0021-Replace-custom-memset-with-OPENSSL_cleanse.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0022-Replace-custom-with-standard-memcpy.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0023-Add-a-note-on-the-RSA-MD-license.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0024-Relicense-md5.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0025-Revert-upstream-soname-bump.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0026-Gracefully-handle-failed-init.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0027-Catch-errors-from-EVP_Digest-functions.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0028-utils-Link-libcrypto.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0029-Load-OpenSSL3-legacy-provider-digestmd5.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0030-testsuite-Replace-MD5-with-OpenSSL-EVP-implementation.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0031-checkpw-Replace-MD5-with-OpenSSL-EVP-implementation.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0032-Add-with_pgsql-include-postgresql-to-include-path.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0033-Check-for-gssapi_krb5.h-before-testing-a-resulting-value.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0034-channel-binding-gssapi-gss-spnego.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0035-Add-support-for-setting-max-ssf-0-to-GSS-SPNEGO-1.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0035-Add-support-for-setting-max-ssf-0-to-GSS-SPNEGO-2.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0036-Prevent-linking-via-intersphinx.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/0037-Extend-the-time_t-format-specifiers-to-64-bit.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/cyrus-sasl2/plain/debian/patches/series?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/libsasl2-2/plain/debian/watch?h=ubuntu/noble']
Dependencies ['libc6', 'libsasl2-modules-db', 'libssl3t64']
Optional-Dependencies ['libsasl2-modules']
Build-Dependencies ['chrpath', 'debhelper-compat', 'default-libmysqlclient-dev <!pkg.cyrus-sasl2.nosql>', 'docbook-to-man', 'groff-base', 'heimdal-multidev <!pkg.cyrus-sasl2.nogssapi>', 'krb5-multidev <!pkg.cyrus-sasl2.nogssapi>', 'libdb-dev', 'libcrypt-dev', 'libkrb5-dev <!pkg.cyrus-sasl2.nogssapi>', 'libldap2-dev <!pkg.cyrus-sasl2.noldap>', 'libpam0g-dev', 'libpod-pom-view-restructured-perl', 'libpq-dev <!pkg.cyrus-sasl2.nosql>', 'libsqlite3-dev', 'libssl-dev', 'po-debconf', 'python3-six', 'python3-sphinx-rtd-theme']
Provides []
Builddate
Architecture amd64
Distro-Version noble
Licenses []
Hash eda097f98dcb3a08b9ce157d6191d140e4885c1cba47b683c94b8ca45e88f458
#!/usr/bin/make -f
# -*- makefile -*-
#
# debian/rules for CMU Cyrus SASL version 2.1
#
# Copyright (c) 2011 by Ondřej Surý - migrated to dh7
# Based on previous work (c) 2006 by Fabian Fagerholm.
# Based on previous work by Dima Barsky.
# Based on cyrus-imapd-2.2 packages by Henrique de Moraes Holshuch.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Note that Cyrus SASL itself is published under a different license.

# Debhelper control.
export DH_ALWAYS_EXCLUDE=CVS
#export DH_VERBOSE=1 # uncomment this to turn on verbose mode

# Enable package hardening through dpkg-buildflags
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk
-include /usr/share/dpkg/buildtools.mk
export CC

ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
# Debian's GSSAPI is known to support SPNEGO.
export ac_cv_gssapi_supports_spnego=yes
endif

# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
# package maintainers to append LDFLAGS
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-z,defs

# Save Berkeley DB used for building the package
BDB_VERSION ?= $(shell LC_ALL=C dpkg-query -l 'libdb[45].[0-9]-dev' | grep ^ii | sed -e 's|.*\s\libdb\([45]\.[0-9]\)-dev\s.*|\1|')

# SQL support may be turned off during the build, but is on by default.
ifeq (,$(findstring no-sql,$(DEB_BUILD_OPTIONS))$(findstring pkg.cyrus-sasl2.nosql,$(DEB_BUILD_PROFILES)))
	CONFIGURE_SQL=--enable-sql
else
	CONFIGURE_SQL=--disable-sql
	DH_PACKAGE_EXCLUDES += -Nlibsasl2-modules-sql
endif

# LDAP support may be turned off during the build, but is on by default.
ifeq (,$(findstring no-ldap,$(DEB_BUILD_OPTIONS))$(findstring pkg.cyrus-sasl2.noldap,$(DEB_BUILD_PROFILES)))
	CONFIGURE_LDAP=--with-ldap
	CONFIGURE_LDAPDB=--enable-ldapdb
else
	CONFIGURE_LDAP=--without-ldap
	CONFIGURE_LDAPDB=--disable-ldapdb
	DH_PACKAGE_EXCLUDES += -Nlibsasl2-modules-ldap
endif

# GSSAPI support may be turned off during the build, but is on by default
ifeq (,$(findstring no-gssapi,$(DEB_BUILD_OPTIONS))$(findstring pkg.cyrus-sasl2.nogssapi,$(DEB_BUILD_PROFILES)))
	CONFIGURE_GSSAPI=--enable-gssapi
else
	CONFIGURE_GSSAPI=--disable-gssapi
	DH_PACKAGE_EXCLUDES += -Nlibsasl2-modules-gssapi-mit \
		-Nlibsasl2-modules-gssapi-heimdal
endif

CONFIGURE_COMMON_OPTIONS= \
	--build=$(DEB_BUILD_GNU_TYPE) \
	--prefix=/usr \
	--mandir=\$${prefix}/share/man \
	--infodir=\$${prefix}/share/info \
	--enable-static \
	--enable-shared \
	--enable-alwaystrue \
	--enable-checkapop \
	--enable-cram \
	--enable-digest \
	--enable-otp \
	--disable-srp \
	--disable-srp-setpass \
	--disable-krb4 \
	$(CONFIGURE_GSSAPI) \
	--enable-gss_mutexes \
	--enable-auth-sasldb \
	--enable-plain \
	--enable-anon \
	--enable-login \
	--enable-ntlm \
	--disable-passdss \
	$(CONFIGURE_SQL) \
	--with-sqlite3=/usr \
	--with-mysql=/usr \
	--with-pgsql=/usr \
	$(CONFIGURE_LDAPDB) \
	--disable-macos-framework \
	--with-pam=/usr \
	--with-saslauthd=/var/run/saslauthd \
	$(CONFIGURE_LDAP) \
	--with-configdir=/etc/sasl2:/etc/sasl:/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2:/usr/lib/sasl2 \
	--with-plugindir=/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2 \
	--sysconfdir=/etc \
	--with-devrandom=/dev/urandom \
	--with-sphinx-build

# Some convenience variables
export TMPBUILD_MIT := build-mit
export TMPBUILD_HEIMDAL := build-heimdal
export TMP_MIT := debian/tmp
export TMP_HEIMDAL := debian/tmp-heimdal
export MIT_LDFLAGS := $(shell krb5-config.mit --libs gssapi | sed -e 's/ -l.*//')
export MIT_CFLAGS := $(shell krb5-config.mit --cflags gssapi)
export HEIMDAL_LDFLAGS := $(shell krb5-config.heimdal --libs gssapi | sed -e 's/ -l.*//')
export HEIMDAL_CFLAGS := $(shell krb5-config.heimdal --cflags gssapi)

AUTOFILES=acinclude.m4 aclocal.m4 config/config.sub config/config.guess \
		  config/ltmain.sh config/libtool.m4

### The Makefile targets begin. ###

%:
	dh $@ $(DH_PACKAGE_EXCLUDES)

override_dh_auto_clean:
	dh_auto_clean -B$(TMPBUILD_MIT)
	dh_auto_clean -B$(TMPBUILD_HEIMDAL)

	rm -f sample/sample-client \
		sample/sample-server
	[ ! -f Makefile ] || $(MAKE) distclean
	-rm -f config.h config.log autom4ate.cache

	# Remove symlinks that the CMU build sets up but never removes.
	# They can be found by running find . -lname '*' -print in the
	# source tree before and after a build and comparing the differences.
	rm -f lib/sasldb.c lib/db_berkeley.c lib/allockey.c lib/cram.c \
			lib/digestmd5.c lib/otp.c lib/gssapi.c lib/plain.c \
			lib/anonymous.c lib/login.c lib/ntlm.c lib/sql.c lib/ldapdb.c

	# Remove generated man pages
	-rm -f sasl-sample-client.8 sasl-sample-server.8

	# Remove build directories
	rm -rf $(TMP_MIT) $(TMP_HEIMDAL)

override_dh_auto_configure:
	$(file > common/crypto-compat.c,)
	$(file > common/crypto-compat.h,)
	LDFLAGS="$(LDFLAGS) $(HEIMDAL_LDFLAGS)" \
	CFLAGS="$(CFLAGS) $(HEIMDAL_CFLAGS)" \
	dh_auto_configure -B$(TMPBUILD_HEIMDAL) -- $(CONFIGURE_COMMON_OPTIONS) --with-gss_impl=heimdal

	LDFLAGS="$(LDFLAGS) $(MIT_LDFLAGS)" \
	CFLAGS="$(CFLAGS) $(MIT_CFLAGS)" \
	dh_auto_configure -B$(TMPBUILD_MIT) -- $(CONFIGURE_COMMON_OPTIONS) --with-gss_impl=mit

override_dh_auto_build:
	-mkdir docsrc/exts/themes
	-ln -s /usr/share/sphinx_rtd_theme docsrc/exts/themes/cyrus
	dh_auto_build -B$(TMPBUILD_HEIMDAL) -- sasldir=/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2
	dh_auto_build -B$(TMPBUILD_MIT) -- sasldir=/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2 all doc-html

	# Build sample-{client,server}
	$(MAKE) -f ../debian/sample/Makefile -C sample T=../$(TMPBUILD_MIT)

	# Build the sasl-sample-client and sasl-sample-server man pages.
	/usr/bin/docbook-to-man debian/sasl-sample-client.sgml \
		> sasl-sample-client.8
	/usr/bin/docbook-to-man debian/sasl-sample-server.sgml \
		> sasl-sample-server.8

override_dh_auto_install:
	dh_auto_install -B$(TMPBUILD_HEIMDAL) --destdir=$(TMP_HEIMDAL) -- sasldir=/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2
	dh_auto_install -B$(TMPBUILD_MIT) --destdir=$(TMP_MIT) -- sasldir=/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2

	# Remove static plugins - they are useless
	rm $(TMP_MIT)/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2/*.a
	# Remove libtool la files, they are eeevil
	rm $(TMP_MIT)/usr/lib/$(DEB_HOST_MULTIARCH)/*.la \
	   $(TMP_MIT)/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2/*.la

	# Note the version of Berkeley DB used to build this package
	mkdir -p $(TMP_MIT)/usr/lib/sasl2
	echo $(BDB_VERSION) > $(TMP_MIT)/usr/lib/sasl2/berkeley_db.txt

	# Alter the default location and names of files to fit Debian
	# policy and better integrate with the Debian system.
	mv $(TMP_MIT)/usr/sbin/pluginviewer $(TMP_MIT)/usr/sbin/saslpluginviewer
	mv $(TMP_MIT)/usr/share/man/man8/pluginviewer.8 \
		$(TMP_MIT)/usr/share/man/man8/saslpluginviewer.8
	install -m 644 saslauthd/saslauthd.mdoc \
		$(TMP_MIT)/usr/share/man/man8/saslauthd.8
	mv $(TMP_MIT)/usr/sbin/dbconverter-2 $(TMP_MIT)/usr/sbin/sasldbconverter2

	# Install sample-{client,server} with Debianized names
	install -m 755 -D sample/sample-client \
		$(TMP_MIT)/usr/bin/sasl-sample-client
	install -m 755 -D sample/sample-server \
		$(TMP_MIT)/usr/sbin/sasl-sample-server

	# Alter the rpath of certain binaries and shared libraries.
	chrpath -d $(TMP_MIT)/usr/sbin/sasldblistusers2 \
		$(TMP_MIT)/usr/sbin/saslpasswd2
ifeq (,$(findstring no-gssapi,$(DEB_BUILD_OPTIONS))$(findstring pkg.cyrus-sasl2.nogssapi,$(DEB_BUILD_PROFILES)))
	chrpath -d $(TMP_HEIMDAL)/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2/libgs2.so.*.*.*
	chrpath -d $(TMP_HEIMDAL)/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2/libgssapiv2.so.*.*.*
endif
ifeq (,$(findstring no-sql,$(DEB_BUILD_OPTIONS))$(findstring pkg.cyrus-sasl2.nosql,$(DEB_BUILD_PROFILES)))
	chrpath -d $(TMP_MIT)/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2/libsql.so.*.*.*
endif

	# Install the sasl-sample-client and -server man pages.
	dh_installman -psasl2-bin sasl-sample-client.8 sasl-sample-server.8

override_dh_install:
	dh_install -Nlibsasl2-modules-gssapi-heimdal --sourcedir=$(TMP_MIT)
	dh_install -plibsasl2-modules-gssapi-heimdal --sourcedir=$(TMP_HEIMDAL)

override_dh_missing:
	dh_missing --fail-missing

override_dh_installinit:
	dh_installinit --no-enable $(DH_PACKAGE_EXCLUDES) --name=saslauthd

execute_after_dh_installsystemd:
	dh_installsystemd --no-enable $(DH_PACKAGE_EXCLUDES) --name=saslauthd

override_dh_installchangelogs:
	dh_installchangelogs -XChangeLog

override_dh_makeshlibs:
	dh_makeshlibs -X/usr/lib/$(DEB_HOST_MULTIARCH)/sasl2 $(DH_PACKAGE_EXCLUDES)

override_dh_auto_test:
	cd $(TMPBUILD_MIT)/saslauthd && $(MAKE) testsaslauthd
	cd $(TMPBUILD_MIT)/utils && $(MAKE) testsuite