[Pkg-samba-maint] [Git][samba-team/samba][master] 9 commits: d/rules: reorder config/options a bit, lowercase ${WITH_*}, and consolidate Ubuntu-i386 check
Michael Tokarev (@mjt)
gitlab at salsa.debian.org
Mon Oct 24 16:41:12 BST 2022
Michael Tokarev pushed to branch master at Debian Samba Team / samba
Commits:
3a1ba111 by Michael Tokarev at 2022-10-24T13:59:56+03:00
d/rules: reorder config/options a bit, lowercase ${WITH_*}, and consolidate Ubuntu-i386 check
- - - - -
f3b7c4d1 by Michael Tokarev at 2022-10-24T13:59:56+03:00
d/rules: omit glusterfs on ubuntu-i386
d/control change (build-depends) is still needed
- - - - -
be04d32a by Michael Tokarev at 2022-10-24T13:59:57+03:00
apply Ubuntu changes to smb.conf at install time (d/smb.conf.ubuntu.diff)
- - - - -
59b1b419 by Michael Tokarev at 2022-10-24T13:59:57+03:00
d/tests/: move uring availability check code into common function
and make the test much shorter
- - - - -
46521e66 by Michael Tokarev at 2022-10-24T13:59:57+03:00
d/tests/util: ensure io_uring module is built before testing it
Ubuntu does not build liburing on i386, so the vfs object
is not being built too. Skip the uring tests in this case.
- - - - -
99fe4b7d by Michael Tokarev at 2022-10-24T14:01:20+03:00
d/libldb2.install: simplify, no need to check ${DEB_HOST_ARCH_BITS} since dpkg-architecture does it internally
- - - - -
d3500b47 by Michael Tokarev at 2022-10-24T15:41:22+03:00
d/rules: inline parallel check from dpkg/buildopts.mk
buildopts.mk does not exist on ubuntu 20.04 focal
And we did not even include buildopts.mk here
- - - - -
27cd8d60 by Michael Tokarev at 2022-10-24T17:06:22+03:00
d/rules: minor changes, make it more consistent with other samba packages
- - - - -
10192c84 by Michael Tokarev at 2022-10-24T17:06:48+03:00
d/rules: stop exporting ${PYTHON}
- - - - -
6 changed files:
- debian/libldb2.install
- debian/rules
- + debian/smb.conf.ubuntu.diff
- debian/tests/cifs-share-access-uring
- debian/tests/smbclient-share-access-uring
- debian/tests/util
Changes:
=====================================
debian/libldb2.install
=====================================
@@ -1,7 +1,7 @@
#!/bin/sh
echo 'usr/lib/*/libldb.so.*'
# lib/ldb/wscript: (sizeof(size_t) >= 8), >=64bit is required for lmdb
-if [ 64 -le "${DEB_HOST_ARCH_BITS:-$(dpkg-architecture -qDEB_HOST_ARCH_BITS)}" ]
+if [ 64 -le "$(dpkg-architecture -qDEB_HOST_ARCH_BITS)" ]
then
echo 'usr/lib/*/samba/libldb-mdb-int-samba4.so.0'
echo 'usr/lib/*/samba/ldb/mdb.so'
=====================================
debian/rules
=====================================
@@ -3,30 +3,53 @@ SHELL = /bin/sh -e
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
-include /usr/share/dpkg/buildflags.mk
-include /usr/share/dpkg/pkg-info.mk
-include /usr/share/dpkg/vendor.mk
# Fast version of dpkg/architecture.mk defining all vars in one go
ifeq (${DEB_HOST_MULTIARCH},)
$(foreach d, $(shell dpkg-architecture | sed 's/=/?=/'), $(eval export $d))
endif
+include /usr/share/dpkg/buildflags.mk
+include /usr/share/dpkg/pkg-info.mk
+include /usr/share/dpkg/vendor.mk
+V = 1
+WAF = PYTHONHASHSEED=1 ./buildtools/bin/waf \
+ $(if $(filter parallel=%,${DEB_BUILD_OPTIONS}),\
+ $(patsubst parallel=%,-j%,$(filter parallel=%,${DEB_BUILD_OPTIONS})))
+WAFv = ${WAF}$(if $V, -v)
-export PYTHON = python3
+DESTDIR = ${CURDIR}/debian/tmp
-LDB_EPOCH := 2:
+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_DEPENDS := libldb2 (= ${LDB_DEB_VERSION})
-LDB_PACKAGES := libldb2 libldb-dev ldb-tools python3-ldb python3-ldb-dev
+LDB_DEB_VERSION = ${LDB_EPOCH}${LDB_VERSION}+samba$(subst +dfsg,,${DEB_VERSION_UPSTREAM_REVISION})
+LDB_DEPENDS = libldb2 (= ${LDB_DEB_VERSION})
+LDB_PACKAGES = libldb2 libldb-dev ldb-tools python3-ldb python3-ldb-dev
# #1021371: we only need the single "version" symbol LDB_2.4.4 in the library
# 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
-V = 1
-WAF := PYTHONHASHSEED=1 ${PYTHON} ./buildtools/bin/waf \
- $(subst parallel=,-j,$(filter parallel=%,${DEB_BUILD_OPTIONS}))
-WAFv := ${WAF} $(if $V, -v)
+with_ceph = yes
+# Ceph is not available on all platforms
+ifeq (,$(filter amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x, ${DEB_HOST_ARCH}))
+with_ceph =
+endif
+
+with_glusterfs = yes
+# GlusterFS is linux-only
+ifneq (${DEB_HOST_ARCH_OS}, linux)
+with_glusterfs =
+endif
+
+# Ubuntu i386 binary compatibility only effort: Disable some i386 packages
+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 =
+endif
+
+# build_pakages will honour arch/indep and the above list in ${DH_OPTIONS}
+build_packages = $(shell dh_listpackages)
conf_args = \
--prefix=/usr \
@@ -65,28 +88,11 @@ conf_args = \
--enable-etcd-reclock \
--with-socketpath=/run/ctdb/ctdbd.socket \
--with-logdir=/var/log/ctdb \
+ $(if ${with_ceph},\
+ --enable-cephfs --enable-ceph-reclock,\
+ --disable-cephfs) \
-WITH_CEPH = yes
-# Ceph is not available on all platforms
-ifeq (,$(filter amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x, $(DEB_HOST_ARCH)))
- WITH_CEPH =
-endif
-# Ubuntu i386 binary compatibility only effort: No Ceph
-ifeq ($(DEB_VENDOR) $(DEB_HOST_ARCH), Ubuntu i386)
- WITH_CEPH =
-endif
-
-conf_args += $(if ${WITH_CEPH},\
- --enable-cephfs --enable-ceph-reclock,\
- --disable-cephfs)
-
-WITH_GLUSTERFS = yes
-# GlusterFS is linux-only
-ifneq ($(DEB_HOST_ARCH_OS), linux)
- WITH_GLUSTERFS =
-endif
-
-ifeq ($(DEB_HOST_ARCH_OS), linux)
+ifeq (${DEB_HOST_ARCH_OS}, linux)
conf_args += \
--with-systemd \
--systemd-install-services \
@@ -95,14 +101,6 @@ else
conf_args += --without-systemd
endif
-# Ubuntu i386 binary compatibility only effort: Disable some i386 packages
-ifeq ($(DEB_VENDOR) $(DEB_HOST_ARCH), Ubuntu i386)
-export DH_OPTIONS += $(addprefix -N,\
- ctdb libpam-winbind samba samba-testsuite samba-vfs-modules )
-endif
-# build_pakages will honour arch/indep and the above disabled list
-build_packages := $(shell dh_listpackages)
-
binary binary-arch binary-indep \
install install-arch install-indep: %:
dh $*
@@ -131,7 +129,7 @@ bin/built.stamp: bin/configured.stamp
# we'll repeat during actual install stage, but this is definitely
# better/faster than building whole thing for _not_ running from the build dir.
${WAFv} --targets=compile_et,asn1_compile
- ${WAFv} install --destdir="${CURDIR}/debian/tmp"
+ ${WAFv} install --destdir="${DESTDIR}"
touch $@
build-indep:
build: build-arch build-indep
@@ -174,7 +172,7 @@ override_dh_auto_test: # $(if $(findstring nocheck, ${DEB_BUILD_OPTIONS}),, self
override_dh_auto_install-arch:
# the same "waf install" as in the build target
- ${WAF} install --destdir="${CURDIR}/debian/tmp"
+ ${WAF} install --destdir="${DESTDIR}"
# get list of files in build log
find debian/tmp
# Included in python-tevent
@@ -235,7 +233,10 @@ override_dh_auto_install-indep:
# Most of files needs are renamed during install so lets put them
# directly into the right place without d/samba-common.install indirection
# Debian goodies
- install -Dp -m0644 debian/smb.conf* -t debian/samba-common/usr/share/samba/
+ install -Dp -m0644 debian/smb.conf -t debian/samba-common/usr/share/samba/
+ifeq (${DEB_VENDOR}, Ubuntu)
+ patch debian/samba-common/usr/share/samba/smb.conf debian/smb.conf.ubuntu.diff
+endif
install -Dp -m755 debian/panic-action -t debian/samba-common/usr/share/samba/
install -Dp -m0644 debian/gdbcommands -t debian/samba-common/etc/samba/
install -Dp -m0755 debian/samba-common.dhcp debian/samba-common/etc/dhcp/dhclient-enter-hooks.d/samba
@@ -292,10 +293,10 @@ override_dh_makeshlibs:
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 \
+ dh_shlibdeps -l${DESTDIR}/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 (${with_ceph},)
dpkg-shlibdeps -Tdebian/ctdb.substvars -prados \
debian/ctdb/usr/libexec/ctdb/ctdb_mutex_ceph_rados_helper
endif
@@ -303,8 +304,8 @@ endif
ifneq (,$(filter samba-vfs-modules,${build_packages}))
dpkg-shlibdeps -Tdebian/samba-vfs-modules.substvars -pvfsmods \
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_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
# after shlibdeps run, check that we don't have wrong depdendencies
# libldb2 should not depend on samba-libs
=====================================
debian/smb.conf.ubuntu.diff
=====================================
@@ -0,0 +1,55 @@
+Subject: ubuntu changes for smb.conf
+
++ Add "(Samba, Ubuntu)" to server string.
++ Comment out the default [homes] share, and add a comment about
+ "valid users = %s" to show users how to restrict access to
+ \\server\username to only username.
+* Comment out "read only = yes" for a few standard shares.
+
+diff --git a/debian/smb.conf b/debian/smb.conf
+index 37fafb27398..385197abee9 100644
+--- a/debian/smb.conf
++++ b/debian/smb.conf
+@@ -30,2 +30,5 @@
+
++# server string is the equivalent of the NT Description field
++ server string = %h server (Samba, Ubuntu)
++
+ #### Networking ####
+@@ -168,5 +171,8 @@
+
+-[homes]
+- comment = Home Directories
+- browseable = no
++# Un-comment the following (and tweak the other settings below to suit)
++# to enable the default home directory shares. This will share each
++# user's home directory as \\server\username
++;[homes]
++; comment = Home Directories
++; browseable = no
+
+@@ -174,3 +180,3 @@
+ # next parameter to 'no' if you want to be able to write to them.
+- read only = yes
++; read only = yes
+
+@@ -178,3 +184,3 @@
+ # create files with group=rw permissions, set next parameter to 0775.
+- create mask = 0700
++; create mask = 0700
+
+@@ -182,3 +188,3 @@
+ # create dirs. with group=rw permissions, set next parameter to 0775.
+- directory mask = 0700
++; directory mask = 0700
+
+@@ -186,6 +192,6 @@
+ # with access to the samba server.
+-# The following parameter makes sure that only "username" can connect
+-# to \\server\username
++# Un-comment the following parameter to make sure that only "username"
++# can connect to \\server\username
+ # This might need tweaking when using external authentication schemes
+- valid users = %S
++; valid users = %S
+
=====================================
debian/tests/cifs-share-access-uring
=====================================
@@ -5,11 +5,7 @@ set -e
. debian/tests/util
-k_ver=$(uname -r | cut -d - -f 1)
-if ! check_kernel_version ${k_ver}; then
- echo "uring not available in kernel version ${k_ver}, skipping test"
- exit 77
-fi
+ensure_uring_available
username="smbtest$$"
password="$$"
=====================================
debian/tests/smbclient-share-access-uring
=====================================
@@ -5,11 +5,7 @@ set -e
. debian/tests/util
-k_ver=$(uname -r | cut -d - -f 1)
-if ! check_kernel_version ${k_ver}; then
- echo "uring not available in kernel version ${k_ver}, skipping test"
- exit 77
-fi
+ensure_uring_available
username="smbtest$$"
password="$$"
=====================================
debian/tests/util
=====================================
@@ -47,19 +47,22 @@ populate_share() {
chown -R "${usergroup}:${usergroup}" "${sharepath}"
}
-
-# $1: kernel version in the form major.minor.patch
-check_kernel_version() {
- local k_ver=$1
- local k_major=$(echo ${k_ver} | cut -d . -f 1)
- local k_minor=$(echo ${k_ver} | cut -d . -f 2)
+ensure_uring_available() {
# uring is supported starting with kernel 5.1.x
- if [ ${k_major} -eq 5 ] && [ ${k_minor} -ge 1 ]; then
- return 0
- elif [ ${k_major} -ge 6 ]; then
- return 0
- else
- return 1
+ local kver=$(uname -r)
+ case "$kver" in
+ ( [0-4].* | 5.0.* ) # everything before 5.1
+ echo "uring not available in kernel version ${kver%%-*}, skipping test"
+ exit 77
+ ;;
+ esac
+
+ # ubuntu does not build liburing on i386,
+ # so io_uring vfs object is unavailable too
+ : ${DEB_HOST_MULTIARCH:=$(dpkg-architecture -qDEB_BUILD_MULTIARCH)}
+ if [ ! -f /usr/lib/$DEB_HOST_MULTIARCH/samba/vfs/io_uring.so ]; then
+ echo "io_uring vfs object is not available on this architecture, skipping test"
+ exit 77
fi
}
View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/ccd64bc30788a169a55c64ffc63be987aacaeed9...10192c84f22680dca037164998ffa526f770fd46
--
View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/ccd64bc30788a169a55c64ffc63be987aacaeed9...10192c84f22680dca037164998ffa526f770fd46
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/20221024/dc51f665/attachment-0001.htm>
More information about the Pkg-samba-maint
mailing list