From b427f03cd0f6e5d2d652da1726ca564f06f14020 Mon Sep 17 00:00:00 2001 From: K Panuragh Date: Sat, 14 Nov 2026 01:29:17 +0530 Subject: [PATCH 1/2] build: Register the vendoring dist script only once The root meson.build and the credentialsd and credentialsd-ui subdirs each registered build-aux/dist-vendor.sh. The root and credentialsd registrations both run in the same dist directory, so the second one fails on `mkdir .cargo` and `meson dist` aborts without producing a tarball. Keep the registration in the root meson.build only, which vendors the crates for the whole workspace. --- credentialsd-ui/meson.build | 8 -------- credentialsd/meson.build | 8 -------- 2 files changed, 16 deletions(-) diff --git a/credentialsd-ui/meson.build b/credentialsd-ui/meson.build index 0edeadf5..9871576a 100644 --- a/credentialsd-ui/meson.build +++ b/credentialsd-ui/meson.build @@ -37,14 +37,6 @@ else application_id = base_id endif -meson.add_dist_script( - meson.project_source_root() / 'build-aux/dist-vendor.sh', - meson.project_build_root() / 'meson-dist' / gui_executable_name - + '-' - + version, - meson.project_source_root(), -) - if get_option('profile') == 'development' # Setup pre-commit hook for ensuring coding style is always consistent message('Setting up git pre-commit hook..') diff --git a/credentialsd/meson.build b/credentialsd/meson.build index a2ec9a25..ad7f8f5f 100644 --- a/credentialsd/meson.build +++ b/credentialsd/meson.build @@ -24,14 +24,6 @@ else application_id = base_id endif -meson.add_dist_script( - meson.project_source_root() / 'build-aux/dist-vendor.sh', - meson.project_build_root() / 'meson-dist' / backend_executable_name - + '-' - + version, - meson.project_source_root(), -) - if get_option('profile') == 'development' # Setup pre-commit hook for ensuring coding style is always consistent message('Setting up git pre-commit hook..') From 9914fe8337aad8cead7f405e486f2b72aa65794a Mon Sep 17 00:00:00 2001 From: K Panuragh Date: Sat, 14 Nov 2026 12:58:08 +0530 Subject: [PATCH 2/2] build: Add Debian packaging Add distrib/debian/, which builds the daemon, the GTK UI and the browser helper as credentialsd, credentialsd-ui and credentialsd-webextension. It builds offline from the crates that `meson dist` vendors into the source tarball, so it works on the openSUSE Build Service. README.source explains how to make the tarball and what an upload to the Debian archive needs instead (crates packaged on their own). --- distrib/debian/README.source | 39 ++++++++ distrib/debian/changelog | 5 + distrib/debian/control | 97 +++++++++++++++++++ distrib/debian/copyright | 42 ++++++++ distrib/debian/credentialsd-ui.install | 9 ++ .../debian/credentialsd-webextension.install | 4 + distrib/debian/credentialsd.install | 4 + distrib/debian/rules | 59 +++++++++++ distrib/debian/source/format | 1 + distrib/debian/source/lintian-overrides | 6 ++ distrib/debian/upstream/metadata | 5 + 11 files changed, 271 insertions(+) create mode 100644 distrib/debian/README.source create mode 100644 distrib/debian/changelog create mode 100644 distrib/debian/control create mode 100644 distrib/debian/copyright create mode 100644 distrib/debian/credentialsd-ui.install create mode 100644 distrib/debian/credentialsd-webextension.install create mode 100644 distrib/debian/credentialsd.install create mode 100755 distrib/debian/rules create mode 100644 distrib/debian/source/format create mode 100644 distrib/debian/source/lintian-overrides create mode 100644 distrib/debian/upstream/metadata diff --git a/distrib/debian/README.source b/distrib/debian/README.source new file mode 100644 index 00000000..d516440b --- /dev/null +++ b/distrib/debian/README.source @@ -0,0 +1,39 @@ +credentialsd for Debian +======================= + +Source tarball +-------------- + +The package builds without network access, from the Rust crates in vendor/. +Git does not contain them, so the .orig tarball is the one that `meson dist` +produces, which adds vendor/ and a .cargo/config that points Cargo at it +(build-aux/dist-vendor.sh). Releases up to 0.4.0 contain neither this +packaging nor the fix that lets `meson dist` vendor the crates, so build +from a git checkout that has both, and give the package a snapshot version: + + cd credentialsd + meson setup _dist -Dfeature_demo_client=disabled + meson dist -C _dist --no-tests --formats xztar + VERSION=$(meson introspect --projectinfo _dist | jq -r .version) + cd .. + cp credentialsd/_dist/meson-dist/credentialsd-$VERSION.tar.xz \ + credentialsd_$VERSION.orig.tar.xz + +Upstream keeps this packaging in distrib/debian/. Copy it to debian/ in +the unpacked tarball, set the version in debian/changelog (for example with +`dch -v $VERSION+git$(date +%Y%m%d)-1`, which also needs the .orig tarball +renamed to match), and build: + + tar xf credentialsd_$VERSION.orig.tar.xz + cp -r credentialsd-$VERSION/distrib/debian credentialsd-$VERSION/debian + cd credentialsd-$VERSION + dpkg-buildpackage -us -uc + +Vendored crates +--------------- + +Building against vendored crates is fine for third-party repositories such +as the openSUSE Build Service. The Debian archive +expects each crate to be packaged on its own (see the Debian Rust team +policy), so an upload to Debian has to replace vendor/ with Build-Depends +on librust-*-dev packages. diff --git a/distrib/debian/changelog b/distrib/debian/changelog new file mode 100644 index 00000000..a7e9a263 --- /dev/null +++ b/distrib/debian/changelog @@ -0,0 +1,5 @@ +credentialsd (0.4.0-1) UNRELEASED; urgency=medium + + * Initial packaging. + + -- K Panuragh Sat, 14 Nov 2026 12:00:00 +0000 diff --git a/distrib/debian/control b/distrib/debian/control new file mode 100644 index 00000000..5a5cd9ec --- /dev/null +++ b/distrib/debian/control @@ -0,0 +1,97 @@ +Source: credentialsd +Section: utils +Maintainer: K Panuragh +Build-Depends: + debhelper-compat (= 13), + appstream , + blueprint-compiler (>= 0.20.4), + cargo (>= 1.92), + clang, + dbus-daemon , + gettext, + libclang-dev, + libdbus-1-dev, + libglib2.0-dev, + libglib2.0-dev-bin, + libgtk-4-dev, + libnfc-dev (>= 1.8.0), + libpcsclite-dev (>= 2.0.3), + libssl-dev, + libudev-dev, + libxml2-utils, + meson (>= 1.5.0), + ninja-build, + pkgconf, + rustc (>= 1.92), + systemd-dev, + zip, +Standards-Version: 4.7.4 +Rules-Requires-Root: no +Homepage: https://github.com/linux-credentials/credentialsd +Vcs-Browser: https://github.com/linux-credentials/credentialsd +Vcs-Git: https://github.com/linux-credentials/credentialsd.git + +Package: credentialsd +Architecture: linux-any +Depends: + publicsuffix, + ${misc:Depends}, + ${shlibs:Depends}, +Recommends: + credentialsd-ui, + dbus-user-session, +Suggests: + credentialsd-webextension, +Description: credential manager service with WebAuthn/passkey support + credentialsd is a D-Bus service that lets applications create and use + WebAuthn credentials (passkeys) with security keys over USB, NFC and + hybrid (caBLE) transports. + . + This package contains the daemon, its D-Bus activation file and systemd + user unit. + . + Applications reach the service through the experimental Credential + interface of xdg-desktop-portal, which is not in upstream + xdg-desktop-portal yet and needs a patched build of it. + +Package: credentialsd-ui +Architecture: linux-any +Depends: + credentialsd (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends}, +Suggests: + xdg-desktop-portal, +Description: credential manager service with WebAuthn/passkey support - GTK UI + credentialsd is a D-Bus service that lets applications create and use + WebAuthn credentials (passkeys) with security keys over USB, NFC and + hybrid (caBLE) transports. + . + This package contains the GTK 4 dialog that asks the user to choose a + device, enter a PIN or confirm a request, and the xdg-desktop-portal + backend description that points the Credential portal at it. + +Package: credentialsd-webextension +Architecture: all +Depends: + credentialsd (>= ${source:Version}), + python3, + python3-dbus-next, + ${misc:Depends}, +Enhances: + firefox, + firefox-esr, +Description: credential manager service with WebAuthn/passkey support - browser helper + credentialsd is a D-Bus service that lets applications create and use + WebAuthn credentials (passkeys) with security keys over USB, NFC and + hybrid (caBLE) transports. + . + This package contains the native messaging host that connects the + credentialsd browser extension to the service, for Firefox builds without + native portal integration, and the unsigned extension archives for + Firefox and Chromium. The native messaging host is registered for + Firefox from the Debian package; Firefox installed as a Snap or Flatpak + does not read it. + . + Release builds of Firefox only install signed extensions; upstream + publishes a signed build of the extension with each release. diff --git a/distrib/debian/copyright b/distrib/debian/copyright new file mode 100644 index 00000000..cd10203d --- /dev/null +++ b/distrib/debian/copyright @@ -0,0 +1,42 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: credentialsd +Upstream-Contact: https://github.com/linux-credentials/credentialsd/issues +Source: https://github.com/linux-credentials/credentialsd + +Files: * +Copyright: 2023-2026 Isaiah Inuwa and the credentialsd contributors +License: LGPL-3.0-only + +Files: vendor/* +Copyright: The authors of each crate, as listed in vendor/*/Cargo.toml +License: various +Comment: + vendor/ holds the Rust crates from Cargo.lock, added to the source tarball + by `meson dist` (build-aux/dist-vendor.sh). Each crate's license is given + in its Cargo.toml and license files. All are DFSG-free. The licenses used, + alone, as alternatives or combined, are MIT, Apache-2.0 (with or without + the LLVM exception), BSD-1-Clause, BSD-2-Clause, BSD-3-Clause, 0BSD, ISC, + Zlib, BSL-1.0, Unlicense, Unicode-3.0 and LGPL-2.1-or-later. This stanza needs to be expanded to one per crate before + the package can go into the Debian archive. + +Files: debian/* +Copyright: 2026 K Panuragh +License: LGPL-3.0-only + +License: various + The vendored crates are under the licenses listed in the vendor/* + stanza above; each crate's Cargo.toml names its license and the crate + directory holds the license text. + +License: LGPL-3.0-only + This program 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, version 3. + . + This program 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. + . + On Debian systems, the complete text of the GNU Lesser General Public + License version 3 can be found in "/usr/share/common-licenses/LGPL-3". diff --git a/distrib/debian/credentialsd-ui.install b/distrib/debian/credentialsd-ui.install new file mode 100644 index 00000000..1b90dd72 --- /dev/null +++ b/distrib/debian/credentialsd-ui.install @@ -0,0 +1,9 @@ +usr/bin/credentialsd-ui +usr/lib/systemd/user/xyz.iinuwa.credentialsd.UiControl.service +usr/share/credentialsd-ui +usr/share/dbus-1/services/xyz.iinuwa.credentialsd.UiControl.service +usr/share/glib-2.0/schemas +usr/share/icons +usr/share/locale +usr/share/metainfo +usr/share/xdg-desktop-portal/portals/credentialsd.portal diff --git a/distrib/debian/credentialsd-webextension.install b/distrib/debian/credentialsd-webextension.install new file mode 100644 index 00000000..577182f7 --- /dev/null +++ b/distrib/debian/credentialsd-webextension.install @@ -0,0 +1,4 @@ +usr/bin/credentialsd-firefox-helper +usr/lib/mozilla/native-messaging-hosts/xyz.iinuwa.credentialsd_helper.json +usr/share/credentialsd/credentialsd-chromium-helper.zip +usr/share/credentialsd/credentialsd-firefox-helper.xpi diff --git a/distrib/debian/credentialsd.install b/distrib/debian/credentialsd.install new file mode 100644 index 00000000..647eea92 --- /dev/null +++ b/distrib/debian/credentialsd.install @@ -0,0 +1,4 @@ +usr/bin/credentialsd +usr/lib/systemd/user/xyz.iinuwa.credentialsd.Credentials.service +usr/share/credentialsd/xyz.iinuwa.credentialsd.Credentials.xml +usr/share/dbus-1/services/xyz.iinuwa.credentialsd.Credentials.service diff --git a/distrib/debian/rules b/distrib/debian/rules new file mode 100755 index 00000000..60aa8b8d --- /dev/null +++ b/distrib/debian/rules @@ -0,0 +1,59 @@ +#!/usr/bin/make -f + +include /usr/share/dpkg/architecture.mk + +# Ubuntu's dpkg-buildflags turn on LTO for C code. The C dependencies that +# Cargo compiles (hidapi) then come out as GCC LTO objects, which the Rust +# linker can't use. +export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=-lto + +# Crates come from the vendor/ directory in the source tarball, which +# .cargo/config points Cargo at. Keep Cargo's own state out of $HOME. +CARGO_HOME = $(CURDIR)/debian/cargo-home + +# Cargo's release profile builds without debug info, which would leave the +# -dbgsym packages empty. dh_strip moves the symbols out of the binaries. +export CARGO_PROFILE_RELEASE_DEBUG = true + +# Don't record the build directory in the binaries' debug info. +export RUSTFLAGS += --remap-path-prefix=$(CURDIR)=/usr/src/credentialsd + +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) +export CARGO_BUILD_JOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) +endif + +%: + dh $@ + +# --libdir=lib: Firefox looks for native messaging manifests in +# /usr/lib/mozilla/native-messaging-hosts, not in the multiarch libdir. +override_dh_auto_configure: + dh_auto_configure -- \ + --libdir=lib \ + -Dcargo_home=$(CARGO_HOME) \ + -Dcargo_locked=true \ + -Dcargo_offline=true \ + -Dfeature_demo_client=disabled + +# The Cargo test targets compile their test binaries first, which takes longer +# than Meson's 30 second default timeout, and parallel runs only wait on +# Cargo's build directory lock. +override_dh_auto_test: + dh_auto_test -- --num-processes=1 --timeout-multiplier=20 + +# The Cargo targets are always stale, and in compat 13 dh_auto_install runs +# `ninja install`, which would run `cargo build` again. (Compat 14 uses +# `meson install --no-rebuild` itself, but needs debhelper >= 14.) +override_dh_auto_install: + meson install -C obj-$(DEB_HOST_GNU_TYPE) --no-rebuild \ + --destdir=$(CURDIR)/debian/tmp + +# dh_clean deletes *.orig files, but the vendored crates ship Cargo.toml.orig +# and Cargo checks it against .cargo-checksum.json. +override_dh_clean: + dh_clean -X.orig + +# Meson copies these generated files into the source tree at configure time. +execute_after_dh_auto_clean: + rm -rf $(CARGO_HOME) + rm -f credentialsd-ui/src/config.rs credentialsd/tests/config/mod.rs diff --git a/distrib/debian/source/format b/distrib/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/distrib/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/distrib/debian/source/lintian-overrides b/distrib/debian/source/lintian-overrides new file mode 100644 index 00000000..2234d58d --- /dev/null +++ b/distrib/debian/source/lintian-overrides @@ -0,0 +1,6 @@ +# Files inside the vendored crates (vendor/), which `cargo vendor` copies +# as published on crates.io. None of them are used for a Linux build. +credentialsd source: source-contains-prebuilt-java-object [vendor/*] +credentialsd source: source-contains-prebuilt-wasm-binary [vendor/*] +credentialsd source: source-contains-prebuilt-windows-binary [vendor/*] +credentialsd source: very-long-line-length-in-source-file * [vendor/*] diff --git a/distrib/debian/upstream/metadata b/distrib/debian/upstream/metadata new file mode 100644 index 00000000..ee7cf6ad --- /dev/null +++ b/distrib/debian/upstream/metadata @@ -0,0 +1,5 @@ +Bug-Database: https://github.com/linux-credentials/credentialsd/issues +Bug-Submit: https://github.com/linux-credentials/credentialsd/issues/new +Repository: https://github.com/linux-credentials/credentialsd.git +Repository-Browse: https://github.com/linux-credentials/credentialsd +Security-Contact: https://github.com/linux-credentials/credentialsd/security/advisories/new