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
|
#!/usr/bin/make -f
# -*- makefile -*-
MAKEOPTS=LIBEXT=so
export PYBUILD_NAME=biosig
export PYBUILD_SYSTEM=pybuild
export DEB_CFLAGS_MAINT_APPEND = -I$(CURDIR)
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
%:
dh $@ --with python2,python3
override_dh_auto_configure:
dh_auto_configure
: # Use our copies
ln -s debian/upstream-extern extern
override_dh_auto_build:
: # Build everything upstream builds by default
make $(MAKEOPTS)
: # Assure additional interesting to us pieces are built
make $(MAKEOPTS) libbiosig.so mex4o biosig4python
#make libbiosig.a save2gdf save2aecg save2scp pdp2gdf \
# biosig_client biosig_server
# Later: libbiosig.so -- fails, no SONAME etc,
# mex4o -- there are some copying etc
# Later: Python -- depends on obsolete Numeric
# biosig4python
# to build for multiple Python's would need to loop
# between versions with smth like make python -B PYTHONVER=2.6
override_dh_auto_test:
: I: skip testing for now -- relies on download of test data
# Manual crafting of installing Octave and Python bindings
# TODO: proper
PYTHON=$(shell pyversions -d)
PYTHON3=$(shell py3versions -d)
PYDIR=$(shell /bin/ls -d /usr/lib/$(PYTHON)/*-packages)
PY3DIR=$(shell if /bin/ls -d /usr/lib/${PYTHON3}/*-packages 2>/dev/null ; then /bin/ls -d /usr/lib/${PYTHON3}/*-packages ; else /bin/ls -d /usr/lib/python3/*-packages ; fi)
PYVER=$(shell pyversions -d -v)
PY3VER=$(shell py3versions -d -v)
OCTDIR=$(shell octave-config -p LOCALOCTFILEDIR)/biosig
override_dh_auto_install:
dh_auto_install
: I: install Python binding for current Python verion TODO: all
mkdir -p debian/python-biosig$(PYDIR)
cp -a python/build/lib.*-$(PYVER)/biosig.so debian/python-biosig$(PYDIR)
mkdir -p debian/python3-biosig$(PY3DIR)
cp -a python/build/lib.*-$(PY3VER)/biosig.*.so debian/python3-biosig$(PY3DIR)/biosig.so
: I: install Octave bindings
mkdir -p debian/octave-biosig$(OCTDIR)
: # install with executable flag so dh_{strip,...} tools could catch it to operate
install mex/mexS*.mex debian/octave-biosig$(OCTDIR)
[ -x /usr/bin/dh_numpy ] && dh_numpy || :
override_dh_install:
dh_install
d-shlibmove --commit \
--multiarch \
--devunversioned \
--exclude-la \
--override s/libcholmod3-dev/libsuitesparse-dev/ \
--movedev debian/tmp/usr/include usr \
debian/tmp/usr/lib/*/*.so
override_dh_makeshlibs:
dh_makeshlibs
: # Provide octave:Depends
dh_octave_substvar
# Tune up permission for .mex files this late in the chain
# Silly dh_strip, dh_shlibdeps do not process those since extension
# is "unknown" to them and they are not executable
override_dh_gencontrol:
chmod a-x debian/octave-biosig$(OCTDIR)/*.mex
dh_gencontrol
override_dh_auto_clean:
dh_auto_clean
if [ -f Makefile ] ; then make $(MAKEOPTS) clean ; fi # distclean invoked by auto isn't enough
-rm extern
|