#!/usr/bin/make -f # See debhelper(7) (uncomment to enable) # output every command that modifies files on the build system. #export DH_VERBOSE = 1 # see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/default.mk DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) DEB_SOURCE_PACKAGE := $(strip $(shell egrep '^Source: ' debian/control | cut -f 2 -d ':')) DEB_VERSION := $(shell dpkg-parsechangelog -S Version) 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' ) # SLEPC4PY_VERSION is used for the package names, library sonames, and # /usr/lib/petscdir subdirectory names. export SLEPC4PY_VERSION=$(DEB_STRIPPED_UPSTREAM_VERSION)$(SLEPC_EXT) # use only major.minor in general soname (rather than major.minor.patch.build) export SLEPC_BASE_VERSION=$(shell echo $(SLEPC4PY_VERSION) | awk 'BEGIN { FS="."}; {print $$1"."$$2 }') SLEPC_MAJOR_VERSION=$(shell echo $(SLEPC_BASE_VERSION) | sed "s/\..*//") SLEPC_MINOR_VERSION=$(shell echo $(SLEPC_BASE_VERSION) | sed "s/.*\.//") SLEPC_NEXT_VERSION=$(shell echo $(SLEPC_MAJOR_VERSION).$$(( $(SLEPC_MINOR_VERSION) + 1 )) ) PETSC_DIR_REAL=/usr/lib/petscdir/petsc$(SLEPC_BASE_VERSION)/$(DEB_HOST_MULTIARCH)-real SLEPC_DIR_REAL=/usr/lib/slepcdir/slepc$(SLEPC_BASE_VERSION)/$(DEB_HOST_MULTIARCH)-real PETSC_DIR_COMPLEX=/usr/lib/petscdir/petsc$(SLEPC_BASE_VERSION)/$(DEB_HOST_MULTIARCH)-complex SLEPC_DIR_COMPLEX=/usr/lib/slepcdir/slepc$(SLEPC_BASE_VERSION)/$(DEB_HOST_MULTIARCH)-complex PETSC64_DIR_REAL=/usr/lib/petscdir/petsc64-$(SLEPC_BASE_VERSION)/$(DEB_HOST_MULTIARCH)-real SLEPC64_DIR_REAL=/usr/lib/slepcdir/slepc64-$(SLEPC_BASE_VERSION)/$(DEB_HOST_MULTIARCH)-real PETSC64_DIR_COMPLEX=/usr/lib/petscdir/petsc64-$(SLEPC_BASE_VERSION)/$(DEB_HOST_MULTIARCH)-complex SLEPC64_DIR_COMPLEX=/usr/lib/slepcdir/slepc64-$(SLEPC_BASE_VERSION)/$(DEB_HOST_MULTIARCH)-complex # see FEATURE AREAS in dpkg-buildflags(1) #export DEB_BUILD_MAINT_OPTIONS = hardening=+all # see ENVIRONMENT in dpkg-buildflags(1) # package maintainers to append CFLAGS #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic # package maintainers to append LDFLAGS #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed # main packaging script based on dh7 syntax %: dh $@ --with python3,sphinxdoc --buildsystem=pybuild override_dh_clean: dh_clean rm -rf .eggs # nothing to build for arch-indep (docs, dummy package) override_dh_auto_configure-indep: ; override_dh_auto_build-indep: ; override_dh_auto_install-indep: ; override_dh_auto_configure-arch: PYBUILD_NAME=slepc4py_real SLEPC_DIR=$(SLEPC_DIR_REAL) PETSC_DIR=$(PETSC_DIR_REAL) dh_auto_configure -ppython3-slepc4py-real$(SLEPC_BASE_VERSION) PYBUILD_NAME=slepc4py_complex SLEPC_DIR=$(SLEPC_DIR_COMPLEX) PETSC_DIR=$(PETSC_DIR_COMPLEX) dh_auto_configure -ppython3-slepc4py-complex$(SLEPC_BASE_VERSION) PYBUILD_NAME=slepc4py_64_real SLEPC_DIR=$(SLEPC64_DIR_REAL) PETSC_DIR=$(PETSC64_DIR_REAL) dh_auto_configure -ppython3-slepc4py-64-real$(SLEPC_BASE_VERSION) PYBUILD_NAME=slepc4py_64_complex SLEPC_DIR=$(SLEPC64_DIR_COMPLEX) PETSC_DIR=$(PETSC64_DIR_COMPLEX) dh_auto_configure -ppython3-slepc4py-64-complex$(SLEPC_BASE_VERSION) override_dh_auto_build-arch: PYBUILD_NAME=slepc4py_real SLEPC_DIR=$(SLEPC_DIR_REAL) PETSC_DIR=$(PETSC_DIR_REAL) dh_auto_build -ppython3-slepc4py-real$(SLEPC_BASE_VERSION) PYBUILD_NAME=slepc4py_complex SLEPC_DIR=$(SLEPC_DIR_COMPLEX) PETSC_DIR=$(PETSC_DIR_COMPLEX) dh_auto_build -ppython3-slepc4py-complex$(SLEPC_BASE_VERSION) PYBUILD_NAME=slepc4py_64_real SLEPC_DIR=$(SLEPC64_DIR_REAL) PETSC_DIR=$(PETSC64_DIR_REAL) dh_auto_build -ppython3-slepc4py-64-real$(SLEPC_BASE_VERSION) PYBUILD_NAME=slepc4py_64_complex SLEPC_DIR=$(SLEPC64_DIR_COMPLEX) PETSC_DIR=$(PETSC64_DIR_COMPLEX) dh_auto_build -ppython3-slepc4py-64-complex$(SLEPC_BASE_VERSION) # slepc4py embeds the deep PETSC_DIR path as RPATH in its library. # Swap it out for a standard path, or else dh_shlibdeps gets confused chrpath -d .pybuild/*python*/build/slepc4py*/lib/SLEPc*.so override_dh_auto_build-indep: export http_proxy=127.0.0.1:9 override_dh_auto_build-indep: export https_proxy=127.0.0.1:9 override_dh_auto_build-indep: PYTHONPATH=. sphinx-build -M html docs/source .pybuild/docs PYTHONPATH=. sphinx-build -M man docs/source .pybuild/docs PYTHONPATH=. sphinx-build -M info docs/source .pybuild/docs PYTHONPATH=. sphinx-build -M latexpdf docs/source .pybuild/docs override_dh_auto_install-arch: PYBUILD_NAME=slepc4py_real SLEPC_DIR=$(SLEPC_DIR_REAL) PETSC_DIR=$(PETSC_DIR_REAL) dh_auto_install -ppython3-slepc4py-real$(SLEPC_BASE_VERSION) PYBUILD_NAME=slepc4py_complex SLEPC_DIR=$(SLEPC_DIR_COMPLEX) PETSC_DIR=$(PETSC_DIR_COMPLEX) dh_auto_install -ppython3-slepc4py-complex$(SLEPC_BASE_VERSION) PYBUILD_NAME=slepc4py_64_real SLEPC_DIR=$(SLEPC64_DIR_REAL) PETSC_DIR=$(PETSC64_DIR_REAL) dh_auto_install -ppython3-slepc4py-64-real$(SLEPC_BASE_VERSION) PYBUILD_NAME=slepc4py_64_complex SLEPC_DIR=$(SLEPC64_DIR_COMPLEX) PETSC_DIR=$(PETSC64_DIR_COMPLEX) dh_auto_install -ppython3-slepc4py-64-complex$(SLEPC_BASE_VERSION) mkdir -p debian/python3-slepc4py-real$(SLEPC_BASE_VERSION)/usr debian/python3-slepc4py-complex$(SLEPC_BASE_VERSION)/usr mv debian/python3-slepc4py-real/usr/lib debian/python3-slepc4py-real$(SLEPC_BASE_VERSION)/usr mv debian/python3-slepc4py-complex/usr/lib debian/python3-slepc4py-complex$(SLEPC_BASE_VERSION)/usr mkdir -p debian/python3-slepc4py-64-real$(SLEPC_BASE_VERSION)/usr debian/python3-slepc4py-64-complex$(SLEPC_BASE_VERSION)/usr mv debian/python3-slepc4py-64-real/usr/lib debian/python3-slepc4py-64-real$(SLEPC_BASE_VERSION)/usr mv debian/python3-slepc4py-64-complex/usr/lib debian/python3-slepc4py-64-complex$(SLEPC_BASE_VERSION)/usr override_dh_installdocs: dh_installdocs debian/README.Debian override_dh_sphinxdoc: dh_sphinxdoc -Xcontents.rst.txt override_dh_python3-indep: dh_python3 -i dh_numpy3 -i override_dh_python3-arch: dh_python3 -a dh_numpy3 -a mkdir -p debian/python3-slepc4py-real$(SLEPC_BASE_VERSION)/$(SLEPC_DIR_REAL)/lib debian/python3-slepc4py-complex$(SLEPC_BASE_VERSION)/$(SLEPC_DIR_COMPLEX)/lib mv debian/python3-slepc4py-real$(SLEPC_BASE_VERSION)/usr/lib/python3 debian/python3-slepc4py-real$(SLEPC_BASE_VERSION)/$(SLEPC_DIR_REAL)/lib mv debian/python3-slepc4py-complex$(SLEPC_BASE_VERSION)/usr/lib/python3 debian/python3-slepc4py-complex$(SLEPC_BASE_VERSION)/$(SLEPC_DIR_COMPLEX)/lib mkdir -p debian/python3-slepc4py-64-real$(SLEPC_BASE_VERSION)/$(SLEPC64_DIR_REAL)/lib debian/python3-slepc4py-64-complex$(SLEPC_BASE_VERSION)/$(SLEPC64_DIR_COMPLEX)/lib mv debian/python3-slepc4py-64-real$(SLEPC_BASE_VERSION)/usr/lib/python3 debian/python3-slepc4py-64-real$(SLEPC_BASE_VERSION)/$(SLEPC64_DIR_REAL)/lib mv debian/python3-slepc4py-64-complex$(SLEPC_BASE_VERSION)/usr/lib/python3 debian/python3-slepc4py-64-complex$(SLEPC_BASE_VERSION)/$(SLEPC64_DIR_COMPLEX)/lib override_dh_compress: dh_compress -Xpdf override_dh_installdeb: dh_installdeb for pkg in $$(dh_listpackages -a); do \ sed -i -e 's/__SLEPC4PY_VERSION__/$(SLEPC4PY_VERSION)/' debian/$$pkg/DEBIAN/*; \ done