#!/usr/bin/make -f %: dh $@ GIT_REPO := https://github.com/B00merang-Project/Windows-10.git DEBIAN_PATH := $(abspath $(dir $(firstword $(MAKEFILE_LIST)))) PACKAGE := $(shell dpkg-parsechangelog -l$(DEBIAN_PATH)/changelog | awk '/^Source:/ {print $$2}') SRC_VERSION := $(shell dpkg-parsechangelog -l$(DEBIAN_PATH)/changelog | awk '/^Version:/ {sub(/-[^-]*/, "", $$2); print $$2}') GIT_REVISION := $(shell echo $(SRC_VERSION) | sed -r 's,.+git\.(\w+).*,\1,') TARBALL := $(PACKAGE)_$(SRC_VERSION).orig.tar.xz .PHONY: get-orig-source get-orig-source: rm -rf get-orig-source $(TARBALL) && mkdir get-orig-source git clone $(GIT_REPO) get-orig-source/$(PACKAGE)-$(SRC_VERSION) git -C get-orig-source/$(PACKAGE)-$(SRC_VERSION) checkout $(GIT_REVISION) find get-orig-source/$(PACKAGE)-$(SRC_VERSION) -name '.*' -print0 | xargs -0 --no-run-if-empty rm -rfv tar cJf $(TARBALL) -C get-orig-source $(PACKAGE)-$(SRC_VERSION) rm -rf get-orig-source @echo " "$(TARBALL)" created; move it to the right destination to build the package"