File sudo-rs.spec of Package sudo-rs
#
# spec file for package sudo-rs
#
# Copyright (c) 2025, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: sudo-rs
Version: 0.2.6+git20250617.5d2435bf
Release: 0
Summary: Execute some commands as root
License: Apache-2.0 OR MIT
Group: System/Base
URL: https://github.com/trifectatechfoundation/sudo-rs
Source: %{name}-%{version}.tar.gz
Source1: vendor.tar.zst
Source2: sudo-rs-rpmlintrc
BuildRequires: cargo-packaging
BuildRequires: pam-devel
BuildRequires: timezone
BuildRequires: pkgconfig(libapparmor)
PreReq: permissions
ExclusiveArch: %{rust_tier1_arches}
%description
A safety oriented and memory safe implementation of sudo and su
written in Rust.
%prep
%autosetup -a 1
%build
%{cargo_build} --features pam-login --features apparmor
%install
%{cargo_install}
mv %{buildroot}/%{_bindir}/su %{buildroot}/%{_bindir}/su-rs
mv %{buildroot}/%{_bindir}/sudo %{buildroot}/%{_bindir}/sudo-rs
mv %{buildroot}/%{_bindir}/visudo %{buildroot}/%{_bindir}/visudo-rs
%check
%{cargo_test} -- \
--skip common::resolve::test::canonicalization \
--skip system::tests::test_get_user_and_group_by_id \
--skip system::audit::test::secure_open_is_predictable \
--skip system::interface::test::test_unix_group \
--skip system::interface::test::test_unix_user \
%post
%set_permissions %{_bindir}/su-rs
%set_permissions %{_bindir}/sudo-rs
%verifyscript
%verify_permissions -e %{_bindir}/su-rs
%verify_permissions -e %{_bindir}/sudo-rs
%files
%license COPYRIGHT
%doc CHANGELOG.md README.md
%attr(4755, root, root) %{_bindir}/su-rs
%attr(4111, root, root) %{_bindir}/sudo-rs
%attr(0755, root, root) %{_bindir}/visudo-rs
%changelog