File: rules

package info (click to toggle)
mrmpi 1.0~20140404-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 1,764 kB
  • ctags: 1,693
  • sloc: cpp: 13,440; python: 876; ansic: 306; makefile: 175; sh: 11
file content (95 lines) | stat: -rwxr-xr-x 3,117 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

CMAKE_EXTRA_FLAGS = \
	-DCMAKE_BUILD_TYPE:STRING=None \
	-DBUILD_SHARED_LIBS:BOOL=ON \
	-DVTK_INSTALL_EXPORT_NAME:STRING=mrmpi \
	-DVTK_LIBRARY_PROPERTIES:STRING="VERSION;1;SOVERSION;1" \
	-DVTK_INSTALL_INCLUDE_DIR_CM24:STRING=include \
	-DVTK_INSTALL_BIN_DIR_CM24:STRING=bin \
	-DVTK_INSTALL_LIB_DIR_CM24:STRING=lib/$(DEB_HOST_MULTIARCH) \
	-DVTK_USE_MPI:BOOL=ON

pkg_run = libmrmpi1
pkg_dev = libmrmpi-dev
pkg_doc = mrmpi-doc

%:
	dh $@ --buildsystem=cmake --parallel

override_dh_auto_configure:
	dh_auto_configure -- $(CMAKE_EXTRA_FLAGS)

override_dh_compress:
	dh_compress -X.pdf

override_dh_auto_clean:
	rm -f mrmpi_txt2html
	rm -f doc/Manual.pdf
	rm -f doc/*.html
	rm -f oinkdoc/Manual.pdf
	rm -f oinkdoc/*.html
	dh_auto_clean

override_dh_install-arch:
	# Runtime Package
	dh_install -p$(pkg_run) usr/lib/$(DEB_HOST_MULTIARCH)/lib*.so.*
	# Development Package
	dh_install -p$(pkg_dev) usr/include
	dh_install -p$(pkg_dev) usr/lib/$(DEB_HOST_MULTIARCH)/lib*.so

# Let's be smart with building doc
override_dh_auto_build-indep:
	# Need a custom txt2html
	g++ ./txt2html/txt2html.cpp -o mrmpi_txt2html
	# 1. MapReduceMPI:
	# Generate html file for PDF:
	./mrmpi_txt2html -b doc/*.txt
	# Generate PDF from HTML
	(cd doc && htmldoc --title --toctitle "Table of Contents" --tocfooter ..i --toclevels 4 \
		--header ... --footer ..1 --size letter --linkstyle plain --linkcolor blue -f \
		Manual.pdf Manual.html Background.html Whatis.html Start.html Program.html \
		Interface_c++.html [a-z]*.html Interface_c.html Interface_python.html \
		Interface_oink.html Technical.html Examples.html)
	# Generate clean HTML files:
	./mrmpi_txt2html doc/*.txt
	# 2. OINK:
	(cd oinkdoc && python Manual.py)
	./mrmpi_txt2html -b oinkdoc/*.txt
	(cd oinkdoc && htmldoc --title --toctitle "Table of Contents" --tocfooter ..i --toclevels 4 \
		--header ... --footer ..1 --size letter --linkstyle plain --linkcolor blue -f \
		Manual.pdf Manual.html Section_build.html Section_script.html \
		Section_functions.html Section_commands.html Section_errors.html [a-z]*.html)
	./mrmpi_txt2html oinkdoc/*.txt

# No tests needed for docs
override_dh_auto_test-indep:

VER_FULL = $(shell dpkg-parsechangelog | grep '^Version' | cut -d' ' -f2 | cut -f1 -d-)

UPSTREAM_SRC = mrmpi
UPSTREAM_SRC_DIR = mrmpi-7Apr14
DEBIAN_SRC_DIR = mrmpi-$(VER_FULL)
DEBIAN_SRC_TAR = mrmpi_$(VER_FULL).orig.tar.gz

txt2html.tar.gz:
	wget http://www.cs.sandia.gov/~sjplimp/tars/$@

$(UPSTREAM_SRC).tar.gz: txt2html.tar.gz
	wget http://www.cs.sandia.gov/~sjplimp/tars/$@

get-orig-source: $(UPSTREAM_SRC).tar.gz
	tar xzf $(UPSTREAM_SRC).tar.gz
	mv $(UPSTREAM_SRC_DIR) $(DEBIAN_SRC_DIR)
	rm $(DEBIAN_SRC_DIR)/oinkdoc/Manual.pdf
	rm $(DEBIAN_SRC_DIR)/oinkdoc/*.html
	rm $(DEBIAN_SRC_DIR)/doc/Manual.pdf
	rm $(DEBIAN_SRC_DIR)/doc/*.html
	tar xfz txt2html.tar.gz -C $(DEBIAN_SRC_DIR)
	GZIP="--best --no-name" tar czf $(DEBIAN_SRC_TAR) $(DEBIAN_SRC_DIR)
	rm -rf $(DEBIAN_SRC_DIR)
	rm $(UPSTREAM_SRC).tar.gz
	rm txt2html.tar.gz