Source: openldap
Version: 2.4.31-1+nmu2
Severity: wishlist
Tags: patch

During bootstrapping, I need to break the Build-Depends cycle openldap -> 
heimdal-dev -> libldap2-dev.  The attached patch allows this.  (There's also a 
small part that's not qualified by ifeq ($(DEB_BUILD_PROFILE),stage1) as it 
seems like a minor bug to me that the build process depends on the previous 
shlibs file for libldap-2.4-2.)
-- 
Daniel Schepler
diff -urN openldap-2.4.31.old/debian/rules openldap-2.4.31/debian/rules
--- openldap-2.4.31.old/debian/rules	2013-06-04 11:39:49.000000000 -0700
+++ openldap-2.4.31/debian/rules	2013-06-04 11:46:37.123068800 -0700
@@ -13,6 +13,10 @@
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
 
+ifeq ($(DEB_BUILD_PROFILE),stage1)
+DH_PACKAGE_EXCLUDES = -Nslapd-smbk5pwd
+endif
+
 CONFIG		= $(shell grep -v "^\#" debian/configure.options)
 ifneq ($(DEB_HOST_ARCH_OS),linux)
 	CONFIG += --disable-mdb
@@ -51,7 +55,7 @@
 	gzip -9 openldap_$(VERSION).orig.tar
 
 %:
-	dh $@ --with quilt,autoreconf --builddirectory=$(builddir)
+	dh $@ --with quilt,autoreconf --builddirectory=$(builddir) $(DH_PACKAGE_EXCLUDES)
 
 override_dh_auto_configure:
 	# Check if we include the RFCs, Internet-Drafts, or upstream schemas
@@ -78,12 +82,16 @@
 
 override_dh_auto_build:
 	dh_auto_build -- $(MAKEVARS)
+ifneq ($(DEB_BUILD_PROFILE),stage1)
 	$(MAKE) -C contrib/slapd-modules/smbk5pwd
+endif
 	$(MAKE) -C contrib/slapd-modules/autogroup
 
 override_dh_auto_install:
 	dh_auto_install -- $(MAKEVARS)
+ifneq ($(DEB_BUILD_PROFILE),stage1)
 	$(MAKE) -C contrib/slapd-modules/smbk5pwd install DESTDIR=$(installdir)
+endif
 	$(MAKE) -C contrib/slapd-modules/autogroup install DESTDIR=$(installdir)
 
 	# Empty the dependency_libs file in the .la files.
@@ -113,17 +121,17 @@
 		| xargs perl -pi -e 's#(\.TH \w+ 8)C#$$1#'
 
 override_dh_install:
-	dh_install
+	dh_install $(DH_PACKAGE_EXCLUDES)
 	rm -rf $(CURDIR)/debian/slapd/usr/lib/ldap/smbk5pwd*
 	chmod 0755 $(CURDIR)/debian/slapd/usr/share/slapd/ldiftopasswd
 
 override_dh_installinit:
-	dh_installinit -- "defaults 19 80"
+	dh_installinit $(DH_PACKAGE_EXCLUDES) -- "defaults 19 80"
 
 override_dh_strip:
 	dh_strip -plibldap-2.4-2 --dbg-package=libldap-2.4-2-dbg
 	dh_strip -pslapd --dbg-package=slapd-dbg
-	dh_strip -Nlibldap-2.4-2 -Nslapd
+	dh_strip -Nlibldap-2.4-2 -Nslapd $(DH_PACKAGE_EXCLUDES)
 	# hardlink these so not confined by apparmor; do this here and not
 	# in dh_link so that dh_strip doesn't get confused and put the wrong
 	# binary in the debug package.
@@ -135,13 +143,15 @@
 	for pkg in libldap2-dev libldap-2.4-2; do \
 		sed -e"s/\$${DEB_HOST_MULTIARCH}/$(DEB_HOST_MULTIARCH)/g" < debian/$$pkg.links.in > debian/$$pkg.links; \
 	done
-	dh_link
+	dh_link $(DH_PACKAGE_EXCLUDES)
 
 override_dh_makeshlibs:
 	# ideally we would do this and not have any libldap-2.4.so.2 links
 	# at all, but that requires adjusting the build scripts first to
 	# link against libldap_r, otherwise dh_shlibdeps fails
 	#dh_makeshlibs -plibldap-2.4-2 -V 'libldap-2.4-2 (>= 2.4.7)'
+	mkdir -p debian/libldap-2.4-2/DEBIAN
+	cp -p debian/libldap-2.4-2.shlibs debian/libldap-2.4-2/DEBIAN/shlibs
 	echo "slapd:Provides=$$(objdump -p debian/slapd/usr/lib/$(DEB_HOST_MULTIARCH)/libslapi-*.so.* \
 		| sed -ne '/SONAME/ { s/[[:space:]]*SONAME[[:space:]]*//; \
 		                      s/\.so\./-/; p; q }' \
@@ -149,7 +159,7 @@
 	dh_makeshlibs -pslapd -X/usr/lib/ldap/ -V "$$(sed -ne's/slapd:Provides=//p' debian/slapd.substvars)"
 
 override_dh_installdeb:
-	dh_installdeb
+	dh_installdeb $(DH_PACKAGE_EXCLUDES)
 	perl -w debian/dh_installscripts-common -p slapd
 
 override_dh_auto_clean:

Reply via email to