File: rules

package info (click to toggle)
yade 2017.01a-8
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 14,316 kB
  • ctags: 10,827
  • sloc: cpp: 52,081; python: 25,506; ansic: 6,463; sh: 109; makefile: 55
file content (75 lines) | stat: -rwxr-xr-x 2,373 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
#!/usr/bin/make -f
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

# 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:
ifneq (,$(filter $(DEB_HOST_ARCH), armel armhf mips mipsel))
	echo 'This architecture is not supported, exiting'
	exit 2
endif
	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
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)