]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
debian: extract python3 packages to a single place 46416/head
authorKefu Chai <tchaikov@gmail.com>
Sun, 29 May 2022 00:22:59 +0000 (08:22 +0800)
committerKefu Chai <tchaikov@gmail.com>
Tue, 31 May 2022 11:42:32 +0000 (19:42 +0800)
to better maintainability

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
debian/rules

index a3fb66f9e8839abdfb702671c8acf47055854333..05ce93ee139207d2d439c5f8936c1fb95257f7d8 100755 (executable)
@@ -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: