commit fa22b7dd6953c77356e9edafad017e0b8a0d5e35 Author: MSVSphere Packaging Team Date: Fri Dec 20 16:31:04 2024 +0300 import rust-oxipng-9.1.3-1.el10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ef8365d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/oxipng-9.1.3-filtered.tar.gz +SOURCES/oxipng-9.1.3.crate diff --git a/.rust-oxipng.metadata b/.rust-oxipng.metadata new file mode 100644 index 0000000..bbef1d9 --- /dev/null +++ b/.rust-oxipng.metadata @@ -0,0 +1,2 @@ +bf12f029533a70e52bc81ba35eb1d484b214af85 SOURCES/oxipng-9.1.3-filtered.tar.gz +ee13bfe74a77070fee6f38620968e6d82f471c64 SOURCES/oxipng-9.1.3.crate diff --git a/SOURCES/653.patch b/SOURCES/653.patch new file mode 100644 index 0000000..3940877 --- /dev/null +++ b/SOURCES/653.patch @@ -0,0 +1,21 @@ +From 112aa06a6db85bb1d8dd00530e7a8e0808bcbeb0 Mon Sep 17 00:00:00 2001 +From: Andrew +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"), diff --git a/SOURCES/README.md b/SOURCES/README.md new file mode 100644 index 0000000..a9ee44b --- /dev/null +++ b/SOURCES/README.md @@ -0,0 +1,3 @@ +# rust-oxipng + +The rust-oxipng package diff --git a/SOURCES/get_source b/SOURCES/get_source new file mode 100755 index 0000000..f386276 --- /dev/null +++ b/SOURCES/get_source @@ -0,0 +1,49 @@ +#!/bin/sh +set -o errexit +set -o nounset + +if [ "$#" != '1' ] +then + cat 1>&2 < 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 didn’t.) +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 diff --git a/SOURCES/oxipng-fix-metadata-auto.diff b/SOURCES/oxipng-fix-metadata-auto.diff new file mode 100644 index 0000000..db4d355 --- /dev/null +++ b/SOURCES/oxipng-fix-metadata-auto.diff @@ -0,0 +1,25 @@ +--- oxipng-9.1.3/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ oxipng-9.1.3/Cargo.toml 2024-11-30T18:06:52.515550+00:00 +@@ -149,7 +149,6 @@ + [features] + binary = [ + "dep:clap", +- "dep:glob", + "dep:env_logger", + ] + default = [ +@@ -168,13 +167,10 @@ + sanity-checks = ["dep:image"] + zopfli = ["dep:zopfli"] + +-[target."cfg(windows)".dependencies.glob] +-version = "0.3.1" +-optional = true +- + [badges.maintenance] + status = "actively-developed" + + [badges.travis-ci] + branch = "master" + repository = "shssoichiro/oxipng" ++ diff --git a/SOURCES/rust-oxipng.rpmlintrc b/SOURCES/rust-oxipng.rpmlintrc new file mode 100644 index 0000000..cd1fd90 --- /dev/null +++ b/SOURCES/rust-oxipng.rpmlintrc @@ -0,0 +1,2 @@ +# Feature metapackages are not supposed to have documentation! +addFilter(r"\+[-0\w]+-devel.noarch: W: no-documentation") diff --git a/SOURCES/rust2rpm.toml b/SOURCES/rust2rpm.toml new file mode 100644 index 0000000..81f3317 --- /dev/null +++ b/SOURCES/rust2rpm.toml @@ -0,0 +1,66 @@ +[package] +extra-files = [ + "%{_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 can’t respect upstream’s 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] +post = [ + "mansrc='target/xtask/mangen/manpages/oxipng.1'", + "mandest='%{buildroot}%{_mandir}/man1'", + "install -t \"${mandest}\" -D -p -m 0644 \"${mansrc}\"", +] diff --git a/SPECS/rust-oxipng.spec b/SPECS/rust-oxipng.spec new file mode 100644 index 0000000..eaeefe3 --- /dev/null +++ b/SPECS/rust-oxipng.spec @@ -0,0 +1,258 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.7.3) +## RPMAUTOSPEC: autorelease, autochangelog +%define autorelease(e:s:pb:n) %{?-p:0.}%{lua: + release_number = 1; + base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); + print(release_number + base_release_number - 1); +}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} +## END: Set by rpmautospec + +# Generated by rust2rpm 27 +%bcond check 1 + +%global crate oxipng + +Name: rust-oxipng +Version: 9.1.3 +Release: %autorelease +Summary: Lossless PNG compression optimizer + +License: MIT +URL: https://crates.io/crates/oxipng +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 +Patch: oxipng-fix-metadata-auto.diff +# * Fix manpage for --zi +Patch10: https://github.com/shssoichiro/oxipng/pull/653.patch + +BuildRequires: cargo-rpm-macros >= 24 + +%global _description %{expand: +A lossless PNG compression optimizer.} + +%description %{_description} + +%package -n %{crate} +Summary: %{summary} +# Apache-2.0 +# Apache-2.0 OR MIT +# Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT +# BSL-1.0 +# MIT +# MIT OR Apache-2.0 (duplicate) +# Zlib OR Apache-2.0 OR MIT +License: %{shrink: + Apache-2.0 AND + (Apache-2.0 OR MIT) AND + (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND + BSL-1.0 AND + MIT AND + (Zlib OR Apache-2.0 OR MIT) + } +# LICENSE.dependencies contains a full license breakdown + +%description -n %{crate} %{_description} + +%files -n %{crate} +%license LICENSE +%license LICENSE.dependencies +%doc CHANGELOG.md +%doc MANUAL.txt +%doc README.md +%{_bindir}/oxipng +%{_mandir}/man1/oxipng.1* + +%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}/LICENSE +%doc %{crate_instdir}/CHANGELOG.md +%doc %{crate_instdir}/MANUAL.txt +%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}+binary-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+binary-devel %{_description} + +This package contains library source intended for building other packages which +use the "binary" feature of the "%{crate}" crate. + +%files -n %{name}+binary-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+filetime-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+filetime-devel %{_description} + +This package contains library source intended for building other packages which +use the "filetime" feature of the "%{crate}" crate. + +%files -n %{name}+filetime-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+freestanding-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+freestanding-devel %{_description} + +This package contains library source intended for building other packages which +use the "freestanding" feature of the "%{crate}" crate. + +%files -n %{name}+freestanding-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+parallel-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+parallel-devel %{_description} + +This package contains library source intended for building other packages which +use the "parallel" feature of the "%{crate}" crate. + +%files -n %{name}+parallel-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+sanity-checks-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+sanity-checks-devel %{_description} + +This package contains library source intended for building other packages which +use the "sanity-checks" feature of the "%{crate}" crate. + +%files -n %{name}+sanity-checks-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+zopfli-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+zopfli-devel %{_description} + +This package contains library source intended for building other packages which +use the "zopfli" feature of the "%{crate}" crate. + +%files -n %{name}+zopfli-devel +%ghost %{crate_instdir}/Cargo.toml + +%prep +%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 can’t respect upstream’s 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 + +%generate_buildrequires +%cargo_generate_buildrequires +pushd xtask >/dev/null +%cargo_generate_buildrequires +popd >/dev/null + +%build +%cargo_build +%{cargo_license_summary} +%{cargo_license} > LICENSE.dependencies +# Generate the man page +%{__cargo} run --manifest-path xtask/Cargo.toml -- mangen + +%install +%cargo_install +mansrc='target/xtask/mangen/manpages/oxipng.1' +mandest='%{buildroot}%{_mandir}/man1' +install -t "${mandest}" -D -p -m 0644 "${mansrc}" + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +* Fri Dec 20 2024 MSVSphere Packaging Team - 9.1.3-1 +- Rebuilt for MSVSphere 10 + +## START: Generated by rpmautospec +* Sat Nov 30 2024 Benjamin A. Beasley - 9.1.3-1 +- Update to 9.1.3 (close RHBZ#2329572) + +* Mon Jul 22 2024 Benjamin A. Beasley - 9.1.2-3 +- Re-enable features that require rust-image 0.25 + +* Sat Jul 20 2024 Fedora Release Engineering - 9.1.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Mon Jul 15 2024 Benjamin A. Beasley - 9.1.2-1 +- Update to 9.1.2 (close RHBZ#2297884) + +* Thu May 23 2024 Fabio Valentini - 9.1.1-3 +- Rebuild with Rust 1.78 to fix incomplete debuginfo and backtraces + +* Fri Apr 26 2024 Benjamin A. Beasley - 9.1.1-2 +- Hide the image and sanity-checks crate features + +* Wed Apr 24 2024 Benjamin A. Beasley - 9.1.1-1 +- Update to 9.1.1 (close RHBZ#2276572) +- Replace downstream man page with upstream generated man page + +* Sat Mar 16 2024 Benjamin A. Beasley - 9.0.0-4 +- Add a man page + +* Fri Mar 15 2024 Benjamin A. Beasley - 9.0.0-3 +- Use rust2rpm 26 features to simplify packaging + +* Sat Feb 17 2024 Benjamin A. Beasley - 9.0.0-1 +- Unretire and update to 9.0.0 (close RHBZ#2259760) + +* Mon May 31 2021 Rémi Lauzier - 4.0.3-1 +- Initial package + +## END: Generated by rpmautospec