From 9db64e360a7e76b96bdcf46015e64cd7f9f4cdfa Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Thu, 11 Jan 2024 02:16:33 +0300 Subject: [PATCH] import rust-libz-sys-1.1.14-1.el9 --- .gitignore | 2 +- .rust-libz-sys.metadata | 2 +- ...use-pkg-config-to-link-with-system-z.patch | 40 ++++++++++++------- SOURCES/libz-sys-fix-metadata.diff | 4 +- SOURCES/rust2rpm.conf | 5 --- SOURCES/rust2rpm.toml | 4 ++ SPECS/rust-libz-sys.spec | 13 +++--- 7 files changed, 41 insertions(+), 29 deletions(-) delete mode 100644 SOURCES/rust2rpm.conf create mode 100644 SOURCES/rust2rpm.toml diff --git a/.gitignore b/.gitignore index 6b5897c..f6fbd50 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/libz-sys-1.1.12.crate +SOURCES/libz-sys-1.1.14.crate diff --git a/.rust-libz-sys.metadata b/.rust-libz-sys.metadata index 5e76454..7e21958 100644 --- a/.rust-libz-sys.metadata +++ b/.rust-libz-sys.metadata @@ -1 +1 @@ -cbd461352b53bf636246166891a87769bd1e0030 SOURCES/libz-sys-1.1.12.crate +4f696df4c5b2aead79afd94480c246dcf11d67cd SOURCES/libz-sys-1.1.14.crate diff --git a/SOURCES/0001-unconditionally-use-pkg-config-to-link-with-system-z.patch b/SOURCES/0001-unconditionally-use-pkg-config-to-link-with-system-z.patch index 9afbea6..c0b92f3 100644 --- a/SOURCES/0001-unconditionally-use-pkg-config-to-link-with-system-z.patch +++ b/SOURCES/0001-unconditionally-use-pkg-config-to-link-with-system-z.patch @@ -1,19 +1,19 @@ -From 1d8cd791f014ff2a3e043730eaaaf3b7c5be114f Mon Sep 17 00:00:00 2001 +From 7d6c389b4f3330696e737110bbb9f7c38101da55 Mon Sep 17 00:00:00 2001 From: Fabio Valentini -Date: Sat, 29 Jul 2023 16:48:39 +0200 +Date: Wed, 10 Jan 2024 17:12:19 +0100 Subject: [PATCH] unconditionally use pkg-config to link with system zlib --- - build.rs | 188 ++------------------------------------------------- + build.rs | 197 ++------------------------------------------------- build_zng.rs | 60 ---------------- - 2 files changed, 5 insertions(+), 243 deletions(-) + 2 files changed, 4 insertions(+), 253 deletions(-) delete mode 100644 build_zng.rs diff --git a/build.rs b/build.rs -index 51ebe6b..8d1acf7 100644 +index 1368a12..8d1acf7 100644 --- a/build.rs +++ b/build.rs -@@ -1,187 +1,9 @@ +@@ -1,198 +1,9 @@ -use std::env; -use std::fs; -use std::path::PathBuf; @@ -111,7 +111,7 @@ index 51ebe6b..8d1acf7 100644 - let lib = dst.join("lib"); - - cfg.warnings(false).out_dir(&lib).include("src/zlib"); -- + - cfg.file("src/zlib/adler32.c") - .file("src/zlib/compress.c") - .file("src/zlib/crc32.c") @@ -153,11 +153,26 @@ index 51ebe6b..8d1acf7 100644 - fs::copy("src/zlib/zconf.h", dst.join("include/zconf.h")).unwrap(); - - fs::create_dir_all(lib.join("pkgconfig")).unwrap(); +- let zlib_h = fs::read_to_string(dst.join("include/zlib.h")).unwrap(); +- let version = zlib_h +- .lines() +- .find(|l| l.contains("ZLIB_VERSION")) +- .unwrap() +- .split("\"") +- .nth(1) ++ pkg_config::Config::new() ++ .cargo_metadata(true) ++ .print_system_libs(false) ++ .probe("zlib") + .unwrap(); - fs::write( - lib.join("pkgconfig/zlib.pc"), - fs::read_to_string("src/zlib/zlib.pc.in") - .unwrap() -- .replace("@prefix@", dst.to_str().unwrap()), +- .replace("@prefix@", dst.to_str().unwrap()) +- .replace("@includedir@", "${prefix}/include") +- .replace("@libdir@", "${prefix}/lib") +- .replace("@VERSION@", version), - ) - .unwrap(); - @@ -198,13 +213,8 @@ index 51ebe6b..8d1acf7 100644 - return true; - } - } - +- - false -+ pkg_config::Config::new() -+ .cargo_metadata(true) -+ .print_system_libs(false) -+ .probe("zlib") -+ .unwrap(); } diff --git a/build_zng.rs b/build_zng.rs deleted file mode 100644 @@ -273,5 +283,5 @@ index 2557625..0000000 - build_zlib_ng(&target, false); -} -- -2.41.0 +2.43.0 diff --git a/SOURCES/libz-sys-fix-metadata.diff b/SOURCES/libz-sys-fix-metadata.diff index 6baba85..644269f 100644 --- a/SOURCES/libz-sys-fix-metadata.diff +++ b/SOURCES/libz-sys-fix-metadata.diff @@ -1,5 +1,5 @@ ---- libz-sys-1.1.12/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ libz-sys-1.1.12/Cargo.toml 2023-07-29T14:43:10.223812+00:00 +--- libz-sys-1.1.14/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ libz-sys-1.1.14/Cargo.toml 2024-01-10T16:05:38.163257+00:00 @@ -47,25 +47,12 @@ [build-dependencies.cc] version = "1.0.18" diff --git a/SOURCES/rust2rpm.conf b/SOURCES/rust2rpm.conf deleted file mode 100644 index c2ea5c0..0000000 --- a/SOURCES/rust2rpm.conf +++ /dev/null @@ -1,5 +0,0 @@ -[DEFAULT] -buildrequires = - pkgconfig(zlib) -lib.requires = - pkgconfig(zlib) diff --git a/SOURCES/rust2rpm.toml b/SOURCES/rust2rpm.toml new file mode 100644 index 0000000..2704a72 --- /dev/null +++ b/SOURCES/rust2rpm.toml @@ -0,0 +1,4 @@ +[requires] +build = ["pkgconfig(zlib)"] +lib = ["pkgconfig(zlib)"] + diff --git a/SPECS/rust-libz-sys.spec b/SPECS/rust-libz-sys.spec index 9e436ab..819b6d5 100644 --- a/SPECS/rust-libz-sys.spec +++ b/SPECS/rust-libz-sys.spec @@ -8,14 +8,14 @@ }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec -# Generated by rust2rpm 24 +# Generated by rust2rpm 25 %bcond_without check %global debug_package %{nil} %global crate libz-sys Name: rust-libz-sys -Version: 1.1.12 +Version: 1.1.14 Release: %autorelease Summary: Low-level bindings to the system libz library (also known as zlib) @@ -29,7 +29,7 @@ Patch: libz-sys-fix-metadata.diff # * unconditionally use pkg-config to link with system libz Patch: 0001-unconditionally-use-pkg-config-to-link-with-system-z.patch -BuildRequires: rust-packaging >= 21 +BuildRequires: cargo-rpm-macros >= 24 %global _description %{expand: Low-level bindings to the system libz library (also known as zlib).} @@ -89,11 +89,11 @@ use the "stock-zlib" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 +%cargo_prep # remove bundled zlib and zlib-ng sources rm -r src/zlib/ rm -r src/zlib-ng/ -%cargo_prep %generate_buildrequires %cargo_generate_buildrequires @@ -111,6 +111,9 @@ echo 'pkgconfig(zlib)' %endif %changelog +* Wed Jan 10 2024 Fabio Valentini - 1.1.14-1 +- Update to version 1.1.14; Fixes RHBZ#2257247 + * Mon Nov 20 2023 Arkady L. Shane - 1.1.12-1 - Rebuilt for MSVSphere 9.2