File: rules

package info (click to toggle)
cyclonedds 0.7.0-8
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,948 kB
  • sloc: ansic: 164,480; java: 5,141; xml: 1,905; perl: 1,863; sh: 734; makefile: 102
file content (88 lines) | stat: -rwxr-xr-x 3,469 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
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all reproducible=+all future=+lfs

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

BUILD_TESTING = $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),OFF,ON)
BUILD_DOCS = $(if $(filter nodoc,$(DEB_BUILD_OPTIONS)),OFF,ON)

DDS_PLUGINS_DIR = lib/$(DEB_HOST_MULTIARCH)/libddsc0

# TODO: compile-time check would be better than this hardcoded architecture list
LINK_LIBATOMIC = $(if $(filter s390x,$(DEB_HOST_ARCH)),ON,OFF)

%:
	dh $@ --buildsystem=cmake --with sphinxdoc,javahelper

override_dh_auto_configure: maven-build/pom.xml maven-build/Project.java
	# Build idlc first, because it will be needed for ddsperf later
	# TODO: I would prefer to call dh_auto_configure -plibdsc-tools
	# directly, but this would do nothing for indep targets, where I
	# still need the Java build.
	dh_auto_configure --buildsystem=maven
	mh_patchpoms -plibddsc-tools --debian-build --keep-pom-version --maven-repo=$(CURDIR)/debian/maven-repo
	dh_auto_build --buildsystem=maven -- \
		-f maven-build/pom.xml package -e
	sed -e 's#@JARPATH@#$(CURDIR)/maven-build/target/#' \
		debian/wrapper/dds_idlc.in > maven-build/bootstrap-dds_idlc
	sed -e 's#@JARPATH@#/usr/share/libddsc-tools/#' \
		debian/wrapper/dds_idlc.in > maven-build/dds_idlc
	chmod +x maven-build/dds_idlc maven-build/bootstrap-dds_idlc
	# Continue with the regular build, which is patched to use the prebuilt idlc
	dh_auto_configure --buildsystem=cmake -- \
		-DCMAKE_SKIP_RPATH=ON \
		-DBUILD_DOCS=$(BUILD_DOCS) \
		-DBUILD_TESTING=OFF \
		-DDDS_PLUGINS_DIR=$(DDS_PLUGINS_DIR) \
		-DDEB_LINK_LIBATOMIC=$(LINK_LIBATOMIC) \
		-DBUILD_IDLC=ON

# Inject LD_LIBRARY_PATH on selected targets so we do not need RPATHs
override_dh_auto_build:
	env LD_LIBRARY_PATH=$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/lib \
		dh_auto_build

# Disable flaky and long-running test suite
override_dh_auto_test:
#	cd obj-$(DEB_HOST_GNU_TYPE) && \
#	env LD_LIBRARY_PATH=$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/lib \
#		ctest --force-new-ctest-process -j1

doc_dir = debian/tmp/usr/share/doc/CycloneDDS
execute_after_dh_auto_install:
	mv $(doc_dir)/manual/docs $(doc_dir)/manual/html

# Ignore plugins when generating the symbols file
override_dh_makeshlibs:
	dh_makeshlibs -X/$(DDS_PLUGINS_DIR)/

# Create pom.xml from template
maven-build/pom.xml: src/idlc/src/pom.xml.in
	mkdir -p maven-build
	sed -e 's/@PROJECT_VERSION@/$(DEB_VERSION_UPSTREAM)/g' \
		-e 's#$${CMAKE_CURRENT_BINARY_DIR}/org/eclipse/cyclonedds/##' \
		-e 's#$${basedir}#$(CURDIR)/src/idlc/src#g' $< > $@
	

project_java_destdir = target/generated-sources/idlc/org/eclipse/cyclonedds
maven-build/Project.java: src/idlc/src/org/eclipse/cyclonedds/Project.java.in
	mkdir -p maven-build
	sed -e 's/@PROJECT_NAME@/CycloneDDS/' \
		-e 's/@PROJECT_NAME_CAPS@/CYCLONEDDS/' \
		-e 's/@PROJECT_VERSION@/$(DEB_VERSION_UPSTREAM)/' $< > $@
	# Emulate copy-rename-maven-plugin
	mkdir -p maven-build/$(project_java_destdir)
	cp maven-build/Project.java maven-build/$(project_java_destdir)

execute_before_dh_installman: debian/dds_idlc.1 debian/ddsls.1 debian/ddsperf.1 debian/pubsub.1
	true

libddsc_doc_dir = debian/libddsc-doc/usr/share/doc/libddsc-dev
execute_after_dh_sphinxdoc-indep:
	# Reuse _static files from main documentation
	rm -r $(libddsc_doc_dir)/examples/html/_static
	ln -s ../../html/_static $(libddsc_doc_dir)/examples/html/_static

%.1: %.1.in
	sed -e 's/@VERSION@/$(DEB_VERSION_UPSTREAM)/g' $< > $@