[Pkg-samba-maint] [Git][samba-team/samba][master] 8 commits: d/samba.lintian-overrides: *docs-outside-share-doc usr/share/samba/setup/

Michael Tokarev (@mjt) gitlab at salsa.debian.org
Thu Oct 27 13:01:03 BST 2022



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


Commits:
8e7da40f by Michael Tokarev at 2022-10-27T12:28:40+03:00
d/samba.lintian-overrides: *docs-outside-share-doc usr/share/samba/setup/

Keep schema and its specification in the same place

- - - - -
1ea5e5d2 by Michael Tokarev at 2022-10-27T12:34:26+03:00
d/rules: use the right dir for dh_shlibdeps -l

dpkg-shlibdeps (and dh_shlibdeps) uses -ldir as a path
*within package install directories* (like, debian/$pkg/),
not as absolute path on the build host.  It searches all
debian/$pkg/$dir for the libraries, in order to know the
package where this library resides.  It was used incorrectly
in the past as ${CURDIR}/debian/tmp/usr/lib/samba/, it should
have been /usr/lib/samba instead.

- - - - -
e943a405 by Michael Tokarev at 2022-10-27T14:19:20+03:00
rewrite shlibs/symbols-generating file

Replace debian/make_shlibs file with an entirely new debian/genshlibs file
which uses different approach to deal with samba shared libs.

See comments in d/genshlibs for all the details.

This makes whole shlibs/symbols generation much cleaner and 10x faster.

- - - - -
9e04ca16 by Michael Tokarev at 2022-10-27T14:19:21+03:00
debian/libnss-winbind.triggers: activate ldconfig trigger

- - - - -
c481fd31 by Michael Tokarev at 2022-10-27T14:19:21+03:00
add debian/samba-libs.symbols with libsmbldap library

and adjust d/samba-libs.lintian-overrides:
  +shared-library-symbols-not-tracked *

- - - - -
8eacffb2 by Michael Tokarev at 2022-10-27T14:19:21+03:00
d/samba.examples: do not install smbadduser: csh considered harmful

- - - - -
87c4cc60 by Michael Tokarev at 2022-10-27T14:30:41+03:00
d/rules: remove long-unused commented-out override_dh_perl-arch

- - - - -
e95e8cca by Michael Tokarev at 2022-10-27T15:00:33+03:00
update chanelog

- - - - -


9 changed files:

- debian/changelog
- + debian/genshlibs
- + debian/libnss-winbind.triggers
- − debian/make_shlibs
- debian/rules
- debian/samba-libs.lintian-overrides
- + debian/samba-libs.symbols
- debian/samba.examples
- debian/samba.lintian-overrides


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,16 @@
+samba (2:4.16.6+dfsg-6) UNRELEASED; urgency=medium
+
+  * d/rules: use the right dir for dh_shlibdeps -l (long-standing issue)
+  * rewrite shlibs/symbols-generating file d/genshlibs, make whole process
+    much more clean and strighforward, and 10x times faster too
+  * debian/libnss-winbind.triggers: activate ldconfig trigger
+  * add debian/samba-libs.symbols with libsmbldap library
+  * d/samba.examples: do not install smbadduser: csh considered harmful
+  * d/rules: remove long-unused commented-out override_dh_perl-arch
+  * d/samba.lintian-overrides: *docs-outside-share-doc usr/share/samba/setup/
+
+ -- Michael Tokarev <mjt at tls.msk.ru>  Thu, 27 Oct 2022 14:58:33 +0300
+
 samba (2:4.16.6+dfsg-5) unstable; urgency=medium
 
   * move samba:idmap_script.8.gz and samba-libs:idmap_rfc2307.8.gz manpages to


=====================================
debian/genshlibs
=====================================
@@ -0,0 +1,110 @@
+#! /bin/sh
+#
+# generate shlibs/symbols files for samba packages
+#
+# samba ships a mix of:
+#   public libraries with stable ABI in /usr/lib
+#   public libraries in /usr/lib
+#   public python libraries in /usr/lib
+#   private libraries in /usr/lib/samba/
+#   plugins in /usr/lib/samba/*/
+#
+# For public libraries with stable ABI we generate symbols files.
+# These are listed in d/package.symbols files.
+# For other librries, we only need to generate shlibs files
+# with basic version information so that dpkg-shlibdeps will find them.
+# Here, for libs without .symbols file, we have 2 choices:
+# for public libraries we generate ($pkg >> $version) dependency in
+# shlibs file, but for private libs the relation is equality (=).
+# We do not process plugins, and we do not process python objects.
+#
+# dh_makeshlibs is too difficult to use here, we have much simpler approach.
+# We know exactly where our libs resides (dh_makeshlibs looks everywhere)
+# and we know filename patterns to recognize our shared libs.
+# dh_makeshlibs can not be used to generate symbols files for *some* libraries
+# (it is either all if .symbols is provided, or nothing if not).
+# It is easier to take strightforward approach than to fight a tool.
+
+set -e
+umask 022
+
+: ${DEB_VERSION:=$(dpkg-parsechangelog -S Version)}
+: ${DEB_HOST_MULTIARCH:=$(dpkg-architecture -qDEB_HOST_MULTIARCH)}
+
+# arguments in form pkg1=custom-version pkg2=version2...
+# to override ${DEB_VERSION} for the given packages
+custvers="$*"
+
+lib=usr/lib/${DEB_HOST_MULTIARCH}  # the only library directory
+smblib=$lib/samba                  # samba private libraries
+
+rc=0
+
+# process all packages but skip those without libs of interst
+for pkg in $(dh_listpackages); do
+  pd=debian/$pkg # package directory
+
+  # find library directories
+  libs=
+  for x in $lib $smblib ; do
+    [ -d $pd/$x ] && libs="$libs $x"
+  done
+  [ -n "$libs" ] || continue
+  # find libraries in library dirs (search for libfoo.so.NN names)
+  libs="$(cd $pd; find $libs -maxdepth 1 -regex '.*\.so.[0-9]+')"
+  [ -n "$libs" ] || continue
+
+  ver=${DEB_VERSION}
+  for x in $custvers; do
+    case "$x" in
+      ( $pkg=* ) ver=${x#*=}; break;;
+    esac
+  done
+  echo "${0##*/}: processing $pkg $ver"
+
+  # generate shlibs file: for public libs use >>$ver, for private =$ver
+  for x in $libs; do
+    case "$x" in
+      ($smblib/*) rel="= $ver";;
+      (*)         rel=">> $ver~";;
+    esac
+    x=${x##*/}
+    echo "${x%.so.*} ${x#**.so.} $pkg ($rel)"
+  done > $pd/DEBIAN/shlibs
+
+  # see if we have any public (eg, not in /usr/lib/samba/) libs
+  if echo "$libs" | fgrep -qv $smblib/; then
+    # generate ldconfig trigger activation
+    x=debian/.debhelper/generated/$pkg/triggers
+    y="activate-noawait ldconfig"
+    mkdir -p ${x%/*}
+    if [ ! -f $x ] || ! grep -q "^$y" $x; then
+      echo "# Triggers added by Samba:$0 ${DEB_VERSION}
+$y" >> $x
+    fi
+  fi
+
+  # packages without .symbols file need no further processing
+  [ -f debian/$pkg.symbols ] || continue
+
+  # process libraries listed in .symbols files with dpkg-gensymbols
+  # find libraries listed in .symbols, find full path of them in $libs
+  # and construct -e$filename argument list in $checklibs for dpkg-gensymbols
+  symlibs=$(sed -n -r 's/^([a-z][^ ]*) .*/\1/p' debian/$pkg.symbols)
+  checklibs=
+  for x in $symlibs; do
+    for y in $libs; do
+      case $y in (*/$x) checklibs="$checklibs -e$pd/$y"; break;; esac
+    done
+  done
+  # dpkg-gensymbols will detect listed but missing libs
+  # here we continue if dpkg-gensymbols failed to collect all errors
+  x=0; dpkg-gensymbols -c4 -p$pkg -P$pd -v$ver -l$smblib $checklibs || x=$?
+  if [ $x = 0 ]; then :
+  elif [ $x = 2 ]; then rc=1
+  else exit 1
+  fi
+
+done
+
+exit $rc


=====================================
debian/libnss-winbind.triggers
=====================================
@@ -0,0 +1 @@
+activate-noawait ldconfig


=====================================
debian/make_shlibs deleted
=====================================
@@ -1,70 +0,0 @@
-#! /bin/sh
-
-set -e
-umask 022
-
-DEB_VERSION=$(dpkg-parsechangelog -S Version)
-DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH)
-
-# arguments in form pkg1=custom-version pkg2=version2...
-custvers="$*"
-
-make_shlibs() {
-	pkg=$1
-	PKGDIR=debian/$pkg/DEBIAN
-
-	# shorctcut if no libs and no python libs
-	# (or no package at all)
-	[ -d $PKGDIR/usr/lib/$DEB_HOST_MULTIARCH -o \
-	  -d $PKGDIR/usr/lib/python3 ] || continue
-
-	ver=${DEB_VERSION}
-	for v in $custvers; do
-	    case "$v" in
-		( $pkg=* ) ver=${v#*=}; break;;
-	    esac
-	done
-	echo $pkg $ver
-
-	# step 1:
-	# - create symbols files:
-	#   - we only want symbols for public libraries (exclude private libs)
-	#   - we want to fail if new symbols appear, which are not listed in
-	#     the symbols file (dpkg-gensymbols -c4)
-	# - create first part of the shlibs file:
-	#   for public libraries, we want a weak version dependency
-	dh_makeshlibs -p$pkg -V"$pkg (>= ${ver%-*})" -X/usr/lib/${DEB_HOST_MULTIARCH}/samba -X/usr/lib/python3 -- -c4 -v$ver
-	[ -e $PKGDIR/shlibs ] && mv $PKGDIR/shlibs $PKGDIR/shlibs.1
-
-	# step 2:
-	# - ignore the symbols file generated by this step (it might contain
-	#   private symbols):
-	#   - output to /dev/null (-O/dev/null)
-	#   - don't print info about new symbols (-q)
-	# - create second part of the shlibs file:
-	#   for private libraries, we want a strict version dependency
-	#   this step will generate a strict dependency for all libraries (also
-	#   public ones), so afterwards, we will have to merge them
-	dh_makeshlibs -p$pkg -V"$pkg (= $ver)" -- -q -O/dev/null -v$ver
-
-	if [ -e $PKGDIR/shlibs -a -e $PKGDIR/shlibs.1 ]; then
-		# append entries from 2nd file if they are not in 1st
-		exec <$PKGDIR/shlibs.1; seen=
-		while read lib rest; do seen="$seen|$lib"; done
-		exec <$PKGDIR/shlibs
-		while read lib rest; do
-			case "$seen|" in (*"|$lib|"*) continue;; esac
-			echo "$lib $rest"
-		done >>$PKGDIR/shlibs.1
-		exec <&-
-		mv -f $PKGDIR/shlibs.1 $PKGDIR/shlibs
-	elif [ -e $PKGDIR/shlibs.1 ]; then
-		mv $PKGDIR/shlibs.1 $PKGDIR/shlibs
-	fi
-}
-
-# dh_shlibdeps handles -Nfoo passed from dh sequence in d/rules, too
-for pkg in $(dh_listpackages)
-do
-	make_shlibs $pkg
-done


=====================================
debian/rules
=====================================
@@ -266,12 +266,6 @@ override_dh_installsystemd:
 	$(call ifpkg, winbind, dh_installsystemd -pwinbind)
 	$(call ifpkg, ctdb, dh_installsystemd -pctdb --no-start --no-stop-on-upgrade)
 
-#override_dh_perl-arch:
-#	dh_perl -a
-#	# Fix Perl shbangs
-#	sed -i '1s@^#!/usr/bin/env perl@#!/usr/bin/perl@' \
-#	  debian/smbclient/usr/bin/findsmb
-
 execute_after_dh_fixperms-arch:
 	$(call ifpkg, smbclient, chmod 0700 debian/smbclient/usr/libexec/samba/smbspool_krb5_wrapper)
 
@@ -288,14 +282,14 @@ override_dh_makeshlibs:
 
 	# create symbols and shlibs files in separate wrapper script
 	# to deal with private libraries
-	debian/make_shlibs $(addsuffix =${LDB_DEB_VERSION},${LDB_PACKAGES})
+	debian/genshlibs $(addsuffix =${LDB_DEB_VERSION},${LDB_PACKAGES})
 
 	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${DESTDIR}/usr/lib/${DEB_HOST_MULTIARCH}/samba \
+	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},)


=====================================
debian/samba-libs.lintian-overrides
=====================================
@@ -8,15 +8,7 @@ samba-libs: embedded-library heimdal */samba/libgssapi-samba4.so.0*
 samba-libs: library-not-linked-against-libc *
 samba-libs: shared-library-lacks-prerequisites */libdcerpc-samr.so.*
 # unofficial APIs
-samba-libs: no-symbols-control-file */libsamba-*.so*
-samba-libs: no-symbols-control-file */libdcerpc*.so.*
-samba-libs: no-symbols-control-file */libndr*.so.*
-samba-libs: no-symbols-control-file */libnetapi.so.*
-samba-libs: no-symbols-control-file */libsamdb.so.*
-samba-libs: no-symbols-control-file */libsmbconf.so.*
-# FIXME: libsmbldap actually has ABI file
-#samba-libs: no-symbols-control-file */libsmbldap.so.*
-samba-libs: no-symbols-control-file usr/lib/*/libtevent-util.so.*
+samba-libs: shared-library-symbols-not-tracked *
 # deliberate, a synonym for misspelled parameter
 samba-libs: spelling-error-in-binary prefered preferred */libsamba-hostconfig.so.*
 # simple libs:


=====================================
debian/samba-libs.symbols
=====================================
@@ -0,0 +1,40 @@
+libsmbldap.so.2 #PACKAGE# #MINVER#
+* Build-Depends-Package: samba-dev
+ SMBLDAP_0 at SMBLDAP_0 2:4.16.6
+ SMBLDAP_1 at SMBLDAP_1 2:4.16.6
+ SMBLDAP_2.1.0 at SMBLDAP_2.1.0 2:4.16.6
+ SMBLDAP_2 at SMBLDAP_2 2:4.16.6
+ smbldap_add at SMBLDAP_0 2:4.16.6
+ smbldap_delete at SMBLDAP_0 2:4.16.6
+ smbldap_extended_operation at SMBLDAP_0 2:4.16.6
+ smbldap_free_struct at SMBLDAP_0 2:4.16.6
+ smbldap_get_ldap at SMBLDAP_1 2:4.16.6
+ smbldap_get_paged_results at SMBLDAP_1 2:4.16.6
+ smbldap_get_single_attribute at SMBLDAP_0 2:4.16.6
+ smbldap_has_control at SMBLDAP_0 2:4.16.6
+ smbldap_has_extension at SMBLDAP_0 2:4.16.6
+ smbldap_has_naming_context at SMBLDAP_0 2:4.16.6
+ smbldap_init at SMBLDAP_0 2:4.16.6
+ smbldap_make_mod at SMBLDAP_0 2:4.16.6
+ smbldap_make_mod_blob at SMBLDAP_0 2:4.16.6
+ smbldap_modify at SMBLDAP_0 2:4.16.6
+ smbldap_pull_sid at SMBLDAP_0 2:4.16.6
+ smbldap_search at SMBLDAP_0 2:4.16.6
+ smbldap_search_paged at SMBLDAP_0 2:4.16.6
+ smbldap_search_suffix at SMBLDAP_0 2:4.16.6
+ smbldap_set_bind_callback at SMBLDAP_2 2:4.16.6
+ smbldap_set_creds at SMBLDAP_0 2:4.16.6
+ smbldap_set_mod at SMBLDAP_0 2:4.16.6
+ smbldap_set_mod_blob at SMBLDAP_0 2:4.16.6
+ smbldap_set_paged_results at SMBLDAP_1 2:4.16.6
+ smbldap_setup_full_conn at SMBLDAP_0 2:4.16.6
+ smbldap_start_tls at SMBLDAP_0 2:4.16.6
+ smbldap_start_tls_start at SMBLDAP_2.1.0 2:4.16.6
+ smbldap_talloc_autofree_ldapmod at SMBLDAP_0 2:4.16.6
+ smbldap_talloc_autofree_ldapmsg at SMBLDAP_0 2:4.16.6
+ smbldap_talloc_dn at SMBLDAP_0 2:4.16.6
+ smbldap_talloc_first_attribute at SMBLDAP_0 2:4.16.6
+ smbldap_talloc_single_attribute at SMBLDAP_0 2:4.16.6
+ smbldap_talloc_single_blob at SMBLDAP_0 2:4.16.6
+ smbldap_talloc_smallest_attribute at SMBLDAP_0 2:4.16.6
+


=====================================
debian/samba.examples
=====================================
@@ -1,4 +1,3 @@
 examples/LDAP
 examples/logon
 examples/printing
-source3/smbadduser.in


=====================================
debian/samba.lintian-overrides
=====================================
@@ -1,3 +1,5 @@
 # Standard path for [printers] section is world-writeable with sticky bit set
 samba: non-standard-dir-perm var/spool/samba/ 1777 != 0755
 samba: hardening-no-fortify-functions */samba/libmscat-samba4.so.*
+# documentation and specifications for the schemas, keep them in the same place
+samba: package-contains-documentation-outside-usr-share-doc *usr/share/samba/setup/*



View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/dcf3cc4585d1cfcb05acd6481311d33cf3678424...e95e8ccab099c7fff8351fe0a5e6f07d82e0a6cc

-- 
View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/dcf3cc4585d1cfcb05acd6481311d33cf3678424...e95e8ccab099c7fff8351fe0a5e6f07d82e0a6cc
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/20221027/acf185be/attachment-0001.htm>


More information about the Pkg-samba-maint mailing list