| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
UPSTREAM_GIT ?= http://lab.jerasure.org/jerasure/jerasure.git |
| 4 |
|
| 5 |
DEBVERS ?= $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p') |
| 6 |
VERSION ?= $(shell echo '$(DEBVERS)' | sed -e 's/^[[:digit:]]*://' -e 's/[-].*//') |
| 7 |
DEBFLAVOR ?= $(shell dpkg-parsechangelog | grep -E ^Distribution: | cut -d" " -f2) |
| 8 |
DEBPKGNAME ?= $(shell dpkg-parsechangelog | grep -E ^Source: | cut -d" " -f2) |
| 9 |
GIT_TAG ?= $(shell echo '$(VERSION)' | sed -e 's/~/_/') |
| 10 |
|
| 11 |
%: |
| 12 |
dh $@ |
| 13 |
|
| 14 |
override_dh_auto_test: |
| 15 |
set -e; cd Examples; GF_COMPLETE_DIR=/usr/bin bash ./test_all_gfs.sh |
| 16 |
|
| 17 |
############################################ |
| 18 |
### Below is to manage upstream Git repo ### |
| 19 |
### and is not used during package build ### |
| 20 |
############################################ |
| 21 |
gen-orig-xz: |
| 22 |
git tag -v $(GIT_TAG) || true |
| 23 |
if [ ! -f ../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ] ; then \ |
| 24 |
git archive --prefix=$(DEBPKGNAME)-$(VERSION)/ $(GIT_TAG) | xz >../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ; \ |
| 25 |
fi |
| 26 |
[ ! -e ../build-area ] && mkdir ../build-area || true |
| 27 |
[ ! -e ../build-area/$(DEBPKGNAME)_$(VERSION).orig.tar.xz ] && cp ../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ../build-area |
| 28 |
|
| 29 |
fetch-upstream-remote: |
| 30 |
git remote add upstream $(UPSTREAM_GIT) || true |
| 31 |
git fetch upstream |