# Generated by rust2rpm 26 %bcond_without check %global debug_package %{nil} %global crate blosc2-sys %global upstream_version 0.2.6+2.14.3 Name: rust-blosc2-sys Version: 0.2.6 Release: %autorelease Summary: Bindings to C Blosc2 License: MIT URL: https://crates.io/crates/blosc2-sys Source: %{crates_source %{crate} %{upstream_version}} # Automatically generated patch to strip dependencies and normalize metadata Patch: blosc2-sys-fix-metadata-auto.diff # Manually created patch for downstream crate metadata changes # * Make bindgen and pkg-config non-optional Patch: blosc2-sys-fix-metadata.diff BuildRequires: cargo-rpm-macros >= 24 BuildRequires: tomcli BuildRequires: pkgconfig(blosc2) %global _description %{expand: Bindings to C Blosc2.} %description %{_description} %package devel Summary: %{summary} BuildArch: noarch Requires: pkgconfig(blosc2) %description devel %{_description} This package contains library source intended for building other packages which use the "%{crate}" crate. %files devel %license %{crate_instdir}/LICENSE %{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}+regenerate-bindings-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+regenerate-bindings-devel %{_description} This package contains library source intended for building other packages which use the "regenerate-bindings" feature of the "%{crate}" crate. %files -n %{name}+regenerate-bindings-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+shared-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+shared-devel %{_description} This package contains library source intended for building other packages which use the "shared" feature of the "%{crate}" crate. %files -n %{name}+shared-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+use-system-blosc2-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+use-system-blosc2-devel %{_description} This package contains library source intended for building other packages which use the "use-system-blosc2" feature of the "%{crate}" crate. %files -n %{name}+use-system-blosc2-devel %ghost %{crate_instdir}/Cargo.toml %prep %autosetup -n %{crate}-%{upstream_version} -p1 # Remove the bundled copy of blosc2 and the CMake-generated Makefile for it rm -rv c-blosc2 Makefile # These would only be needed to build the bundled blosc2: tomcli set Cargo.toml del build-dependencies.cmake tomcli set Cargo.toml del build-dependencies.copy_dir # Downstream-only: do not require the blosc2 version to exactly match # upstream’s bundled one sed -r -i 's@^([[:blank:]]*)(\.exactly_version\()@\1// \2@' build.rs # Downstream-only: tell bindgen to use the system header sed -r -i 's@c-blosc2/include@%{_includedir}@' build.rs comment='Downstream patch: always regenerate bindings' cfg='#\[cfg\(feature = "regenerate-bindings"\)\]' sed -r -i "s@([[:blank:]]*)(${cfg})@\\1// ${comment}\\n\\1// \\2@" build.rs comment='Downstream patch: always use the system blosc2' cfg='#\[cfg\(feature = "use-system-blosc2"\)\]' sed -r -i "s@([[:blank:]]*)(${cfg})@\\1// ${comment}\\n\\1// \\2@" build.rs cfg='#\[cfg\(not\(feature = "use-system-blosc2"\)\)\]' off='#\[cfg\(any\(\)\)\]' sed -r -i \ "s@([[:blank:]]*)(${cfg})@\\1// ${comment}\\n\\1${off}\\n\\1// \\2@" \ build.rs %cargo_prep %generate_buildrequires %cargo_generate_buildrequires -f regenerate-bindings %build %cargo_build -f regenerate-bindings %install %cargo_install -f regenerate-bindings %if %{with check} %check %cargo_test -f regenerate-bindings %endif %changelog %autochangelog