[Pkg-samba-maint] [Git][samba-team/samba][master] 7 commits: d/rules: stop stripping +dfsg suffix from ldb version, it makes no sense

Michael Tokarev (@mjt) gitlab at salsa.debian.org
Thu Nov 10 14:05:30 GMT 2022



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


Commits:
2fb7ac84 by Michael Tokarev at 2022-11-09T09:54:48+03:00
d/rules: stop stripping +dfsg suffix from ldb version, it makes no sense

..but it makes the same version string to be found everywhere

- - - - -
75d1f7a1 by Michael Tokarev at 2022-11-09T21:48:38+03:00
d/control: declare dependency on password (for groupadd in postinst) for winbind and samba (#1023759)

- - - - -
f2367b87 by Michael Tokarev at 2022-11-10T14:03:15+03:00
d/control: mark libufing-dev build dep with <!pkg.samba.nouring>

This makes it much easier to build samba packages on older distributions
where liburing does not exist (eg ubuntu focal)

- - - - -
9e40de8c by Michael Tokarev at 2022-11-10T15:56:26+03:00
d/rules: parametrise list of packages to omit (on ubuntu-i386) with ${omit-pkgs}

- - - - -
9be6aa6a by Michael Tokarev at 2022-11-10T16:03:47+03:00
d/rules: use variables in a more consistent way

- - - - -
08c8f439 by Michael Tokarev at 2022-11-10T16:03:51+03:00
enable pkg.samba.mitkrb5 build profile to build with system mit-kerberos5

- enable libkrb5-dev build dependency (>= 1.19.0),
- remove third_party/heimdal out of the way just in case
- (and move it back in "clean" target),
- add extra options to configure -- --with-system-mitkrb5,
- enable --with-experimental-mit-ad-dc,
- remove heimdal libraries from samba-libs.install (and a few other *.install)
  (with <!mitkrb5> mark)
- adds few more files to winbind.install and samba.install
  (with <mitkrb5> mark)

For now, all package names are the same no matter if the profile has been
enabled or not, but packages from different builds are obviously not
compatible with each other.

- - - - -
b089d4b2 by Michael Tokarev at 2022-11-10T16:08:20+03:00
for mitkrb5 build profile, add "mitkrb5" version suffix to certain packages

Having two builds of samba package, one with mitkrb5 profile and one without,
various packages from two builds are not compatible with each other, --
for example, samba built with mitkrb5 can not be used with samba-libs built
without mitkrb5 and vise versa.  Add "mitkrb5" suffix to version of various
packages with direct =$version dependencies between each other, so that the
correct dependencies will be picked up.

This might be automated perhaps - everything which depends on samba-libs
with exact version should be marked with that version suffix.

- - - - -


5 changed files:

- debian/control
- debian/rules
- debian/samba-libs.install
- debian/samba.install
- debian/winbind.install


Changes:

=====================================
debian/control
=====================================
@@ -47,6 +47,7 @@ Build-Depends-Arch:
 	libicu-dev,
 	libjansson-dev,
 	libjson-perl,
+	libkrb5-dev (>= 1.19.0~) <pkg.samba.mitkrb5>,
 	libldap2-dev,
 	liblmdb-dev,
 	libncurses5-dev,
@@ -59,7 +60,7 @@ Build-Depends-Arch:
 	libsystemd-dev [linux-any],
 	libtasn1-6-dev (>= 3.8),
 	libtasn1-bin,
-	liburing-dev [linux-any],
+	liburing-dev [linux-any] <!pkg.samba.nouring>,
 	xfslibs-dev [linux-any],
 	zlib1g-dev (>= 1:1.2.3),
 # python:
@@ -81,7 +82,7 @@ Vcs-Git: https://salsa.debian.org/samba-team/samba.git
 Package: samba
 Architecture: any
 Pre-Depends: ${misc:Pre-Depends}
-Depends: adduser,
+Depends: passwd,
          libpam-modules,
          libpam-runtime (>= 1.0.1-11),
          lsb-base (>= 4.1+Debian),
@@ -349,9 +350,11 @@ Multi-Arch: allowed
 Depends: lsb-base (>= 3.0-6),
          samba-common (= ${source:Version}),
          samba-common-bin (=${binary:Version}),
+# for groupadd in postinst
+         passwd,
          ${misc:Depends},
          ${shlibs:Depends}
-Enhances: libkrb5-26-heimdal
+Enhances: libkrb5-26-heimdal <!pkg.samba.mitkrb5>
 Suggests: libnss-winbind, libpam-winbind
 # 4.16.6+dfsg-5 idmap_{script,rfc2307}.8 moved samba{,-libs} => winbind
 Breaks:   samba (<< 2:4.16.6+dfsg-5~), samba-libs (<< 2:4.16.6+dfsg-5~),


=====================================
debian/rules
=====================================
@@ -19,7 +19,7 @@ DESTDIR = ${CURDIR}/debian/tmp
 
 LDB_EPOCH = 2:
 LDB_VERSION = $(call dpkg_late_eval,LDB_VERSION,grep ^VERSION lib/ldb/wscript | cut -d\' -f2)
-LDB_DEB_VERSION = ${LDB_EPOCH}${LDB_VERSION}+samba$(subst +dfsg,,${DEB_VERSION_UPSTREAM_REVISION})
+LDB_DEB_VERSION = ${LDB_EPOCH}${LDB_VERSION}+samba${DEB_VERSION_UPSTREAM_REVISION}
 LDB_DEPENDS = libldb2 (= ${LDB_DEB_VERSION})
 LDB_PACKAGES = libldb2 libldb-dev ldb-tools python3-ldb python3-ldb-dev
 
@@ -27,40 +27,61 @@ LDB_PACKAGES = libldb2 libldb-dev ldb-tools python3-ldb python3-ldb-dev
 # should be removed for bookworm+. Also LDB_2.4.4 in d/libldb2.symbols
 EXTRA_ABI_VERSION_FILES = lib/ldb/ABI/ldb-2.4.4.sigs
 
+omit-pkgs =
+with-glusterfs =
+with-ceph =
+with-snapper =
+extra-args =
+
 ifeq (${DEB_HOST_ARCH_OS}, linux) # extra linux-specific features
-with_glusterfs = yes
-with_ceph = yes
-with_snapper = yes
+with-glusterfs = yes
+with-ceph = yes
+with-snapper = yes
 
 # Ceph is not available on all platforms
 ifeq (,$(filter amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x, ${DEB_HOST_ARCH}))
-with_ceph =
+with-ceph =
 endif
 
-extra-args = \
+extra-args += \
 	--with-quota \
 	\
 	--with-systemd \
 	--systemd-install-services \
 	--with-systemddir=/lib/systemd/system \
 
-else # non-linux
-with_glusterfs =
-with_ceph =
-with_snapper =
-extra-args =
 endif
 
 # Ubuntu i386 binary compatibility only effort: Disable some i386 packages and modules
 ifeq (${DEB_VENDOR}-${DEB_HOST_ARCH}, Ubuntu-i386)
-export DH_OPTIONS += $(addprefix -N,\
-	ctdb libpam-winbind samba samba-testsuite samba-vfs-modules )
-with_ceph =
-with_glusterfs =
+omit-pkgs += ctdb libpam-winbind samba samba-testsuite samba-vfs-modules
+with-ceph =
+with-glusterfs =
+endif
+
+with_mitkrb5 = $(filter pkg.samba.mitkrb5, ${DEB_BUILD_PROFILES})
+ifneq (,${with_mitkrb5})
+extra-args += \
+	--with-system-mitkrb5 \
+	--with-experimental-mit-ad-dc \
+	--with-system-mitkdc=/usr/sbin/krb5kdc
+# samba packages will have its own version suffix
+mitkrb5-samba-ver := ${DEB_VERSION}mitkrb5
+mitkrb5-dep-pkgs := samba-libs samba-dev
+mitkrb5-dep-pkgs += samba samba-common-bin python3-samba
+mitkrb5-dep-pkgs += samba-dsdb-modules samba-vfs-modules
+mitkrb5-dep-pkgs += libsmbclient smbclient
+mitkrb5-dep-pkgs += libnss-winbind libpam-winbind
+mitkrb5-dep-pkgs += winbind
+mitkrb5-dep-pkgs += samba-testsuite
+mitkrb5-dep-pkgs += ctdb
+else
+mitkrb5-dep-pkgs :=
 endif
 
-# build_pakages will honour arch/indep and the above list in ${DH_OPTIONS}
-build_packages = $(shell dh_listpackages)
+export DH_OPTIONS += $(addprefix -N, ${omit-pkgs})
+# ${build-pkgs} will honour arch/indep and the above list in ${DH_OPTIONS}
+build-pkgs = $(shell dh_listpackages)
 
 conf_args = \
 	--prefix=/usr \
@@ -98,7 +119,7 @@ conf_args = \
 	--enable-etcd-reclock \
 	--with-socketpath=/run/ctdb/ctdbd.socket \
 	--with-logdir=/var/log/ctdb \
-	$(if ${with_ceph},\
+	$(if ${with-ceph},\
 	  --enable-cephfs --enable-ceph-reclock,\
 	  --disable-cephfs) \
 	${extra-args} \
@@ -122,6 +143,10 @@ bin/configured.stamp:
 	touch ${EXTRA_ABI_VERSION_FILES}
 # #1013205: https://lists.samba.org/archive/samba-technical/2022-November/137788.html
 	rm -f third_party/heimdal/lib/gssapi/gssapi.h
+ifneq (,${with_mitkrb5}) # ensure we do not use embedded heimdal in any way
+	[ -d third_party/heimdal-build-with-mitkrb5 ] || \
+		mv third_party/heimdal third_party/heimdal-build-with-mitkrb5
+endif
 	touch $@
 
 build-arch: bin/built.stamp
@@ -251,16 +276,16 @@ endif
 override_dh_installpam:
 
 # include a command only if the given package is being built
-ifpkg = $(if $(filter ${1},${build_packages}),${2})
+ifpkg = $(if $(filter ${1},${build-pkgs}),${2})
 
 override_dh_installinit:
-ifneq (,$(filter samba, ${build_packages}))
+ifneq (,$(filter samba, ${build-pkgs}))
 	dh_installinit -psamba --name smbd
 	dh_installinit -psamba --name nmbd --error-handler nmbd_error_handler
 	dh_installinit -psamba --name samba-ad-dc
 endif
 	$(call ifpkg, winbind, dh_installinit -pwinbind)
-ifneq (,$(filter ctdb, ${build_packages}))
+ifneq (,$(filter ctdb, ${build-pkgs}))
 	install -Dp -m755 ctdb/config/ctdb.init debian/ctdb/etc/init.d/ctdb
 	# Install dh scripts
 	dh_installinit -pctdb --no-start --no-stop-on-upgrade --onlyscripts
@@ -287,7 +312,9 @@ override_dh_makeshlibs:
 
 	# create symbols and shlibs files in separate wrapper script
 	# to deal with private libraries
-	debian/genshlibs $(addsuffix =${LDB_DEB_VERSION},${LDB_PACKAGES})
+	debian/genshlibs \
+		$(addsuffix =${LDB_DEB_VERSION},${LDB_PACKAGES}) \
+		$(addsuffix =${mitkrb5-samba-ver}, ${mitkrb5-dep-pkgs})
 
 	rm -f debian/python3-ldb.symbols
 
@@ -300,18 +327,18 @@ override_dh_shlibdeps:
 # to change Depends to Recommends for them in d/control
 	dh_shlibdeps -l/usr/lib/${DEB_HOST_MULTIARCH}/samba \
 	    -Xceph.so -Xglusterfs.so -Xsnapper.so -Xctdb_mutex_ceph_rados_helper
-ifneq (,$(filter ctdb, ${build_packages}))
-ifneq (${with_ceph},)
+ifneq (,$(filter ctdb, ${build-pkgs}))
+ifneq (${with-ceph},)
 	dpkg-shlibdeps -Tdebian/ctdb.substvars -prados \
 	    debian/ctdb/usr/libexec/ctdb/ctdb_mutex_ceph_rados_helper
 endif
 endif
-ifneq (,$(filter samba-vfs-modules,${build_packages}))
-ifneq (${with_snapper}${with_ceph}${with_glusterfs},)
+ifneq (,$(filter samba-vfs-modules,${build-pkgs}))
+ifneq (${with-snapper}${with-ceph}${with-glusterfs},)
 	dpkg-shlibdeps -Tdebian/samba-vfs-modules.substvars -pvfsmods \
-	    $(if ${with_snapper}, debian/samba-vfs-modules/usr/lib/*/samba/vfs/snapper.so) \
-	    $(if ${with_ceph}, debian/samba-vfs-modules/usr/lib/*/samba/vfs/ceph.so) \
-	    $(if ${with_glusterfs}, debian/samba-vfs-modules/usr/lib/*/samba/vfs/glusterfs.so)
+	    $(if ${with-snapper}, debian/samba-vfs-modules/usr/lib/*/samba/vfs/snapper.so) \
+	    $(if ${with-ceph}, debian/samba-vfs-modules/usr/lib/*/samba/vfs/ceph.so) \
+	    $(if ${with-glusterfs}, debian/samba-vfs-modules/usr/lib/*/samba/vfs/glusterfs.so)
 endif
 endif
 # after shlibdeps run, check that we don't have wrong depdendencies
@@ -325,6 +352,9 @@ endif
 
 override_dh_gencontrol:
 	dh_gencontrol $(addprefix -p,${LDB_PACKAGES}) -- -v${LDB_DEB_VERSION}
+ifneq (,$(filter ${build-pkgs}, ${mitkrb5-dep-pkgs})))
+	dh_gencontrol $(addprefix -p, $(filter ${build-pkgs}, ${mitkrb5-dep-pkgs})) -- -v${mitkrb5-samba-ver}
+endif
 	dh_gencontrol --remaining-packages -- -Vldb:Depends="${LDB_DEPENDS}"
 
 clean:
@@ -332,3 +362,7 @@ clean:
 	dh_clean bin/ testbuild/
 	rm -f ${EXTRA_ABI_VERSION_FILES}
 	[ ! -f VERSION.orig ] || mv -f VERSION.orig VERSION
+ifneq (,${with_mitkrb5})
+	[ ! -d third_party/heimdal-build-with-mitkrb5 ] || \
+		mv third_party/heimdal-build-with-mitkrb5 third_party/heimdal
+endif


=====================================
debian/samba-libs.install
=====================================
@@ -1,3 +1,4 @@
+#!/usr/bin/dh-exec --with-scripts=filter-build-profiles
 # when there are any real changes in the publically visible libs (usr/lib/*/libfoo.so.N*),
 # especially the soname changes, check for pkgs which depend on samba-libs (eg sssd-ad)
 # and add Breaks for packages/versions using old libs to d/control
@@ -22,6 +23,17 @@ usr/lib/*/libsamdb.so.0*
 usr/lib/*/libsmbconf.so.0*
 usr/lib/*/libsmbldap.so.2*
 usr/lib/*/libtevent-util.so.0*
+# heimdal libraries (used by samba and winbind)
+<!pkg.samba.mitkrb5> usr/lib/*/samba/libasn1-samba4.so.0
+<!pkg.samba.mitkrb5> usr/lib/*/samba/libcom-err-samba4.so.0
+<!pkg.samba.mitkrb5> usr/lib/*/samba/libgssapi-samba4.so.0
+<!pkg.samba.mitkrb5> usr/lib/*/samba/libhcrypto-samba4.so.0
+<!pkg.samba.mitkrb5> usr/lib/*/samba/libheimbase-samba4.so.0
+<!pkg.samba.mitkrb5> usr/lib/*/samba/libheimntlm-samba4.so.0
+<!pkg.samba.mitkrb5> usr/lib/*/samba/libhx509-samba4.so.0
+<!pkg.samba.mitkrb5> usr/lib/*/samba/libkrb5-samba4.so.0
+<!pkg.samba.mitkrb5> usr/lib/*/samba/libroken-samba4.so.0
+<!pkg.samba.mitkrb5> usr/lib/*/samba/libwind-samba4.so.0
 #
 usr/lib/*/samba/auth/
 usr/lib/*/samba/bind9/dlz_bind9_*.so
@@ -35,7 +47,6 @@ usr/lib/*/samba/libRPC-SERVER-LOOP-samba4.so.0
 usr/lib/*/samba/libRPC-WORKER-samba4.so.0
 usr/lib/*/samba/libaddns-samba4.so.0
 usr/lib/*/samba/libads-samba4.so.0
-usr/lib/*/samba/libasn1-samba4.so.0
 usr/lib/*/samba/libasn1util-samba4.so.0
 usr/lib/*/samba/libauth-unix-token-samba4.so.0
 usr/lib/*/samba/libauth-samba4.so.0
@@ -52,7 +63,6 @@ usr/lib/*/samba/libclidns-samba4.so.0
 usr/lib/*/samba/libcluster-samba4.so.0
 usr/lib/*/samba/libcmdline-contexts-samba4.so.0
 usr/lib/*/samba/libcmdline-samba4.so.0
-usr/lib/*/samba/libcom-err-samba4.so.0
 usr/lib/*/samba/libcommon-auth-samba4.so.0
 usr/lib/*/samba/libdb-glue-samba4.so.0
 usr/lib/*/samba/libdbwrap-samba4.so.0
@@ -70,15 +80,9 @@ usr/lib/*/samba/libgensec-samba4.so.0
 usr/lib/*/samba/libgpext-samba4.so.0
 usr/lib/*/samba/libgpo-samba4.so.0
 usr/lib/*/samba/libgse-samba4.so.0
-usr/lib/*/samba/libgssapi-samba4.so.0
-usr/lib/*/samba/libhcrypto-samba4.so.0
-usr/lib/*/samba/libheimbase-samba4.so.0
-usr/lib/*/samba/libheimntlm-samba4.so.0
 usr/lib/*/samba/libhttp-samba4.so.0
-usr/lib/*/samba/libhx509-samba4.so.0
 usr/lib/*/samba/libinterfaces-samba4.so.0
 usr/lib/*/samba/libiov-buf-samba4.so.0
-usr/lib/*/samba/libkrb5-samba4.so.0
 usr/lib/*/samba/libkrb5samba-samba4.so.0
 usr/lib/*/samba/libldbsamba-samba4.so.0
 usr/lib/*/samba/liblibcli-lsa3-samba4.so.0
@@ -99,7 +103,6 @@ usr/lib/*/samba/libprinting-migrate-samba4.so.0
 usr/lib/*/samba/libprocess-model-samba4.so.0
 usr/lib/*/samba/libregistry-samba4.so.0
 usr/lib/*/samba/libreplace-samba4.so.0
-usr/lib/*/samba/libroken-samba4.so.0
 usr/lib/*/samba/libsamba-cluster-support-samba4.so.0
 usr/lib/*/samba/libsamba-debug-samba4.so.0
 usr/lib/*/samba/libsamba-modules-samba4.so.0
@@ -128,6 +131,5 @@ usr/lib/*/samba/libtrusts-util-samba4.so.0
 usr/lib/*/samba/libutil-reg-samba4.so.0
 usr/lib/*/samba/libutil-setid-samba4.so.0
 usr/lib/*/samba/libutil-tdb-samba4.so.0
-usr/lib/*/samba/libwind-samba4.so.0
 usr/lib/*/samba/libxattr-tdb-samba4.so.0
 usr/lib/*/samba/process_model/*.so


=====================================
debian/samba.install
=====================================
@@ -1,4 +1,4 @@
-#!/usr/bin/dh-exec --with-scripts=filter-arch
+#!/usr/bin/dh-exec --with-scripts=filter-arch,filter-build-profiles
 etc/ufw/applications.d/samba
 [linux-any] lib/systemd/system/nmbd.service
 [linux-any] lib/systemd/system/samba-ad-dc.service
@@ -11,10 +11,11 @@ usr/bin/profiles
 usr/bin/sharesec
 usr/bin/smbcontrol
 usr/bin/smbstatus
-usr/lib/*/samba/libHDB-SAMBA4-samba4.so.0
-usr/lib/*/samba/libgss-preauth-samba4.so.0
-usr/lib/*/samba/libhdb-samba4.so.0
-usr/lib/*/samba/libkdc-samba4.so.0
+<!pkg.samba.mitkrb5> usr/lib/*/samba/libHDB-SAMBA4-samba4.so.0
+<!pkg.samba.mitkrb5> usr/lib/*/samba/libgss-preauth-samba4.so.0
+<!pkg.samba.mitkrb5> usr/lib/*/samba/libhdb-samba4.so.0
+<!pkg.samba.mitkrb5> usr/lib/*/samba/libkdc-samba4.so.0
+<pkg.samba.mitkrb5> usr/lib/*/krb5/plugins/kdb/samba.so
 usr/lib/*/samba/libmscat-samba4.so.0
 usr/libexec/samba/samba-bgqd
 usr/lib/*/samba/service/*.so


=====================================
debian/winbind.install
=====================================
@@ -1,5 +1,7 @@
-#!/usr/bin/dh-exec --with-scripts=filter-arch
+#!/usr/bin/dh-exec --with-scripts=filter-arch,filter-build-profiles
 [linux-any] lib/systemd/system/winbind.service
+<pkg.samba.mitkrb5> usr/lib/*/samba/krb5/winbind_krb5_localauth.so
+<pkg.samba.mitkrb5> usr/share/man/man8/winbind_krb5_localauth.8
 usr/bin/ntlm_auth
 usr/bin/wbinfo
 usr/lib/*/samba/idmap



View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/50f3bbb8a1b625d3bee5d47acc2915b61071a76b...b089d4b2622da6a407cdf4641c81a85cd74402b1

-- 
View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/50f3bbb8a1b625d3bee5d47acc2915b61071a76b...b089d4b2622da6a407cdf4641c81a85cd74402b1
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/20221110/1a6a65d5/attachment-0001.htm>


More information about the Pkg-samba-maint mailing list