From eda839d56f4e65090cb1a0b14055feb30ce99019 Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Wed, 29 Mar 2023 20:46:20 +0200 Subject: proxmox-backup-client: install man-pages and shell completions This requires two additional patches; one taken from the AUR package and one to fix up the path to the built executable for the man-pages build step. Signed-off-by: Christoph Heiss --- .../0002-docs-drop-all-but-client-man-pages.patch | 72 ++++++++++++++++++++++ .../0003-docs-Add-target-path-fixup-variable.patch | 33 ++++++++++ .../backup/proxmox-backup-client/default.nix | 26 +++++++- 3 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 pkgs/applications/backup/proxmox-backup-client/0002-docs-drop-all-but-client-man-pages.patch create mode 100644 pkgs/applications/backup/proxmox-backup-client/0003-docs-Add-target-path-fixup-variable.patch (limited to 'pkgs/applications/backup/proxmox-backup-client') diff --git a/pkgs/applications/backup/proxmox-backup-client/0002-docs-drop-all-but-client-man-pages.patch b/pkgs/applications/backup/proxmox-backup-client/0002-docs-drop-all-but-client-man-pages.patch new file mode 100644 index 0000000000000..da83e14988cdd --- /dev/null +++ b/pkgs/applications/backup/proxmox-backup-client/0002-docs-drop-all-but-client-man-pages.patch @@ -0,0 +1,72 @@ +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 | 16 ---------------- + docs/conf.py | 19 ------------------- + 2 files changed, 35 deletions(-) + +diff --git a/docs/Makefile b/docs/Makefile +index b06badff..94130228 100644 +--- a/docs/Makefile ++++ b/docs/Makefile +@@ -1,25 +1,9 @@ + include ../defines.mk + + GENERATED_SYNOPSIS := \ +- proxmox-tape/synopsis.rst \ + proxmox-backup-client/synopsis.rst \ + proxmox-backup-client/catalog-shell-synopsis.rst \ +- proxmox-backup-manager/synopsis.rst \ +- proxmox-backup-debug/synopsis.rst \ +- proxmox-file-restore/synopsis.rst \ + pxar/synopsis.rst \ +- pmtx/synopsis.rst \ +- pmt/synopsis.rst \ +- config/media-pool/config.rst \ +- config/tape/config.rst \ +- config/tape-job/config.rst \ +- config/user/config.rst \ +- config/remote/config.rst \ +- config/sync/config.rst \ +- config/verification/config.rst \ +- config/acl/roles.rst \ +- config/datastore/config.rst \ +- config/domains/config.rst + + MAN1_PAGES := \ + pxar.1 \ +diff --git a/docs/conf.py b/docs/conf.py +index 8944926e..deeb63bf 100644 +--- a/docs/conf.py ++++ b/docs/conf.py +@@ -93,26 +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), +- # 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/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), + ] + + diff --git a/pkgs/applications/backup/proxmox-backup-client/0003-docs-Add-target-path-fixup-variable.patch b/pkgs/applications/backup/proxmox-backup-client/0003-docs-Add-target-path-fixup-variable.patch new file mode 100644 index 0000000000000..1999461ade5a2 --- /dev/null +++ b/pkgs/applications/backup/proxmox-backup-client/0003-docs-Add-target-path-fixup-variable.patch @@ -0,0 +1,33 @@ +From f8c26751c51c1618278689d8b3ce94496c579064 Mon Sep 17 00:00:00 2001 +From: Christoph Heiss +Date: Fri, 10 Feb 2023 23:54:41 +0100 +Subject: [PATCH] docs: Add target path fixup variable + +Signed-off-by: Christoph Heiss +--- + docs/Makefile | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/docs/Makefile b/docs/Makefile +index 94130228..f4766a64 100644 +--- a/docs/Makefile ++++ b/docs/Makefile +@@ -67,12 +67,13 @@ API_VIEWER_FILES := \ + SPHINXOPTS = + SPHINXBUILD = sphinx-build + BUILDDIR = output ++RUSTC_TARGET ?= + + ifeq ($(BUILD_MODE), release) +-COMPILEDIR := ../target/release ++COMPILEDIR := ../target/$(RUSTC_TARGET)/release + SPHINXOPTS += -t release + else +-COMPILEDIR := ../target/debug ++COMPILEDIR := ../target/$(RUSTC_TARGET)/debug + SPHINXOPTS += -t devbuild + endif + +-- +2.40.0 + diff --git a/pkgs/applications/backup/proxmox-backup-client/default.nix b/pkgs/applications/backup/proxmox-backup-client/default.nix index 661e2294f5ada..48d4c626eafaa 100644 --- a/pkgs/applications/backup/proxmox-backup-client/default.nix +++ b/pkgs/applications/backup/proxmox-backup-client/default.nix @@ -1,6 +1,6 @@ { lib, fetchgit, rustPlatform, pkg-config, openssl, fuse3, libuuid, acl, - libxcrypt, git, + libxcrypt, git, installShellFiles, sphinx, stdenv, }: rustPlatform.buildRustPackage rec { @@ -38,6 +38,8 @@ rustPlatform.buildRustPackage rec { cargoPatches = [ ./0001-re-route-dependencies-not-available-on-crates.io-to-.patch + ./0002-docs-drop-all-but-client-man-pages.patch + ./0003-docs-Add-target-path-fixup-variable.patch ]; postPatch = '' @@ -45,6 +47,26 @@ rustPlatform.buildRustPackage rec { rm .cargo/config ''; + postBuild = '' + make -C docs \ + DEB_VERSION=${version} DEB_VERSION_UPSTREAM=${version} \ + RUSTC_TARGET=${stdenv.targetPlatform.config} \ + BUILD_MODE=release \ + proxmox-backup-client.1 pxar.1 + ''; + + postInstall = '' + installManPage docs/output/man/proxmox-backup-client.1 + installShellCompletion --cmd proxmox-backup-client \ + --bash debian/proxmox-backup-client.bc \ + --zsh zsh-completions/_proxmox-backup-client + + installManPage docs/output/man/pxar.1 + installShellCompletion --cmd pxar \ + --bash debian/pxar.bc \ + --zsh zsh-completions/_pxar + ''; + cargoLock = { lockFileContents = builtins.readFile ./Cargo.lock; }; @@ -59,7 +81,7 @@ rustPlatform.buildRustPackage rec { doCheck = false; - nativeBuildInputs = [ git pkg-config rustPlatform.bindgenHook ]; + nativeBuildInputs = [ git pkg-config rustPlatform.bindgenHook installShellFiles sphinx ]; buildInputs = [ openssl fuse3 libuuid acl libxcrypt ]; meta = with lib; { -- cgit 1.4.1