#!/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_installdocs-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' $< > $@