From da836b7e85f2296eebd6b5206e3fd22582d89391 Mon Sep 17 00:00:00 2001 From: blinxen Date: Fri, 3 Mar 2023 22:19:40 +0100 Subject: [PATCH] Initial package --- .gitignore | 1 + rust-imagequant-sys.spec | 146 +++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 148 insertions(+) create mode 100644 .gitignore create mode 100644 rust-imagequant-sys.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7aa67bc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/imagequant-sys-4.0.1.crate diff --git a/rust-imagequant-sys.spec b/rust-imagequant-sys.spec new file mode 100644 index 0000000..b64fa78 --- /dev/null +++ b/rust-imagequant-sys.spec @@ -0,0 +1,146 @@ +# 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 diff --git a/sources b/sources new file mode 100644 index 0000000..0d5779c --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (imagequant-sys-4.0.1.crate) = fe26e72cae98c8adc1bcf460871556c79b76620034b126cb388a081acd8b15e37137a971b3f3d8b9d2f94d9ab241749797b944e112d5cd09e8a8537458245908