File: rules

package info (click to toggle)
biosig4c%2B%2B 1.3.0-2.2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,144 kB
  • sloc: ansic: 30,471; cpp: 7,543; makefile: 1,630; python: 65; awk: 58; sh: 4; ruby: 2
file content (74 lines) | stat: -rwxr-xr-x 2,194 bytes parent folder | download
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
#!/usr/bin/make -f
# -*- makefile -*-

MAKEOPTS=LIBEXT=so

%:
	dh  $@ --with python2

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)
PYDIR=$(shell /bin/ls -d /usr/lib/$(PYTHON)/*-packages)

OCTDIR=$(shell octave-config --oct-site-dir)

override_dh_auto_install:
	dh_auto_install

	: I: install Python binding for current Python verion TODO: all
	mkdir -p debian/python-biosig$(PYDIR)
	install -m 0644 python/biosig.py python/_biosig.so debian/python-biosig$(PYDIR)

	: 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_makeshlibs:
	dh_makeshlibs
	: # Provide Octave:Depends
	[ -e /usr/bin/octave-depends ] \
	&& octave-depends \
	|| echo 'octave:Depends=octave (>= 3.4.3-1~)' >> debian/octave-biosig.substvars


override_dh_strip:
	dh_strip --dbg-package=libbiosig1-dbg

# 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
	make $(MAKEOPTS) clean					# distclean invoked by auto isn't enough
	-rm extern