# Generated by rust2rpm 28 # Inspiration from Aleksa Sarai # %bcond check 1 # crate name %global crate pathrs Name: rust-pathrs Version: 0.2.4 Release: %autorelease Summary: C-friendly API to make path resolution safer on Linux # The github repo lists SPDX-License-Identifier: MPL-2.0 OR LGPL-3.0-or-later License: Apache-2.0 AND Apache-2.0 WITH LLVM-exception AND MIT AND BSD-2-Clause AND MPL-2.0 AND LGPL-3.0-or-later AND Unlicense AND Zlib URL: https://crates.io/crates/pathrs Source: %{crates_source} # Manually created patch for downstream crate metadata changes # * Update open-enum dependency to version available in Fedora Patch: pathrs-fix-metadata.diff BuildRequires: cargo-rpm-macros >= 24 BuildRequires: cargo-c # description copied from opensuse source %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} # The github repo lists SPDX-License-Identifier: MPL-2.0 OR LGPL-3.0-or-later License: Apache-2.0 AND Apache-2.0 WITH LLVM-exception AND MIT AND BSD-2-Clause AND MPL-2.0 AND LGPL-3.0-or-later AND Unlicense AND Zlib # LICENSE.dependencies contains a full license breakdown %description -n libpathrs %{_description} %files -n libpathrs %license COPYING.md %license LICENSE.GPL-3.0 LICENSE.LGPL-3.0 LICENSE.MPL-2.0 %license LICENSE.dependencies %{_libdir}/libpathrs.so{.*} # ################################################################ %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 %{_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 -a %{cargo_license_summary -a} %{cargo_license -a} > LICENSE.dependencies %cargo_cbuild -a # ################################################################ %install %cargo_cinstall -a # set up /usr/include path install -d -m 0755 %{buildroot}%{_includedir}/pathrs # remove static library # https://docs.fedoraproject.org/en-US/packaging-guidelines/#packaging-static-libraries rm '%{buildroot}%{_libdir}/libpathrs.a' %if %{with check} %check %cargo_test -a -- -- \ --skip tests::test_procfs::procfs_overmounts\ --skip tests::test_resolve::root_resolve_complete_file_link_opath\ --skip tests::test_resolve::root_resolve_complete_root_link\ --skip tests::test_resolve::root_resolve_dangling1_inroot_partial_dotdot_opath %endif %changelog %autochangelog