| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
# Uncomment this to turn on verbose mode. |
| 4 |
export DH_VERBOSE=1 |
| 5 |
|
| 6 |
export PYBUILD_SYSTEM=pyproject |
| 7 |
export SETUPTOOLS_SCM_PRETEND_VERSION=$(DEB_VERSION_UPSTREAM) |
| 8 |
|
| 9 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 10 |
DPKG_EXPORT_BUILDFLAGS = 1 |
| 11 |
include /usr/share/dpkg/buildflags.mk |
| 12 |
include /usr/share/dpkg/pkg-info.mk |
| 13 |
|
| 14 |
DESTDIR:=$(CURDIR)/debian/python3-loki-ecmwf |
| 15 |
|
| 16 |
PYTHONPATH:=$(CURDIR) |
| 17 |
export PYTHONPATH |
| 18 |
|
| 19 |
# magic debhelper rule |
| 20 |
%: |
| 21 |
dh $@ --buildsystem=pybuild --with sphinxdoc |
| 22 |
|
| 23 |
override_dh_auto_build: |
| 24 |
PYBUILD_NAME=loki-ecmwf dh_auto_build -O--buildsystem=pybuild |
| 25 |
# transformations no longer a project |
| 26 |
# PYBUILD_NAME=loki-ecmwf-transformations dh_auto_build -O--buildsystem=pybuild --sourcedirectory=loki/transformations |
| 27 |
PYBUILD_NAME=loki-ecmwf-lint-rules dh_auto_build -O--buildsystem=pybuild --sourcedirectory=lint_rules |
| 28 |
PYTHONPATH=$(CURDIR) $(MAKE) -C docs html |
| 29 |
|
| 30 |
override_dh_auto_install: |
| 31 |
PYBUILD_NAME=loki-ecmwf dh_auto_install -O--buildsystem=pybuild |
| 32 |
PYBUILD_NAME=loki-ecmwf-transformations dh_auto_install -O--buildsystem=pybuild --sourcedirectory=loki/transformations |
| 33 |
PYBUILD_NAME=loki-ecmwf-lint-rules dh_auto_install -O--buildsystem=pybuild --sourcedirectory=lint_rules |
| 34 |
mv $(DESTDIR)/usr/bin/loki-lint.py $(DESTDIR)/usr/bin/loki-lint |
| 35 |
mv $(DESTDIR)/usr/bin/loki-transform.py $(DESTDIR)/usr/bin/loki-transform |
| 36 |
|
| 37 |
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) |
| 38 |
override_dh_sphinxdoc: |
| 39 |
dh_sphinxdoc --exclude=MathJax.js |
| 40 |
find debian/python3-loki-ecmwf-doc -name '*.html' \ |
| 41 |
-exec grep require.js {} /dev/null \; | cut -f1 -d: | while read r; do \ |
| 42 |
sed -e 's%https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4% file:/usr/share/javascript/requirejs%' \ |
| 43 |
< $$r > debian/tmp/x ; \ |
| 44 |
mv debian/tmp/x $$r ; \ |
| 45 |
done |
| 46 |
endif |
| 47 |
|
| 48 |
override_dh_auto_test: |
| 49 |
( dh_auto_test || echo "Don't fail on tests; just capture errors" ) |