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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
|
#!/usr/bin/make -f
export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
PY3VERS:=$(shell py3versions --supported)
PY3DEFAULT:=$(shell py3versions --default -v)
PYDIR:=debian/python3-pmix/usr/lib/python3/dist-packages
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
AUTOGENERATED:= pmix-mca-params.conf
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) -fPIC
PSM_ARCH= amd64
UCX_ARCH= amd64 arm64 ppc64el
PSM2_ARCH= amd64
PSM2:= $(if $(filter $(DEB_TARGET_ARCH),$(PSM2_ARCH)), --with-psm2, )
UCX:= $(if $(filter $(DEB_TARGET_ARCH),$(UCX_ARCH)), --with-ucx=/usr, )
export LD_LIBRARY_PATH:=$(CURDIR)/debian/tmp/$(LIBDIR)/pmix2/lib:$(LD_LIBRARY_PATH)
# Do not embed build username or build system hostname, see README
export HOSTNAME=hostname
export USER=username
%:
dh $@ --with sphinxdoc
BUILD_FLAGS:= \
$(PSM2) \
$(UCX) \
--prefix=$(LIBDIR)/pmix2 \
--libdir=$(LIBDIR)/pmix2/lib \
--includedir=$(LIBDIR)/pmix2/include \
--sysconfdir=$(LIBDIR)/pmix2/share \
--datarootdir=$(LIBDIR)/pmix2/share \
--with-curl \
--enable-ipv6 \
--with-zlib=/usr \
--with-zlib-libdir=$(LIBDIR) \
--with-jansson=/usr \
--with-jansson-libdir=$(LIBDIR) \
--with-hwloc=/usr \
--with-hwloc-libdir=$(LIBDIR) \
--enable-python-bindings
override_dh_auto_clean:
dh_auto_clean
rm -f $(patsubst %, debian/%, ${AUTOGENERATED})
rm -rf debian/static-build debian/shared-build*
rm -f .gitmodules
# autogenerated files. Clean so double-build works
find . -name Makefile.in -delete
rm -f aclocal.m4 config/ar-lib config/autogen_found_items.m4 config/compile config/config.sub config/depcomp \
config/install-sh config/libtool.m4 config/config.guess config/ltmain.sh config/ltoptions.m4 \
config/ltsugar.m4 config/lt~obsolete.m4 config/ltversion.m4 config/mca_library_paths.txt \
config/missing config/test-driver config/ylwrap configure src/include/pmix_config.h.in \
src/include/pmix_frameworks.c src/include/pmix_frameworks.h include/pmix_version.h
override_dh_autoreconf:
./autogen.pl --force
for f in ${AUTOGENERATED} ; do \
sed -e 's%@DEB_HOST_MULTIARCH@%${DEB_HOST_MULTIARCH}%g' < debian/$$f.in > debian/$$f ; \
done
override_dh_auto_configure:
dh_auto_configure --builddirectory=debian/static-build -- $(BUILD_FLAGS) \
--enable-static
dh_auto_configure --builddirectory=debian/shared-build -- $(BUILD_FLAGS) \
--enable-shared
for p in $(PY3VERS) ; do \
PYTHON=$$p dh_auto_configure --builddirectory=debian/shared-build-$$p -- $(BUILD_FLAGS) \
--enable-shared ; done
override_dh_auto_build:
# Hack - build system doesn't work well with builddirs
cp include/*.h debian/static-build/include
cp include/*.h debian/shared-build/include
cp debian/static-build/include/pmix_version.h include
cp bindings/python/pmix.* debian/static-build/bindings/python
cp bindings/python/pmix.* debian/shared-build/bindings/python
dh_auto_build --builddirectory=debian/static-build
dh_auto_build --builddirectory=debian/shared-build
for p in $(PY3VERS) ; do \
cp include/*.h debian/shared-build-$$p/include ; \
cp bindings/python/pmix.* debian/shared-build-$$p/bindings/python ; \
PYTHON=$$p dh_auto_build --builddirectory=debian/shared-build-$$p ; \
done
override_dh_auto_install:
dh_auto_install --builddirectory=debian/static-build
dh_auto_install --builddirectory=debian/shared-build
for p in $(PY3VERS) ; do \
PYTHON=$$p dh_auto_install --builddirectory=debian/shared-build-$$p ; \
done
find debian/tmp -name '*.la' -delete
chrpath -d debian/tmp/$(LIBDIR)/pmix2/bin/*
chrpath -d debian/tmp/$(LIBDIR)/pmix2/lib/pmix/*.so
execute_after_dh_python3:
mkdir -p $(PYDIR)/pmix
mv $(PYDIR)/*egg/*.so $(PYDIR)/pmix
mv $(PYDIR)/pypmix-*-py$(PY3DEFAULT)-linux-*.egg/*.py $(PYDIR)/pmix
|