#!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 export DH_GOPKG := github.com/docker/spdystream %: dh $@ --buildsystem=golang --with=golang override_dh_auto_test: -dh_auto_test ## http://wiki.debian.org/onlyjob/get-orig-source .PHONY: get-orig-source PKD = $(abspath $(dir $(MAKEFILE_LIST))) PKG = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source)) VER ?= $(shell dpkg-parsechangelog -l$(PKD)/changelog -SVersion | perl -ne 'print $$1 if m{^(?:\d+:)?(\d.*)(?:\-\d+.*)};') REV = $(shell sh -c 'printf "$${1\#\#*.0.}"' -- "$(VER)") get-orig-source: $(PKG)_$(VER).orig.tar.gz $(info I: $(PKG)_$(VER)) @ $(PKG)_$(VER).orig.tar.gz: $(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..)) @echo "# Downloading..." wget --tries=3 --timeout=40 --read-timeout=40 --continue -O $@ \ https://$(DH_GOPKG)/archive/$(REV).tar.gz \ || uscan --noconf --verbose --rename --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-current-version $(PKD)