From 37ecdb134ef94bec7f8022a0ad07d2c0d1dc7d54 Mon Sep 17 00:00:00 2001 From: blinxen Date: Thu, 23 Feb 2023 20:44:19 +0100 Subject: [PATCH] Initial package --- .gitignore | 1 + remove-benchmark-dep.patch | 12 +++++ rust-imagequant.spec | 96 ++++++++++++++++++++++++++++++++++++++ sources | 1 + 4 files changed, 110 insertions(+) create mode 100644 .gitignore create mode 100644 remove-benchmark-dep.patch create mode 100644 rust-imagequant.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ae331ff --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/imagequant-4.1.0.crate diff --git a/remove-benchmark-dep.patch b/remove-benchmark-dep.patch new file mode 100644 index 0000000..ec50079 --- /dev/null +++ b/remove-benchmark-dep.patch @@ -0,0 +1,12 @@ +--- imagequant-4.1.0/Cargo.toml 2023-02-02 23:13:28.802949438 +0100 ++++ imagequant-4.1.0/Cargo.toml 2023-02-02 23:13:28.802949438 +0100 +@@ -75,9 +75,6 @@ + version = "1.1.4" + optional = true + +-[dev-dependencies.lodepng] +-version = "3.7.0" +- + [features] + _internal_c_ffi = [] + default = ["threads"] diff --git a/rust-imagequant.spec b/rust-imagequant.spec new file mode 100644 index 0000000..63679d8 --- /dev/null +++ b/rust-imagequant.spec @@ -0,0 +1,96 @@ +# Generated by rust2rpm 24 +%bcond_without check +%global debug_package %{nil} + +%global crate imagequant + +Name: rust-imagequant +Version: 4.1.0 +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 +Source: %{crates_source} +# lodepng is only needed for benchmarking, +# so we don't actually need it here +Patch: remove-benchmark-dep.patch +BuildRequires: cargo-rpm-macros >= 24 + +%global _description %{expand: +Convert 24/32-bit images to 8-bit palette with alpha channel. For lossy PNG +compression and high-quality GIF images 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}+_internal_c_ffi-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+_internal_c_ffi-devel %{_description} + +This package contains library source intended for building other packages which +use the "_internal_c_ffi" feature of the "%{crate}" crate. + +%files -n %{name}+_internal_c_ffi-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 + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p1 +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires + +%build +%cargo_build + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..83a9fed --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (imagequant-4.1.0.crate) = 98635af970dfdc9fddd85a08e10ed6053fd02051c4a0bd80535b1498cbb872e905d6ff8e3cc6d3d6f0d54eb42aa5421b8c81107da7e65326091fc2f8b27e0bc9