1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- # common targets and definitions for debian packaging (simple deb packaging and pypi2deb)
- # "simplified" deb package files follow s simple filename pattern (e.g. "python3-foo.deb") without
- # any version numbers or architectures. They are useful for build artifact uploads.
- DIR_DEBIAN_SIMPLIFIED_PACKAGE_FILES ?= $(DIR_DEBIAN_BUILD)/export
- # "wildcard" resolves the home directory
- DEB_DPUT_CONFIG ?= $(wildcard ~/.dput.cf)
- DEBIAN_BUILD_ARCH := $(shell dpkg-architecture -q DEB_BUILD_ARCH 2>/dev/null || echo "unknown")
- # should be overwritten
- DEBIAN_UPLOAD_TARGET := custom
- LINTIAN_ARGS ?=
- .PHONY: help
- help: help-deb-common
- .PHONY: help-deb-common
- help-deb-common:
- @echo "deb-related targets common for all packaging methods:"
- @echo " check-dput-config"
- @echo " clean-deb-export"
- @echo " dist-deb-packages-directory"
- @echo " init-deb - prepare a deb package skeleton directory (by using 'dh_make')"
- @echo " lint-deb - run lintian for the deb package"
- @echo
- .PHONY: check-dput-config
- check-dput-config:
- @[ -e "$(DEB_DPUT_CONFIG)" ] || { \
- echo "Failed to find 'dput.cf' file ($(DEB_DPUT_CONFIG))."; \
- echo "You should provide this file or override its location (DEB_DPUT_CONFIG)."; \
- exit 1; } >&2
- .PHONY: _init_deb_single_job
- _init_deb_single_job:
- @if [ -d debian ]; then \
- echo >&2 "ERROR: cowardly refusing to run 'dh_make' while 'debian/' exists"; \
- exit 1; fi
- dh_make --copyright gpl3 --createorig \
- --packagename "$(notdir $(shell pwd))_$(call get_current_version)"
- @echo "An example 'debian/' directory was created. You should verify its content."
- @echo "Afterwards you may want to remove all debian/*.ex files (examples)."
- @echo "Read the Debian New Maintainer's Guide for more details:"
- @echo " https://www.debian.org/doc/manuals/maint-guide"
- .PHONY: init-deb
- init-deb:
- $(MAKE) --jobs=1 _init_deb_single_job
- .PHONY: lint-deb
- lint-deb:
- @if [ -d "$(DIR_DEBIAN_BUILD)" ]; then \
- find "$(DIR_DEBIAN_BUILD)" -type f -name "*.changes"; fi \
- | xargs --max-args=1 --no-run-if-empty lintian $(LINTIAN_ARGS)
- .PHONY: clean-deb-export
- clean-deb-export:
- $(RM) -r "$(DIR_DEBIAN_SIMPLIFIED_PACKAGE_FILES)"
- .PHONY: clean
- clean: clean-deb-export
|