+#
+# Conditional build:
+%bcond_without clib # C library
+
+# no working cargo-c on x32 currently
+%ifarch x32
+%undefine with_clib
+%endif
Summary: The fastest and safest AV1 encoder
Summary(pl.UTF-8): Najszybszy i najbezpieczniejszy koder AV1
Name: rav1e
# Source1-md5: cb04c9255da1a4b5caca116652a7781e
URL: https://github.com/xiph/rav1e
BuildRequires: cargo
-BuildRequires: cargo-c
+%{?with_clib:BuildRequires: cargo-c}
%ifarch %{x8664}
BuildRequires: nasm
%endif
cargo -v build --release --frozen %{target_opt} %{features}
+%if %{with clib}
cargo -v cbuild --release --frozen %{target_opt}
+%endif
%install
rm -rf $RPM_BUILD_ROOT
--path . \
--root $RPM_BUILD_ROOT%{_prefix}
+%if %{with clib}
cargo -v cinstall --frozen --release %{target_opt} \
--destdir $RPM_BUILD_ROOT \
--prefix %{_prefix} \
--bindir %{_bindir} \
--includedir %{_includedir} \
--libdir %{_libdir}
+%endif
%{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
%doc LICENSE PATENTS README.md
%attr(755,root,root) %{_bindir}/rav1e
+%if %{with clib}
%files libs
%defattr(644,root,root,755)
%doc LICENSE PATENTS README.md doc/GLOSSARY.md
%files static
%defattr(644,root,root,755)
%{_libdir}/librav1e.a
+%endif