# Generated by rust2rpm 26
%bcond_without check
%global debug_package %{nil}
%global crate libheif-sys
%global upstream_version 2.1.0+1.17.4
Name: rust-libheif-sys
Version: 2.1.0
Release: %autorelease
Summary: Libheif bindings
License: MIT
URL: https://crates.io/crates/libheif-sys
Source: %{crates_source %{crate} %{upstream_version}}
# Automatically generated patch to strip dependencies and normalize metadata
Patch: libheif-sys-fix-metadata-auto.diff
# Manually created patch for downstream crate metadata changes
# * make build-dependency on bindgen unconditional
Patch: libheif-sys-fix-metadata.diff
Patch: 0001-unconditionally-regenerate-bindings-with-bindgen.patch
BuildRequires: cargo-rpm-macros >= 24
BuildRequires: pkgconfig(libheif) >= 1.16
%global _description %{expand:
Libheif bindings.}
%description %{_description}
%package devel
Summary: %{summary}
BuildArch: noarch
Requires: pkgconfig(libheif) >= 1.16
%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}/CHANGELOG.md
%doc %{crate_instdir}/README.md
%{crate_instdir}/
# Don't include the test data in the package as it is not useful for other
# programs consuming the crate. This also avoids us having to include
# CC-BY-SA-4.0 that the test data is licensed under in the license tag.
%exclude %{crate_instdir}/data/
%exclude %{crate_instdir}/tests/
%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
%prep
%autosetup -n %{crate}-%{upstream_version} -p1
%cargo_prep
%generate_buildrequires
%cargo_generate_buildrequires
%build
%cargo_build
%install
%cargo_install
%if %{with check}
%check
%cargo_test
%endif
%changelog
%autochangelog