pkg-info.mk 1.2 KB

123456789101112131415161718
  1. # Makefile snippet defining the following variables:
  2. #
  3. # DEB_SOURCE_PACKAGE: the source package name
  4. # DEB_VERSION: the full version of the package
  5. # DEB_VERSION_NOREV: the package's version without the Debian revision
  6. # DEB_VERSION_NOEPOCH: the package's version without the Debian epoch
  7. # DEB_VERSION_UPSTREAM: the package's upstream version
  8. # DEB_DISTRIBUTION: the first distribution of the current entry in debian/changelog
  9. dpkg_late_eval ?= $(or $(value DPKG_CACHE_$(1)),$(eval DPKG_CACHE_$(1) := $(shell $(2)))$(value DPKG_CACHE_$(1)))
  10. DEB_SOURCE_PACKAGE = $(call dpkg_late_eval,DEB_SOURCE_PACKAGE,awk '/^Source: / { print $$2 }' debian/control)
  11. DEB_VERSION = $(call dpkg_late_eval,DEB_VERSION,dpkg-parsechangelog | awk '/^Version: / { print $$2 }')
  12. DEB_VERSION_NOREV = $(call dpkg_late_eval,DEB_VERSION_NOREV,echo '$(DEB_VERSION)' | sed -e 's/-[^-]*$$//')
  13. DEB_VERSION_NOEPOCH = $(call dpkg_late_eval,DEB_VERSION_NOEPOCH,echo '$(DEB_VERSION)' | sed -e 's/^[0-9]*://')
  14. DEB_VERSION_UPSTREAM = $(call dpkg_late_eval,DEB_VERSION_UPSTREAM,echo '$(DEB_VERSION_NOREV)' | sed -e 's/^[0-9]*://')
  15. DEB_DISTRIBUTION = $(call dpkg_late_eval,DEB_DISTRIBUTION,dpkg-parsechangelog | awk '/^Distribution: / { print $$2 }')