%global commit be5dd7740cd740064a1eb99e037fe550343b06a0 %global up oo7 # Upstream tags are 0.7.0.beta; RPM needs 0.7.0~beta so that 0.7.0 sorts after it %global rpmver %(echo 0.7.0.beta | sed -E 's/\\.(alpha|beta|rc[0-9]*)$/~\\1/') # The release profile has no debug info, so there is nothing for a debuginfo package %global debug_package %{nil} Name: oo7 Version: %{rpmver} Release: 1%{?dist} Summary: Secret Service provider # The vendored crates carry their own licenses (mostly MIT and Apache-2.0) License: MIT URL: https://github.com/linux-credentials/oo7 # Tarball of the upstream release tag with the crates vendored, produced by scripts/make-srpm.sh Source0: %{up}-%{commit}.tar.gz BuildRequires: cargo BuildRequires: rust BuildRequires: gcc BuildRequires: meson BuildRequires: gettext BuildRequires: desktop-file-utils BuildRequires: systemd-rpm-macros BuildRequires: pkgconfig(pam) BuildRequires: pkgconfig(systemd) %description oo7 is a Secret Service provider: a daemon that implements the org.freedesktop.secrets D-Bus API, a portal backend, a PAM module and a command-line client. %package daemon Summary: oo7 daemon Requires: (oo7-portal = %{version}-%{release} if xdg-desktop-portal) %description daemon Service providing the Secret Service D-Bus API. %package -n pam_oo7 Summary: oo7 PAM module Requires: oo7-daemon = %{version}-%{release} %description -n pam_oo7 A PAM (Pluggable Authentication Modules) module that integrates with the oo7 Secret Service daemon to automatically unlock keyrings during user authentication. %package portal Summary: oo7 Portal Provides: xdg-desktop-portal-oo7 = %{version}-%{release} Requires: oo7-daemon = %{version}-%{release} Requires: dbus-common Requires: xdg-desktop-portal %description portal An implementation of the org.freedesktop.impl.portal.Secret interface. %package cli Summary: oo7 CLI %description cli A CLI application to interact with the system keyring. %prep %autosetup -n %{up}-%{commit} # Upstream declares Rust 1.95 and Meson 1.7; the code builds with what EL10 ships (Rust 1.92, Meson 1.4) sed -i 's/^rust-version = "[0-9.]*"/rust-version = "1.92"/' Cargo.toml sed -i "s/meson_version: '>= 1.7'/meson_version: '>= 1.4'/" server/meson.build pam/meson.build portal/meson.build %build export CARGO_HOME=$PWD/.cargo-home for d in server pam portal; do pushd $d %meson %meson_build popd done cargo build --release --offline --locked -p oo7-cli %install for d in server pam portal; do pushd $d %meson_install popd done install -D -m755 -p target/release/oo7-cli %{buildroot}%{_bindir}/oo7-cli %find_lang oo7-daemon %check desktop-file-validate %{buildroot}%{_datadir}/applications/oo7-portal.desktop %post daemon %systemd_user_post oo7-daemon.service %preun daemon %systemd_user_preun oo7-daemon.service %postun daemon %systemd_user_postun_with_restart oo7-daemon.service %post portal %systemd_user_post oo7-portal.service %preun portal %systemd_user_preun oo7-portal.service %postun portal %systemd_user_postun_with_restart oo7-portal.service %files daemon -f oo7-daemon.lang %license LICENSE %doc server/README.md %{_libexecdir}/oo7-daemon %{_libexecdir}/oo7-daemon-login %{_userunitdir}/dbus-org.freedesktop.secrets.service %{_userunitdir}/oo7-daemon.service %files -n pam_oo7 %license LICENSE %doc pam/README.md %{_libdir}/security/pam_oo7.so %files portal %license LICENSE %doc portal/README.md %{_libexecdir}/oo7-portal %{_datadir}/applications/oo7-portal.desktop %{_datadir}/dbus-1/services/org.freedesktop.impl.portal.desktop.oo7.service %{_datadir}/xdg-desktop-portal/portals/oo7-portal.portal %{_userunitdir}/dbus-org.freedesktop.impl.portal.desktop.oo7.service %{_userunitdir}/oo7-portal.service %files cli %license LICENSE %doc cli/README.md %{_bindir}/oo7-cli %changelog %autochangelog