[Pkg-samba-maint] [Git][samba-team/samba][master] 4 commits: d/rules: make dh magic a bit less magical

Michael Tokarev (@mjt) gitlab at salsa.debian.org
Tue Apr 5 17:43:24 BST 2022



Michael Tokarev pushed to branch master at Debian Samba Team / samba


Commits:
7c67aec1 by Michael Tokarev at 2022-04-05T18:50:07+03:00
d/rules: make dh magic a bit less magical

In d/rules we had some pieces depending on the output of
dh_listpackages.  And we were passing some -Nfoo options
to the dh sequence depending on arch/os.  This worked due
to some dh "magic", - aparently dh exports these options
soemwhere, and when invokes d/rules again (nested) to do
individual steps (like override_dh_installinit), the nested
invocation of dh_listpackages will return different list
than the one it returned while d/rules were read the first
time, - according to the -Nfoo options done by the dh
call nested in-between two d/rules.

This change makes this whole magic a bit less puzzling by
replacing $(dh_listpackages) checks with ${omit_packages}
checks which is set to the same value in both inner and
outer d/rules. This also saves another expensive $(shell )
run.

Also fix one case of working on ctdb package without checing
if it is enabled for this build or not.

While at it, add comment to d/make_shlibs about this very
dh_makeshlibs thing.

- - - - -
2d4468fc by Michael Tokarev at 2022-04-05T19:30:47+03:00
internal-ldb: add the forgotten python3-ldb symbols file generation

- - - - -
227955df by Michael Tokarev at 2022-04-05T19:37:39+03:00
use strict dependency in samba-dsdb-modules against libldb2 version

Since we build libldb from samba source, we can depend on the exact
version of libldb2 now.

This simplifies procedure of finding the right dependency expression,
so we do not need to cache it in a separate d/ldb-version.mk file.

- - - - -
6ae9d4ab by Michael Tokarev at 2022-04-05T19:41:52+03:00
d/rules: use ${LDB_VERSION} while generating the header for python3-ldb.symbols

- - - - -


4 changed files:

- − debian/ldb-version.mk
- debian/make_shlibs
- debian/python3-ldb.symbols.in
- debian/rules


Changes:

=====================================
debian/ldb-version.mk deleted
=====================================
@@ -1,3 +0,0 @@
-# autogenerated from lib/ldb/wscript
-LDB_DEB_VERSION := ${LDB_EPOCH}2.5.0+samba${DEB_VERSION_UPSTREAM_REVISION}
-LDB_DEPENDS := libldb2 (>> ${LDB_EPOCH}2.5.0~), libldb2 (<< ${LDB_EPOCH}2.5.1~)


=====================================
debian/make_shlibs
=====================================
@@ -58,7 +58,7 @@ make_shlibs() {
 	fi
 }
 
-
+# dh_shlibdeps handles -Nfoo passed from dh sequence in d/rules, too
 for pkg in $(dh_listpackages)
 do
 	make_shlibs $pkg


=====================================
debian/python3-ldb.symbols.in
=====================================
@@ -1,7 +1,5 @@
-#!/usr/bin/dh-exec
-libpyldb-util${DEB_PY3_EXTENSION_SUFFIX}.2 python3-ldb #MINVER#
- PYLDB_UTIL${DEB_PY3_EXTENSION_UPCASE}_2.5.0 at PYLDB_UTIL${DEB_PY3_EXTENSION_UPCASE}_2.5.0 2:2.5.0
-#include "python3-ldb.symbols.common" PYLDB_UTIL_1.1.2 at PYLDB_UTIL_1.1.2 2:2.0.7
+#libpyldb-util${DEB_PY3_EXTENSION_SUFFIX}.2 python3-ldb #MINVER#
+# PYLDB_UTIL${DEB_PY3_EXTENSION_UPCASE}_2.5.0 at PYLDB_UTIL${DEB_PY3_EXTENSION_UPCASE}_2.5.0 2:2.5.0
  PYLDB_UTIL_1.1.2 at PYLDB_UTIL_1.1.2 2:2.2.0
  PYLDB_UTIL_1.1.3 at PYLDB_UTIL_1.1.3 2:2.0.7
  PYLDB_UTIL_1.1.4 at PYLDB_UTIL_1.1.4 2:2.0.7


=====================================
debian/rules
=====================================
@@ -11,23 +11,10 @@ $(foreach var,DEB_HOST_ARCH DEB_HOST_ARCH_OS DEB_HOST_MULTIARCH,\
 
 export PYTHON = python3
 
-dh_packagelist := $(shell dh_listpackages)
-
 LDB_EPOCH := 2:
-debian/ldb-version.mk: lib/ldb/wscript
-# define two variables based on local version of ldb
-# samba ships ldb modules, which are specific to the ldb version,
-# so we need a strict dependency on the upstream ldb version
-	@echo "(Re)checkig version of LDB library.."
-	@set -e; \
-	v=$$(grep ^VERSION $< | cut -d\' -f2); \
-	[ -n "$$v" ] || { echo "E: unable to get LDB version from $<" >&2; exit 1; }; \
-	v="\$${LDB_EPOCH}$$v"; n="$${v%.*}.$$(($${v##*.}+1))"; exec 3>$@.tmp; \
-	echo "# autogenerated from $<" >&3; \
-	echo "LDB_DEB_VERSION := $$v+samba\$${DEB_VERSION_UPSTREAM_REVISION}" >&3; \
-	echo "LDB_DEPENDS := libldb2 (>> $$v~), libldb2 (<< $$n~)" >&3; \
-	exec 3>&-; mv -f $@.tmp $@
-include debian/ldb-version.mk
+LDB_VERSION := $(shell grep ^VERSION lib/ldb/wscript | cut -d\' -f2)
+LDB_DEB_VERSION := ${LDB_EPOCH}${LDB_VERSION}+samba${DEB_VERSION_UPSTREAM_REVISION}
+LDB_DEPENDS := libldb2 (= ${LDB_DEB_VERSION})
 
 V = 1
 WAF_CMD := PYTHONHASHSEED=1 ${PYTHON} ./buildtools/bin/waf
@@ -103,7 +90,6 @@ ifeq ($(DEB_VENDOR), Ubuntu)
     WITH_GLUSTERFS =
 endif
 
-
 ifeq ($(DEB_HOST_ARCH_OS), linux)
 	conf_args += \
 		--with-systemd \
@@ -114,18 +100,20 @@ else
 		--without-systemd
 endif
 
+omit_packages =
+
 # Ubuntu i386 binary compatibility only effort: Disable some i386 packages
 ifeq ($(DEB_VENDOR) $(DEB_HOST_ARCH), Ubuntu i386)
-	BUILD_PACKAGES += \
-		-Nctdb \
-		-Nlibpam-winbind \
-		-Nsamba \
-		-Nsamba-testsuite
+	omit_packages += \
+		ctdb \
+		libpam-winbind \
+		samba \
+		samba-testsuite
 endif
 
 binary binary-arch binary-indep build build-arch build-indep \
 clean install install-arch install-indep: %:
-	dh $* --with python3 $(BUILD_PACKAGES)
+	dh $* --with python3 $(addprefix -N,${omit_packages})
 
 override_dh_auto_configure configure: bin/configured.stamp
 .PHONY: configure
@@ -217,15 +205,15 @@ override_dh_install:
 		dh_install
 
 override_dh_installinit:
-ifneq (,$(filter samba, ${dh_packagelist}))
+ifeq (,$(filter samba, ${omit_packages}))
 	dh_installinit -psamba --name smbd
 	dh_installinit -psamba --name nmbd --error-handler nmbd_error_handler
 	dh_installinit -psamba --name samba-ad-dc
 endif
-ifneq (,$(filter winbind, ${dh_packagelist}))
+ifeq (,$(filter winbind, ${omit_packages}))
 	dh_installinit -pwinbind
 endif
-ifneq (,$(filter ctdb, ${dh_packagelist}))
+ifeq (,$(filter ctdb, ${omit_packages}))
 	# Install /etc/init.d/ctdb
 	mkdir -p debian/ctdb/etc/init.d
 	install -m755 ctdb/config/ctdb.init debian/ctdb/etc/init.d/ctdb
@@ -234,13 +222,13 @@ ifneq (,$(filter ctdb, ${dh_packagelist}))
 endif
 
 override_dh_installsystemd:
-ifneq (,$(filter samba, ${dh_packagelist}))
+ifeq (,$(filter samba, ${omit_packages}))
 	dh_installsystemd -psamba
 endif
-ifneq (,$(filter winbind, ${dh_packagelist}))
+ifeq (,$(filter winbind, ${omit_packages}))
 	dh_installsystemd -pwinbind
 endif
-ifneq (,$(filter ctdb, ${dh_packagelist}))
+ifeq (,$(filter ctdb, ${omit_packages}))
 	dh_installsystemd -pctdb --no-start --no-stop-on-upgrade
 endif
 
@@ -255,26 +243,37 @@ override_dh_installpam:
 
 override_dh_fixperms:
 	dh_fixperms
-ifneq (,$(filter samba, ${dh_packagelist}))
+ifeq (,$(filter samba, ${omit_packages}))
 	chmod 1777 debian/samba/var/spool/samba/
 endif
-ifneq (,$(filter smbclient, ${dh_packagelist}))
+ifeq (,$(filter smbclient, ${omit_packages}))
 	chmod 0700 debian/smbclient/usr/libexec/samba/smbspool_krb5_wrapper
 endif
 
 override_dh_makeshlibs:
+	# generate symbols file with correct cpython suffix in there
+	pyext=$$(python3-config --extension-suffix | tr _ -); \
+	pyUP=$$(echo $${pyext%.so} | tr a-z A-Z); \
+	{ echo "libpyldb-util$${pyext}.2 python3-ldb #MINVER#"; \
+	  echo " PYLDB_UTIL$${pyUP}_${LDB_VERSION}@PYLDB_UTIL$${pyUP}_${LDB_VERSION} ${LDB_EPOCH}${LDB_VERSION}"; \
+	  cat debian/python3-ldb.symbols.in; } > debian/python3-ldb.symbols
+
 	# create symbols and shlibs files in separate wrapper script
 	# to deal with private libraries
 	debian/make_shlibs "${LDB_DEB_VERSION}|libldb2|ldb-tools|libldb-dev|python3-ldb|python3-ldb-dev"
 
+	rm -f debian/python3-ldb.symbols
+
 override_dh_shlibdeps:
 # for specific executables/modules, put dependencies in separate variables
 # to change Depends to Recommends for them in d/control
 	dh_shlibdeps -l${CURDIR}/debian/tmp/usr/lib/${DEB_HOST_MULTIARCH}/samba \
 	    -Xceph.so -Xglusterfs.so -Xsnapper.so -Xctdb_mutex_ceph_rados_helper
+ifeq (,$(filter ctdb, ${omit_packages}))
 ifneq ($(WITH_CEPH),)
 	dpkg-shlibdeps -Tdebian/ctdb.substvars -prados \
 	    debian/ctdb/usr/libexec/ctdb/ctdb_mutex_ceph_rados_helper
+endif
 endif
 	dpkg-shlibdeps -Tdebian/samba-vfs-modules.substvars -pvfsmods \
 	    debian/samba-vfs-modules/usr/lib/*/samba/vfs/snapper.so \



View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/9f2cdd2060d7860838d4c6882453fe9752097b81...6ae9d4ab7a2b767d839e3a1dc525f869d2a36567

-- 
View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/9f2cdd2060d7860838d4c6882453fe9752097b81...6ae9d4ab7a2b767d839e3a1dc525f869d2a36567
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-samba-maint/attachments/20220405/a5d7ded3/attachment-0001.htm>


More information about the Pkg-samba-maint mailing list