diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt index 9d6401ff02..a7143e4284 100644 --- a/docs/manual/adding-packages-generic.txt +++ b/docs/manual/adding-packages-generic.txt @@ -314,6 +314,10 @@ information is (assuming the package name is +libfoo+) : that have more than one leading component to strip, set this variable with the value to be passed to tar. Default: 1. +* +LIBFOO_EXCLUDES+ is a space-separated list of patterns to exclude + when extracting the archive. Each item from that list is passed as + a tar's +--exclude+ option. By default, empty. + * +LIBFOO_DEPENDENCIES+ lists the dependencies (in terms of package name) that are required for the current target package to compile. These dependencies are guaranteed to be compiled and diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index ffef4d3de1..8b189fed2c 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -508,7 +508,10 @@ $(2)_TARGET_DIRCLEAN = $$($(2)_DIR)/.stamp_dircleaned # default extract command $(2)_EXTRACT_CMDS ?= \ $$(if $$($(2)_SOURCE),$$(INFLATE$$(suffix $$($(2)_SOURCE))) $$(DL_DIR)/$$($(2)_SOURCE) | \ - $$(TAR) --strip-components=$$($(2)_STRIP_COMPONENTS) -C $$($(2)_DIR) $$(TAR_OPTIONS) -) + $$(TAR) --strip-components=$$($(2)_STRIP_COMPONENTS) \ + -C $$($(2)_DIR) \ + $$(foreach x,$$($(2)_EXCLUDES),--exclude='$$(x)' ) \ + $$(TAR_OPTIONS) -) # pre/post-steps hooks $(2)_PRE_DOWNLOAD_HOOKS ?=