summaryrefslogtreecommitdiffstats
path: root/debian
diff options
context:
space:
mode:
Diffstat (limited to 'debian')
-rw-r--r--debian/changelog102
-rw-r--r--debian/control36
-rw-r--r--debian/copyright18
-rw-r--r--debian/debian-package-notes.specs2
-rw-r--r--debian/dh-dlopenlibdeps.install3
-rw-r--r--debian/dh-dlopenlibdeps.manpages1
-rw-r--r--debian/dh-package-notes.install2
-rw-r--r--debian/dh-package-notes.manpages1
-rwxr-xr-xdebian/dh_dlopenlibdeps156
-rw-r--r--debian/dh_package_notes.1172
-rw-r--r--debian/dlopenlibdeps.pm7
-rw-r--r--debian/package-notes.mk21
-rwxr-xr-xdebian/rules10
-rw-r--r--debian/source/format1
14 files changed, 532 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..ec86dff
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,102 @@
+package-notes (0.10~exp) experimental; urgency=medium
+
+ * Add Python script to parse dlopen ELF notes
+ * Add Debian tool for dlopen-notes
+ * d/control: bump Standards-Version to 4.7.0, no changes
+
+ -- Luca Boccassi <bluca@debian.org> Thu, 09 May 2024 10:15:28 +0100
+
+package-notes (0.9) unstable; urgency=medium
+
+ * Switch to --package-metadata linker flag via specs file
+
+ -- Luca Boccassi <bluca@debian.org> Sun, 27 Nov 2022 16:43:58 +0000
+
+package-notes (0.8) unstable; urgency=medium
+
+ * use LONG instead of BYTEs for binary fields
+
+ -- Luca Boccassi <bluca@debian.org> Mon, 04 Apr 2022 19:52:18 +0100
+
+package-notes (0.7) unstable; urgency=medium
+
+ * dh: derive distro name at build time
+ * dh: pick debuginfod from DEBUGINFOD_URLS env var if available
+ * dh: install makefile include to automatically set LDFLAGS
+
+ -- Luca Boccassi <bluca@debian.org> Mon, 07 Mar 2022 11:40:22 +0000
+
+package-notes (0.6) unstable; urgency=medium
+
+ * Mark package as Multi-Arch: foreign
+
+ -- Luca Boccassi <bluca@debian.org> Sun, 20 Feb 2022 22:16:03 +0000
+
+package-notes (0.5) unstable; urgency=medium
+
+ [ Zbigniew Jędrzejewski-Szmek ]
+ * generator: add a hint how to use the output to the output
+ * generator: allow disabling READONLY
+ * rpm: skip (READONLY) with older linker versions
+ * Use -Wl,-dT
+ * generator: add help strings
+
+ [ Luca Boccassi ]
+ * Initial packaging (Closes: #1004357)
+ * Add architecture field
+ * Skip fields without value
+ * Debian: use -Wl,dT
+
+ [ Zbigniew Jędrzejewski-Szmek ]
+ * generator: add description in help output
+ * generator: add --version argument
+ * generator: disallow abbreviated option names
+ * generator: rename program to not have .py suffix
+ * generator: fix two minor issues reported by pylint
+ * debian: stop using dh-exec
+
+ [ Mark Wielaard ]
+ * generate-package-notes.py: Add --debuginfod argument
+
+ [ Victor Westerhuis ]
+ * Add Debian debuginfod server in dh_package_notes
+ * Provide dh-sequence-package_notes
+ * Fix Python installation
+ * Add manpage for generate-package-notes
+
+ [ Zbigniew Jędrzejewski-Szmek ]
+ * rpm: rename srpm macros file
+ * rpm: fix filename in macro
+ * rpm: conditionalize all macros on %_package_note_file being defined
+ * rpm: make _generate_package_note_file always recreate the file
+ * rpm: use $RPM_PACKAGE_VERSION variable to refer to the package version
+ * rpm: also voidify the macros if we're on a noarch build
+ * rpm: use %{buildsubdir} in %_package_note_file if defined
+ * rpm: allow unsetting %_package_note_readonly to drop the READONLY
+ attribute
+ * rpm: add %_package_note_linker and document everything (rhbz#2043178,
+ rhbz#2043368)
+ * rpm: disable notes with linkers other than bfd
+ * rpm: disable notes when clang toolchain is used on arm
+ * generator: do not write zeroes to the linker script
+
+ [ Frantisek Sumsal ]
+ * ci: update repos before installing packages
+
+ [ Zbigniew Jędrzejewski-Szmek ]
+ * rpm: use named arguments
+
+ [ Luca Boccassi ]
+ * python: add --cpe auto
+ * shell: add --cpe auto
+ * man: document new --cpe auto option
+ * shell: add --root option
+ * python: add --root option
+ * man: document new --root option
+ * python: parse files in gather_data rather than parse_args
+ * tests: add resources and tests for --auto-cpe and --root
+ * rpm: use --cpe auto
+ * debian: bump debhelper-compat version to 13
+ * README: note we have both python and shell implementations
+
+ -- Luca Boccassi <bluca@debian.org> Mon, 31 Jan 2022 23:43:02 +0000
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..8cbaf0f
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,36 @@
+Source: package-notes
+Section: admin
+Priority: optional
+Rules-Requires-Root: no
+Maintainer: Luca Boccassi <bluca@debian.org>
+Build-Depends: debhelper-compat (= 13),
+ python3:native <!nocheck>,
+ python3-pyelftools:native <!nocheck>,
+ python3-pytest:native <!nocheck>,
+Standards-Version: 4.7.0
+Homepage: https://systemd.io/ELF_PACKAGE_METADATA/
+Vcs-Git: https://github.com/systemd/package-notes.git
+Vcs-Browser: https://github.com/systemd/package-notes
+
+Package: dh-package-notes
+Architecture: all
+Multi-Arch: foreign
+Enhances: debhelper
+Depends: ${misc:Depends}, debhelper,
+Description: Debian Helper for adding package metadata to ELF binaries
+ Provides a linker specs file to add package metadata to the ELF binaries being
+ built. See: https://systemd.io/ELF_PACKAGE_METADATA/
+
+Package: dh-dlopenlibdeps
+Architecture: all
+Multi-Arch: foreign
+Enhances: debhelper
+Depends: ${misc:Depends},
+ ${perl:Depends},
+ debhelper,
+ python3,
+ python3-pyelftools,
+Provides: dh-sequence-dlopenlibdeps,
+Description: Debian Helper for parsing dlopen metadata from ELF binaries
+ Parses dlopen ELF note and generates dependencies from it that can be used
+ via ${dlopen:Depends|Recommends|Suggests}
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..0962154
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,18 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+
+Files: *
+Copyright: 2021-2022 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
+ 2021-2022 Luca Boccassi <bluca@debian.org>
+ 2021 Victor Westerhuis <victor@westerhu.is>
+ 2021 Mark Wielaard <mark@klomp.org>
+ 2022 Frantisek Sumsal <fsumsal@redhat.com>
+License: CC0-1.0
+ To the extent possible under law, the author(s) have dedicated all copyright
+ and related and neighboring rights to this software to the public domain
+ worldwide. This software is distributed without any warranty.
+ .
+ You should have received a copy of the CC0 Public Domain Dedication along with
+ this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+ .
+ On Debian systems, the complete text of the CC0 1.0 Universal license can be
+ found in ‘/usr/share/common-licenses/CC0-1.0’.
diff --git a/debian/debian-package-notes.specs b/debian/debian-package-notes.specs
new file mode 100644
index 0000000..9045a9a
--- /dev/null
+++ b/debian/debian-package-notes.specs
@@ -0,0 +1,2 @@
+*link:
++ --package-metadata={\"type\":\"deb\",\"os\":\"%:getenv(DEB_VENDOR \",\"name\":\"%:getenv(DEB_SOURCE_PACKAGE_NAME \",\"version\":\"%:getenv(DEB_SOURCE_PACKAGE_VERSION \",\"architecture\":\"%:getenv(DEB_HOST_ARCH \",\"debugInfoUrl\":\"%:getenv(DEBUGINFOD_URLS \"})))))
diff --git a/debian/dh-dlopenlibdeps.install b/debian/dh-dlopenlibdeps.install
new file mode 100644
index 0000000..75c3a60
--- /dev/null
+++ b/debian/dh-dlopenlibdeps.install
@@ -0,0 +1,3 @@
+debian/dlopenlibdeps.pm usr/share/perl5/Debian/Debhelper/Sequence
+debian/dh_dlopenlibdeps usr/bin
+usr/bin/dlopen-notes
diff --git a/debian/dh-dlopenlibdeps.manpages b/debian/dh-dlopenlibdeps.manpages
new file mode 100644
index 0000000..87a4db4
--- /dev/null
+++ b/debian/dh-dlopenlibdeps.manpages
@@ -0,0 +1 @@
+debian/dh_dlopenlibdeps.1
diff --git a/debian/dh-package-notes.install b/debian/dh-package-notes.install
new file mode 100644
index 0000000..215cc86
--- /dev/null
+++ b/debian/dh-package-notes.install
@@ -0,0 +1,2 @@
+debian/package-notes.mk usr/share/debhelper/dh_package_notes/
+debian/debian-package-notes.specs usr/share/debhelper/dh_package_notes/
diff --git a/debian/dh-package-notes.manpages b/debian/dh-package-notes.manpages
new file mode 100644
index 0000000..6c26efd
--- /dev/null
+++ b/debian/dh-package-notes.manpages
@@ -0,0 +1 @@
+debian/dh_package_notes.1
diff --git a/debian/dh_dlopenlibdeps b/debian/dh_dlopenlibdeps
new file mode 100755
index 0000000..067618c
--- /dev/null
+++ b/debian/dh_dlopenlibdeps
@@ -0,0 +1,156 @@
+#!/usr/bin/perl
+# SPDX-License-Identifier: CC0-1.0
+
+=head1 NAME
+
+dh_dlopenlibdeps - parse dlopen library dependencies from ELF notes
+
+=cut
+
+use strict;
+use warnings;
+use Debian::Debhelper::Dh_Lib;
+
+our $VERSION = DH_BUILTIN_VERSION;
+
+=head1 SYNOPSIS
+
+B<dh_dlopenlibdeps> [S<I<debhelper options>>] [B<-X>I<item>]
+
+=head1 DESCRIPTION
+
+B<dh_dlopenlibdeps> is a debhelper program that is responsible for calculating
+dlopen library dependencies for packages.
+
+This program follows the dlopen notes metadata specification as defined at
+https://systemd.io/ELF_PACKAGE_METADATA/
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-X>I<item>, B<--exclude=>I<item>
+
+Exclude files that contain F<item> anywhere in their filename from being
+parsed. This will make their dependencies be ignored.
+This may be useful in some situations, but use it with caution. This option
+may be used more than once to exclude more than one thing.
+
+=back
+
+=cut
+
+init();
+
+on_pkgs_in_parallel {
+ my $is_elf_file = sub {
+ my ($file) = @_;
+ my @file_args = Debian::Debhelper::Dh_Lib::_internal_optional_file_args();
+ my $ff = qx_cmd('file', @file_args, '--brief', '-e', 'apptype', '-e', 'ascii',
+ '-e', 'encoding', '-e', 'cdf', '-e', 'compress', '-e', 'tar', '--', $file);
+ return 1 if $ff =~ m/ELF/;
+ return 0;
+ };
+
+ foreach my $package (@_) {
+ my $tmp = tmpdir($package);
+ my $ext = pkgext($package);
+ my (@filelist);
+ my %required_packages;
+ my %recommended_packages;
+ my %suggested_packages;
+
+ # Generate a list of ELF binaries in the package, ignoring any we were told to exclude.
+ my $find_options='';
+ if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
+ $find_options="! \\( $dh{EXCLUDE_FIND} \\)";
+ }
+ next if not -d $tmp;
+ foreach my $file (split(/\n/, `find $tmp -type f \\( -perm /111 -or -name "*.so*" -or -name "*.cmxs" -or -name "*.node" \\) $find_options -print`)) {
+ # Prune directories that contain separated debug symbols.
+ # CAVEAT: There are files in /usr/lib/debug that are not detached debug symbols, which should be processed. (see #865982)
+ next if $file =~ m!^\Q$tmp\E/usr/lib/debug/(lib|lib64|usr|bin|sbin|opt|dev|emul|\.build-id)/!;
+ if ($is_elf_file->($file)) {
+ push @filelist, $file;
+ }
+ }
+
+ if (@filelist) {
+ my $required_sonames = '';
+ my $recommended_sonames = '';
+ my $suggested_sonames = '';
+
+ my $sonames = `dlopen-notes --sonames @filelist`;
+ foreach my $line (split(/\n/, $sonames)) {
+ my ($soname, $priority) = split(' ', $line, 2);
+
+ if ($priority eq 'required') {
+ $required_sonames .= " $soname";
+ } elsif ($priority eq 'recommended') {
+ $recommended_sonames .= " $soname";
+ } elsif ($priority eq 'suggested') {
+ $suggested_sonames .= " $soname";
+ } else {
+ warning("Unknown priority $priority for $soname");
+ }
+ }
+
+ if ($required_sonames) {
+ my $dpkg_query = `dpkg-query --search -- $required_sonames`;
+ foreach my $line (split(/\n/, $dpkg_query)) {
+ chomp $line;
+ if ($line =~ m/^local diversion |^diversion by/) {
+ next;
+ }
+ if ($line =~ m/^([-a-z0-9+]+):/) {
+ $required_packages{$1} = 1;
+ }
+ }
+ }
+
+ if ($recommended_sonames) {
+ my $dpkg_query = `dpkg-query --search -- $recommended_sonames`;
+ foreach my $line (split(/\n/, $dpkg_query)) {
+ chomp $line;
+ if ($line =~ m/^local diversion |^diversion by/) {
+ next;
+ }
+ if ($line =~ m/^([-a-z0-9+]+):/) {
+ $recommended_packages{$1} = 1;
+ }
+ }
+ }
+
+ if ($suggested_sonames) {
+ my $dpkg_query = `dpkg-query --search -- $suggested_sonames`;
+ foreach my $line (split(/\n/, $dpkg_query)) {
+ chomp $line;
+ if ($line =~ m/^local diversion |^diversion by/) {
+ next;
+ }
+ if ($line =~ m/^([-a-z0-9+]+):/) {
+ $suggested_packages{$1} = 1;
+ }
+ }
+ }
+ }
+
+ # Always write the substvars file, even if it's empty, so that the variables are defined and
+ # there are no warnings when using them in the control file.
+ open(SV, ">>debian/${ext}substvars") || error("open debian/${ext}substvars: $!");
+ print SV "dlopen:Depends=" . join(", ", sort keys %required_packages) . "\n";
+ print SV "dlopen:Recommends=" . join(", ", sort keys %recommended_packages) . "\n";
+ print SV "dlopen:Suggests=" . join(", ", sort keys %suggested_packages) . "\n";
+ close(SV);
+ }
+};
+
+=head1 SEE ALSO
+
+L<debhelper(7)>, L<dh_shlibsdeps(1)>
+
+=head1 AUTHOR
+
+Luca Boccassi <bluca@debian.org>
+
+=cut
diff --git a/debian/dh_package_notes.1 b/debian/dh_package_notes.1
new file mode 100644
index 0000000..8942874
--- /dev/null
+++ b/debian/dh_package_notes.1
@@ -0,0 +1,172 @@
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+. ds C`
+. ds C'
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is >0, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.\"
+.\" Avoid warning from groff about undefined register 'F'.
+.de IX
+..
+.nr rF 0
+.if \n(.g .if rF .nr rF 1
+.if (\n(rF:(\n(.g==0)) \{\
+. if \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. if !\nF==2 \{\
+. nr % 0
+. nr F 2
+. \}
+. \}
+.\}
+.rr rF
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "DH_PACKAGE_NOTES 1"
+.TH DH_PACKAGE_NOTES 1 "2022-11-27"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+dh_package_notes \- Add package metadata to ELF header
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+\&\fBdh_package_notes\fR
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\fBdh_package_notes\fR provides a linker specs file to include package metadata in
+\&\s-1ELF\s0 binaries built by packages.
+.PP
+The package metadata specification for \s-1ELF\s0 binaries can be found at
+<https://systemd.io/ELF_PACKAGE_METADATA/>.
+.PP
+\&\fBdh_package_notes\fR provides a linker specs file at
+\&\fB/usr/share/debhelper/dh_package_notes/debian\-package\-notes.specs\fR which can be
+used by including \fB/usr/share/debhelper/dh_package_notes/debian\-package\-notes.mk\fR
+at the dop of \fBdebian/rules\fR. This will export the right environment variables
+that will result in a package note \s-1ELF\s0 section being added to all packaged \s-1ELF\s0
+files, with the package type set to \fBdeb\fR, the package name and version set to
+the source package name and version respectively, the \s-1OS\s0 set to \fBDebian\fR and
+debuginfod \s-1URL\s0 set to \fBhttps://debuginfod.debian.net\fR. On Ubuntu, the \s-1OS\s0
+will be set to \fBUbuntu\fR and debuginfod \s-1URL\s0 will be set to
+\&\fBhttps://debuginfod.ubuntu.com\fR.
+.PP
+Note that it is not sufficient to build-depend on this package, the \fBinclude\fR
+must be used at the top of \fBdebian/rules\fR for this to be enabled.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fBdebhelper\fR\|(7)
+.SH "AUTHOR"
+.IX Header "AUTHOR"
+Luca Boccassi <bluca@debian.org>
diff --git a/debian/dlopenlibdeps.pm b/debian/dlopenlibdeps.pm
new file mode 100644
index 0000000..2d98645
--- /dev/null
+++ b/debian/dlopenlibdeps.pm
@@ -0,0 +1,7 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Debian::Debhelper::Dh_Lib;
+
+insert_after("dh_shlibdeps", "dh_dlopenlibdeps");
diff --git a/debian/package-notes.mk b/debian/package-notes.mk
new file mode 100644
index 0000000..aabc6dc
--- /dev/null
+++ b/debian/package-notes.mk
@@ -0,0 +1,21 @@
+# SPDX-License-Identifier: CC0-1.0
+# Include from debian/rules to use with dh_package_notes.
+# See dh_package_notes(1) for details
+
+# binutils 2.39 is required for --package-metadata=
+ifeq (0, $(shell dpkg --compare-versions $$(dpkg-query -f '$${Version}' -W binutils) ge 2.39; echo $$?))
+include /usr/share/dpkg/vendor.mk
+ifeq (, $(filter nocheck, $(DEBUGINFOD_URLS)))
+ifeq ($(DEB_VENDOR),Ubuntu)
+export DEBUGINFOD_URLS=https://debuginfod.ubuntu.com
+else
+export DEBUGINFOD_URLS=https://debuginfod.debian.net
+endif
+endif
+export DEB_SOURCE_PACKAGE_VERSION=$(shell dpkg-parsechangelog -S Version)
+export DEB_SOURCE_PACKAGE_NAME=$(shell dpkg-parsechangelog -S Source)
+# Set by /usr/share/dpkg/vendor.mk
+export DEB_VENDOR
+export DEB_LDFLAGS_MAINT_APPEND+= -specs=/usr/share/debhelper/dh_package_notes/debian-package-notes.specs
+endif
+
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..123257a
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,10 @@
+#!/usr/bin/make -f
+
+%:
+ dh $@
+
+execute_after_dh_auto_build:
+ pod2man --utf8 $(CURDIR)/debian/dh_dlopenlibdeps > $(CURDIR)/debian/dh_dlopenlibdeps.1
+
+execute_after_dh_auto_clean:
+ rm -f $(CURDIR)/debian/dh_dlopenlibdeps.1
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)