jerasure/debian/rules

32 lines
1.2 KiB
Makefile
Executable File

#!/usr/bin/make -f
UPSTREAM_GIT ?= http://lab.jerasure.org/jerasure/jerasure.git
DEBVERS ?= $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
VERSION ?= $(shell echo '$(DEBVERS)' | sed -e 's/^[[:digit:]]*://' -e 's/[-].*//')
DEBFLAVOR ?= $(shell dpkg-parsechangelog | grep -E ^Distribution: | cut -d" " -f2)
DEBPKGNAME ?= $(shell dpkg-parsechangelog | grep -E ^Source: | cut -d" " -f2)
GIT_TAG ?= $(shell echo '$(VERSION)' | sed -e 's/~/_/')
%:
dh $@
override_dh_auto_test:
set -e; cd Examples; GF_COMPLETE_DIR=/usr/bin bash ./test_all_gfs.sh
############################################
### Below is to manage upstream Git repo ###
### and is not used during package build ###
############################################
gen-orig-xz:
git tag -v $(GIT_TAG) || true
if [ ! -f ../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ] ; then \
git archive --prefix=$(DEBPKGNAME)-$(VERSION)/ $(GIT_TAG) | xz >../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ; \
fi
[ ! -e ../build-area ] && mkdir ../build-area || true
[ ! -e ../build-area/$(DEBPKGNAME)_$(VERSION).orig.tar.xz ] && cp ../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ../build-area
fetch-upstream-remote:
git remote add upstream $(UPSTREAM_GIT) || true
git fetch upstream