From 65f1880a742a73dcb6b5c5f5ac0f44c6ffc78750 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Sun, 18 May 2025 22:07:29 +0200 Subject: [PATCH] - script and patches required to create working source tarball --- ...ncies-not-available-on-crates.io-to-.patch | 205 ++++++++++++++++++ ...2-docs-drop-all-but-client-man-pages.patch | 79 +++++++ .../0003-cargo-downgrade-http-to-0.2.12.patch | 26 +++ ...argo-use-local-patched-h2-dependency.patch | 25 +++ make_tarball/fuse-pkgconfig.patch | 12 + make_tarball/h2-revert-legacy.patch | 169 +++++++++++++++ make_tarball/make_tarball.sh | 109 ++++++++++ 7 files changed, 625 insertions(+) create mode 100644 make_tarball/0001-re-route-dependencies-not-available-on-crates.io-to-.patch create mode 100644 make_tarball/0002-docs-drop-all-but-client-man-pages.patch create mode 100644 make_tarball/0003-cargo-downgrade-http-to-0.2.12.patch create mode 100644 make_tarball/0004-cargo-use-local-patched-h2-dependency.patch create mode 100644 make_tarball/fuse-pkgconfig.patch create mode 100644 make_tarball/h2-revert-legacy.patch create mode 100755 make_tarball/make_tarball.sh diff --git a/make_tarball/0001-re-route-dependencies-not-available-on-crates.io-to-.patch b/make_tarball/0001-re-route-dependencies-not-available-on-crates.io-to-.patch new file mode 100644 index 0000000..09666b6 --- /dev/null +++ b/make_tarball/0001-re-route-dependencies-not-available-on-crates.io-to-.patch @@ -0,0 +1,205 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Thomas Lamprecht +Date: Wed, 18 May 2022 08:41:14 +0200 +Subject: [PATCH] re-route dependencies not available on crates.io to git repos + +Signed-off-by: Thomas Lamprecht +--- + Cargo.toml | 146 ++++++++++++------------------------------------------------- + 1 file changed, 27 insertions(+), 119 deletions(-) + +diff --git a/Cargo.toml b/Cargo.toml +index d14f320a..27fec0ef 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -41,8 +41,6 @@ members = [ + + "proxmox-backup-banner", + "proxmox-backup-client", +- "proxmox-file-restore", +- "proxmox-restore-daemon", + + "pxar-bin", + ] +@@ -111,7 +109,6 @@ pbs-tools = { path = "pbs-tools" } + # regular crates + anyhow = "1.0" + async-trait = "0.1.56" +-apt-pkg-native = "0.3.2" + base64 = "0.13" + bitflags = "2.4" + bytes = "1.0" +@@ -125,7 +122,6 @@ flate2 = "1.0" + foreign-types = "0.3" + futures = "0.3" + h2 = { version = "0.4", features = [ "legacy", "stream" ] } +-handlebars = "3.0" + hex = "0.4.3" + hickory-resolver = { version = "0.24.1", default-features = false, features = [ "system-config", "tokio-runtime" ] } + hyper = { version = "0.14", features = [ "backports", "deprecated", "full" ] } +@@ -160,138 +156,50 @@ xdg = "2.2" + zstd = { version = "0.12", features = [ "bindgen" ] } + zstd-safe = "6.0" + +-[dependencies] +-anyhow.workspace = true +-async-trait.workspace = true +-base64.workspace = true +-bytes.workspace = true +-cidr.workspace = true +-const_format.workspace = true +-crc32fast.workspace = true +-crossbeam-channel.workspace = true +-endian_trait.workspace = true +-futures.workspace = true +-h2.workspace = true +-hex.workspace = true +-hyper.workspace = true +-libc.workspace = true +-log.workspace = true +-nix.workspace = true +-nom.workspace = true +-num-traits.workspace = true +-once_cell.workspace = true +-openssl.workspace = true +-percent-encoding.workspace = true +-regex.workspace = true +-rustyline.workspace = true +-serde.workspace = true +-serde_json.workspace = true +-syslog.workspace = true +-termcolor.workspace = true +-thiserror.workspace = true +-tokio = { workspace = true, features = [ "fs", "io-util", "io-std", "macros", "net", "parking_lot", "process", "rt", "rt-multi-thread", "signal", "time" ] } +-tokio-openssl.workspace = true +-tokio-stream.workspace = true +-tokio-util = { workspace = true, features = [ "codec" ] } +-tracing.workspace = true +-udev.workspace = true +-url.workspace = true +-walkdir.workspace = true +-zstd.workspace = true +- + #valgrind_request = { git = "https://github.com/edef1c/libvalgrind_request", version = "1.1.0", optional = true } + +-# proxmox workspace +-proxmox-apt.workspace = true +-proxmox-apt-api-types.workspace = true +-proxmox-async.workspace = true +-proxmox-auth-api = { workspace = true, features = [ "api", "pam-authenticator" ] } +-proxmox-compression.workspace = true +-proxmox-config-digest.workspace = true +-proxmox-daemon.workspace = true +-proxmox-http = { workspace = true, features = [ "client-trait", "proxmox-async", "rate-limited-stream" ] } # pbs-client doesn't use these +-proxmox-human-byte.workspace = true +-proxmox-io.workspace = true +-proxmox-lang.workspace = true +-proxmox-log.workspace = true +-proxmox-ldap.workspace = true +-proxmox-metrics.workspace = true +-proxmox-notify = { workspace = true, features = [ "pbs-context" ] } +-proxmox-openid.workspace = true +-proxmox-rest-server = { workspace = true, features = [ "rate-limited-stream" ] } +-proxmox-router = { workspace = true, features = [ "cli", "server"] } +-proxmox-schema = { workspace = true, features = [ "api-macro" ] } +-proxmox-section-config.workspace = true +-proxmox-serde = { workspace = true, features = [ "serde_json" ] } +-proxmox-shared-cache.workspace = true +-proxmox-shared-memory.workspace = true +-proxmox-sortable-macro.workspace = true +-proxmox-subscription.workspace = true +-proxmox-sys = { workspace = true, features = [ "timer" ] } +-proxmox-systemd.workspace = true +-proxmox-tfa.workspace = true +-proxmox-time.workspace = true +-proxmox-uuid.workspace = true +-proxmox-worker-task.workspace = true +-pbs-api-types.workspace = true +- +-# in their respective repo +-proxmox-acme.workspace = true +-pxar.workspace = true +- +-# proxmox-backup workspace/internal crates +-pbs-buildcfg.workspace = true +-pbs-client.workspace = true +-pbs-config.workspace = true +-pbs-datastore.workspace = true +-pbs-key-config.workspace = true +-pbs-tape.workspace = true +-pbs-tools.workspace = true +-proxmox-rrd.workspace = true +-proxmox-rrd-api-types.workspace = true +- + # Local path overrides + # NOTE: You must run `cargo update` after changing this for it to take effect! + [patch.crates-io] +-#pbs-api-types = { path = "../proxmox/pbs-api-types" } ++pbs-api-types = { path = "../proxmox/pbs-api-types" } + #proxmox-acme = { path = "../proxmox/proxmox-acme" } + #proxmox-apt = { path = "../proxmox/proxmox-apt" } +-#proxmox-apt-api-types = { path = "../proxmox/proxmox-apt-api-types" } +-#proxmox-async = { path = "../proxmox/proxmox-async" } +-#proxmox-auth-api = { path = "../proxmox/proxmox-auth-api" } +-#proxmox-borrow = { path = "../proxmox/proxmox-borrow" } +-#proxmox-compression = { path = "../proxmox/proxmox-compression" } +-#proxmox-config-digest = { path = "../proxmox/proxmox-config-digest" } ++proxmox-apt-api-types = { path = "../proxmox/proxmox-apt-api-types" } ++proxmox-async = { path = "../proxmox/proxmox-async" } ++proxmox-auth-api = { path = "../proxmox/proxmox-auth-api" } ++proxmox-borrow = { path = "../proxmox/proxmox-borrow" } ++proxmox-compression = { path = "../proxmox/proxmox-compression" } ++proxmox-config-digest = { path = "../proxmox/proxmox-config-digest" } + #proxmox-daemon = { path = "../proxmox/proxmox-daemon" } +-#proxmox-fuse = { path = "../proxmox-fuse" } +-#proxmox-http = { path = "../proxmox/proxmox-http" } +-#proxmox-human-byte = { path = "../proxmox/proxmox-human-byte" } +-#proxmox-io = { path = "../proxmox/proxmox-io" } +-#proxmox-lang = { path = "../proxmox/proxmox-lang" } +-#proxmox-log = { path = "../proxmox/proxmox-log" } ++proxmox-fuse = { path = "../proxmox-fuse" } ++proxmox-http = { path = "../proxmox/proxmox-http" } ++proxmox-human-byte = { path = "../proxmox/proxmox-human-byte" } ++proxmox-io = { path = "../proxmox/proxmox-io" } ++proxmox-lang = { path = "../proxmox/proxmox-lang" } ++proxmox-log = { path = "../proxmox/proxmox-log" } + #proxmox-ldap = { path = "../proxmox/proxmox-ldap" } + #proxmox-metrics = { path = "../proxmox/proxmox-metrics" } +-#proxmox-notify = { path = "../proxmox/proxmox-notify" } ++proxmox-notify = { path = "../proxmox/proxmox-notify" } + #proxmox-openid = { path = "../proxmox/proxmox-openid" } + #proxmox-rest-server = { path = "../proxmox/proxmox-rest-server" } +-#proxmox-router = { path = "../proxmox/proxmox-router" } ++proxmox-router = { path = "../proxmox/proxmox-router" } + #proxmox-rrd = { path = "../proxmox/proxmox-rrd" } + #proxmox-rrd-api-types = { path = "../proxmox/proxmox-rrd-api-types" } +-#proxmox-schema = { path = "../proxmox/proxmox-schema" } +-#proxmox-section-config = { path = "../proxmox/proxmox-section-config" } +-#proxmox-serde = { path = "../proxmox/proxmox-serde" } +-#proxmox-shared-memory = { path = "../proxmox/proxmox-shared-memory" } +-#proxmox-sortable-macro = { path = "../proxmox/proxmox-sortable-macro" } ++proxmox-schema = { path = "../proxmox/proxmox-schema" } ++proxmox-section-config = { path = "../proxmox/proxmox-section-config" } ++proxmox-serde = { path = "../proxmox/proxmox-serde" } ++proxmox-shared-memory = { path = "../proxmox/proxmox-shared-memory" } ++proxmox-sortable-macro = { path = "../proxmox/proxmox-sortable-macro" } + #proxmox-subscription = { path = "../proxmox/proxmox-subscription" } +-#proxmox-sys = { path = "../proxmox/proxmox-sys" } +-#proxmox-systemd = { path = "../proxmox/proxmox-systemd" } ++proxmox-sys = { path = "../proxmox/proxmox-sys" } ++proxmox-systemd = { path = "../proxmox/proxmox-systemd" } + #proxmox-tfa = { path = "../proxmox/proxmox-tfa" } +-#proxmox-time = { path = "../proxmox/proxmox-time" } +-#proxmox-uuid = { path = "../proxmox/proxmox-uuid" } +-#proxmox-worker-task = { path = "../proxmox/proxmox-worker-task" } ++proxmox-time = { path = "../proxmox/proxmox-time" } ++proxmox-uuid = { path = "../proxmox/proxmox-uuid" } ++proxmox-worker-task = { path = "../proxmox/proxmox-worker-task" } + +-#pathpatterns = {path = "../pathpatterns" } +-#pxar = { path = "../pxar" } ++pathpatterns = {path = "../pathpatterns" } ++pxar = { path = "../pxar" } + + [features] + default = [] diff --git a/make_tarball/0002-docs-drop-all-but-client-man-pages.patch b/make_tarball/0002-docs-drop-all-but-client-man-pages.patch new file mode 100644 index 0000000..89d525f --- /dev/null +++ b/make_tarball/0002-docs-drop-all-but-client-man-pages.patch @@ -0,0 +1,79 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Thomas Lamprecht +Date: Tue, 29 Nov 2022 17:20:28 +0100 +Subject: [PATCH] docs: drop all but client man pages + +Signed-off-by: Thomas Lamprecht +--- + docs/Makefile | 19 ------------------- + docs/conf.py | 24 ------------------------ + 2 files changed, 43 deletions(-) + +diff --git a/docs/Makefile b/docs/Makefile +index c57cbbc2..9f56e7e0 100644 +--- a/docs/Makefile ++++ b/docs/Makefile +@@ -1,27 +1,8 @@ + include ../defines.mk + + GENERATED_SYNOPSIS := \ +- config/acl/roles.rst \ +- config/datastore/config.rst \ +- config/domains/config.rst \ +- config/media-pool/config.rst \ +- config/notifications-priv/config.rst \ +- config/notifications/config.rst \ +- config/remote/config.rst \ +- config/sync/config.rst \ +- config/tape-job/config.rst \ +- config/tape/config.rst \ +- config/user/config.rst \ +- config/verification/config.rst \ +- config/prune/config.rst \ +- pmt/synopsis.rst \ +- pmtx/synopsis.rst \ + proxmox-backup-client/catalog-shell-synopsis.rst \ + proxmox-backup-client/synopsis.rst \ +- proxmox-backup-debug/synopsis.rst \ +- proxmox-backup-manager/synopsis.rst \ +- proxmox-file-restore/synopsis.rst \ +- proxmox-tape/synopsis.rst \ + pxar/synopsis.rst \ + + MAN1_PAGES := \ +diff --git a/docs/conf.py b/docs/conf.py +index a7fa1079..345a0170 100644 +--- a/docs/conf.py ++++ b/docs/conf.py +@@ -93,31 +93,7 @@ rst_epilog += f"\n.. |pbs-copyright| replace:: Copyright (C) {copyright}" + man_pages = [ + # CLI + ('proxmox-backup-client/man1', 'proxmox-backup-client', 'Command line tool for Backup and Restore', [author], 1), +- ('proxmox-backup-manager/man1', 'proxmox-backup-manager', 'Command line tool to manage and configure the backup server.', [author], 1), +- ('proxmox-backup-debug/man1', 'proxmox-backup-debug', 'Debugging command line tool for Backup and Restore', [author], 1), +- ('proxmox-backup-proxy/man1', 'proxmox-backup-proxy', 'Proxmox Backup Public API Server', [author], 1), +- ('proxmox-backup/man1', 'proxmox-backup', 'Proxmox Backup Local API Server', [author], 1), +- ('proxmox-file-restore/man1', 'proxmox-file-restore', 'CLI tool for restoring files and directories from Proxmox Backup Server archives', [author], 1), +- ('proxmox-tape/man1', 'proxmox-tape', 'Proxmox Tape Backup CLI Tool', [author], 1), + ('pxar/man1', 'pxar', 'Proxmox File Archive CLI Tool', [author], 1), +- ('pmt/man1', 'pmt', 'Control Linux Tape Devices', [author], 1), +- ('pmtx/man1', 'pmtx', 'Control SCSI media changer devices (tape autoloaders)', [author], 1), +- ('pbs2to3/man1', 'pbs2to3', 'Proxmox Backup Server upgrade checker script for 2.4+ to current 3.x major upgrades', [author], 1), +- # configs +- ('config/acl/man5', 'acl.cfg', 'Access Control Configuration', [author], 5), +- ('config/datastore/man5', 'datastore.cfg', 'Datastore Configuration', [author], 5), +- ('config/domains/man5', 'domains.cfg', 'Realm Configuration', [author], 5), +- ('config/media-pool/man5', 'media-pool.cfg', 'Media Pool Configuration', [author], 5), +- ('config/node/man5', 'proxmox-backup.node.cfg', 'Proxmox Backup Server - Node Configuration', [author], 5), +- ('config/remote/man5', 'remote.cfg', 'Remote Server Configuration', [author], 5), +- ('config/sync/man5', 'sync.cfg', 'Synchronization Job Configuration', [author], 5), +- ('config/tape-job/man5', 'tape-job.cfg', 'Tape Job Configuration', [author], 5), +- ('config/tape/man5', 'tape.cfg', 'Tape Drive and Changer Configuration', [author], 5), +- ('config/user/man5', 'user.cfg', 'User Configuration', [author], 5), +- ('config/verification/man5', 'verification.cfg', 'Verification Job Configuration', [author], 5), +- ('config/prune/man5', 'prune.cfg', 'Prune Job Configuration', [author], 5), +- ('config/notifications/man5', 'notifications.cfg', 'Notification target/matcher configuration', [author], 5), +- ('config/notifications-priv/man5', 'notifications-priv.cfg', 'Notification target secrets', [author], 5), + ] + + diff --git a/make_tarball/0003-cargo-downgrade-http-to-0.2.12.patch b/make_tarball/0003-cargo-downgrade-http-to-0.2.12.patch new file mode 100644 index 0000000..ad7c90e --- /dev/null +++ b/make_tarball/0003-cargo-downgrade-http-to-0.2.12.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Thomas Lamprecht +Date: Sat, 30 Nov 2024 11:41:27 +0100 +Subject: [PATCH] cargo: downgrade http to 0.2.12 + +Signed-off-by: Thomas Lamprecht +--- + Cargo.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Cargo.toml b/Cargo.toml +index 34ca3d6..12fc1a8 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -45,7 +45,7 @@ futures-sink = { version = "0.3", default-features = false } + tokio-util = { version = "0.7.1", features = ["codec", "io"] } + tokio = { version = "1", features = ["io-util"] } + bytes = "1" +-http = "1" ++http = "0.2.12" + tracing = { version = "0.1.35", default-features = false, features = ["std"] } + fnv = "1.0.5" + slab = "0.4.2" +-- +2.47.1 + diff --git a/make_tarball/0004-cargo-use-local-patched-h2-dependency.patch b/make_tarball/0004-cargo-use-local-patched-h2-dependency.patch new file mode 100644 index 0000000..ae3ba45 --- /dev/null +++ b/make_tarball/0004-cargo-use-local-patched-h2-dependency.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Thomas Lamprecht +Date: Sat, 30 Nov 2024 11:56:16 +0100 +Subject: [PATCH] cargo: use local patched h2 dependency + +Signed-off-by: Thomas Lamprecht +--- + Cargo.toml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Cargo.toml b/Cargo.toml +index 27fec0ef..98a68309 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -161,6 +161,7 @@ zstd-safe = "6.0" + # Local path overrides + # NOTE: You must run `cargo update` after changing this for it to take effect! + [patch.crates-io] ++h2 = { path = "../h2" } + pbs-api-types = { path = "../proxmox/pbs-api-types" } + #proxmox-acme = { path = "../proxmox/proxmox-acme" } + #proxmox-apt = { path = "../proxmox/proxmox-apt" } +-- +2.47.1 + diff --git a/make_tarball/fuse-pkgconfig.patch b/make_tarball/fuse-pkgconfig.patch new file mode 100644 index 0000000..39b4fe9 --- /dev/null +++ b/make_tarball/fuse-pkgconfig.patch @@ -0,0 +1,12 @@ +diff -ur proxmox-fuse.orig/build.rs proxmox-fuse/build.rs +--- proxmox-fuse.orig/build.rs 2025-05-16 20:14:13.369212722 +0200 ++++ proxmox-fuse/build.rs 2025-05-16 23:18:27.008138265 +0200 +@@ -2,7 +2,7 @@ + use std::process::Command; + + fn main() { +- let ccflags = Command::new("pkgconf") ++ let ccflags = Command::new("pkg-config") + .arg("--cflags") + .arg("fuse3") + .output() diff --git a/make_tarball/h2-revert-legacy.patch b/make_tarball/h2-revert-legacy.patch new file mode 100644 index 0000000..210f7fe --- /dev/null +++ b/make_tarball/h2-revert-legacy.patch @@ -0,0 +1,169 @@ +diff -ur proxmox-backup.orig/Cargo.toml proxmox-backup/Cargo.toml +--- proxmox-backup.orig/Cargo.toml 2025-05-16 20:33:13.571733359 +0200 ++++ proxmox-backup/Cargo.toml 2025-05-16 21:00:04.535301120 +0200 +@@ -121,7 +121,7 @@ + flate2 = "1.0" + foreign-types = "0.3" + futures = "0.3" +-h2 = { version = "0.4", features = [ "legacy", "stream" ] } ++h2 = { version = "0.4", features = [ "stream" ] } + hex = "0.4.3" + hickory-resolver = { version = "0.24.1", default-features = false, features = [ "system-config", "tokio-runtime" ] } + hyper = { version = "0.14", features = [ "backports", "deprecated", "full" ] } +diff -ur proxmox-backup.orig/examples/h2client.rs proxmox-backup/examples/h2client.rs +--- proxmox-backup.orig/examples/h2client.rs 2025-05-16 20:33:09.987725464 +0200 ++++ proxmox-backup/examples/h2client.rs 2025-05-16 20:59:38.179242597 +0200 +@@ -10,7 +10,7 @@ + // Simple H2 client to test H2 download speed using h2server.rs + + struct Process { +- body: h2::legacy::RecvStream, ++ body: h2::RecvStream, + trailers: bool, + bytes: usize, + } +@@ -50,7 +50,7 @@ + } + + fn send_request( +- mut client: h2::legacy::client::SendRequest, ++ mut client: h2::client::SendRequest, + ) -> impl Future> { + println!("sending request"); + +@@ -78,7 +78,7 @@ + let conn = TcpStream::connect(std::net::SocketAddr::from(([127, 0, 0, 1], 8008))).await?; + conn.set_nodelay(true).unwrap(); + +- let (client, h2) = h2::legacy::client::Builder::new() ++ let (client, h2) = h2::client::Builder::new() + .initial_connection_window_size(1024 * 1024 * 1024) + .initial_window_size(1024 * 1024 * 1024) + .max_frame_size(4 * 1024 * 1024) +diff -ur proxmox-backup.orig/examples/h2s-client.rs proxmox-backup/examples/h2s-client.rs +--- proxmox-backup.orig/examples/h2s-client.rs 2025-05-16 20:33:09.987725464 +0200 ++++ proxmox-backup/examples/h2s-client.rs 2025-05-16 20:59:38.179242597 +0200 +@@ -10,7 +10,7 @@ + // Simple H2 client to test H2 download speed using h2s-server.rs + + struct Process { +- body: h2::legacy::RecvStream, ++ body: h2::RecvStream, + trailers: bool, + bytes: usize, + } +@@ -50,7 +50,7 @@ + } + + fn send_request( +- mut client: h2::legacy::client::SendRequest, ++ mut client: h2::client::SendRequest, + ) -> impl Future> { + println!("sending request"); + +@@ -94,7 +94,7 @@ + .await + .map_err(|err| format_err!("connect failed - {}", err))?; + +- let (client, h2) = h2::legacy::client::Builder::new() ++ let (client, h2) = h2::client::Builder::new() + .initial_connection_window_size(1024 * 1024 * 1024) + .initial_window_size(1024 * 1024 * 1024) + .max_frame_size(4 * 1024 * 1024) +diff -ur proxmox-backup.orig/pbs-client/src/backup_writer.rs proxmox-backup/pbs-client/src/backup_writer.rs +--- proxmox-backup.orig/pbs-client/src/backup_writer.rs 2025-05-16 20:33:09.987725464 +0200 ++++ proxmox-backup/pbs-client/src/backup_writer.rs 2025-05-16 20:59:38.179242597 +0200 +@@ -56,7 +56,7 @@ + } + + struct ChunkUploadResponse { +- future: h2::legacy::client::ResponseFuture, ++ future: h2::client::ResponseFuture, + size: usize, + } + +@@ -143,7 +143,7 @@ + param: Option, + content_type: &str, + data: Vec, +- ) -> Result { ++ ) -> Result { + let request = + H2Client::request_builder("localhost", method, path, param, Some(content_type)) + .unwrap(); +@@ -514,7 +514,7 @@ + } + + fn response_queue() -> ( +- mpsc::Sender, ++ mpsc::Sender, + oneshot::Receiver>, + ) { + let (verify_queue_tx, verify_queue_rx) = mpsc::channel(100); +@@ -537,7 +537,7 @@ + tokio::spawn( + ReceiverStream::new(verify_queue_rx) + .map(Ok::<_, Error>) +- .try_for_each(move |response: h2::legacy::client::ResponseFuture| { ++ .try_for_each(move |response: h2::client::ResponseFuture| { + response + .map_err(Error::from) + .and_then(H2Client::h2api_response) +diff -ur proxmox-backup.orig/pbs-client/src/http_client.rs proxmox-backup/pbs-client/src/http_client.rs +--- proxmox-backup.orig/pbs-client/src/http_client.rs 2025-05-16 20:33:09.987725464 +0200 ++++ proxmox-backup/pbs-client/src/http_client.rs 2025-05-16 20:59:38.179242597 +0200 +@@ -863,7 +863,7 @@ + + let max_window_size = (1 << 31) - 2; + +- let (h2, connection) = h2::legacy::client::Builder::new() ++ let (h2, connection) = h2::client::Builder::new() + .initial_connection_window_size(max_window_size) + .initial_window_size(max_window_size) + .max_frame_size(4 * 1024 * 1024) +@@ -1008,11 +1008,11 @@ + + #[derive(Clone)] + pub struct H2Client { +- h2: h2::legacy::client::SendRequest, ++ h2: h2::client::SendRequest, + } + + impl H2Client { +- pub fn new(h2: h2::legacy::client::SendRequest) -> Self { ++ pub fn new(h2: h2::client::SendRequest) -> Self { + Self { h2 } + } + +@@ -1092,7 +1092,7 @@ + &self, + request: Request<()>, + data: Option, +- ) -> impl Future> { ++ ) -> impl Future> { + self.h2 + .clone() + .ready() +@@ -1109,9 +1109,7 @@ + }) + } + +- pub async fn h2api_response( +- response: Response, +- ) -> Result { ++ pub async fn h2api_response(response: Response) -> Result { + let status = response.status(); + + let (_head, mut body) = response.into_parts(); +diff -ur proxmox-backup.orig/pbs-client/src/pipe_to_stream.rs proxmox-backup/pbs-client/src/pipe_to_stream.rs +--- proxmox-backup.orig/pbs-client/src/pipe_to_stream.rs 2025-05-16 20:33:09.987725464 +0200 ++++ proxmox-backup/pbs-client/src/pipe_to_stream.rs 2025-05-16 20:59:38.179242597 +0200 +@@ -8,7 +8,7 @@ + use anyhow::{format_err, Error}; + use bytes::Bytes; + use futures::{ready, Future}; +-use h2::legacy::SendStream; ++use h2::SendStream; + + pub struct PipeToSendStream { + body_tx: SendStream, diff --git a/make_tarball/make_tarball.sh b/make_tarball/make_tarball.sh new file mode 100755 index 0000000..69b4ae9 --- /dev/null +++ b/make_tarball/make_tarball.sh @@ -0,0 +1,109 @@ +#!/bin/bash + +# Name and version of package +package="proxmox-backup-client-3.4.1" + +# Source URLs +source_repos=( + "git://git.proxmox.com/git/proxmox-backup.git#commit=115942267df1a5a55f10a5bdd8477202e7942158" + "git://git.proxmox.com/git/proxmox.git#commit=f92f773aed3d21c791755a8737a0cce76664b588" + "git://git.proxmox.com/git/proxmox-fuse.git" + "git://git.proxmox.com/git/pathpatterns.git" + "git://git.proxmox.com/git/pxar.git" + "https://github.com/hyperium/h2.git#tag=v0.4.10" +) + +# Function for applying patches to downloaded sources +apply_patch() { + pwd + repo=$1 + patch=$2 + pushd "${repo}" + echo "Applying patch to ${repo}: ${patch}" + patch --forward --strip=1 --input="../../${patch}" + popd +} + +# Create empty package directory +rm -rf "${package}" 2>/dev/null +mkdir "${package}" + +# Enter package directory +pushd "${package}" + +# Download required sources +for repo in "${source_repos[@]}"; do + repo_url=${repo%#*} + repo_dir=$(basename "$repo_url" .git) + repo_ref="" + if [[ "${repo}" == *"#"* ]]; then + repo_ref=${repo##*#} + fi + git clone "${repo_url}" "${repo_dir}" + if [ -n "${repo_ref}" ]; then + pushd "${repo_dir}" + git -c advice.detachedHead=false checkout "${repo_ref#*=}" + popd + fi +done + +# Apply required patches +apply_patch h2 0003-cargo-downgrade-http-to-0.2.12.patch +apply_patch proxmox-backup 0001-re-route-dependencies-not-available-on-crates.io-to-.patch +apply_patch proxmox-backup 0002-docs-drop-all-but-client-man-pages.patch +apply_patch proxmox-backup 0004-cargo-use-local-patched-h2-dependency.patch +apply_patch proxmox-backup h2-revert-legacy.patch +apply_patch proxmox-fuse fuse-pkgconfig.patch + +# Enter proxmox-backup directory +pushd proxmox-backup + +# Download all required crates +cargo vendor --versioned-dirs > .cargo/config.toml + +# Add build optimizations for smaller binaries +cat >> .cargo/config.toml << EOF + +[profile.release] +opt-level = "s" +lto = true +codegen-units = 1 +panic = "abort" +EOF + +# Move bash completion files +mkdir bash-completions +mv debian/*.bc bash-completions/ + +# Move elf-strip-unused-dependencies.sh +mv debian/scripts/elf-strip-unused-dependencies.sh ../ + +# Leave proxmox-backup directory +popd + +# Remove unused proxmox-* crates +rm -rf proxmox/proxmox-{acme,apt,daemon,ldap,metrics,openid,rest-server,rrd,rrd-api-types,subscription,tfa} + +# Remove systemd dependency from proxmox-systemd +rm -f proxmox/proxmox-systemd/src/{journal,notify,sys}.rs +sed -i -r -e '/mod\s+(journal|notify|sys)/d' proxmox/proxmox-systemd/src/lib.rs + +# Remove other not needed stuff +rm -rf \ + h2/{.git,.github,examples,fixtures} \ + pathpatterns/{.git,debian} \ + proxmox/{.git,debian} \ + proxmox/proxmox-*/debian \ + proxmox-backup/{.git,debian,examples,www} \ + proxmox-fuse/{.git,debian,examples} \ + pxar/{.git,debian,examples} + +# Leave package directory +popd + +# Compress package sources +echo "Compressing sources to ${package}.tar.xz" +tar Jcf "${package}.tar.xz" "${package}" + +# Remove package directory +rm -rf "${package}" -- 2.49.0