diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 621fb91424..c46c742352 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -518,7 +518,7 @@ ifndef $(2)_SOURCE ifdef $(3)_SOURCE $(2)_SOURCE = $$($(3)_SOURCE) else ifdef $(2)_VERSION - $(2)_SOURCE ?= $$($(2)_BASENAME_RAW).tar.gz + $(2)_SOURCE ?= $$($(2)_BASENAME_RAW)$$(call pkg_source_ext,$(2)) endif endif diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk index a2cc160d0b..c7597a3a45 100644 --- a/package/pkg-utils.mk +++ b/package/pkg-utils.mk @@ -40,6 +40,11 @@ KCONFIG_DISABLE_OPT = $(call KCONFIG_MUNGE_DOT_CONFIG, $(1), $(SHARP_SIGN) $(1) pkgdir = $(dir $(lastword $(MAKEFILE_LIST))) pkgname = $(lastword $(subst /, ,$(pkgdir))) +# Helper to build the extension for a package archive, based on various +# conditions. +# $(1): upper-case package name +pkg_source_ext = .tar.gz + # Define extractors for different archive suffixes INFLATE.bz2 = $(BZCAT) INFLATE.gz = $(ZCAT)