# Generated by rust2rpm 28 %bcond check 1 # prevent library files from being installed %global cargo_install_lib 0 %global crate pathrs Name: rust-pathrs Version: 0.2.4 Release: %autorelease Summary: C-friendly API to make path resolution safer on Linux License: MPL-2.0 OR LGPL-3.0-or-later URL: https://crates.io/crates/pathrs Source: %{crates_source} # Manually created patch for downstream crate metadata changes # * Add cdylib compilation target # * Update open-enum dependency to version available in Fedora # * Manual cargo macro updates of -a (generate buildrequires) and -f capi (all # others) Patch: pathrs-fix-metadata.diff BuildRequires: cargo-rpm-macros >= 26 BuildRequires: cargo-c %global _description %{expand: libpathrs implements a set of C-friendly APIs (written in Rust) to make path resolution within a potentially-untrusted directory safe on GNU/Linux. There are countless examples of security vulnerabilities caused by bad handling of paths (symlinks make the issue significantly worse).} %description %{_description} %package -n libpathrs Summary: %{summary} # FIXME: paste output of %%cargo_license_summary here License: # FIXME # LICENSE.dependencies contains a full license breakdown %description -n libpathrs %{_description} %files -n libpathrs %license COPYING.md %license LICENSE.GPL-3.0 %license LICENSE.LGPL-3.0 %license LICENSE.MPL-2.0 %license LICENSE.dependencies %doc CHANGELOG.md %doc README.md %{_libdir}/libpathrs.so.0{,.*} %package -n libpathrs-devel Summary: %{summary} Requires: libpathrs%{?_isa} = %{version}-%{release} %description -n libpathrs-devel %{_description} This subpackage provides the development headers for libpathrs. %files -n libpathrs-devel %dir %{_includedir}/pathrs %{_includedir}/pathrs/pathrs.h %{_libdir}/libpathrs.so %{_libdir}/pkgconfig/pathrs.pc %prep %autosetup -n %{crate}-%{version} -p1 %cargo_prep %generate_buildrequires %cargo_generate_buildrequires -a %build %cargo_build -f capi %{cargo_license_summary -f capi} %{cargo_license -f capi} > LICENSE.dependencies %cargo_cbuild -f capi %install %cargo_install -f capi %cargo_cinstall -f capi # remove static library # https://docs.fedoraproject.org/en-US/packaging-guidelines/#packaging-static-libraries rm '%{buildroot}%{_libdir}/libpathrs.a' %if %{with check} %check # * Most opath and fs_dir errors involve: Invalid cross-device link # * See https://github.com/cyphar/libpathrs/issues/372 for related information # * utils:sysctl errors are all panics in rs code %{cargo_test -f capi -- -- %{shrink: --skip _global_fs_dir --skip _opath --skip utils::sysctl::tests }} %endif %changelog %autochangelog