# Rules for fetching the upstream tarball # Define the git repo and package name. UPSTREAM_GIT=git://example.com/your-git-repo-here # TODO: Automatically figure this out from the package name PACKAGE_NAME=sugar-SOMETHING-activity # NB: Don't touch this unless it's broken. CURRENT_TREEISH =$(shell dpkg-parsechangelog | sed -rne 's,^Version: .*git.{9}([^-]+).*,\1,p') CURVER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p') SOURCE_DIR=$(PACKAGE_NAME)-$(CURVER) TARBALL=$(PACKAGE_NAME)_$(CURVER).orig.tar.gz $(SOURCE_DIR): git clone $(UPSTREAM_GIT) $(SOURCE_DIR) if [ x$(CURRENT_TREEISH) = x ]; then \ cd $(SOURCE_DIR) && git checkout v$(CURVER); \ else \ cd $(SOURCE_DIR) && git checkout $(CURRENT_TREEISH); \ fi cd $(SOURCE_DIR) && rm -rf .git* $(TARBALL): $(SOURCE_DIR) tar czvf $(TARBALL) $(SOURCE_DIR) get-orig-source: $(TARBALL) rm -rf $(SOURCE_DIR) $(SOURCE_DIR).temp