1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
export PYBUILD_NAME=ffc
export PYBUILD_DISABLE=test
DEB_SOURCE_PACKAGE := $(strip $(shell egrep '^Source: ' debian/control | cut -f 2 -d ':'))
DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
DEB_NOEPOCH_VERSION := $(shell echo $(DEB_VERSION) | cut -d: -f2-)
DEB_UPSTREAM_VERSION := $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//')
DEB_STRIPPED_UPSTREAM_VERSION = $(shell echo $(DEB_UPSTREAM_VERSION) | sed -e 's/\+dfsg.*$$//p')
FENICS_RELEASE_VERSION=$(DEB_STRIPPED_UPSTREAM_VERSION)
FENICS_MAJOR_VERSION=$(shell echo $(FENICS_RELEASE_VERSION) | sed "s/^\([^.]*\)\..*$$/\1/")
FENICS_MINOR_VERSION=$(shell echo $(FENICS_RELEASE_VERSION) | sed "s/^\([^.]*\)\.\([^.]*\)\..*$$/\2/")
FENICS_VERSION=$(FENICS_MAJOR_VERSION).$(FENICS_MINOR_VERSION)
FENICS_NEXT_VERSION=$(FENICS_MAJOR_VERSION).$(shell echo $$(( $(FENICS_MINOR_VERSION) + 1 )) )
USCAN_DESTDIR := $(CURDIR)
PYTHON_BASE_SCRIPT="import sys; base=list(filter( lambda p: p.startswith('/usr/lib/python') and p.endswith('/dist-packages'), sys.path ))[0]; sys.stdout.write(base)"
PYTHON3_MODULE_BASE := $(shell python3 -c $(PYTHON_BASE_SCRIPT))
UFC_SUBDIR=ffc/backends/ufc
PYTHON3_UFC_DIR=$(PYTHON3_MODULE_BASE)/$(UFC_SUBDIR)
%:
dh $@ --buildsystem=pybuild
override_dh_compress:
dh_compress -X.py -X.ufl
override_dh_clean:
dh_clean ffc/git_commit_hash.py
rm -rf *.egg-info
override_dh_installdeb:
dh_installdeb
# handle alternatives for ufc.h
for pkg in $$(dh_listpackages -i ); do \
sed -i -e 's|__PYTHON3_UFC_DIR__|$(PYTHON3_UFC_DIR)|' debian/$$pkg/DEBIAN/*; \
done
override_dh_gencontrol:
dh_gencontrol -- -Vfenics:Upstream-Version=$(FENICS_VERSION) -Vfenics:Next-Upstream-Version=$(FENICS_NEXT_VERSION)~
.PHONY: get-orig-source
|