|
| 1 | +#!/usr/bin/make -f |
| 2 | +# -*- makefile -*- |
| 3 | +# Sample debian/rules that uses debhelper. |
| 4 | +# This file was originally written by Joey Hess and Craig Small. |
| 5 | +# As a special exception, when this file is copied by dh-make into a |
| 6 | +# dh-make output file, you may use that output file without restriction. |
| 7 | +# This special exception was added by Craig Small in version 0.37 of dh-make. |
| 8 | + |
| 9 | +# Uncomment this to turn on verbose mode. |
| 10 | +export DH_VERBOSE=1 |
| 11 | +# TODO: remove the LDFLAGS override. It's here to avoid esoteric problems |
| 12 | +# of this sort: |
| 13 | +# https://code.ros.org/trac/ros/ticket/2977 |
| 14 | +# https://code.ros.org/trac/ros/ticket/3842 |
| 15 | +export LDFLAGS= |
| 16 | +export PKG_CONFIG_PATH=@(InstallationPrefix)/lib/pkgconfig |
| 17 | +# Explicitly enable -DNDEBUG, see: |
| 18 | +# https://github.com/ros-infrastructure/bloom/issues/327 |
| 19 | +export DEB_CXXFLAGS_MAINT_APPEND=-DNDEBUG |
| 20 | + |
| 21 | +# Solve shlibdeps errors in REP136 packages that use GNUInstallDirs: |
| 22 | +export DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 23 | + |
| 24 | +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
| 25 | + |
| 26 | +%: |
| 27 | + dh $@@ -v --buildsystem=meson --builddirectory=.obj-$(DEB_HOST_GNU_TYPE) |
| 28 | + |
| 29 | +override_dh_auto_configure: |
| 30 | + if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \ |
| 31 | + dh_auto_configure -- \ |
| 32 | + --prefix="@(InstallationPrefix)" \ |
| 33 | + --cmake-prefix-path="@(InstallationPrefix)" \ |
| 34 | + --libdir=lib \ |
| 35 | + --libexecdir=lib |
| 36 | + |
| 37 | +override_dh_auto_build: |
| 38 | + if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \ |
| 39 | + dh_auto_build |
| 40 | + |
| 41 | +override_dh_auto_test: |
| 42 | + echo -- Running tests. Even if one of them fails the build is not canceled. |
| 43 | + if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \ |
| 44 | + dh_auto_test || true |
| 45 | + |
| 46 | +override_dh_shlibdeps: |
| 47 | + if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \ |
| 48 | + dh_shlibdeps -l$(CURDIR)/debian/@(Package)/@(InstallationPrefix)/lib/:$(CURDIR)/debian/@(Package)/@(InstallationPrefix)/lib/${DEB_HOST_MULTIARCH} |
| 49 | + |
| 50 | +override_dh_auto_install: |
| 51 | + if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \ |
| 52 | + dh_auto_install |
0 commit comments