aboutsummaryrefslogtreecommitdiffstats
path: root/include/download.mk
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-12-21 16:39:56 +0100
committerFelix Fietkau <nbd@nbd.name>2016-12-22 16:42:20 +0100
commitffb0181a8731847ea0d02d6e158adf3d7d95c382 (patch)
treecb7194bddf4b8983598829102a4e239f28e1bc7f /include/download.mk
parent24e58c3f72a94ebf659586eb876b06b59adb2bb2 (diff)
downloadupstream-ffb0181a8731847ea0d02d6e158adf3d7d95c382.tar.gz
upstream-ffb0181a8731847ea0d02d6e158adf3d7d95c382.tar.bz2
upstream-ffb0181a8731847ea0d02d6e158adf3d7d95c382.zip
build: add defaults for PKG_SOURCE, PKG_SOURCE_SUBDIR, PKG_VERSION
This makes it easier to unify versioning of git based package downloads. PKG_SOURCE_DATE along with an 8-character abbreviation of the git hash is used as PKG_VERSION, PKG_RELEASE should be used like normal packages. Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'include/download.mk')
-rw-r--r--include/download.mk6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/download.mk b/include/download.mk
index 63ded7ebcd..09b929bd77 100644
--- a/include/download.mk
+++ b/include/download.mk
@@ -9,6 +9,12 @@
OPENWRT_GIT = http://git.openwrt.org
LEDE_GIT = https://git.lede-project.org
+ifdef PKG_SOURCE_VERSION
+PKG_VERSION ?= $(if $(PKG_SOURCE_DATE),$(PKG_SOURCE_DATE)-)$(call version_abbrev,$(PKG_SOURCE_VERSION))
+PKG_SOURCE_SUBDIR ?= $(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE ?= $(PKG_SOURCE_SUBDIR).tar.xz
+endif
+
DOWNLOAD_RDEP=$(STAMP_PREPARED) $(HOST_STAMP_PREPARED)
# Try to guess the download method from the URL