pkg-info.mk 1.5 KB

12345678910111213141516171819202122232425
  1. # Makefile snippet defining the following variables:
  2. #
  3. # DEB_SOURCE: the source package name
  4. # DEB_VERSION: the full version of the package (epoch + upstream vers. + revision)
  5. # DEB_VERSION_EPOCH_UPSTREAM: the package's version without the Debian revision
  6. # DEB_VERSION_UPSTREAM_REVISION: the package's version without the Debian epoch
  7. # DEB_VERSION_UPSTREAM: the package's upstream version
  8. # DEB_DISTRIBUTION: the distribution(s) listed in the current entry of debian/changelog
  9. #
  10. # SOURCE_DATE_EPOCH: the source release date as seconds since the epoch, as
  11. # specified by <https://reproducible-builds.org/specs/source-date-epoch/>
  12. dpkg_late_eval ?= $(or $(value DPKG_CACHE_$(1)),$(eval DPKG_CACHE_$(1) := $(shell $(2)))$(value DPKG_CACHE_$(1)))
  13. DEB_SOURCE = $(call dpkg_late_eval,DEB_SOURCE,dpkg-parsechangelog -SSource)
  14. DEB_VERSION = $(call dpkg_late_eval,DEB_VERSION,dpkg-parsechangelog -SVersion)
  15. DEB_VERSION_EPOCH_UPSTREAM = $(call dpkg_late_eval,DEB_VERSION_EPOCH_UPSTREAM,echo '$(DEB_VERSION)' | sed -e 's/-[^-]*$$//')
  16. DEB_VERSION_UPSTREAM_REVISION = $(call dpkg_late_eval,DEB_VERSION_UPSTREAM_REVISION,echo '$(DEB_VERSION)' | sed -e 's/^[0-9]*://')
  17. DEB_VERSION_UPSTREAM = $(call dpkg_late_eval,DEB_VERSION_UPSTREAM,echo '$(DEB_VERSION_EPOCH_UPSTREAM)' | sed -e 's/^[0-9]*://')
  18. DEB_DISTRIBUTION = $(call dpkg_late_eval,DEB_DISTRIBUTION,dpkg-parsechangelog -SDistribution)
  19. SOURCE_DATE_EPOCH ?= $(call dpkg_late_eval,SOURCE_DATE_EPOCH,dpkg-parsechangelog -STimestamp)
  20. export SOURCE_DATE_EPOCH