Migration to debhelper 9
This page contains information on migrating old debhelper 6 compatible package to debhelper 9.
Target Distros are debian jessie, stretch and buster.
debian Boilerplate
debian/compat
Fill with the number 9
.
debian/control
Add
*-dbg
packages as usual (only for C/C++ packages)Use
amd64
as architecture.Use
${source:Version}
instead of deprecated${Source-Version}
debian/rules
Use 'dh
$@'
pattern as described in https://wiki.debian.org/Packaging/IntroDescription on specifying debug packages with newer debhelper variants can be found in https://wiki.debian.org/DebugPackage
Do not use deprecated
include /usr/share/cdbs/1/rules/debhelper.mk
pattern.Use
override_dh_*
pattern forbuild/install/strip
To speed up non-arch-builds (e.g. Java packages) use an empty
override_dh_strip_nondeterminism
ruleThe
override_dh_strip
(see below) is only need for C/C++ packages (don't use it for non-arch builds like Java packaging)
The following example is from elite-client with simulator and test packages.
#!/usr/bin/make -f
#
# $Id: rules 3009 2019-12-25 09:18:51Z wglas $
#
# rules file for creating debian packages
#
DEB_DH_ALWAYS_EXCLUDE = .svn:debian/tmp
package = elite-client
devpackage = elite-client-dev
testpackage = elite-client-test
simulatorpackage = elite-simulator
builddir = $(shell /bin/pwd)/build/unix/release
PKGROOT=$(shell pwd)/debian
INSTALL_PROGRAM = install
DEB_INSTALL_DOCS_ALL := doc/LICENSE.txt doc/ReadMe.txt
%:
dh $@
override_dh_strip:
dh_strip -pelite-client --dbg-package=elite-client-dbg
dh_strip -pelite-client-test --dbg-package=elite-client-test-dbg
dh_strip -pelite-simulator --dbg-package=elite-simulator-dbg
override_dh_auto_build:
cd $(builddir) && $(MAKE)
clean::
cd $(builddir) && $(MAKE) clean
rm -rf debian/*.subvars debian/*.log debian/$(package) debian/$(devpackage) debian/$(testpackage) debian/$(simulatorpackage)
override_dh_auto_install:
rm -rf $(PKGROOT)/$(package)
mkdir -p $(PKGROOT)/$(package)
rm -rf $(PKGROOT)/$(devpackage)
mkdir -p $(PKGROOT)/$(devpackage)
rm -rf $(PKGROOT)/$(testpackage)
mkdir -p $(PKGROOT)/$(testpackage)
rm -rf $(PKGROOT)/$(simulatorpackage)
mkdir -p $(PKGROOT)/$(simulatorpackage)
cd $(builddir)/modules/elite-client && $(MAKE) install-bin DESTDIR=$(PKGROOT)/$(package)
cd $(builddir)/modules/elite-client && $(MAKE) install-dev DESTDIR=$(PKGROOT)/$(devpackage)
cd $(builddir)/programs/elite-client-test && $(MAKE) install-bin DESTDIR=$(PKGROOT)/$(testpackage)
cd $(builddir)/programs/elite-simulator && $(MAKE) install-bin DESTDIR=$(PKGROOT)/$(simulatorpackage) |