# Generated by rust2rpm 28 # Inspiration from Aleksa Sarai # %bcond check 1 %global debug_package %{nil} # crate name %global crate pathrs # The SONAME version is constructed based on the semantic version; for pre-1.0 # releases, that means MAJOR.MINOR. Still, to avoid undetected SONAME version # bumps, we document it manually in the spec file rather than constructing it # from the package version. %global so_ver 0.2 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} # license files and COPYING.MD pulled from %global srcpath https://github.com/cyphar/libpathrs/raw/refs/tags/%{version} SOURCE10: %{srcpath}/COPYING.md SOURCE11: %{srcpath}/LICENSE.GPL-3.0 SOURCE12: %{srcpath}/LICENSE.LGPL-3.0 SOURCE13: %{srcpath}/LICENSE.MPL-2.0 # Manually created patch for downstream crate metadata changes Patch: pathrs-fix-metadata.diff BuildRequires: cargo-rpm-macros >= 24 BuildRequires: cargo-c BuildRequires: lld BuildRequires: clang BuildRequires: fdupes %global _description %{expand: C-friendly API written in Rust to make path resolution safer on Linux.} %description %{_description} # ################################################################ %package -n libpathrs Summary: %{summary} # MIT OR Apache-2.0 License: MPL-2.0 OR LGPL-3.0-or-later # LICENSE.dependencies contains a full license breakdown %description -n libpathrs %{_description} This package contains the shared library providing the C API for libpathrs. %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.%{so_ver}{,.*} # ################################################################ %package -n libpathrs-devel Summary: %{summary} Requires: libpathrs%{?_isa} = %{version}-%{release} Requires: glibc-devel %description -n libpathrs-devel %{_description} This package contains headers and other files needed to develop and build programs that use the C API for libpathrs. %files -n libpathrs-devel %{_includedir}/pathrs//pathrs.h %{_libdir}/libpathrs.so %{_libdir}/pkgconfig/pathrs.pc # ################################################################ %prep %autosetup -n %{crate}-%{version} -p1 cp -p '%{SOURCE10}' '%{SOURCE11}' '%{SOURCE12}' '%{SOURCE13}' . %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 # https://docs.fedoraproject.org/en-US/packaging-guidelines/#packaging-static-libraries rm '%{buildroot}%{_libdir}/libpathrs.a' %if %{with check} %check # %%cargo_test -- --features capi %cargo_test — --lib %endif %changelog %autochangelog