# Generated by rust2rpm 24 %bcond_without check # C library name %global lib libimagequant %global crate imagequant-sys Name: rust-imagequant-sys Version: 4.0.1 Release: %autorelease Summary: Convert 24/32-bit images to 8-bit palette with alpha channel License: GPL-3.0-or-later URL: https://crates.io/crates/imagequant-sys Source: %{crates_source} BuildRequires: rust-packaging >= 23 %global _description %{expand: Convert 24/32-bit images to 8-bit palette with alpha channel. C API/FFI libimagequant that powers pngquant lossy PNG compressor. Dual-licensed like pngquant. See https://pngquant.org for details.} %description %{_description} %package devel Summary: %{summary} BuildArch: noarch %description devel %{_description} This package contains library source intended for building other packages which use the "%{crate}" crate. %files devel %license %{crate_instdir}/COPYRIGHT %doc %{crate_instdir}/README.md %{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}+capi-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+capi-devel %{_description} This package contains library source intended for building other packages which use the "capi" feature of the "%{crate}" crate. %files -n %{name}+capi-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+threads-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+threads-devel %{_description} This package contains library source intended for building other packages which use the "threads" feature of the "%{crate}" crate. %files -n %{name}+threads-devel %ghost %{crate_instdir}/Cargo.toml # C library packages %package -n %{lib} Summary: %{summary} # Apache-2.0 # GPL-3.0-or-later # MIT # MIT OR Apache-2.0 # Zlib OR Apache-2.0 OR MIT License: Apache-2.0 AND GPL-3.0-or-later AND MIT # LICENSE.dependencies contains a full license breakdown %description -n %{lib} %{_description} %files -n %{lib} %license COPYRIGHT %license LICENSE.dependencies %doc README.md %{_libdir}/%{lib}.so.0* %package -n %{lib}-devel Summary: Development files for %{lib} Requires: %{lib}%{?_isa} = %{version}-%{release} %description -n %{lib}-devel %{_description} The %{lib}-devel package contains libraries and header files for developing applications that use %{lib}. %files -n %{lib}-devel %{_includedir}/%{lib}.h %{_libdir}/%{lib}.so %{_libdir}/pkgconfig/imagequant.pc %prep %autosetup -n %{crate}-%{version_no_tilde} -p1 %cargo_prep %generate_buildrequires %cargo_generate_buildrequires # Dependency for building C shared library echo "cargo-c" %build %cargo_build %__cargo cbuild --release \ --destdir=%{buildroot} \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --includedir=%{_includedir} \ --pkgconfigdir=%{_libdir}/pkgconfig %{cargo_license} > LICENSE.dependencies %install %cargo_install %__cargo cinstall --release \ --destdir=%{buildroot} \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --includedir=%{_includedir} \ --pkgconfigdir=%{_libdir}/pkgconfig # Don't ship static library rm -f %{buildroot}%{_libdir}/%{lib}.a %if %{with check} %check %cargo_test %endif %changelog %autochangelog