* [PATCH v4] Add packaging configuration for Debian
@ 2026-02-10 20:59 Kris Van Hees
2026-02-13 15:14 ` [DTrace-devel] " Nick Alcock
0 siblings, 1 reply; 6+ messages in thread
From: Kris Van Hees @ 2026-02-10 20:59 UTC (permalink / raw)
To: dtrace, dtrace-devel
Packaging configuration files for Debian are provided in dists/debian.
Sample steps to build DEB packages:
- make dist
- cp dtrace-x.y.z.tar.bz2 $D/dtrace_x.y.z.orig.tar.bz2
- cd $D
- tar -jxpSf dtrace_x.y.z.orig.tar.bz2
- cd dtrace-x.y.z
- make prep-debian
- debuild
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
---
dists/Build | 16 ++
dists/debian/control | 74 ++++++++
dists/debian/copyright | 103 +++++++++++
dists/debian/dtrace-tests.install | 1 +
dists/debian/dtrace-tests.lintian-overrides | 8 +
dists/debian/dtrace.docs | 1 +
dists/debian/dtrace.install | 1 +
dists/debian/dtrace.lintian-overrides | 1 +
dists/debian/dtrace.manpages | 1 +
dists/debian/libdtrace2-dev.install | 5 +
dists/debian/libdtrace2.install | 12 ++
dists/debian/libdtrace2.lintian-overrides | 4 +
dists/debian/libdtrace2.manpages | 1 +
dists/debian/mkChangelog | 174 ++++++++++++++++++
dists/debian/patches/debian-configure.patch | 17 ++
.../patches/debian-interpreter-paths.patch | 107 +++++++++++
dists/debian/patches/series | 3 +
dists/debian/rules | 24 +++
dists/debian/source/format | 1 +
19 files changed, 554 insertions(+)
create mode 100644 dists/Build
create mode 100644 dists/debian/control
create mode 100644 dists/debian/copyright
create mode 100644 dists/debian/dtrace-tests.install
create mode 100644 dists/debian/dtrace-tests.lintian-overrides
create mode 100644 dists/debian/dtrace.docs
create mode 100644 dists/debian/dtrace.install
create mode 100644 dists/debian/dtrace.lintian-overrides
create mode 100644 dists/debian/dtrace.manpages
create mode 100644 dists/debian/libdtrace2-dev.install
create mode 100644 dists/debian/libdtrace2.install
create mode 100644 dists/debian/libdtrace2.lintian-overrides
create mode 100644 dists/debian/libdtrace2.manpages
create mode 100755 dists/debian/mkChangelog
create mode 100644 dists/debian/patches/debian-configure.patch
create mode 100644 dists/debian/patches/debian-interpreter-paths.patch
create mode 100644 dists/debian/patches/series
create mode 100755 dists/debian/rules
create mode 100644 dists/debian/source/format
diff --git a/dists/Build b/dists/Build
new file mode 100644
index 00000000..c75f9332
--- /dev/null
+++ b/dists/Build
@@ -0,0 +1,16 @@
+#
+# Oracle Linux DTrace.
+# Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved.
+# Licensed under the Universal Permissive License v 1.0 as shown at
+# http://oss.oracle.com/licenses/upl.
+
+dists_DIR := $(current-dir)
+
+# Prepare package building on Debian (copy ./dists/debian in ./debian, and
+# generate the debian/changelog file.
+
+prep-debian::
+ $(call describe-target,DIST-PREP,Debian)
+ rm -rf debian
+ cp -rp $(dists_DIR)/debian .
+ debian/mkChangelog debian/control dtrace.spec > debian/changelog
diff --git a/dists/debian/control b/dists/debian/control
new file mode 100644
index 00000000..56687a82
--- /dev/null
+++ b/dists/debian/control
@@ -0,0 +1,74 @@
+Source: dtrace
+Section: utils
+Priority: optional
+Maintainer: Kris Van Hees <kris.van.hees@oracle.com>
+Build-Depends: debhelper-compat (= 13),
+ bison, flex, gawk, gcc-bpf, binutils-bpf, valgrind, binutils-dev, login.defs,
+ libbpf-dev, libc-dev (>= 2.34), libelf-dev, libfuse3-dev, libpcap-dev,
+ libpfm4-dev, libsystemd-dev, libz-dev
+Standards-Version: 4.5.1
+Homepage: https://github.com/oracle/dtrace-utils/
+Rules-Requires-Root: no
+
+Package: dtrace
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: Dynamic tracing for Linux (DTrace)
+ This is the official Linux port of the advanced tracing tool DTrace.
+ .
+ DTrace is a high-level dynamic tracing tool for Linux, built on kernel
+ tracing features (tracepoints, function probes (fentry/fexit), dynamic
+ kernel probes (kprobes), dynamic userspace probes (uprobes), ... and
+ leveraging BPF as execution engine. It features an integrated compiler
+ for its high-level tracing language and native support for interacting
+ with the BPF engine, significantly reducing runtime dependencies
+
+Package: libdtrace2
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends},
+ fuse3, libctf0, libelf1t64, libfuse3-4, libpcap0.8t64, libpfm4, libz1
+Description: Dynamic tracing for Linux (DTrace) (library)
+ This is the official Linux port of the advanced tracing tool DTrace.
+ .
+ DTrace is a high-level dynamic tracing tool for Linux, built on kernel
+ tracing features (tracepoints, function probes (fentry/fexit), dynamic
+ kernel probes (kprobes), dynamic userspace probes (uprobes), ... and
+ leveraging BPF as execution engine. It features an integrated compiler
+ for its high-level tracing language and native support for interacting
+ with the BPF engine, significantly reducing runtime dependencies
+ .
+ This package contains the shared library.
+
+Package: libdtrace2-dev
+Architecture: any
+Depends: ${misc:Depends},
+ libdtrace2 (= ${binary:Version})
+Description: Dynamic tracing for Linux (DTrace) (development)
+ This is the official Linux port of the advanced tracing tool DTrace.
+ .
+ DTrace is a high-level dynamic tracing tool for Linux, built on kernel
+ tracing features (tracepoints, function probes (fentry/fexit), dynamic
+ kernel probes (kprobes), dynamic userspace probes (uprobes), ... and
+ leveraging BPF as execution engine. It features an integrated compiler
+ for its high-level tracing language and native support for interacting
+ with the BPF engine, significantly reducing runtime dependencies
+ .
+ This package contains the development files necessary to develop
+ alternative implementations of the user interface for libdtrace, i.e.
+ replacements for dtrace(1) itself.
+
+Package: dtrace-tests
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}, ${perl:Depends},
+ binutils, cpp, gawk, gcc, make, pkgconf, tshark, bpftool
+Description: Dynamic tracing for Linux (DTrace) (testsuite)
+ This is the official Linux port of the advanced tracing tool DTrace.
+ .
+ DTrace is a high-level dynamic tracing tool for Linux, built on kernel
+ tracing features (tracepoints, function probes (fentry/fexit), dynamic
+ kernel probes (kprobes), dynamic userspace probes (uprobes), ... and
+ leveraging BPF as execution engine. It features an integrated compiler
+ for its high-level tracing language and native support for interacting
+ with the BPF engine, significantly reducing runtime dependencies
+ .
+ This package contains the testsuite.
diff --git a/dists/debian/copyright b/dists/debian/copyright
new file mode 100644
index 00000000..1a5c8f64
--- /dev/null
+++ b/dists/debian/copyright
@@ -0,0 +1,103 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: dtrace
+Upstream-Contact: Kris Van Hees <kris.van.hees@oracle.com>
+Source: https://github.com/oracle/dtrace-utils/
+
+Files: *
+Copyright: Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved.
+License: UPL-1.0
+
+Files: include/linux/bpf.h
+Copyright: Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
+License: GPL-2 with Linux-syscall-note exception
+
+Files: include/linux/btf.h
+Copyright: Copyright (c) 2018 Facebook
+License: GPL-2 with Linux-syscall-note exception
+
+Files: include/sys/auxv.h include/sys/bitmap.h
+Copyright: copyright (c) 1984, 1986, 1987, 1988, 1989 at&t
+License: UPL-1.0
+
+Files: include/sys/glibc_internal_link.h
+Copyright: Copyright disclaimed (all content required for interoperability)
+License: LGPL-2.1+
+
+Files: libproc/libproc.h libproc/Pcontrol.c
+Copyright: Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
+License: UPL-1.0
+
+License: UPL-1.0
+ The Universal Permissive License (UPL), Version 1.0
+ .
+ Subject to the condition set forth below, permission is hereby granted
+ to any person obtaining a copy of this software, associated
+ documentation and/or data (collectively the "Software"), free of charge
+ and under any and all copyright rights in the Software, and any and all
+ patent rights owned or freely licensable by each licensor hereunder
+ covering either (i) the unmodified Software as contributed to or
+ provided by such licensor, or (ii) the Larger Works (as defined below),
+ to deal in both
+ .
+ (a) the Software, and
+ (b) any piece of software and/or hardware listed in the lrgrwrks.txt
+ file if one is included with the Software (each a âLarger Workâ to which
+ the Software is contributed by such licensors),
+ .
+ without restriction, including without limitation the rights to copy,
+ create derivative works of, display, perform, and distribute the
+ Software and make, use, sell, offer for sale, import, export, have made,
+ and have sold the Software and the Larger Work(s), and to sublicense the
+ foregoing rights on either these or other terms.
+ .
+ This license is subject to the following condition:
+ The above copyright notice and either this complete permission notice or
+ at a minimum a reference to the UPL must be included in all copies or
+ substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ Licensed under the Universal Permissive License v 1.0 as shown at
+ http://oss.oracle.com/licenses/upl.
+
+License: GPL-2 with Linux-syscall-note exception
+ This program is free software; you can redistribute it
+ and/or modify it under the terms of the GNU General Public
+ License version 2 as published by the Free Software Foundation.
+ .
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file
+ `/usr/share/common-licenses/GPL-2'.
+ .
+ NOTE! This copyright does *not* cover user programs that use kernel
+ services by normal system calls - this is merely considered normal use
+ of the kernel, and does *not* fall under the heading of "derived work".
+ Also note that the GPL below is copyrighted by the Free Software
+ Foundation, but the instance of code that it refers to (the Linux
+ kernel) is copyrighted by me and others who actually wrote it.
+ .
+ Also note that the only valid version of the GPL as far as the kernel
+ is concerned is _this_ particular version of the license (ie v2, not
+ v2.2 or v3.x or whatever), unless explicitly otherwise stated.
+
+License: LGPL-2.1+
+ This file is part of the GNU C Library.
+ .
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+ .
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+ .
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>.
diff --git a/dists/debian/dtrace-tests.install b/dists/debian/dtrace-tests.install
new file mode 100644
index 00000000..a04ebfb9
--- /dev/null
+++ b/dists/debian/dtrace-tests.install
@@ -0,0 +1 @@
+usr//lib/${DEB_HOST_MULTIARCH}/dtrace/testsuite/
diff --git a/dists/debian/dtrace-tests.lintian-overrides b/dists/debian/dtrace-tests.lintian-overrides
new file mode 100644
index 00000000..22cbd6eb
--- /dev/null
+++ b/dists/debian/dtrace-tests.lintian-overrides
@@ -0,0 +1,8 @@
+dtrace-tests binary: unstripped-binary-or-object [*]
+dtrace-tests binary: unusual-interpreter dtrace [*.d]
+dtrace-tests binary: interpreter-not-absolute dtrace [*.d]
+dtrace-tests binary: executable-not-elf-or-script [*.d]
+dtrace-tests binary: relative-library-search-path RUNPATH test/triggers [*]
+dtrace-tests binary: statically-linked-binary [*]
+dtrace-tests binary: package-has-unnecessary-activation-of-ldconfig-trigger
+dtrace-tests binary: shared-library-lacks-prerequisites [*/dtrace/testsuite/test/triggers/libproc-dlmlib.so.0.0.0]
diff --git a/dists/debian/dtrace.docs b/dists/debian/dtrace.docs
new file mode 100644
index 00000000..7696583d
--- /dev/null
+++ b/dists/debian/dtrace.docs
@@ -0,0 +1 @@
+usr/share/doc/dtrace-${env:DEB_VERSION_UPSTREAM}/
diff --git a/dists/debian/dtrace.install b/dists/debian/dtrace.install
new file mode 100644
index 00000000..6be68ccb
--- /dev/null
+++ b/dists/debian/dtrace.install
@@ -0,0 +1 @@
+usr/sbin/dtrace
diff --git a/dists/debian/dtrace.lintian-overrides b/dists/debian/dtrace.lintian-overrides
new file mode 100644
index 00000000..11005f4a
--- /dev/null
+++ b/dists/debian/dtrace.lintian-overrides
@@ -0,0 +1 @@
+dtrace binary: unstripped-binary-or-object [*]
diff --git a/dists/debian/dtrace.manpages b/dists/debian/dtrace.manpages
new file mode 100644
index 00000000..e54b52b3
--- /dev/null
+++ b/dists/debian/dtrace.manpages
@@ -0,0 +1 @@
+usr/share/man/man8/dtrace.8
diff --git a/dists/debian/libdtrace2-dev.install b/dists/debian/libdtrace2-dev.install
new file mode 100644
index 00000000..b5e66db5
--- /dev/null
+++ b/dists/debian/libdtrace2-dev.install
@@ -0,0 +1,5 @@
+usr/lib/${DEB_HOST_MULTIARCH}/libdtrace.so
+usr/include/dtrace
+usr/include/dtrace.h
+usr/include/sys/dtrace.h
+usr/include/sys/dtrace_types.h
diff --git a/dists/debian/libdtrace2.install b/dists/debian/libdtrace2.install
new file mode 100644
index 00000000..36294de3
--- /dev/null
+++ b/dists/debian/libdtrace2.install
@@ -0,0 +1,12 @@
+usr/lib/${DEB_HOST_MULTIARCH}/dtrace/[0-9]*/
+usr/lib/${DEB_HOST_MULTIARCH}/dtrace/bpf_dlib.o
+usr/lib/${DEB_HOST_MULTIARCH}/dtrace/drti/
+usr/lib/${DEB_HOST_MULTIARCH}/dtrace/include/
+usr/lib/${DEB_HOST_MULTIARCH}/libdtrace.so.*
+usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/dtrace.pc
+usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/dtrace_sdt.pc
+usr/lib/systemd/system/dtprobed.service
+usr/lib/systemd/system/dtrace-usdt.target
+usr/lib/systemd/system-preset/50-dtprobed.preset
+usr/lib/udev/rules.d/60-dtprobed.rules
+usr/sbin/dtprobed
diff --git a/dists/debian/libdtrace2.lintian-overrides b/dists/debian/libdtrace2.lintian-overrides
new file mode 100644
index 00000000..34b4011d
--- /dev/null
+++ b/dists/debian/libdtrace2.lintian-overrides
@@ -0,0 +1,4 @@
+libdtrace2 binary: binary-from-other-architecture [*/dtrace/bpf_dlib.o]
+libdtrace2 binary: unstripped-binary-or-object [*]
+libdtrace2 binary: appstream-metadata-missing-modalias-provide usr/lib/udev/rules.d/60-dtprobed.rules
+libdtrace2 binary: systemd-service-file-refers-to-unusual-wantedby-target basic.target [usr/lib/systemd/system/dtprobed.service]
diff --git a/dists/debian/libdtrace2.manpages b/dists/debian/libdtrace2.manpages
new file mode 100644
index 00000000..fef53dc3
--- /dev/null
+++ b/dists/debian/libdtrace2.manpages
@@ -0,0 +1 @@
+usr/share/man/man8/dtprobed.8
diff --git a/dists/debian/mkChangelog b/dists/debian/mkChangelog
new file mode 100755
index 00000000..69958dca
--- /dev/null
+++ b/dists/debian/mkChangelog
@@ -0,0 +1,174 @@
+#!/usr/bin/awk -f
+
+#
+# This script can be used to convert the dtrace.spec into a Debian changelog
+# file. It is intended to be invoked from the 'prep-debian' make target, but
+# it can be used manually as well:
+# mkChangelog debian/control dtrace.spec > debian/changelog
+#
+
+function error(msg) {
+ print "E:"msg >"/dev/stderr";
+ err = 1;
+ exit(1);
+}
+
+BEGIN {
+ if (!dist)
+ dist = "UNRELEASED";
+ else if (dist != "unstable" && dist != "experimental")
+ error("Bad dist ("dist")");
+}
+
+/^Maintainer:/ {
+ sub(/^Maintainer: +/, "");
+ m_name = $0;
+ i = index(m_name, " <");
+ m_mail = substr(m_name, i + 1);
+ m_name = substr(m_name, 1, i - 1);
+
+ nextfile;
+}
+
+/^Name:/ {
+ pkg = $2;
+ next;
+}
+
+/^%changelog/ {
+ in_changelog = 1;
+ next;
+}
+
+!in_changelog {
+ next;
+}
+
+function lineWrap(p, s, line, len, l, n, m, i) {
+ n = length(p);
+ line = p;
+ len = n;
+
+ m = split(s, arr, / +/);
+ for (i = 1; i <= m; i++) {
+ l = length(arr[i]);
+ if (len + 1 + l >= 80) {
+ print line;
+ line = sprintf("%*s %s", n, "", arr[i]);
+ len = n + 1 + l;
+ } else {
+ line = line " " arr[i];
+ len += 1 + l;
+ }
+ }
+ delete arr;
+
+ print line;
+}
+
+function emitEntry(i, j, n) {
+ # Loop through the contributions, determining who each contribution
+ # should be credited to. If there are multiple contributors, we pick
+ # the first one who is not the commit author (if any).
+ # If all contributions are from the commit author, we do not emit an
+ # explicit credit line.
+ for (i = 1; i <= lc; i++) {
+ gsub(/ \[Orabug[:;] [1-9][0-9]*(, [1-9][0-9]*)*\]/, "", lv[i]);
+ sub(/[ \t]+$/, "", lv[i]);
+ gsub(/ +/, " ", lv[i]);
+
+ cont = name;
+ if (match(lv[i], /\([^)]+\)$/) > 0) {
+ auth = substr(lv[i], RSTART + 1, RLENGTH - 2);
+ lv[i] = substr(lv[i], 1, RSTART - 1);
+ sub(/[ \t]+$/, "", lv[i]);
+ n = split(auth, arr, /, */);
+
+ # Find the first contributor not the commit author.
+ for (j = 1; j <= n; j++) {
+ if (arr[j] == name)
+ continue;
+ cont = arr[j];
+ break;
+ }
+ delete arr;
+ }
+
+ # Add to the list of contributions for this contributor.
+ if (cont in map)
+ map[cont] = map[cont] " " i;
+ else
+ map[cont] = i;
+ }
+
+ print pkg" ("vers") "dist"; urgency=medium";
+
+ # First emit contributions by people other than the commit author.
+ n = 0;
+ for (cont in map) {
+ if (cont == name)
+ continue;
+
+ n++;
+ print "\n [ "cont" ]";
+ $0 = map[cont];
+ for (i = 1; i <= NF; i++)
+ lineWrap(" *", lv[int($i)]);
+ }
+ if (n > 0)
+ print "\n [ "name" ]";
+ else
+ print "";
+
+ $0 = map[name];
+ for (i = 1; i <= NF; i++)
+ lineWrap(" *", lv[int($i)]);
+
+ delete map;
+
+ if (m_name) {
+ name = m_name;
+ mail = m_mail;
+ m_name = m_mail = 0;
+ }
+ print "\n -- "name" "mail" "date" 00:00:00 +0000\n";
+}
+
+/^\* (Sun|Mon|Tue|Wed|Thu|Fri|Sat) [A-Z][a-z][a-z] [ 0-3][0-9] / {
+ date = $2", "$4" "$3" "$5;
+ i = index($0, " - ");
+ vers = substr($0, i + 3);
+ name = substr($0, 19, i - 19);
+ i = index(name, " <");
+ mail = substr(name, i + 1);
+ name = substr(name, 1, i - 1);
+ if (name == "")
+ error("No name in: "$0);
+
+ lc = 0;
+ delete lv;
+
+ next;
+}
+
+/^- / {
+ sub(/^- +/, "");
+ lv[++lc] = $0;
+ next;
+}
+
+NF == 0 {
+ emitEntry();
+ date = "";
+ next;
+}
+
+{
+ lv[lc] = lv[lc] $0;
+ next;
+}
+
+END {
+ if (date && !err)
+ emitEntry();
+}
diff --git a/dists/debian/patches/debian-configure.patch b/dists/debian/patches/debian-configure.patch
new file mode 100644
index 00000000..d4a89bb9
--- /dev/null
+++ b/dists/debian/patches/debian-configure.patch
@@ -0,0 +1,17 @@
+Description: issue a warning for unknown configure options
+ The Debian build system specifies configure options that are not known to
+ the DTrace configure script. They should not cause the configure script
+ to abort.
+
+--- dtrace-2.0.4.orig/configure
++++ dtrace-2.0.4/configure
+@@ -172,8 +172,7 @@ for option in "$@"; do
+ HAVE_VALGRIND=*) write_config_var VALGRIND "$option";;
+ HAVE_BPFV3=*) write_config_var BPFV3 "$option";;
+ HAVE_BPFMASM=*) write_config_var BPFMASM "$option";;
+- *) echo "Unknown option $option" >&2
+- exit 1;;
++ *) echo "Unknown option $option" >&2;;
+ esac
+ done
+
diff --git a/dists/debian/patches/debian-interpreter-paths.patch b/dists/debian/patches/debian-interpreter-paths.patch
new file mode 100644
index 00000000..58bea538
--- /dev/null
+++ b/dists/debian/patches/debian-interpreter-paths.patch
@@ -0,0 +1,107 @@
+Description: fix interpreter paths in tests
+ Lintian prefers /bin/bash and /bin/sed over /usr/bin/bash and /usr/bin/sed.
+
+--- dtrace-2.0.4.orig/test/unittest/arrays/err.D_UNKNOWN.uregs_toobig.aarch64.x
++++ dtrace-2.0.4/test/unittest/arrays/err.D_UNKNOWN.uregs_toobig.aarch64.x
+@@ -1,4 +1,4 @@
+-#!/usr/bin/bash
++#!/bin/bash
+
+ [ `uname -m` = "aarch64" ] && exit 0
+ exit 2
+--- dtrace-2.0.4.orig/test/unittest/arrays/err.D_UNKNOWN.uregs_toobig.x86_64.x
++++ dtrace-2.0.4/test/unittest/arrays/err.D_UNKNOWN.uregs_toobig.x86_64.x
+@@ -1,4 +1,4 @@
+-#!/usr/bin/bash
++#!/bin/bash
+
+ [ `uname -m` = "x86_64" ] && exit 0
+ exit 2
+--- dtrace-2.0.4.orig/test/unittest/codegen/err.deref_0.r.p
++++ dtrace-2.0.4/test/unittest/codegen/err.deref_0.r.p
+@@ -1,4 +1,4 @@
+-#!/usr/bin/sed -f
++#!/bin/sed -f
+
+ # runtest.sh looks for "0x" to filter out pointer values.
+ # Strip the 0x so that the illegal address will not be filtered out;
+--- dtrace-2.0.4.orig/test/unittest/codegen/err.deref_1.r.p
++++ dtrace-2.0.4/test/unittest/codegen/err.deref_1.r.p
+@@ -1,4 +1,4 @@
+-#!/usr/bin/sed -f
++#!/bin/sed -f
+
+ # runtest.sh looks for "0x" to filter out pointer values.
+ # Strip the 0x so that the illegal address will not be filtered out;
+--- dtrace-2.0.4.orig/test/unittest/codegen/err.deref_i0.r.p
++++ dtrace-2.0.4/test/unittest/codegen/err.deref_i0.r.p
+@@ -1,4 +1,4 @@
+-#!/usr/bin/sed -f
++#!/bin/sed -f
+
+ # runtest.sh looks for "0x" to filter out pointer values.
+ # Strip the 0x so that the illegal address will not be filtered out;
+--- dtrace-2.0.4.orig/test/unittest/codegen/err.deref_i1.r.p
++++ dtrace-2.0.4/test/unittest/codegen/err.deref_i1.r.p
+@@ -1,4 +1,4 @@
+-#!/usr/bin/sed -f
++#!/bin/sed -f
+
+ # runtest.sh looks for "0x" to filter out pointer values.
+ # Strip the 0x so that the illegal address will not be filtered out;
+--- dtrace-2.0.4.orig/test/unittest/codegen/err.deref_string-assoc.r.p
++++ dtrace-2.0.4/test/unittest/codegen/err.deref_string-assoc.r.p
+@@ -1,4 +1,4 @@
+-#!/usr/bin/sed -f
++#!/bin/sed -f
+
+ # runtest.sh looks for "0x" to filter out pointer values.
+ # Strip the 0x so that the illegal address will not be filtered out;
+--- dtrace-2.0.4.orig/test/unittest/codegen/err.deref_string-gvar.r.p
++++ dtrace-2.0.4/test/unittest/codegen/err.deref_string-gvar.r.p
+@@ -1,4 +1,4 @@
+-#!/usr/bin/sed -f
++#!/bin/sed -f
+
+ # runtest.sh looks for "0x" to filter out pointer values.
+ # Strip the 0x so that the illegal address will not be filtered out;
+--- dtrace-2.0.4.orig/test/unittest/codegen/err.deref_string-lvar.r.p
++++ dtrace-2.0.4/test/unittest/codegen/err.deref_string-lvar.r.p
+@@ -1,4 +1,4 @@
+-#!/usr/bin/sed -f
++#!/bin/sed -f
+
+ # runtest.sh looks for "0x" to filter out pointer values.
+ # Strip the 0x so that the illegal address will not be filtered out;
+--- dtrace-2.0.4.orig/test/unittest/codegen/err.deref_string-tvar.r.p
++++ dtrace-2.0.4/test/unittest/codegen/err.deref_string-tvar.r.p
+@@ -1,4 +1,4 @@
+-#!/usr/bin/sed -f
++#!/bin/sed -f
+
+ # runtest.sh looks for "0x" to filter out pointer values.
+ # Strip the 0x so that the illegal address will not be filtered out;
+--- dtrace-2.0.4.orig/test/unittest/preprocessor/err.ifdefincomp.r.p
++++ dtrace-2.0.4/test/unittest/preprocessor/err.ifdefincomp.r.p
+@@ -1,4 +1,4 @@
+-#!/usr/bin/sed -f
++#!/bin/sed -f
+ # GCC 16 improved diagnostics formatting. Until GCC 16 is the minimum
+ # supported, we have to sed it back again.
+ s,[ââ],",g
+--- dtrace-2.0.4.orig/test/unittest/preprocessor/err.incompelse.r.p
++++ dtrace-2.0.4/test/unittest/preprocessor/err.incompelse.r.p
+@@ -1,4 +1,4 @@
+-#!/usr/bin/sed -f
++#!/bin/sed -f
+ # GCC 16 improved diagnostics formatting. Until GCC 16 is the minimum
+ # supported, we have to sed it back again.
+ s,[ââ],,g
+--- dtrace-2.0.4.orig/test/utils/clean_probes.sh
++++ dtrace-2.0.4/test/utils/clean_probes.sh
+@@ -1,4 +1,4 @@
+-#!/usr/bin/bash
++#!/bin/bash
+
+ TRACEFS=/sys/kernel/debug/tracing
+ EVENTS=${TRACEFS}/available_events
diff --git a/dists/debian/patches/series b/dists/debian/patches/series
new file mode 100644
index 00000000..6d3b5413
--- /dev/null
+++ b/dists/debian/patches/series
@@ -0,0 +1,3 @@
+# You must remove unused comment lines for the released package.
+debian-configure.patch
+debian-interpreter-paths.patch
diff --git a/dists/debian/rules b/dists/debian/rules
new file mode 100755
index 00000000..8646ac1a
--- /dev/null
+++ b/dists/debian/rules
@@ -0,0 +1,24 @@
+#!/usr/bin/make -f
+# You must remove unused comment lines for the released package.
+export DH_VERBOSE = 1
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
+export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+
+include /usr/share/dpkg/pkg-info.mk
+
+export DEB_VERSION_UPSTREAM
+
+%:
+ dh $@
+
+override_dh_auto_configure:
+ dh_auto_configure -- --pkg-config-dir=\$${LIBDIR}/pkgconfig BPFC=bpf-gcc BPFLD=bpf-ld
+
+override_dh_strip:
+ dh_strip -Xdtrace
+
+override_dh_auto_test:
+
+override_dh_auto_install:
+ dh_auto_install -- install-test
diff --git a/dists/debian/source/format b/dists/debian/source/format
new file mode 100644
index 00000000..163aaf8d
--- /dev/null
+++ b/dists/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
--
2.51.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [DTrace-devel] [PATCH v4] Add packaging configuration for Debian
2026-02-10 20:59 [PATCH v4] Add packaging configuration for Debian Kris Van Hees
@ 2026-02-13 15:14 ` Nick Alcock
2026-02-14 13:34 ` Sam James
2026-02-14 17:10 ` Kris Van Hees
0 siblings, 2 replies; 6+ messages in thread
From: Nick Alcock @ 2026-02-13 15:14 UTC (permalink / raw)
To: Kris Van Hees; +Cc: dtrace-devel, dtrace
On 10 Feb 2026, Kris Van Hees via DTrace-devel outgrape:
> Packaging configuration files for Debian are provided in dists/debian.
Nice! Seems to work, even on Debian stable (I was sure I'd need at least
testing, but no!).
> Sample steps to build DEB packages:
>
> - make dist
> - cp dtrace-x.y.z.tar.bz2 $D/dtrace_x.y.z.orig.tar.bz2
This...
> - cd $D
> - tar -jxpSf dtrace_x.y.z.orig.tar.bz2
... seems rather duplicative with this. See below for a patch with a
make prep-debuild target that does this for you.
> - cd dtrace-x.y.z
> - make prep-debian
> - debuild
It is a bit annoying that you have to do a prep-debian before doing a
build, because this prevents you doing a normal apt-src or any other
large-scale build command unless you already have a source deb that this
was done to. (The changelog generation is nice though!)
I would be inclined to use git-buildpackage here. See
https://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.import.upstream-git.html
I tried for a minimal approach using the postexport hook, but alas gbp
wants a debian/ directory before it'll even run that :( so for now this
seems to be the best we can do.
Here's a tiny patch to let you avoid the make dist in favour of a simple
'make prep-debuild'. (I didn't fold it into make prep-debian because
some package building tools, like apt-src, don't need the .orig.tar.bz2
at all.)
8<--------------------------------->8
From 472a6c863d06f8e419827842e0e455d8f13f6edd Mon Sep 17 00:00:00 2001
From: Nick Alcock <nick.alcock@oracle.com>
Date: Fri, 13 Feb 2026 14:29:05 +0000
Subject: [PATCH] dists: add prep-debuild target
This does the creation of the .orig.tar.bz2 in the parent of
the source tree for you.
---
dists/Build | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dists/Build b/dists/Build
index c75f933270fa3..f1ed1a4627176 100644
--- a/dists/Build
+++ b/dists/Build
@@ -9,8 +9,14 @@ dists_DIR := $(current-dir)
# Prepare package building on Debian (copy ./dists/debian in ./debian, and
# generate the debian/changelog file.
-prep-debian::
+prep-debian:: dist
$(call describe-target,DIST-PREP,Debian)
rm -rf debian
cp -rp $(dists_DIR)/debian .
debian/mkChangelog debian/control dtrace.spec > debian/changelog
+
+# Prepare for debuild, which needs a tarball to already be present.
+# Many wrappers around debuild already do this for you.
+
+prep-debuild::
+ mv dtrace-$(VERSION).tar.bz2 ../dtrace_$(VERSION).orig.tar.bz2
--
2.47.3
8<--------------------------------->8
> Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
A couple of questions below.
> +prep-debian::
> + $(call describe-target,DIST-PREP,Debian)
> + rm -rf debian
> + cp -rp $(dists_DIR)/debian .
> + debian/mkChangelog debian/control dtrace.spec > debian/changelog
(I have a tiny patch for this.)
> diff --git a/dists/debian/control b/dists/debian/control
> new file mode 100644
> index 00000000..56687a82
> --- /dev/null
> +++ b/dists/debian/control
> @@ -0,0 +1,74 @@
> +Source: dtrace
> +Section: utils
> +Priority: optional
> +Maintainer: Kris Van Hees <kris.van.hees@oracle.com>
> +Build-Depends: debhelper-compat (= 13),
> + bison, flex, gawk, gcc-bpf, binutils-bpf, valgrind, binutils-dev, login.defs,
> + libbpf-dev, libc-dev (>= 2.34), libelf-dev, libfuse3-dev, libpcap-dev,
> + libpfm4-dev, libsystemd-dev, libz-dev
> +Standards-Version: 4.5.1
Why 4.5.1? I guess it's what debhelper writes right now. (The current
version of Debian Policy is 4.7.3. It looks to me like we're compatible
with it.)
> +Homepage: https://github.com/oracle/dtrace-utils/
> +Rules-Requires-Root: no
> +
> +Package: dtrace
> +Architecture: any
> +Depends: ${misc:Depends}, ${shlibs:Depends}
> +Description: Dynamic tracing for Linux (DTrace)
> + This is the official Linux port of the advanced tracing tool DTrace.
> + .
> + DTrace is a high-level dynamic tracing tool for Linux, built on kernel
> + tracing features (tracepoints, function probes (fentry/fexit), dynamic
> + kernel probes (kprobes), dynamic userspace probes (uprobes), ... and
> + leveraging BPF as execution engine. It features an integrated compiler
> + for its high-level tracing language and native support for interacting
> + with the BPF engine, significantly reducing runtime dependencies
Full stop at end of sentence (and for all the others below.)
> +Package: libdtrace2
> +Architecture: any
> +Depends: ${misc:Depends}, ${shlibs:Depends},
> + fuse3, libctf0, libelf1t64, libfuse3-4, libpcap0.8t64, libpfm4, libz1
> +Description: Dynamic tracing for Linux (DTrace) (library)
> + This is the official Linux port of the advanced tracing tool DTrace.
> + .
> + DTrace is a high-level dynamic tracing tool for Linux, built on kernel
> + tracing features (tracepoints, function probes (fentry/fexit), dynamic
> + kernel probes (kprobes), dynamic userspace probes (uprobes), ... and
> + leveraging BPF as execution engine. It features an integrated compiler
> + for its high-level tracing language and native support for interacting
> + with the BPF engine, significantly reducing runtime dependencies
> + .
> + This package contains the shared library.
> +
> +Package: libdtrace2-dev
> +Architecture: any
> +Depends: ${misc:Depends},
> + libdtrace2 (= ${binary:Version})
> +Description: Dynamic tracing for Linux (DTrace) (development)
> + This is the official Linux port of the advanced tracing tool DTrace.
> + .
> + DTrace is a high-level dynamic tracing tool for Linux, built on kernel
> + tracing features (tracepoints, function probes (fentry/fexit), dynamic
> + kernel probes (kprobes), dynamic userspace probes (uprobes), ... and
> + leveraging BPF as execution engine. It features an integrated compiler
> + for its high-level tracing language and native support for interacting
> + with the BPF engine, significantly reducing runtime dependencies
> + .
> + This package contains the development files necessary to develop
> + alternative implementations of the user interface for libdtrace, i.e.
> + replacements for dtrace(1) itself.
> +
> +Package: dtrace-tests
> +Architecture: any
> +Depends: ${misc:Depends}, ${shlibs:Depends}, ${perl:Depends},
> + binutils, cpp, gawk, gcc, make, pkgconf, tshark, bpftool
> +Description: Dynamic tracing for Linux (DTrace) (testsuite)
> + This is the official Linux port of the advanced tracing tool DTrace.
> + .
> + DTrace is a high-level dynamic tracing tool for Linux, built on kernel
> + tracing features (tracepoints, function probes (fentry/fexit), dynamic
> + kernel probes (kprobes), dynamic userspace probes (uprobes), ... and
> + leveraging BPF as execution engine. It features an integrated compiler
> + for its high-level tracing language and native support for interacting
> + with the BPF engine, significantly reducing runtime dependencies
> + .
> + This package contains the testsuite.
(... up to here.)
> diff --git a/dists/debian/copyright b/dists/debian/copyright
> new file mode 100644
> index 00000000..1a5c8f64
> --- /dev/null
> +++ b/dists/debian/copyright
> @@ -0,0 +1,103 @@
> +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
> +Upstream-Name: dtrace
> +Upstream-Contact: Kris Van Hees <kris.van.hees@oracle.com>
> +Source: https://github.com/oracle/dtrace-utils/
> +
> +Files: *
> +Copyright: Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved.
> +License: UPL-1.0
> +
> +Files: include/linux/bpf.h
> +Copyright: Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
> +License: GPL-2 with Linux-syscall-note exception
> +
> +Files: include/linux/btf.h
> +Copyright: Copyright (c) 2018 Facebook
> +License: GPL-2 with Linux-syscall-note exception
> +
> +Files: include/sys/auxv.h include/sys/bitmap.h
> +Copyright: copyright (c) 1984, 1986, 1987, 1988, 1989 at&t
AT&T, surely?
> --- /dev/null
> +++ b/dists/debian/libdtrace2-dev.install
> @@ -0,0 +1,5 @@
> +usr/lib/${DEB_HOST_MULTIARCH}/libdtrace.so
> +usr/include/dtrace
> +usr/include/dtrace.h
> +usr/include/sys/dtrace.h
> +usr/include/sys/dtrace_types.h
> diff --git a/dists/debian/libdtrace2.install b/dists/debian/libdtrace2.install
> new file mode 100644
> index 00000000..36294de3
> --- /dev/null
> +++ b/dists/debian/libdtrace2.install
> @@ -0,0 +1,12 @@
> +usr/lib/${DEB_HOST_MULTIARCH}/dtrace/[0-9]*/
> +usr/lib/${DEB_HOST_MULTIARCH}/dtrace/bpf_dlib.o
> +usr/lib/${DEB_HOST_MULTIARCH}/dtrace/drti/
> +usr/lib/${DEB_HOST_MULTIARCH}/dtrace/include/
> +usr/lib/${DEB_HOST_MULTIARCH}/libdtrace.so.*
> +usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/dtrace.pc
> +usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/dtrace_sdt.pc
> +usr/lib/systemd/system/dtprobed.service
> +usr/lib/systemd/system/dtrace-usdt.target
> +usr/lib/systemd/system-preset/50-dtprobed.preset
> +usr/lib/udev/rules.d/60-dtprobed.rules
> +usr/sbin/dtprobed
I've always been worried that these lists would be hard to maintain.
It's a shame we can't autogenerate them, though it's hard to imagine
from what. Maybe in the future we should do like we did for the version
numbers, and have a centralized list of files from which we can generate
things like this *and* the install commands in the Build files.
> +++ b/dists/debian/mkChangelog
> @@ -0,0 +1,174 @@
> +#!/usr/bin/awk -f
> +
> +#
> +# This script can be used to convert the dtrace.spec into a Debian changelog
> +# file. It is intended to be invoked from the 'prep-debian' make target, but
> +# it can be used manually as well:
> +# mkChangelog debian/control dtrace.spec > debian/changelog
This is really nifty!
> diff --git a/dists/debian/patches/debian-configure.patch b/dists/debian/patches/debian-configure.patch
> new file mode 100644
> index 00000000..d4a89bb9
> --- /dev/null
> +++ b/dists/debian/patches/debian-configure.patch
> @@ -0,0 +1,17 @@
> +Description: issue a warning for unknown configure options
> + The Debian build system specifies configure options that are not known to
> + the DTrace configure script. They should not cause the configure script
> + to abort.
> +--- dtrace-2.0.4.orig/configure
> ++++ dtrace-2.0.4/configure
> +@@ -172,8 +172,7 @@ for option in "$@"; do
> + HAVE_VALGRIND=*) write_config_var VALGRIND "$option";;
> + HAVE_BPFV3=*) write_config_var BPFV3 "$option";;
> + HAVE_BPFMASM=*) write_config_var BPFMASM "$option";;
> +- *) echo "Unknown option $option" >&2
> +- exit 1;;
> ++ *) echo "Unknown option $option" >&2;;
> + esac
> + done
I assumed you could just stuff an || true in there, but this is being
invoked by dh_auto_configure, so that option isn't available (plus, of
course, if there's an actual error other than unknown args, we don't
want to fail).
Maybe we should just not exit with exitcode 1 on unknown configure
options, only IIRC Gentoo actually wants us to. This may be the best we
can do.
> diff --git a/dists/debian/patches/debian-interpreter-paths.patch b/dists/debian/patches/debian-interpreter-paths.patch
> new file mode 100644
> index 00000000..58bea538
> --- /dev/null
> +++ b/dists/debian/patches/debian-interpreter-paths.patch
> @@ -0,0 +1,107 @@
> +Description: fix interpreter paths in tests
> + Lintian prefers /bin/bash and /bin/sed over /usr/bin/bash and /usr/bin/sed.
Honestly this one I think we should do upstream. I always thought that
/bin/bash is universal and /usr/bin/bash less so.
> --- /dev/null
> +++ b/dists/debian/rules
> @@ -0,0 +1,24 @@
> +#!/usr/bin/make -f
> +# You must remove unused comment lines for the released package.
> +export DH_VERBOSE = 1
> +export DEB_BUILD_MAINT_OPTIONS = hardening=+all
> +export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
I suppose without -Werror this is safe :)
--
NULL && (void)
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [DTrace-devel] [PATCH v4] Add packaging configuration for Debian
2026-02-13 15:14 ` [DTrace-devel] " Nick Alcock
@ 2026-02-14 13:34 ` Sam James
2026-02-14 16:39 ` Kris Van Hees
2026-02-14 17:10 ` Kris Van Hees
1 sibling, 1 reply; 6+ messages in thread
From: Sam James @ 2026-02-14 13:34 UTC (permalink / raw)
To: Nick Alcock; +Cc: Kris Van Hees, dtrace-devel, dtrace
[-- Attachment #1: Type: text/plain, Size: 2528 bytes --]
Nick Alcock via DTrace-devel <dtrace-devel@oss.oracle.com> writes:
> On 10 Feb 2026, Kris Van Hees via DTrace-devel outgrape:
>
>> Packaging configuration files for Debian are provided in dists/debian.
>
> Nice! Seems to work, even on Debian stable (I was sure I'd need at least
> testing, but no!).
>
> [...]
>> diff --git a/dists/debian/patches/debian-configure.patch b/dists/debian/patches/debian-configure.patch
>> new file mode 100644
>> index 00000000..d4a89bb9
>> --- /dev/null
>> +++ b/dists/debian/patches/debian-configure.patch
>> @@ -0,0 +1,17 @@
>> +Description: issue a warning for unknown configure options
>> + The Debian build system specifies configure options that are not known to
>> + the DTrace configure script. They should not cause the configure script
>> + to abort.
>> +--- dtrace-2.0.4.orig/configure
>> ++++ dtrace-2.0.4/configure
>> +@@ -172,8 +172,7 @@ for option in "$@"; do
>> + HAVE_VALGRIND=*) write_config_var VALGRIND "$option";;
>> + HAVE_BPFV3=*) write_config_var BPFV3 "$option";;
>> + HAVE_BPFMASM=*) write_config_var BPFMASM "$option";;
>> +- *) echo "Unknown option $option" >&2
>> +- exit 1;;
>> ++ *) echo "Unknown option $option" >&2;;
>> + esac
>> + done
>
> I assumed you could just stuff an || true in there, but this is being
> invoked by dh_auto_configure, so that option isn't available (plus, of
> course, if there's an actual error other than unknown args, we don't
> want to fail).
>
> Maybe we should just not exit with exitcode 1 on unknown configure
> options, only IIRC Gentoo actually wants us to. This may be the best we
> can do.
I really doubt this is the first / only package for Debian where there's
a non-autoconf configure script.
The real issue here is letting whatever Debian machinery that calls
configure think it is autoconf. ebuilds do the same, by default econf
will pass things assuming it's autoconf.
I'm sure there's a way to override that?
>
>> diff --git a/dists/debian/patches/debian-interpreter-paths.patch b/dists/debian/patches/debian-interpreter-paths.patch
>> new file mode 100644
>> index 00000000..58bea538
>> --- /dev/null
>> +++ b/dists/debian/patches/debian-interpreter-paths.patch
>> @@ -0,0 +1,107 @@
>> +Description: fix interpreter paths in tests
>> + Lintian prefers /bin/bash and /bin/sed over /usr/bin/bash and /usr/bin/sed.
>
> Honestly this one I think we should do upstream. I always thought that
> /bin/bash is universal and /usr/bin/bash less so.
>
Yes.
> [...]
sam
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 418 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [DTrace-devel] [PATCH v4] Add packaging configuration for Debian
2026-02-14 13:34 ` Sam James
@ 2026-02-14 16:39 ` Kris Van Hees
2026-02-14 18:39 ` Kris Van Hees
0 siblings, 1 reply; 6+ messages in thread
From: Kris Van Hees @ 2026-02-14 16:39 UTC (permalink / raw)
To: Sam James; +Cc: Nick Alcock, Kris Van Hees, dtrace-devel, dtrace
On Sat, Feb 14, 2026 at 01:34:31PM +0000, Sam James wrote:
> Nick Alcock via DTrace-devel <dtrace-devel@oss.oracle.com> writes:
>
> > On 10 Feb 2026, Kris Van Hees via DTrace-devel outgrape:
> >
> >> Packaging configuration files for Debian are provided in dists/debian.
> >
> > Nice! Seems to work, even on Debian stable (I was sure I'd need at least
> > testing, but no!).
> >
> > [...]
> >> diff --git a/dists/debian/patches/debian-configure.patch b/dists/debian/patches/debian-configure.patch
> >> new file mode 100644
> >> index 00000000..d4a89bb9
> >> --- /dev/null
> >> +++ b/dists/debian/patches/debian-configure.patch
> >> @@ -0,0 +1,17 @@
> >> +Description: issue a warning for unknown configure options
> >> + The Debian build system specifies configure options that are not known to
> >> + the DTrace configure script. They should not cause the configure script
> >> + to abort.
> >> +--- dtrace-2.0.4.orig/configure
> >> ++++ dtrace-2.0.4/configure
> >> +@@ -172,8 +172,7 @@ for option in "$@"; do
> >> + HAVE_VALGRIND=*) write_config_var VALGRIND "$option";;
> >> + HAVE_BPFV3=*) write_config_var BPFV3 "$option";;
> >> + HAVE_BPFMASM=*) write_config_var BPFMASM "$option";;
> >> +- *) echo "Unknown option $option" >&2
> >> +- exit 1;;
> >> ++ *) echo "Unknown option $option" >&2;;
> >> + esac
> >> + done
> >
> > I assumed you could just stuff an || true in there, but this is being
> > invoked by dh_auto_configure, so that option isn't available (plus, of
> > course, if there's an actual error other than unknown args, we don't
> > want to fail).
> >
> > Maybe we should just not exit with exitcode 1 on unknown configure
> > options, only IIRC Gentoo actually wants us to. This may be the best we
> > can do.
>
> I really doubt this is the first / only package for Debian where there's
> a non-autoconf configure script.
>
> The real issue here is letting whatever Debian machinery that calls
> configure think it is autoconf. ebuilds do the same, by default econf
> will pass things assuming it's autoconf.
>
> I'm sure there's a way to override that?
Well, while the configure script Nick wrote isn't autoconf, I believe he did
make it accept optionsn autoconf's configure style and naming. That said, the
script does not support all the options that autoconf's configure scripts
could accept (and that are passed by dh_auto_configure). Hence this patch.
I guess we could replace the dh_auto_configure invocation with an explicit
invocation of our configure script, but then we need to figure out all the
explicit options we do need to pass to set various paths correctly based on
the build system configuration. That seems to me like replicating work that
is already done for us by dh_auto_configure. None of the options we ignore
are actually relevant (and if in the future, they are, we'd need to patch
our configure script anyway).
So I would be inclined to argue that ignoring the unrecognized options is not
a bad option. It reports what is being ignored.
Alternatively, I'd suggest we update the configure script to actually support
the options that we get complaints about right now, providing an implementation
that makes sense (accept and ignore some, accept and use some others).
I could go either way here. I don't think one is worse than the other, aside
from having 'accept and ignore' cases feeling a bit less ideal to me because
it hides the 'ignore' effect (unless you print a message we're ignoring it and
then we're back to my current solution anyway).
Thoughts?
> >
> >> diff --git a/dists/debian/patches/debian-interpreter-paths.patch b/dists/debian/patches/debian-interpreter-paths.patch
> >> new file mode 100644
> >> index 00000000..58bea538
> >> --- /dev/null
> >> +++ b/dists/debian/patches/debian-interpreter-paths.patch
> >> @@ -0,0 +1,107 @@
> >> +Description: fix interpreter paths in tests
> >> + Lintian prefers /bin/bash and /bin/sed over /usr/bin/bash and /usr/bin/sed.
> >
> > Honestly this one I think we should do upstream. I always thought that
> > /bin/bash is universal and /usr/bin/bash less so.
> >
>
> Yes.
Done.
> > [...]
>
> sam
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [DTrace-devel] [PATCH v4] Add packaging configuration for Debian
2026-02-14 16:39 ` Kris Van Hees
@ 2026-02-14 18:39 ` Kris Van Hees
0 siblings, 0 replies; 6+ messages in thread
From: Kris Van Hees @ 2026-02-14 18:39 UTC (permalink / raw)
To: Kris Van Hees; +Cc: Sam James, Nick Alcock, dtrace-devel, dtrace
On Sat, Feb 14, 2026 at 11:39:36AM -0500, Kris Van Hees wrote:
> On Sat, Feb 14, 2026 at 01:34:31PM +0000, Sam James wrote:
> > Nick Alcock via DTrace-devel <dtrace-devel@oss.oracle.com> writes:
> >
> > > On 10 Feb 2026, Kris Van Hees via DTrace-devel outgrape:
> > >
> > >> Packaging configuration files for Debian are provided in dists/debian.
> > >
> > > Nice! Seems to work, even on Debian stable (I was sure I'd need at least
> > > testing, but no!).
> > >
> > > [...]
> > >> diff --git a/dists/debian/patches/debian-configure.patch b/dists/debian/patches/debian-configure.patch
> > >> new file mode 100644
> > >> index 00000000..d4a89bb9
> > >> --- /dev/null
> > >> +++ b/dists/debian/patches/debian-configure.patch
> > >> @@ -0,0 +1,17 @@
> > >> +Description: issue a warning for unknown configure options
> > >> + The Debian build system specifies configure options that are not known to
> > >> + the DTrace configure script. They should not cause the configure script
> > >> + to abort.
> > >> +--- dtrace-2.0.4.orig/configure
> > >> ++++ dtrace-2.0.4/configure
> > >> +@@ -172,8 +172,7 @@ for option in "$@"; do
> > >> + HAVE_VALGRIND=*) write_config_var VALGRIND "$option";;
> > >> + HAVE_BPFV3=*) write_config_var BPFV3 "$option";;
> > >> + HAVE_BPFMASM=*) write_config_var BPFMASM "$option";;
> > >> +- *) echo "Unknown option $option" >&2
> > >> +- exit 1;;
> > >> ++ *) echo "Unknown option $option" >&2;;
> > >> + esac
> > >> + done
> > >
> > > I assumed you could just stuff an || true in there, but this is being
> > > invoked by dh_auto_configure, so that option isn't available (plus, of
> > > course, if there's an actual error other than unknown args, we don't
> > > want to fail).
> > >
> > > Maybe we should just not exit with exitcode 1 on unknown configure
> > > options, only IIRC Gentoo actually wants us to. This may be the best we
> > > can do.
> >
> > I really doubt this is the first / only package for Debian where there's
> > a non-autoconf configure script.
> >
> > The real issue here is letting whatever Debian machinery that calls
> > configure think it is autoconf. ebuilds do the same, by default econf
> > will pass things assuming it's autoconf.
> >
> > I'm sure there's a way to override that?
>
> Well, while the configure script Nick wrote isn't autoconf, I believe he did
> make it accept optionsn autoconf's configure style and naming. That said, the
> script does not support all the options that autoconf's configure scripts
> could accept (and that are passed by dh_auto_configure). Hence this patch.
>
> I guess we could replace the dh_auto_configure invocation with an explicit
> invocation of our configure script, but then we need to figure out all the
> explicit options we do need to pass to set various paths correctly based on
> the build system configuration. That seems to me like replicating work that
> is already done for us by dh_auto_configure. None of the options we ignore
> are actually relevant (and if in the future, they are, we'd need to patch
> our configure script anyway).
>
> So I would be inclined to argue that ignoring the unrecognized options is not
> a bad option. It reports what is being ignored.
>
> Alternatively, I'd suggest we update the configure script to actually support
> the options that we get complaints about right now, providing an implementation
> that makes sense (accept and ignore some, accept and use some others).
>
> I could go either way here. I don't think one is worse than the other, aside
> from having 'accept and ignore' cases feeling a bit less ideal to me because
> it hides the 'ignore' effect (unless you print a message we're ignoring it and
> then we're back to my current solution anyway).
>
> Thoughts?
Following up to myself... perhaps we should improve the configure script to
be compliant with the GNU Coding Standards expectations of a configure script,
which would avoid all this... It would require us to accept the currently
unrecognized options for paths, and support --disable-option-checking which
will allow us to silently ignore unknown --with/without-* --enable/disable-*
options.
I would assume that will satisfy the requirements of pretty much all distros,
incl. Gentoo and Debian?
From what I can see, it should be quite trivial to do. We'd need to include
config.sub and config.guess I expect (unless we can pull in systemwide versions
of that using a dependency), and need to generate a config.status script, but
none of that is difficult.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [DTrace-devel] [PATCH v4] Add packaging configuration for Debian
2026-02-13 15:14 ` [DTrace-devel] " Nick Alcock
2026-02-14 13:34 ` Sam James
@ 2026-02-14 17:10 ` Kris Van Hees
1 sibling, 0 replies; 6+ messages in thread
From: Kris Van Hees @ 2026-02-14 17:10 UTC (permalink / raw)
To: Nick Alcock; +Cc: Kris Van Hees, dtrace-devel, dtrace
On Fri, Feb 13, 2026 at 03:14:13PM +0000, Nick Alcock wrote:
> On 10 Feb 2026, Kris Van Hees via DTrace-devel outgrape:
>
> > Packaging configuration files for Debian are provided in dists/debian.
>
> Nice! Seems to work, even on Debian stable (I was sure I'd need at least
> testing, but no!).
>
> > Sample steps to build DEB packages:
> >
> > - make dist
> > - cp dtrace-x.y.z.tar.bz2 $D/dtrace_x.y.z.orig.tar.bz2
>
> This...
>
> > - cd $D
> > - tar -jxpSf dtrace_x.y.z.orig.tar.bz2
>
> ... seems rather duplicative with this. See below for a patch with a
> make prep-debuild target that does this for you.
>
> > - cd dtrace-x.y.z
> > - make prep-debian
> > - debuild
>
> It is a bit annoying that you have to do a prep-debian before doing a
> build, because this prevents you doing a normal apt-src or any other
> large-scale build command unless you already have a source deb that this
> was done to. (The changelog generation is nice though!)
>
> I would be inclined to use git-buildpackage here. See
> https://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.import.upstream-git.html
>
> I tried for a minimal approach using the postexport hook, but alas gbp
> wants a debian/ directory before it'll even run that :( so for now this
> seems to be the best we can do.
>
> Here's a tiny patch to let you avoid the make dist in favour of a simple
> 'make prep-debuild'. (I didn't fold it into make prep-debian because
> some package building tools, like apt-src, don't need the .orig.tar.bz2
> at all.)
The reason why I do not do this is because the steps I outline are to get to
the initial state of having the files necessary to build DTrace for Debian.
This is what needs to be done to go from the upstream dtrace git tree to what
is needed to e.g. be able to use apt-src.
We are a non-native Debian package, so there is some work needed to go from
the upstream tree to what Debian needs. I don't want to automate too much of
it because it is certainly possible that the creation of the Debian package
files is going to be done in a place other than where the git clone is located.
E.g. I create the tarball (make dist) on a non-Debian system, and then do the
building on a very pristine Debian stable system to make sure that it ought to
work in a clean-room environment.
> 8<--------------------------------->8
> >From 472a6c863d06f8e419827842e0e455d8f13f6edd Mon Sep 17 00:00:00 2001
> From: Nick Alcock <nick.alcock@oracle.com>
> Date: Fri, 13 Feb 2026 14:29:05 +0000
> Subject: [PATCH] dists: add prep-debuild target
>
> This does the creation of the .orig.tar.bz2 in the parent of
> the source tree for you.
> ---
> dists/Build | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/dists/Build b/dists/Build
> index c75f933270fa3..f1ed1a4627176 100644
> --- a/dists/Build
> +++ b/dists/Build
> @@ -9,8 +9,14 @@ dists_DIR := $(current-dir)
> # Prepare package building on Debian (copy ./dists/debian in ./debian, and
> # generate the debian/changelog file.
>
> -prep-debian::
> +prep-debian:: dist
> $(call describe-target,DIST-PREP,Debian)
> rm -rf debian
> cp -rp $(dists_DIR)/debian .
> debian/mkChangelog debian/control dtrace.spec > debian/changelog
> +
> +# Prepare for debuild, which needs a tarball to already be present.
> +# Many wrappers around debuild already do this for you.
> +
> +prep-debuild::
> + mv dtrace-$(VERSION).tar.bz2 ../dtrace_$(VERSION).orig.tar.bz2
> --
> 2.47.3
> 8<--------------------------------->8
>
> > Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
>
> A couple of questions below.
>
> > +prep-debian::
> > + $(call describe-target,DIST-PREP,Debian)
> > + rm -rf debian
> > + cp -rp $(dists_DIR)/debian .
> > + debian/mkChangelog debian/control dtrace.spec > debian/changelog
>
> (I have a tiny patch for this.)
>
> > diff --git a/dists/debian/control b/dists/debian/control
> > new file mode 100644
> > index 00000000..56687a82
> > --- /dev/null
> > +++ b/dists/debian/control
> > @@ -0,0 +1,74 @@
> > +Source: dtrace
> > +Section: utils
> > +Priority: optional
> > +Maintainer: Kris Van Hees <kris.van.hees@oracle.com>
> > +Build-Depends: debhelper-compat (= 13),
> > + bison, flex, gawk, gcc-bpf, binutils-bpf, valgrind, binutils-dev, login.defs,
> > + libbpf-dev, libc-dev (>= 2.34), libelf-dev, libfuse3-dev, libpcap-dev,
> > + libpfm4-dev, libsystemd-dev, libz-dev
> > +Standards-Version: 4.5.1
>
> Why 4.5.1? I guess it's what debhelper writes right now. (The current
> version of Debian Policy is 4.7.3. It looks to me like we're compatible
> with it.)
Can change it, but isn't it perhaps even better to be compatible with an
earlier version, especially if perhaps there is interest in backporting to
earlier Debian versions?
> > +Homepage: https://github.com/oracle/dtrace-utils/
> > +Rules-Requires-Root: no
> > +
> > +Package: dtrace
> > +Architecture: any
> > +Depends: ${misc:Depends}, ${shlibs:Depends}
> > +Description: Dynamic tracing for Linux (DTrace)
> > + This is the official Linux port of the advanced tracing tool DTrace.
> > + .
> > + DTrace is a high-level dynamic tracing tool for Linux, built on kernel
> > + tracing features (tracepoints, function probes (fentry/fexit), dynamic
> > + kernel probes (kprobes), dynamic userspace probes (uprobes), ... and
> > + leveraging BPF as execution engine. It features an integrated compiler
> > + for its high-level tracing language and native support for interacting
> > + with the BPF engine, significantly reducing runtime dependencies
>
> Full stop at end of sentence (and for all the others below.)
Will fix.
> > +Package: libdtrace2
> > +Architecture: any
> > +Depends: ${misc:Depends}, ${shlibs:Depends},
> > + fuse3, libctf0, libelf1t64, libfuse3-4, libpcap0.8t64, libpfm4, libz1
> > +Description: Dynamic tracing for Linux (DTrace) (library)
> > + This is the official Linux port of the advanced tracing tool DTrace.
> > + .
> > + DTrace is a high-level dynamic tracing tool for Linux, built on kernel
> > + tracing features (tracepoints, function probes (fentry/fexit), dynamic
> > + kernel probes (kprobes), dynamic userspace probes (uprobes), ... and
> > + leveraging BPF as execution engine. It features an integrated compiler
> > + for its high-level tracing language and native support for interacting
> > + with the BPF engine, significantly reducing runtime dependencies
> > + .
> > + This package contains the shared library.
> > +
> > +Package: libdtrace2-dev
> > +Architecture: any
> > +Depends: ${misc:Depends},
> > + libdtrace2 (= ${binary:Version})
> > +Description: Dynamic tracing for Linux (DTrace) (development)
> > + This is the official Linux port of the advanced tracing tool DTrace.
> > + .
> > + DTrace is a high-level dynamic tracing tool for Linux, built on kernel
> > + tracing features (tracepoints, function probes (fentry/fexit), dynamic
> > + kernel probes (kprobes), dynamic userspace probes (uprobes), ... and
> > + leveraging BPF as execution engine. It features an integrated compiler
> > + for its high-level tracing language and native support for interacting
> > + with the BPF engine, significantly reducing runtime dependencies
> > + .
> > + This package contains the development files necessary to develop
> > + alternative implementations of the user interface for libdtrace, i.e.
> > + replacements for dtrace(1) itself.
> > +
> > +Package: dtrace-tests
> > +Architecture: any
> > +Depends: ${misc:Depends}, ${shlibs:Depends}, ${perl:Depends},
> > + binutils, cpp, gawk, gcc, make, pkgconf, tshark, bpftool
> > +Description: Dynamic tracing for Linux (DTrace) (testsuite)
> > + This is the official Linux port of the advanced tracing tool DTrace.
> > + .
> > + DTrace is a high-level dynamic tracing tool for Linux, built on kernel
> > + tracing features (tracepoints, function probes (fentry/fexit), dynamic
> > + kernel probes (kprobes), dynamic userspace probes (uprobes), ... and
> > + leveraging BPF as execution engine. It features an integrated compiler
> > + for its high-level tracing language and native support for interacting
> > + with the BPF engine, significantly reducing runtime dependencies
> > + .
> > + This package contains the testsuite.
>
> (... up to here.)
>
> > diff --git a/dists/debian/copyright b/dists/debian/copyright
> > new file mode 100644
> > index 00000000..1a5c8f64
> > --- /dev/null
> > +++ b/dists/debian/copyright
> > @@ -0,0 +1,103 @@
> > +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
> > +Upstream-Name: dtrace
> > +Upstream-Contact: Kris Van Hees <kris.van.hees@oracle.com>
> > +Source: https://github.com/oracle/dtrace-utils/
> > +
> > +Files: *
> > +Copyright: Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved.
> > +License: UPL-1.0
> > +
> > +Files: include/linux/bpf.h
> > +Copyright: Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
> > +License: GPL-2 with Linux-syscall-note exception
> > +
> > +Files: include/linux/btf.h
> > +Copyright: Copyright (c) 2018 Facebook
> > +License: GPL-2 with Linux-syscall-note exception
> > +
> > +Files: include/sys/auxv.h include/sys/bitmap.h
> > +Copyright: copyright (c) 1984, 1986, 1987, 1988, 1989 at&t
>
> AT&T, surely?
Huh, no idea how that ended up lowercase. Fixing.
> > --- /dev/null
> > +++ b/dists/debian/libdtrace2-dev.install
> > @@ -0,0 +1,5 @@
> > +usr/lib/${DEB_HOST_MULTIARCH}/libdtrace.so
> > +usr/include/dtrace
> > +usr/include/dtrace.h
> > +usr/include/sys/dtrace.h
> > +usr/include/sys/dtrace_types.h
> > diff --git a/dists/debian/libdtrace2.install b/dists/debian/libdtrace2.install
> > new file mode 100644
> > index 00000000..36294de3
> > --- /dev/null
> > +++ b/dists/debian/libdtrace2.install
> > @@ -0,0 +1,12 @@
> > +usr/lib/${DEB_HOST_MULTIARCH}/dtrace/[0-9]*/
> > +usr/lib/${DEB_HOST_MULTIARCH}/dtrace/bpf_dlib.o
> > +usr/lib/${DEB_HOST_MULTIARCH}/dtrace/drti/
> > +usr/lib/${DEB_HOST_MULTIARCH}/dtrace/include/
> > +usr/lib/${DEB_HOST_MULTIARCH}/libdtrace.so.*
> > +usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/dtrace.pc
> > +usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/dtrace_sdt.pc
> > +usr/lib/systemd/system/dtprobed.service
> > +usr/lib/systemd/system/dtrace-usdt.target
> > +usr/lib/systemd/system-preset/50-dtprobed.preset
> > +usr/lib/udev/rules.d/60-dtprobed.rules
> > +usr/sbin/dtprobed
>
> I've always been worried that these lists would be hard to maintain.
> It's a shame we can't autogenerate them, though it's hard to imagine
> from what. Maybe in the future we should do like we did for the version
> numbers, and have a centralized list of files from which we can generate
> things like this *and* the install commands in the Build files.
I thought about generating them from the spec file but unfortunately, it is
distro-dependent. Perhaps some smart logic could work here based on configs.
But I am not sure if it is worth it. For now, this works.
> > +++ b/dists/debian/mkChangelog
> > @@ -0,0 +1,174 @@
> > +#!/usr/bin/awk -f
> > +
> > +#
> > +# This script can be used to convert the dtrace.spec into a Debian changelog
> > +# file. It is intended to be invoked from the 'prep-debian' make target, but
> > +# it can be used manually as well:
> > +# mkChangelog debian/control dtrace.spec > debian/changelog
>
> This is really nifty!
>
> > diff --git a/dists/debian/patches/debian-configure.patch b/dists/debian/patches/debian-configure.patch
> > new file mode 100644
> > index 00000000..d4a89bb9
> > --- /dev/null
> > +++ b/dists/debian/patches/debian-configure.patch
> > @@ -0,0 +1,17 @@
> > +Description: issue a warning for unknown configure options
> > + The Debian build system specifies configure options that are not known to
> > + the DTrace configure script. They should not cause the configure script
> > + to abort.
> > +--- dtrace-2.0.4.orig/configure
> > ++++ dtrace-2.0.4/configure
> > +@@ -172,8 +172,7 @@ for option in "$@"; do
> > + HAVE_VALGRIND=*) write_config_var VALGRIND "$option";;
> > + HAVE_BPFV3=*) write_config_var BPFV3 "$option";;
> > + HAVE_BPFMASM=*) write_config_var BPFMASM "$option";;
> > +- *) echo "Unknown option $option" >&2
> > +- exit 1;;
> > ++ *) echo "Unknown option $option" >&2;;
> > + esac
> > + done
>
> I assumed you could just stuff an || true in there, but this is being
> invoked by dh_auto_configure, so that option isn't available (plus, of
> course, if there's an actual error other than unknown args, we don't
> want to fail).
>
> Maybe we should just not exit with exitcode 1 on unknown configure
> options, only IIRC Gentoo actually wants us to. This may be the best we
> can do.
See my reply to Sam. I do prefer to do the report-and-ignore option as I put
in this patch. At least it tells us what is being passed that we do not care
about, so we can evaluate whether we should (or when things break).
> > diff --git a/dists/debian/patches/debian-interpreter-paths.patch b/dists/debian/patches/debian-interpreter-paths.patch
> > new file mode 100644
> > index 00000000..58bea538
> > --- /dev/null
> > +++ b/dists/debian/patches/debian-interpreter-paths.patch
> > @@ -0,0 +1,107 @@
> > +Description: fix interpreter paths in tests
> > + Lintian prefers /bin/bash and /bin/sed over /usr/bin/bash and /usr/bin/sed.
>
> Honestly this one I think we should do upstream. I always thought that
> /bin/bash is universal and /usr/bin/bash less so.
Patch posted.
> > --- /dev/null
> > +++ b/dists/debian/rules
> > @@ -0,0 +1,24 @@
> > +#!/usr/bin/make -f
> > +# You must remove unused comment lines for the released package.
> > +export DH_VERBOSE = 1
> > +export DEB_BUILD_MAINT_OPTIONS = hardening=+all
> > +export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
>
> I suppose without -Werror this is safe :)
>
> --
> NULL && (void)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-02-14 18:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-10 20:59 [PATCH v4] Add packaging configuration for Debian Kris Van Hees
2026-02-13 15:14 ` [DTrace-devel] " Nick Alcock
2026-02-14 13:34 ` Sam James
2026-02-14 16:39 ` Kris Van Hees
2026-02-14 18:39 ` Kris Van Hees
2026-02-14 17:10 ` Kris Van Hees
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox