From 42f5465755d234b5180614f88366f25816e0bbe1 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 29 May 2022 08:22:59 +0800 Subject: [PATCH] debian: extract python3 packages to a single place to better maintainability Signed-off-by: Kefu Chai --- debian/rules | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/debian/rules b/debian/rules index a3fb66f9e8839..05ce93ee13920 100755 --- a/debian/rules +++ b/debian/rules @@ -52,6 +52,14 @@ ifneq (,$(filter with_system_libs,$(DEB_BUILD_OPTIONS))) extraopts += -DWITH_SYSTEM_PMDK=ON endif +# for python3-${pkg} packages +py3_bindings := rados cephfs rbd rgw ceph-argparse ceph-common +# for packages with its own py3dist-overrides files, those file should be named +# like ${pkg}.requires +py3_overrides_packages := $(basename $(notdir $(wildcard debian/*.requires))) +# for python3 applications, the package name is used as it is +py3_packages := cephfs-shell cephfs-top cephadm + %: dh $@ --buildsystem=cmake --with javahelper,python3,systemd --parallel @@ -139,17 +147,15 @@ override_dh_shlibdeps: dh_shlibdeps -a --exclude=erasure-code --exclude=rados-classes --exclude=compressor --exclude=ceph_crypto override_dh_python3: - for binding in rados cephfs rbd rgw; do \ - dh_python3 -p python3-$$binding; \ + @for binding in $(py3_bindings); do \ + dh_python3 -p python3-$$binding; \ + done + @for pkg in $(py3_overrides_packages); do \ + dh_python3 -p $$pkg --requires=debian/$$pkg.requires; \ done - for pkg in $(basename $(notdir $(wildcard debian/*.requires))); do \ - dh_python3 -p $$pkg --requires=debian/$$pkg.requires; \ + @for pkg in $(py3_packages); do \ + dh_python3 -p $$pkg; \ done - dh_python3 -p python3-ceph-argparse - dh_python3 -p python3-ceph-common - dh_python3 -p cephfs-shell - dh_python3 -p cephfs-top - dh_python3 -p cephadm # do not run tests override_dh_auto_test: -- 2.39.5