From 25b26a4d2f9a5da3992721dc80ab74acf17c83ec Mon Sep 17 00:00:00 2001 From: robojerk Date: Mon, 4 Aug 2025 00:25:24 +0000 Subject: [PATCH] simplify debian packaging: let dh-python handle installation properly --- Makefile | 7 ++----- debian/rules | 18 +++++------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 322654b..cf34e66 100644 --- a/Makefile +++ b/Makefile @@ -6,11 +6,8 @@ help: ## Show this help message @echo "Available targets:" @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}' -install: ## Install deb-mock in development mode - pip install -e . - -debian-install: ## Install for Debian package build (no pip) - @echo "Debian package build - installation handled by debian/rules" +install: ## Install deb-mock (for Debian package build) + @echo "Installation handled by dh-python" install-dev: ## Install deb-mock with development dependencies pip install -e . diff --git a/debian/rules b/debian/rules index 00ad645..8792926 100755 --- a/debian/rules +++ b/debian/rules @@ -1,5 +1,9 @@ #!/usr/bin/make -f +# dh_python3 will install the python modules +# and handle byte-compilation +export PYBUILD_NAME=deb-mock + %: dh $@ --with python3 @@ -12,19 +16,7 @@ override_dh_auto_install: # Install documentation install -D -m 644 README.md debian/deb-mock/usr/share/doc/deb-mock/README.md install -D -m 644 docs/*.md debian/deb-mock/usr/share/doc/deb-mock/ 2>/dev/null || true - # Install Python modules - mkdir -p debian/deb-mock/usr/lib/python3/dist-packages/deb_mock - cp -r deb_mock/*.py debian/deb-mock/usr/lib/python3/dist-packages/deb_mock/ - # Create __init__.py if it doesn't exist - touch debian/deb-mock/usr/lib/python3/dist-packages/deb_mock/__init__.py - -override_dh_python3: - dh_python3 --no-pycentral override_dh_auto_test: # Skip tests during package build - they're run in CI/CD - @echo "Skipping tests during package build" - -override_dh_auto_build: - # Use debian-install target instead of regular install - $(MAKE) debian-install \ No newline at end of file + @echo "Skipping tests during package build" \ No newline at end of file