upstream_ver = $$(printf '%s\n' '$(OPK_SOURCE_VERSION_UPSTREAM)' | \ sed 's/^\([0-9a-z.~-][0-9a-z.~-]*\)+sip[1-9][0-9]*.*$$/\1/') upstream_url = http://zlib.net/zlib-$(upstream_ver).tar.gz source_archive = ../zlib-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.gz $(source_archive): wget -O - "$(upstream_url)" | tar -xz rm -f "zlib-$(upstream_ver)"/doc/rfc*.txt tar -czf '$(source_archive)' "zlib-$(upstream_ver)" rm -Rf src mv "zlib-$(upstream_ver)" src source: $(source_archive)