# Generated by rust2rpm 25 %bcond_without check # prevent library files from being installed %global __cargo_is_lib() 0 %global crate sudo-rs Name: sudo-rs Version: 0.2.2 Release: %autorelease Summary: Memory safe implementation of sudo and su SourceLicense: Apache-2.0 OR MIT # Apache-2.0 OR MIT # MIT OR Apache-2.0 License: Apache-2.0 OR MIT # LICENSE.dependencies contains a full license breakdown URL: https://github.com/memorysafety/sudo-rs Source: %{url}/archive/v%{version}/sudo-rs-%{version}.tar.gz # https://github.com/memorysafety/sudo-rs/issues/829 ExcludeArch: s390x BuildRequires: cargo-rpm-macros >= 24 BuildRequires: pam-devel %if %{with check} BuildRequires: /usr/bin/pkill %endif %global _description %{expand: A memory safe implementation of sudo and su.} %description %{_description} %prep %autosetup -n %{crate}-%{version} -p1 %cargo_prep %generate_buildrequires %cargo_generate_buildrequires %build %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %install %cargo_install # rename binaries so they do not conflict with sudo mv %{buildroot}/%{_bindir}/su %{buildroot}/%{_bindir}/su-rs mv %{buildroot}/%{_bindir}/sudo %{buildroot}/%{_bindir}/sudo-rs mv %{buildroot}/%{_bindir}/visudo %{buildroot}/%{_bindir}/visudo-rs %if %{with check} %check # * skip a test that requires "/var/log/wtmp" to be present: secure_open_is_predictable # * skip tests that rely on "daemon" having UID 1: test_unix_group, test_unix_user, test_get_user_and_group_by_id: # https://github.com/memorysafety/sudo-rs/issues/708 %cargo_test -- -- --exact --skip system::audit::test::secure_open_is_predictable --skip system::interface::test::test_unix_user --skip system::interface::test::test_unix_group --skip system::tests::test_get_user_and_group_by_id %endif %files %license COPYRIGHT %license LICENSE-APACHE %license LICENSE-MIT %license LICENSE.dependencies %doc CHANGELOG.md %doc CODE_OF_CONDUCT.md %doc CONTRIBUTING.md %doc README.md %doc SECURITY.md %attr(4755, root, root) %{_bindir}/su-rs %attr(4111, root, root) %{_bindir}/sudo-rs %attr(0755, root, root) %{_bindir}/visudo-rs %changelog %autochangelog