From 95038f8c4132aa1e8f6fafce7068b9df8488f643 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sun, 3 Dec 2023 16:22:43 +0100 Subject: [PATCH] Placing debian template files --- debian/changelog.em | 7 ++++ debian/compat.em | 1 + debian/control.em | 14 ++++++++ debian/copyright.em | 11 +++++++ debian/gbp.conf.em | 3 ++ debian/rules.em | 69 ++++++++++++++++++++++++++++++++++++++++ debian/source/format.em | 1 + debian/source/options.em | 6 ++++ 8 files changed, 112 insertions(+) create mode 100644 debian/changelog.em create mode 100644 debian/compat.em create mode 100644 debian/control.em create mode 100644 debian/copyright.em create mode 100644 debian/gbp.conf.em create mode 100755 debian/rules.em create mode 100644 debian/source/format.em create mode 100644 debian/source/options.em diff --git a/debian/changelog.em b/debian/changelog.em new file mode 100644 index 0000000..3585909 --- /dev/null +++ b/debian/changelog.em @@ -0,0 +1,7 @@ +@[for change_version, change_date, changelog, main_name, main_email in changelogs]@(Package) (@(change_version)@(DebianInc)@(Distribution)) @(Distribution); urgency=high + +@(changelog) + + -- @(main_name) <@(main_email)> @(change_date) + +@[end for] diff --git a/debian/compat.em b/debian/compat.em new file mode 100644 index 0000000..7a87216 --- /dev/null +++ b/debian/compat.em @@ -0,0 +1 @@ +@(debhelper_version) diff --git a/debian/control.em b/debian/control.em new file mode 100644 index 0000000..6d7b65c --- /dev/null +++ b/debian/control.em @@ -0,0 +1,14 @@ +Source: @(Package) +Section: misc +Priority: optional +Maintainer: @(Maintainer) +Build-Depends: debhelper (>= @(debhelper_version).0.0), @(', '.join(BuildDepends)) +Homepage: @(Homepage) +Standards-Version: 3.9.2 + +Package: @(Package) +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, @(', '.join(Depends)) +@[if Conflicts]Conflicts: @(', '.join(Conflicts))@\n@[end if]@ +@[if Replaces]Replaces: @(', '.join(Replaces))@\n@[end if]@ +Description: @(Description) diff --git a/debian/copyright.em b/debian/copyright.em new file mode 100644 index 0000000..bc82fd5 --- /dev/null +++ b/debian/copyright.em @@ -0,0 +1,11 @@ +Format: Bloom subset of https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: @(Name) +@[if BugTracker]Upstream-Contact: @(BugTracker)@\n@[end if]@ +@[if Source]Source: @(Source)@\n@[end if]@ +@[for License, Text in Licenses]@ + +Files: See file headers in repository for details +Copyright: See package copyright in source code for details +License: @(License) + @(Text) +@[end for]@ diff --git a/debian/gbp.conf.em b/debian/gbp.conf.em new file mode 100644 index 0000000..ad24a16 --- /dev/null +++ b/debian/gbp.conf.em @@ -0,0 +1,3 @@ +[git-buildpackage] +upstream-tag=@(release_tag) +upstream-tree=tag diff --git a/debian/rules.em b/debian/rules.em new file mode 100755 index 0000000..284a071 --- /dev/null +++ b/debian/rules.em @@ -0,0 +1,69 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 +# TODO: remove the LDFLAGS override. It's here to avoid esoteric problems +# of this sort: +# https://code.ros.org/trac/ros/ticket/2977 +# https://code.ros.org/trac/ros/ticket/3842 +export LDFLAGS= +export PKG_CONFIG_PATH=@(InstallationPrefix)/lib/pkgconfig +# Explicitly enable -DNDEBUG, see: +# https://github.com/ros-infrastructure/bloom/issues/327 +export DEB_CXXFLAGS_MAINT_APPEND=-DNDEBUG +ifneq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),) + BUILD_TESTING_ARG=-DBUILD_TESTING=OFF +endif + +# Solve shlibdeps errors in REP136 packages that use GNUInstallDirs: +export DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) + +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) + +%: + dh $@@ -v --buildsystem=cmake --builddirectory=.obj-$(DEB_HOST_GNU_TYPE) + +override_dh_auto_configure: + # In case we're installing to a non-standard location, look for a setup.sh + # in the install tree and source it. It will set things like + # CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. + if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \ + dh_auto_configure -- \ + -DCMAKE_INSTALL_PREFIX="@(InstallationPrefix)" \ + -DCMAKE_PREFIX_PATH="@(InstallationPrefix)" \ + $(BUILD_TESTING_ARG) + +override_dh_auto_build: + # In case we're installing to a non-standard location, look for a setup.sh + # in the install tree and source it. It will set things like + # CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. + if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \ + dh_auto_build + +override_dh_auto_test: + # In case we're installing to a non-standard location, look for a setup.sh + # in the install tree and source it. It will set things like + # CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. + echo -- Running tests. Even if one of them fails the build is not canceled. + if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \ + dh_auto_test || true + +override_dh_shlibdeps: + # In case we're installing to a non-standard location, look for a setup.sh + # in the install tree and source it. It will set things like + # CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. + if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \ + dh_shlibdeps -l$(CURDIR)/debian/@(Package)/@(InstallationPrefix)/lib/:$(CURDIR)/debian/@(Package)/@(InstallationPrefix)/lib/${DEB_HOST_MULTIARCH} + +override_dh_auto_install: + # In case we're installing to a non-standard location, look for a setup.sh + # in the install tree and source it. It will set things like + # CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. + if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \ + dh_auto_install diff --git a/debian/source/format.em b/debian/source/format.em new file mode 100644 index 0000000..9666bf4 --- /dev/null +++ b/debian/source/format.em @@ -0,0 +1 @@ +3.0 (@(format)) diff --git a/debian/source/options.em b/debian/source/options.em new file mode 100644 index 0000000..8c4c78b --- /dev/null +++ b/debian/source/options.em @@ -0,0 +1,6 @@ +@[if format and format == 'quilt']@ +# Automatically add upstream changes to the quilt overlay. +# http://manpages.ubuntu.com/manpages/trusty/man1/dpkg-source.1.html +# This supports reusing the orig.tar.gz for debian increments. +auto-commit +@[end if]