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
|
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
# magic debhelper rule
%:
dh $@ --with python2,python3
include /usr/share/mpi-default-dev/debian_defaults
MPI:=$(ARCH_DEFAULT_MPI_IMPL)
MPI_INC:=/usr/lib/$(MPI)/include
ifeq ($(MPI),lam)
CC:=mpicc.lam
CXX:=mpic++.lam
else
CXX:=mpic++
CC:=mpicc
endif
export CONFIG_SHELL=/bin/sh
# QT version 4 or 5
export QT_SELECT=5
PYVERS:= `pyversions -s`
PY3VERS:= `py3versions -s`
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH)
export DEFAULT_SZIP=/usr
QT_INC:=/usr/include/$(DEB_HOST_MULTIARCH)/qt5
QT_BINDIR=/usr/bin
QT_INCLUDES:=-I$(QT_INC) -I$(QT_INC)/QtGui -I$(QT_INC)/QtCore -I$(QT_INC)/QtWidgets
QT_LIBS:=-lQt5Core -lQt5Gui -lQt5Widgets
# Work with either old or new-style (co-installable) HDF5 layouts
ifneq ($(wildcard $(LIBDIR)/hdf5/$(MPI)/libhdf5.so),)
HDF5_INC:=/usr/include/hdf5/$(MPI)
HDF5_LIB:=$(LIBDIR)/hdf5/$(MPI)
else
ifneq ($(wildcard $(LIBDIR)/hdf5/serial/libhdf5.so),)
HDF5_INC:=/usr/include/hdf5/serial
HDF5_LIB:=$(LIBDIR)/hdf5/serial
else
HDF5_INC:=/usr/include
HDF5_LIB:=/usr/lib
endif
endif
# Note: Since QT headers now include C++ features, configure must be called with g++ as the C compiler.
# But use $(CC) as the C compiler later when actually building.
override_dh_auto_configure:
dh_auto_configure -- \
--with-versioned-symbols \
--enable-pythonmodule \
--enable-silex \
--with-szlib \
--disable-hzip \
--disable-fpzip \
--with-hdf5=$(HDF5_INC),$(HDF5_DIR) \
--enable-install-lite-headers \
--with-Qt-bin-dir=$(QT_BINDIR) --with-Qt-include-dir=$(QT_INC) \
CC=$(CXX) CXX=$(CXX) CFLAGS="$(CFLAGS) -fPIC " CXXFLAGS="$(CXXFLAGS) -fPIC " \
LDFLAGS="$(LDFLAGS) -L$(HDF5_LIB) " \
CPPFLAGS=" $(QT_INCLUDES) -I$(MPI_INC) $(CPPFLAGS)"
# Iterate over some directories to avoid stepping into tools/silex, which doesn't build.
override_dh_auto_build:
for d in src tools/browser tools/silock ; do \
$(MAKE) -C $$d CC=$(CC) CXX=$(CXX) ; done
$(MAKE) -C tools/silex CXX=$(CXX) QT_MOC=moc QT_LIBS="$(QT_LIBS)"
set -e ; for p in $(PYVERS) $(PY3VERS) ; do \
echo "Build python interface for $$p" ; \
$(MAKE) -C tools/python clean all check CXX=$(CXX) PYTHON_CPPFLAGS="-I/usr/include/$$p" ; \
mkdir -p debian/tmp/usr/lib/pyshared/$$p ; \
cp tools/python/.libs/Silo.so debian/Silo.so.$$p ; \
done
override_dh_auto_test:
for d in tests src tools/browser tools/silock ; do \
$(MAKE) -C $$d check; done
override_dh_auto_install:
# move the python modules to where dh_python* will spot them ...
set -e; for p in $(PYVERS) $(PY3VERS); do \
mkdir -p debian/tmp/usr/lib/$$p/site-packages ; \
chrpath -d debian/Silo.so.$$p ; \
cp debian/Silo.so.$$p debian/tmp/usr/lib/$$p/site-packages/Silo.so ; \
done
for p in src tools/browser tools/silock tools/silex ; do \
$(MAKE) -C $$p install prefix=`pwd`/debian/tmp ; done
dh_install
# cp src/.libs/libsiloh5.a debian/libsilo-dev/$(LIBDIR)
mkdir -p debian/libsiloh5-0/$(LIBDIR)
mv debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libsiloh5.so.0.0.0 debian/libsiloh5-0/$(LIBDIR)
dh_link -p libsiloh5-0 $(LIBDIR)/libsiloh5.so.0.0.0 $(LIBDIR)/libsiloh5.so.0
dh_link -p libsilo-dev $(LIBDIR)/libsiloh5.so.0.0.0 $(LIBDIR)/libsiloh5.so
mkdir -p debian/libsilo-dev/$(LIBDIR)/pkgconfig
cp silo.pc debian/libsilo-dev/$(LIBDIR)/pkgconfig
override_dh_auto_clean:
dh_clean
rm -f debian/Silo.so.* config.log
( [ -f Makefile ] && make distclean || echo "No Makefile present ; skipping make distclean" )
|