File: rules

package info (click to toggle)
isospec 2.2.1-4.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,456 kB
  • sloc: cpp: 9,257; python: 2,065; makefile: 184; ansic: 100; sh: 86
file content (100 lines) | stat: -rwxr-xr-x 3,168 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
100
#!/usr/bin/make -f
# -*- makefile -*-

include /usr/share/dpkg/pkg-info.mk

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

export LC_ALL=C.UTF-8

# For automating the d/*.links stuff.
export ISOSPEC_LIB_VERSION=2.2.1
export ISOSPEC_LIB_SOVERSION=2

export PYBUILD_NAME=isospec

export PYBUILD_SYSTEM=distutils

# Taken from CDBS file for R.
rversion	:= $(shell dpkg-query -W -f='$${Version}' r-base-dev)
rapiversion	:= $(shell dpkg-query -W -f='$${Provides}' r-base-core | grep -o 'r-api[^, ]*')

%:
	dh $@ --with python3

override_dh_clean:
	rm -rf obj-x86_64-linux-gnu
	rm -rf build
	rm -f compile_commands.json
	rm -rf .pc
	rm -rf IsoSpecPy.egg-info
	
	# The setup.py script immediately creates that link which
	# makes the package building to stop because it finds that 
	# the source tree has changed. So, first remove that link,
	# that we'll recreate when we need it later, in the
	# override_dh_auto_build target.
	
	rm -rf IsoSpecPy/IsoSpec++
	rm -rf .pybuild/
	rm -rf tmp-install/
	rm -rf IsoSpec++/IsoSpec++
	rm -rf IsoSpecPy/build/
	rm -rf man/html/
	rm -rf man/latex/
	rm -rf man/man/
	
	# Now the default target
	dh_clean

configure_python_module:
	dh_auto_configure -O--buildsystem=pybuild -O--system=distutils --sourcedirectory=.

configure_cpp_library:
	dh_auto_configure -O--buildsystem=cmake -- \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DISOSPEC_LIB_VERSION=2.1.0 -DISOSPEC_LIB_SOVERSION=2

configure_cpp_library_doc:
	dh_auto_configure -O--buildsystem=cmake -- \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DISOSPEC_LIB_VERSION=2.1.0 -DISOSPEC_LIB_SOVERSION=2

override_dh_auto_configure: configure_cpp_library configure_cpp_library_doc configure_python_module

build_python_module: configure_python_module
	dh_auto_build -O--buildsystem=cmake -O--system=distutils --sourcedirectory=.

build_cpp_library: configure_cpp_library
	dh_auto_build -O--buildsystem=cmake

build_cpp_library_doc: configure_cpp_library_doc
	# Generate the dev-doc in the man/hml and man/latex directories
	#doxygen man/doxyfile
	dh_auto_build -O--buildsyste=cmake -- html_doc
	dh_auto_build -O--buildsyste=cmake -- pdf_doc
	# sed-based replacement of the cloudflare URL with the MathJax.js file from the
	# libjs-mathjax package
	sh debian/replace-mathjax-cloudflare-url-local-file.sh

override_dh_auto_build: build_python_module build_cpp_library build_cpp_library_doc
	# Recreate the symlink that was created by setup.py 
	# and that we had to remove at the override_dh_clean target.
	ln -sf IsoSpec++ IsoSpecPy/IsoSpec++

override_dh_auto_install: override_dh_auto_build
	# Install the Python module
	dh_auto_install -O--buildsystem=pybuild -O--system=distutils --sourcedirectory=.
	# Install the C++ library
	dh_auto_install -O--buildsystem=cmake
	# Now remove the links, that we'll provide using d/*.links
	# So that we can use libIsoSpec++.so.* in d/*.install
	rm -f debian/tmp/usr/lib/*/libIsoSpec++.so 
	rm -f debian/tmp/usr/lib/*/libIsoSpec++.so.$(ISOSPEC_LIB_SOVERSION)