Update to 9.1.3 (close RHBZ#2329572)

epel10 imports/epel10/rust-oxipng-9.1.3-1.el10
Benjamin A. Beasley 4 weeks ago
parent 4bd04f78bf
commit f150b9aeb4

2
.gitignore vendored

@ -4,3 +4,5 @@
/oxipng-9.0.0.crate /oxipng-9.0.0.crate
/oxipng-9.1.1.crate /oxipng-9.1.1.crate
/oxipng-9.1.2.crate /oxipng-9.1.2.crate
/oxipng-9.1.3.crate
/oxipng-9.1.3-filtered.tar.gz

@ -0,0 +1,21 @@
From 112aa06a6db85bb1d8dd00530e7a8e0808bcbeb0 Mon Sep 17 00:00:00 2001
From: Andrew <andrew@digerati.co.nz>
Date: Sat, 30 Nov 2024 21:16:36 +1300
Subject: [PATCH] Fix manpage for `--zi`
---
src/cli.rs | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/cli.rs b/src/cli.rs
index cc861650..373d4141 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -344,6 +344,7 @@ Recommended use is with '-o max' and '--fast'.")
Set the number of iterations to use for Zopfli compression. Using fewer iterations may \
speed up compression for large files. This option requires '--zopfli' to be set.")
.long("zi")
+ .value_name("iterations")
.default_value("15")
.value_parser(1..=255)
.requires("zopfli"),

@ -0,0 +1,49 @@
#!/bin/sh
set -o errexit
set -o nounset
if [ "$#" != '1' ]
then
cat 1>&2 <<EOF
Usage: $0 VERSION
Downloads the requested version and creates a filtered source tarball.
EOF
exit 1
fi
VERSION="${1}"
OUTDIR="${PWD}"
TMPDIR="$(mktemp -d)"
trap "rm -rf '${TMPDIR}'" INT TERM EXIT
cd "${TMPDIR}"
REPO="https://github.com/shssoichiro/oxipng"
URL="${REPO}/archive/v${VERSION}/oxipng-${VERSION}.tar.gz"
echo "--> Downloading: ${URL}" 1>&2
curl -L -O "${URL}"
ARCHIVE="$(find . -mindepth 1 -maxdepth 1 -type f -name '*.tar.gz' -print -quit)"
echo "--> Extracting: $(basename "${ARCHIVE}")" 1>&2
tar -xzf "${ARCHIVE}"
echo '--> Removing tests/files/ due to licensing issues' 1>&2
TARDIR="$(basename "${ARCHIVE}" '.tar.gz')"
MTIME="$(stat -c '%Y' "${TARDIR}")"
rm -rv "${TARDIR}/tests/files/"
# Make sure the original mtime is preserved even if we modified the base
# directory by removing something at the top level. (So far, we didnt.)
touch -d @"${MTIME}" "${TARDIR}"
FILTERED="$(basename "${ARCHIVE}" .tar.gz)-filtered.tar.gz"
echo "--> Re-archiving: ${FILTERED}" 1>&2
# https://www.gnu.org/software/tar/manual/html_section/Reproducibility.html
TZ=UTC LC_ALL=C tar \
--create \
--sort=name \
--format=posix \
--numeric-owner --owner=0 --group=0 \
--mode=go+u,go-w \
--pax-option='delete=atime,delete=ctime' \
"${TARDIR}/" |
gzip -9 > "${FILTERED}"
mv -v "${FILTERED}" "${OUTDIR}"
echo 'Done.' 1>&2

@ -1,6 +1,6 @@
--- oxipng-9.1.2/Cargo.toml 1970-01-01T00:00:01+00:00 --- oxipng-9.1.3/Cargo.toml 1970-01-01T00:00:01+00:00
+++ oxipng-9.1.2/Cargo.toml 2024-07-15T22:13:30.187640+00:00 +++ oxipng-9.1.3/Cargo.toml 2024-11-30T18:06:52.515550+00:00
@@ -150,7 +150,6 @@ @@ -149,7 +149,6 @@
[features] [features]
binary = [ binary = [
"dep:clap", "dep:clap",
@ -8,7 +8,7 @@
"dep:env_logger", "dep:env_logger",
] ]
default = [ default = [
@@ -169,13 +168,10 @@ @@ -168,13 +167,10 @@
sanity-checks = ["dep:image"] sanity-checks = ["dep:image"]
zopfli = ["dep:zopfli"] zopfli = ["dep:zopfli"]

@ -1,18 +1,30 @@
# Generated by rust2rpm 26 # Generated by rust2rpm 27
%bcond_without check %bcond check 1
%global crate oxipng %global crate oxipng
Name: rust-oxipng Name: rust-oxipng
Version: 9.1.2 Version: 9.1.3
Release: %autorelease Release: %autorelease
Summary: Lossless PNG compression optimizer Summary: Lossless PNG compression optimizer
License: MIT License: MIT
URL: https://crates.io/crates/oxipng URL: https://crates.io/crates/oxipng
Source: %{crates_source} Source: %{crates_source}
# * We need the GitHub archive, in addition to the .crate from crates.io,
# because the crate does not contain the xtask/ directory required for
# generating a man page. However, because of some dubiously-licensed test
# files (https://github.com/shssoichiro/oxipng/issues/655), we must use a
# filtered version of the GitHub archive, obtained by running the script in
# Source11. We have asked upstream to simply include the contents of xtask/ in
# the published crates, https://github.com/shssoichiro/oxipng/issues/654.
Source10: https://github.com/shssoichiro/oxipng/archive/v%{version}/oxipng-%{version}-filtered.tar.gz
# * Script used to obtain Source10: ./get_source %%{version}
Source11: get_source
# Automatically generated patch to strip dependencies and normalize metadata # Automatically generated patch to strip dependencies and normalize metadata
Patch: oxipng-fix-metadata-auto.diff Patch: oxipng-fix-metadata-auto.diff
# * Fix manpage for --zi
Patch10: https://github.com/shssoichiro/oxipng/pull/653.patch
BuildRequires: cargo-rpm-macros >= 24 BuildRequires: cargo-rpm-macros >= 24
@ -153,19 +165,39 @@ use the "zopfli" feature of the "%{crate}" crate.
%prep %prep
%autosetup -n %{crate}-%{version} -p1 %autosetup -n %{crate}-%{version} -p1
# Unpacks to oxipng-%%{version}/, *inside* the extracted crate
%setup -q -T -D -a 10 -c -n %{crate}-%{version}
# Required for generating the man page:
#
# Note that the mangen xtask has its own dependencies, so we must run
# %%cargo_generate_buildrequires in the xtask directory if we are to invoke it
# in the build.
mv -v oxipng-%{version}/xtask ./
# We cant respect upstreams lock file, though:
rm xtask/Cargo.lock
# Demonstrate that sources from GitHub are not used to build the executable:
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/#_package_sources
rm -r -v oxipng-%{version}
%cargo_prep %cargo_prep
%generate_buildrequires %generate_buildrequires
%cargo_generate_buildrequires %cargo_generate_buildrequires
pushd xtask >/dev/null
%cargo_generate_buildrequires
popd >/dev/null
%build %build
%cargo_build %cargo_build
%{cargo_license_summary} %{cargo_license_summary}
%{cargo_license} > LICENSE.dependencies %{cargo_license} > LICENSE.dependencies
# Generate the man page
%{__cargo} run --manifest-path xtask/Cargo.toml -- mangen
%install %install
%cargo_install %cargo_install
mansrc='target/release/assets/oxipng.1' mansrc='target/xtask/mangen/manpages/oxipng.1'
mandest='%{buildroot}%{_mandir}/man1' mandest='%{buildroot}%{_mandir}/man1'
install -t "${mandest}" -D -p -m 0644 "${mansrc}" install -t "${mandest}" -D -p -m 0644 "${mansrc}"

@ -3,9 +3,64 @@ extra-files = [
"%{_mandir}/man1/oxipng.1*", "%{_mandir}/man1/oxipng.1*",
] ]
[[package.extra-sources]]
number = 10
file = "https://github.com/shssoichiro/oxipng/archive/v%{version}/oxipng-%{version}-filtered.tar.gz"
comments = [
"""\
We need the GitHub archive, in addition to the .crate from crates.io, \
because the crate does not contain the xtask/ directory required for \
generating a man page. However, because of some dubiously-licensed test \
files (https://github.com/shssoichiro/oxipng/issues/655), we must use a \
filtered version of the GitHub archive, obtained by running the script in \
Source11. We have asked upstream to simply include the contents of xtask/ \
in the published crates, https://github.com/shssoichiro/oxipng/issues/654.\
""",
]
[[package.extra-sources]]
number = 11
file = "get_source"
comments = [
"Script used to obtain Source10: ./get_source %%{version}",
]
[[package.extra-patches]]
number = 10
file = "https://github.com/shssoichiro/oxipng/pull/653.patch"
comments = [
"Fix manpage for --zi",
]
[scripts.prep]
pre = [
"""\
# Unpacks to oxipng-%%{version}/, *inside* the extracted crate
%setup -q -T -D -a 10 -c -n %{crate}-%{version}
# Required for generating the man page:
#
# Note that the mangen xtask has its own dependencies, so we must run
# %%cargo_generate_buildrequires in the xtask directory if we are to invoke it
# in the build.
mv -v oxipng-%{version}/xtask ./
# We cant respect upstreams lock file, though:
rm xtask/Cargo.lock
# Demonstrate that sources from GitHub are not used to build the executable:
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/#_package_sources
rm -r -v oxipng-%{version}\
"""
]
[scripts.build]
post = [
"# Generate the man page",
"%{__cargo} run --manifest-path xtask/Cargo.toml -- mangen",
]
[scripts.install] [scripts.install]
post = [ post = [
"mansrc='target/release/assets/oxipng.1'", "mansrc='target/xtask/mangen/manpages/oxipng.1'",
"mandest='%{buildroot}%{_mandir}/man1'", "mandest='%{buildroot}%{_mandir}/man1'",
"install -t \"${mandest}\" -D -p -m 0644 \"${mansrc}\"", "install -t \"${mandest}\" -D -p -m 0644 \"${mansrc}\"",
] ]

@ -1 +1,2 @@
SHA512 (oxipng-9.1.2.crate) = 23bba0a62add3c8224845c9d01d8414f2f8b27a694d50b23e048722a4562b0c39e88f8db5b42c9020563383e761816f1cb7188d9cfafad88c75131adaad96ae0 SHA512 (oxipng-9.1.3.crate) = 72c53f29216b34fdc88b9d71842a7fd32cba3c9ef3556f9c35cb28eed527029d8ad78ea20b2e2174041542fb05a74288d2d08455fd487451637d781c8c286ce9
SHA512 (oxipng-9.1.3-filtered.tar.gz) = 09ab91d1513e59b01a8fcf07c154e7dd056c09eab286a27edec10efb093b2a2e94084d85e3c901b4d3470762119796b9192163064c2806a273207063178050ce

Loading…
Cancel
Save