# Generated by rust2rpm 28 %bcond check 1 %global debug_package %{nil} %global crate sandlock-core Name: rust-sandlock-core Version: 0.8.1 Release: %autorelease Summary: Lightweight process sandbox using Landlock, seccomp-bpf, and seccomp user notification License: Apache-2.0 URL: https://crates.io/crates/sandlock-core Source: %{crates_source} # * include license file # * TODO https://github.com/multikernel/sandlock/pull/XX Source2: https://raw.githubusercontent.com/multikernel/sandlock/refs/tags/v%{version}/LICENSE # * Fix build issue with hudsucker 0.24. Patch2: compile-with-hudsucker-0.24.diff BuildRequires: cargo-rpm-macros >= 24 BuildRequires: tomcli %if %{with check} BuildRequires: hostname %endif %global _description %{expand: Lightweight process sandbox using Landlock, seccomp-bpf, and seccomp user notification.} %description %{_description} %package devel Summary: %{summary} BuildArch: noarch %description devel %{_description} This package contains library source intended for building other packages which use the "%{crate}" crate. %files devel %license %{crate_instdir}/LICENSE %doc %{crate_instdir}/README.md %{crate_instdir}/ %package -n %{name}+default-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+default-devel %{_description} This package contains library source intended for building other packages which use the "default" feature of the "%{crate}" crate. %files -n %{name}+default-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+cli-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+cli-devel %{_description} This package contains library source intended for building other packages which use the "cli" feature of the "%{crate}" crate. %files -n %{name}+cli-devel %ghost %{crate_instdir}/Cargo.toml %prep %autosetup -n %{crate}-%{version} -p1 # update hudsucker to 0.24 tomcli-set Cargo.toml str dependencies.hudsucker.version 0.24 %cargo_prep # copy in license file cp -p %{SOURCE2} . %generate_buildrequires %cargo_generate_buildrequires %build %cargo_build %install %cargo_install %if %{with check} %check # create /etc/hostname to pass test_policy_fn::test_policy_fn_audit and test_sandbox::test_nested_sandbox touch /etc/hostname # * rootfs-helper not found for tests, it is compiled from rootfs-helper.c which # is not packaged in crate # * according to readme, http host will be resolved at sandlock startup which # requires internet %{cargo_test -- -- %{shrink: --skip test_chroot --skip test_http_acl::test_http_ipv6_non_intercepted_port --skip test_http_acl::test_http_non_intercepted_port }} %endif %changelog %autochangelog