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 <christoph@c8h4.io>
This commit is contained in:
Christoph Heiss 2023-03-29 20:46:20 +02:00
parent 95e1d46d8d
commit eda839d56f
No known key found for this signature in database
GPG key ID: 6817E9C75C0785D7
3 changed files with 129 additions and 2 deletions

View file

@ -0,0 +1,72 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Thomas Lamprecht <thomas@lamprecht.org>
Date: Tue, 29 Nov 2022 17:20:28 +0100
Subject: [PATCH] docs: drop all but client man pages
Signed-off-by: Thomas Lamprecht <thomas@lamprecht.org>
---
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),
]

View file

@ -0,0 +1,33 @@
From f8c26751c51c1618278689d8b3ce94496c579064 Mon Sep 17 00:00:00 2001
From: Christoph Heiss <christoph@c8h4.io>
Date: Fri, 10 Feb 2023 23:54:41 +0100
Subject: [PATCH] docs: Add target path fixup variable
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
---
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

View file

@ -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; {