File: rules

package info (click to toggle)
libsbml 5.13.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 161,112 kB
  • ctags: 108,318
  • sloc: cpp: 909,538; xml: 239,143; ansic: 58,510; cs: 56,683; java: 26,901; python: 25,599; sh: 10,133; perl: 8,784; makefile: 8,001; ruby: 4,760; php: 202; csh: 3
file content (99 lines) | stat: -rwxr-xr-x 4,006 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
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
#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules for libsbml

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

### define the VARS ###
version := $(shell dpkg-parsechangelog | grep Version | cut -d\  -f2 | cut -d- -f1)
major := $(shell dpkg-parsechangelog | grep Version | cut -d\  -f2 | cut -d. -f1)
libpack := libsbml
debtmp := $(CURDIR)/debian/tmp
SRC_TMP := $(CURDIR)/SRC_TMP
# Test for matlab
CMAKE_OPTS := $(shell sed '/MATLAB/d' debian/cmake_opts)
BIND_OCTAVE :=$(shell which otave-config | grep -q ocatve && echo 'yes')
ifdef BIND_OCTAVE
OCTAVE_PATH := $(shell octave-config --oct-site-dir)
endif
BIND_MATLAB := $(shell which matlab | grep -q matlab && echo 'yes')
ifdef BIND_MATLAB
CMAKE_OPTS := $(shell cat debian/cmake_opts)
endif

# seems we need to use debian/cmake_opts
JDK_PATH:=$(shell readlink -f /usr/bin/javac | sed "s:/bin/javac::")
JAVA_INCLUDE_PATH:=$(JDK_PATH)/include

# This is the path to the javadoc jar, which doc/CMakeLists.txt doesn't find
CMAKE_OPTS += -DJava_JAVADOC_JAR=$(JDK_PATH)/lib/tools.jar -DJAVA_INCLUDE_PATH=$(JAVA_INCLUDE_PATH)

ifneq (,$(filter $(DEB_HOST_ARCH), mips mipsel))
CMAKE_OPTS += -D'WITH_01_COMPILE:BOOL=ON'
endif

### let's do it ###

DEB_COMPRESS_EXCLUDE = .pdf

%:
	dh  $@ --with python2,cli

get-orig-source:
	uscan --verbose --download-current-version --force-download --repack --compression xz

override_dh_auto_clean:
	### the clean target of the libsbml makefile is highly b0rken ###
	### the switch to cmake didn't result in great approvements ###
	### still inline changes of files ###
	### very ugly ###
	rm -rf build docs/formatted docs/src/doxygen-version-specific.txt docs/src/doxygen-config-cpp.txt \
	docs/src/doxygen-config-csharp.txt docs/src/doxygen-config-perl.txt docs/src/doxygen-config-python.txt \
	docs/src/java-substitutions/libsbmlConstants.java docs/src/libsbml-installation.html docs/src/perlmod/DoxyDocs.pm \
	docs/src/perlmod/DoxyStructure.pm docs/src/perlmod/Makefile docs/src/perlmod/doxyrules.make \
	src/bindings/matlab/runTests.log docs/src/doxygen-config-c.txt src/bindings/matlab/*.mex* docs/src/perlmod \
	docs/src/doxygen_sqlite3.db docs/src/libsbml.py docs/src/common-text/libsbml-version.html
	find src/bindings -name "*.pyc" -delete

override_dh_autoreconf:
	echo "autoreconf -f -i   returns exit code 1 - skip this"

override_dh_auto_configure:
ifdef BIND_MATLAB
	cat debian/control.matlab >> debian/control || true
endif
	mkdir -p build
	cd build ; cmake $(CMAKE_OPTS) ../
	# skip this hack since it should work also without it
	# /bin/sh debian/bin/python_fix.sh

override_dh_auto_build:
	# we need to mount proc
	# see https://lists.alioth.debian.org/pipermail/debian-med-packaging/2015-December/037461.html
	# and https://lists.alioth.debian.org/pipermail/debian-med-packaging/2015-December/037474.html
	## its rather a bug in pbuilder if proc is not mounted ...# if mount | grep "^proc " ; then echo "proc mounted - fine"; else mount proc /proc -t proc ; fi
	cd build ; make

override_dh_auto_test:
	echo "no tests"

override_dh_auto_install:
	cd build ; DESTDIR=../debian/tmp make install
	sed 's#formatted/##g' docs/index.html.in > $(debtmp)/usr/share/libsbml/docs/index.html
	dh_auto_install
	pyclean $(debtmp)/usr/lib/python*
	find $(debtmp)/usr -type f -name "*.js" -delete
	find $(debtmp)/usr -type f -name "*.md5" -delete
	find $(debtmp)/usr -type f -exec chmod 644 {} +
	for pyv in `pyversions -s` ; do \
	    test -e $(debtmp)/usr/lib/$${pyv}/site-packages && mv $(debtmp)/usr/lib/python$${pyv}/site-packages $(debtmp)/usr/lib/python$${pyv}/dist-packages || true ; \
	done
	find $(debtmp)/usr/lib -name "*.mex*" -exec strip --strip-unneeded {} + || true
	find $(debtmp)/usr/lib -name "*.mex*" -exec strip --remove-section=.comment {} + || true
	dpkg-shlibdeps $(debtmp)/usr/lib/*/*/*/*/*.mex -Tdebian/libsbml5-octave.substvars
ifdef BIND_MATLAB
	dpkg-shlibdeps $(debtmp)/usr/lib/*.mex* -Tdebian/libsbml5-matlab.substvars
endif

override_dh_installchangelogs:
	dh_installchangelogs NEWS.txt