X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/9ef909243235306a47edba82e852211ff6a40853..a1aab420f0a1a7234b006e1d37358c72350dd3f6:/include/package.mk diff --git a/include/package.mk b/include/package.mk index 7ae95f8fe..87e76be2b 100644 --- a/include/package.mk +++ b/include/package.mk @@ -11,6 +11,8 @@ else endif include $(INCLUDE_DIR)/prereq.mk +include $(INCLUDE_DIR)/host.mk +include $(INCLUDE_DIR)/unpack.mk define shvar V_$(subst .,_,$(subst -,_,$(subst /,_,$(1)))) @@ -268,15 +270,10 @@ define BuildPackage endif endef -ifneq ($(strip $(PKG_CAT)),) - ifeq ($(PKG_CAT),unzip) - UNPACK=unzip -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE) - else - UNPACK=$(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(PKG_BUILD_DIR)/.. $(TAR_OPTIONS) - - endif +ifneq ($(strip $(PKG_UNPACK)),) define Build/Prepare/Default - $(UNPACK) - @if [ -d ./patches ]; then \ + $(PKG_UNPACK) + @if [ -d ./patches -a "$$$$(ls ./patches | wc -l)" -gt 0 ]; then \ $(PATCH) $(PKG_BUILD_DIR) ./patches; \ fi endef