File: rules

package info (click to toggle)
yade 2019.01a-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 16,568 kB
  • sloc: cpp: 56,330; python: 30,148; ansic: 6,463; sh: 123; makefile: 56
file content (81 lines) | stat: -rwxr-xr-x 2,659 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
#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk

BUILDDIR = $(CURDIR)/debian/build
tmpInstall = $(CURDIR)/debian/tmp
tmpDirMatplotLib = $(CURDIR)/debian/matplotlib

%:
	dh $@ --builddirectory=$(BUILDDIR) --with python2 --no-parallel

export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed,-no-keep-memory

# no debug info to avoid running
# out of address space when linking
ifneq (,$(filter $(DEB_HOST_ARCH), mips mipsel))
	export DEB_CXXFLAGS_MAINT_APPEND += -g0
endif

# Check, whether Build-Depends-Indep are installed
BUILD_DOC=$(shell dpkg -s python-sphinx | grep -q "^Status:.* installed$$" && echo yes)

export MPLCONFIGDIR := $(tmpDirMatplotLib)
export HOME := $(tmpDirMatplotLib)
export LD_LIBRARY_PATH :=  $(tmpInstall)/usr/lib/$(DEB_HOST_MULTIARCH)/yade/py:$(tmpInstall)/usr/lib/$(DEB_HOST_MULTIARCH)/yade:$(tmpInstall)/usr/lib/$(DEB_HOST_MULTIARCH)/yade/py:$(tmpInstall)/usr/lib/$(DEB_HOST_MULTIARCH)/yade/py/gts:$(tmpInstall)/usr/lib/$(DEB_HOST_MULTIARCH)/yade/py/yade:$(tmpInstall)/usr/lib/$(DEB_HOST_MULTIARCH)/yade/py/yade/qt:$(LD_LIBRARY_PATH);
export DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
export YADE_PREFIX := $(tmpInstall)/usr

extra_flags += \
-DruntimePREFIX="/usr" \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DNOSUFFIX=ON \
-DLIBRARY_OUTPUT_PATH=lib/$(DEB_HOST_MULTIARCH) \
-DUSE_QT5=ON \
-DENABLE_SPH=ON

override_dh_auto_configure:
	dh_auto_configure -- $(extra_flags)
	mkdir -p $(tmpDirMatplotLib)
	mkdir -p $(tmpInstall)
	#Output an information about available memory and CPU
	-cat /proc/meminfo
	-cat /proc/cpuinfo

override_dh_auto_install:
	dh_auto_install
	# generate manpages
	help2man $(tmpInstall)/usr/bin/yade > yade.1
	help2man $(tmpInstall)/usr/bin/yade-batch > yade-batch.1
	$(tmpInstall)/usr/bin/yade --test
	$(tmpInstall)/usr/bin/yade --check
	dh_numpy
ifeq ($(BUILD_DOC), yes)
	#Generate docs
	cd $(CURDIR)/doc/sphinx; PYTHONPATH=. $(tmpInstall)/usr/bin/yade yadeSphinx.py
	cd $(CURDIR)/doc/sphinx/_build/html ; find . -type f -print0 | xargs -0 sed -i 's/https:\/\/cdnjs\.cloudflare\.com\/ajax\/libs\/mathjax\/2\.7\.5\/latest.js/\/usr\/share\/javascript\/mathjax\/MathJax.js\//g'
endif
	#Delete all pyc files
	find . -name '*.pyc' -print0 | xargs -0 rm -f

override_dh_installchangelogs:
	dh_installchangelogs ChangeLog

override_dh_installman:
	dh_installman -p yade yade.1 yade-batch.1

override_dh_compress:
	dh_compress --all -X.py -X.stl -X.gts -X.geo -X.mesh -X.msh -X.pdf -X.png -X.svg -X.txt -X.js -X.inv

override_dh_auto_test: 

override_dh_installdocs:
	dh_installdocs
ifeq ($(BUILD_DOC), yes)
	dh_sphinxdoc
endif

override_dh_auto_clean:
	dh_auto_clean
	rm -rf $(BUILDDIR)