diff options
Diffstat (limited to '')
-rwxr-xr-x | debian/rules | 75 |
1 files changed, 29 insertions, 46 deletions
diff --git a/debian/rules b/debian/rules index bd00724..ddc885a 100755 --- a/debian/rules +++ b/debian/rules @@ -35,12 +35,12 @@ LDB_DEB_VERSION = ${LDB_EPOCH}${LDB_VERSION}+samba${DEB_VERSION_UPSTREAM_REVISIO LDB_DEPENDS = libldb2 (= ${LDB_DEB_VERSION}) LDB_PACKAGES = libldb2 libldb-dev ldb-tools python3-ldb python3-ldb-dev +before-trixie := $(filter pkg.samba.before-trixie, ${DEB_BUILD_PROFILES}) + omit-pkgs = -with-glusterfs = -with-ceph = -with-snapper = config-args = \ + --vendor-name=${DEB_VENDOR}-${DEB_VERSION_UPSTREAM_REVISION} \ --prefix=/usr \ --enable-fhs \ --sysconfdir=/etc \ @@ -78,9 +78,6 @@ config-args = \ --with-logdir=/var/log/ctdb \ ifeq (${DEB_HOST_ARCH_OS}, linux) # extra linux-specific features -with-glusterfs = $(if $(filter amd64 arm64 ppc64el ppc64 riscv64 mips64el s390x ia64 sparc64,${DEB_HOST_ARCH}),yes) -with-ceph = $(if $(filter amd64 arm64 mips64el ppc64el riscv64 s390x, ${DEB_HOST_ARCH}),yes) -with-snapper = yes config-args += \ --with-quota \ @@ -90,7 +87,7 @@ endif # Ubuntu i386 binary compatibility only effort: Disable some i386 packages and modules ifeq (${DEB_VENDOR}-${DEB_HOST_ARCH}, Ubuntu-i386) -omit-pkgs += ctdb libpam-winbind samba samba-testsuite samba-vfs-modules +omit-pkgs += ctdb libpam-winbind samba samba-ad-dc samba-testsuite samba-vfs-modules samba-vfs-ceph samba-vfs-glusterfs endif ifneq (,$(filter armel mipsel m68k powerpc sh4,${DEB_HOST_ARCH})) @@ -118,16 +115,8 @@ endif # build is done in bin/default/ subdir CFLAGS += -ffile-prefix-map=../../= -config-args += $(if ${with-ceph},\ - --enable-cephfs --enable-ceph-reclock,\ - --disable-cephfs) - # we had t64 transition (libsmbclient => libsmbclient0) for trixie -ifneq (,$(filter pkg.samba.before-trixie, ${DEB_BUILD_PROFILES})) -libsmbclient := libsmbclient -else -libsmbclient := libsmbclient0 -endif +libsmbclient := $(if ${before-trixie},libsmbclient,libsmbclient0) with_mitkrb5 = $(filter pkg.samba.mitkrb5, ${DEB_BUILD_PROFILES}) ifneq (,${with_mitkrb5}) @@ -139,7 +128,8 @@ config-args += \ 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 += samba-vfs-ceph samba-vfs-glusterfs +mitkrb5-dep-pkgs += samba-dsdb-modules mitkrb5-dep-pkgs += ${libsmbclient} smbclient mitkrb5-dep-pkgs += libnss-winbind libpam-winbind mitkrb5-dep-pkgs += winbind libwbclient0 @@ -155,6 +145,11 @@ endif # ${build-pkgs} will honour arch/indep and the above list in ${DH_OPTIONS} build-pkgs := $(shell dh_listpackages) +with-ceph := $(filter samba-vfs-ceph,${build-pkgs}) +config-args += $(if ${with-ceph},\ + --enable-cephfs --enable-ceph-reclock,\ + --disable-cephfs) + binary binary-arch binary-indep \ install install-arch install-indep: %: dh $* @@ -162,12 +157,6 @@ install install-arch install-indep: %: configure: bin/configured.stamp .PHONY: configure bin/configured.stamp: -# branding - if [ ! -f VERSION.orig ]; then \ - mv VERSION VERSION.orig; \ - sed -r -e 's/^(SAMBA_VERSION_VENDOR_SUFFIX).*/\1=${DEB_VENDOR}/' \ - VERSION.orig > VERSION; \ - fi CC="${CC}" CPP="${CPP}" LD="${LD}" PKGCONFIG="${PKG_CONFIG}" \ CPPFLAGS="${CPPFLAGS}" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \ PYTHON=python3 PYTHON_CONFIG=${DEB_HOST_MULTIARCH}-python3-config \ @@ -252,12 +241,8 @@ override_dh_auto_install-arch: # pam stuff install -Dp -m0644 debian/winbind.pam-config debian/tmp/usr/share/pam-configs/winbind mv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libnss_* debian/tmp/lib/$(DEB_HOST_MULTIARCH)/ - # Debian goodies to set global option in smb.conf and add a share - install -p -m0755 debian/setoption.py -t debian/tmp/usr/share/samba/ - install -p -m0755 debian/addshare.py -t debian/tmp/usr/share/samba/ install -p -m755 debian/update-apparmor-samba-profile -t debian/tmp/usr/share/samba/ install -Dp -m0644 debian/samba.ufw.profile debian/tmp/etc/ufw/applications.d/samba - install -Dp -m0644 debian/source_samba.py -t debian/tmp/usr/share/apport/package-hooks/ # install-and-rename docs for ctdb (also arch-specific) mkdir -p debian/tmp/ctdb install -p ctdb/config/events/README debian/tmp/ctdb/README.notification @@ -280,6 +265,15 @@ endif dh_link -plibldb2 /usr/lib/${DEB_HOST_MULTIARCH}/ldb/modules/ldb \ /usr/lib/${DEB_HOST_MULTIARCH}/samba/ldb/compat +execute_after_dh_install: +# some vfs modules are in separate packages. Removing them here avoids having +# explicit list of other modules in d/samba.install + rm -f \ + debian/samba/usr/lib/${DEB_HOST_MULTIARCH}/samba/vfs/glusterfs*.so \ + debian/samba/usr/share/man/man8/vfs_glusterfs*.8 \ + debian/samba/usr/lib/${DEB_HOST_MULTIARCH}/samba/vfs/ceph*.so \ + debian/samba/usr/share/man/man8/vfs_ceph*.8 + provision-dest := debian/samba-ad-provision/usr/share/samba/setup override_dh_auto_install-indep: @@ -291,9 +285,6 @@ override_dh_auto_install-indep: ifeq (${DEB_VENDOR}, Ubuntu) patch debian/samba-common/usr/share/samba/smb.conf debian/smb.conf.ubuntu.diff endif - install -Dp -m0755 debian/panic-action -t debian/samba-common/usr/share/samba/ - install -Dp -m0755 debian/is-configured -t debian/samba-common/usr/share/samba/ - install -Dp -m0644 debian/gdbcommands -t debian/samba-common/etc/samba/ # we wrongly have pam file in samba-common instead of samba install -Dp -m0644 debian/samba.pam debian/samba-common/etc/pam.d/samba @@ -312,8 +303,8 @@ ifpkg = $(if $(filter ${1},${build-pkgs}),${2}) override_dh_installinit: 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 + dh_installinit -psamba --name nmbd + dh_installinit -psamba-ad-dc endif $(call ifpkg, winbind, dh_installinit -pwinbind) ifneq (,$(filter ctdb, ${build-pkgs})) @@ -326,7 +317,7 @@ override_dh_installsystemd: ifneq (,$(filter samba, ${build-pkgs})) dh_installsystemd -psamba --name=smbd dh_installsystemd -psamba --name=nmbd - dh_installsystemd -psamba --name=samba-ad-dc + dh_installsystemd -psamba-ad-dc endif $(call ifpkg, winbind, dh_installsystemd -pwinbind) $(call ifpkg, ctdb, dh_installsystemd -pctdb --no-start --no-stop-on-upgrade) @@ -361,7 +352,7 @@ 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/usr/lib/${DEB_HOST_MULTIARCH}/samba \ - -Xceph.so -Xglusterfs.so -Xsnapper.so -Xctdb_mutex_ceph_rados_helper + -Xctdb_mutex_ceph_rados_helper ifneq (,$(filter ctdb, ${build-pkgs})) echo "rados:Depends=" >> debian/ctdb.substvars ifneq (${with-ceph},) @@ -369,15 +360,6 @@ ifneq (${with-ceph},) debian/ctdb/usr/libexec/ctdb/ctdb_mutex_ceph_rados_helper endif endif -ifneq (,$(filter samba-vfs-modules,${build-pkgs})) - echo "vfsmods:Depends=" >> debian/samba-vfs-modules.substvars -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) -endif -endif # after shlibdeps run, check that we don't have wrong depdendencies $(call depcheck, samba-libs, samba|winbind|smbclient|ctdb) $(call depcheck, smbclient, samba|winbind|ctdb) @@ -393,13 +375,14 @@ ifneq (,$(filter ${build-pkgs}, ${mitkrb5-dep-pkgs})) dh_gencontrol $(addprefix -p, $(filter ${build-pkgs}, ${mitkrb5-dep-pkgs})) -- -v${mitkrb5-samba-ver} -Vldb:Depends="${LDB_DEPENDS}" endif dh_gencontrol --remaining-packages -- -Vldb:Depends="${LDB_DEPENDS}" -# move files from / to /usr if needed (#1059187): - if command -v dh_movetousr >/dev/null; then dh_movetousr -plibpam-winbind -plibnss-winbind; fi +ifeq (,${before-trixie}) +# run dh_movetousr only on trixie and up, not before + dh_movetousr -plibpam-winbind -plibnss-winbind +endif clean: # see also debian/clean dh_clean bin/ testbuild/ - [ ! -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 |