upstream_commit = $$(printf '%s\n' '$(OPK_SOURCE_VERSION_UPSTREAM)' | \ sed 's/^.*[~+]git........\.\([0-9a-f]*\).*$$/\1/') upstream_git_uri = git://linuxtv.org/$(OPK_SOURCE).git source_archive = ../$(OPK_SOURCE)-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.bz2 $(source_archive): git clone $(upstream_git_uri) $(OPK_SOURCE)/ (cd $(OPK_SOURCE)/ && git archive --format=tar --prefix=$(OPK_SOURCE)/ \ "$(upstream_commit)") | bzip2 >$@ source: $(source_archive)