add command line option for client only compilation (fixes #30)

This commit is contained in:
Wolfgang
2023-04-07 21:29:17 +00:00
parent 56aa265033
commit 75b9fddaf2
3 changed files with 288 additions and 8 deletions

View File

@@ -19,6 +19,8 @@ source ~/.cargo/env
### Start build script
```
./build.sh
or
./build.sh client (build only proxmox-backup-client package)
```
The compilation can take several hours.<br />

View File

@@ -114,11 +114,18 @@ PACKAGES_BUILD="${BASE}/packages_build"
PATCHES="${BASE}/patches"
SOURCES="${BASE}/sources"
PACKAGE_ARCH=$(dpkg-architecture -q DEB_BUILD_ARCH)
BUILD_PACKAGE="server"
DEB_BUILD_OPTIONS=""
DEB_BUILD_PROFILES=""
while [ "$#" -ge 1 ]
do
case "$1" in
client)
BUILD_PACKAGE="client"
DEB_BUILD_PROFILES="${DEB_BUILD_PROFILES} nodoc"
DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS} nocheck"
;;
nocheck)
DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS} nocheck"
;;
@@ -129,7 +136,7 @@ do
esac
shift
done
export DEB_BUILD_OPTIONS
export DEB_BUILD_OPTIONS DEB_BUILD_PROFILES
if [ ! -d "${PATCHES}" ]; then
echo "Directory ${PATCHES} is missing! Have you cloned the repository?"
@@ -178,7 +185,7 @@ PROMXOX_FUSE_GIT="8d57fb64f044ea3dcfdef77ed5f1888efdab0708" # 0.1.4
PROXMOX_GIT="32e7d3ccdfd2702dcceea312a6caee7b1565030a"
PROXMOX_OPENID_GIT="ecf59cbb74278ea0e9710466508158ed6a6828c4" # 0.9.9-1
PXAR_GIT="29cbeed3e1b52f5eef455cdfa8b5e93f4e3e88f5" # 0.10.2-1
if [ ! -e "${PACKAGES}/proxmox-backup-server_${PROXMOX_BACKUP_VER}_${PACKAGE_ARCH}.deb" ]; then
if [ ! -e "${PACKAGES}/proxmox-backup-${BUILD_PACKAGE}_${PROXMOX_BACKUP_VER}_${PACKAGE_ARCH}.deb" ]; then
git_clone_or_fetch https://git.proxmox.com/git/proxmox.git
git_clean_and_checkout ${PROXMOX_GIT} proxmox
git_clone_or_fetch https://git.proxmox.com/git/proxmox-fuse.git
@@ -197,6 +204,8 @@ if [ ! -e "${PACKAGES}/proxmox-backup-server_${PROXMOX_BACKUP_VER}_${PACKAGE_ARC
git_clone_or_fetch https://git.proxmox.com/git/proxmox-backup.git
git_clean_and_checkout ${PROXMOX_BACKUP_GIT} proxmox-backup
patch -p1 -d proxmox-backup/ < "${PATCHES}/proxmox-backup-build.patch"
[ "${BUILD_PACKAGE}" = "client" ] && \
patch -p1 -d proxmox-backup/ < "${PATCHES}/proxmox-backup-client.patch"
[ "${PACKAGE_ARCH}" = "arm64" ] && \
patch -p1 -d proxmox-backup/ < "${PATCHES}/proxmox-backup-arm.patch"
cd proxmox-backup/
@@ -206,11 +215,16 @@ if [ ! -e "${PACKAGES}/proxmox-backup-server_${PROXMOX_BACKUP_VER}_${PACKAGE_ARC
export DEB_VERSION_UPSTREAM=$(dpkg-parsechangelog -SVersion | cut -d- -f1)
dpkg-buildpackage -b -us -uc
cd ..
if [ "${BUILD_PACKAGE}" = "client" ]; then
cp -a proxmox-backup-client{,-dbgsym}_${PROXMOX_BACKUP_VER}_${PACKAGE_ARCH}.deb \
"${PACKAGES}"
else
cp -a proxmox-backup-client{,-dbgsym}_${PROXMOX_BACKUP_VER}_${PACKAGE_ARCH}.deb \
proxmox-backup-docs_${PROXMOX_BACKUP_VER}_all.deb \
proxmox-backup-file-restore{,-dbgsym}_${PROXMOX_BACKUP_VER}_${PACKAGE_ARCH}.deb \
proxmox-backup-server{,-dbgsym}_${PROXMOX_BACKUP_VER}_${PACKAGE_ARCH}.deb \
"${PACKAGES}"
fi
else
echo "proxmox-backup up-to-date"
fi

View File

@@ -0,0 +1,264 @@
diff --git a/Makefile b/Makefile
index 83ab59bd..4a1e499b 100644
--- a/Makefile
+++ b/Makefile
@@ -4,32 +4,21 @@ include defines.mk
PACKAGE := proxmox-backup
ARCH := $(DEB_BUILD_ARCH)
-SUBDIRS := etc www docs
+SUBDIRS := docs
# Binaries usable by users
USR_BIN := \
proxmox-backup-client \
- proxmox-file-restore \
- pxar \
- proxmox-tape \
- pmtx \
- pmt
+ pxar
# Binaries usable by admins
-USR_SBIN := \
- proxmox-backup-manager \
- proxmox-backup-debug \
+USR_SBIN :=
# Binaries for services:
-SERVICE_BIN := \
- proxmox-backup-api \
- proxmox-backup-banner \
- proxmox-backup-proxy \
- proxmox-daily-update
+SERVICE_BIN :=
# Single file restore daemon
-RESTORE_BIN := \
- proxmox-restore-daemon
+RESTORE_BIN :=
SUBCRATES != cargo metadata --format-version=1 | jq -r .workspace_members'[]' | awk '{ print $$1 }' | grep -v '^proxmox-backup$$' | tr '\n' ' '
@@ -59,8 +48,7 @@ RESTORE_DEB=proxmox-backup-file-restore_${DEB_VERSION}_${ARCH}.deb
RESTORE_DBG_DEB=proxmox-backup-file-restore-dbgsym_${DEB_VERSION}_${ARCH}.deb
DOC_DEB=${PACKAGE}-docs_${DEB_VERSION}_all.deb
-DEBS=${SERVER_DEB} ${SERVER_DBG_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB} \
- ${RESTORE_DEB} ${RESTORE_DBG_DEB} ${DEBUG_DEB} ${DEBUG_DBG_DEB}
+DEBS=${CLIENT_DEB} ${CLIENT_DBG_DEB}
DSC = rust-${PACKAGE}_${DEB_VERSION}.dsc
@@ -77,7 +65,7 @@ $(SUBDIRS):
test:
#cargo test test_broadcast_future
#cargo test $(CARGO_BUILD_ARGS)
- $(CARGO) test $(tests) $(CARGO_BUILD_ARGS)
+ $(CARGO) test $(tests) $(CARGO_BUILD_ARGS)
doc:
$(CARGO) doc --workspace --no-deps $(CARGO_BUILD_ARGS)
@@ -152,30 +140,11 @@ cargo-build:
$(COMPILED_BINS) $(COMPILEDIR)/dump-catalog-shell-cli $(COMPILEDIR)/docgen: .do-cargo-build
.do-cargo-build:
$(CARGO) build $(CARGO_BUILD_ARGS) \
- --package proxmox-backup-banner \
- --bin proxmox-backup-banner \
--package proxmox-backup-client \
--bin proxmox-backup-client \
--bin dump-catalog-shell-cli \
- --bin proxmox-backup-debug \
- --package proxmox-file-restore \
- --bin proxmox-file-restore \
--package pxar-bin \
- --bin pxar \
- --package pbs-tape \
- --bin pmt \
- --bin pmtx \
- --package proxmox-restore-daemon \
- --bin proxmox-restore-daemon \
- --package proxmox-backup \
- --bin docgen \
- --bin proxmox-backup-api \
- --bin proxmox-backup-manager \
- --bin proxmox-backup-proxy \
- --bin proxmox-daily-update \
- --bin proxmox-file-restore \
- --bin proxmox-tape \
- --bin sg-tape-cmd
+ --bin pxar
touch "$@"
@@ -184,10 +153,11 @@ lint:
cargo clippy -- -A clippy::all -D clippy::correctness
install: $(COMPILED_BINS)
+ @echo "$(DESTDIR)"
install -dm755 $(DESTDIR)$(BINDIR)
install -dm755 $(DESTDIR)$(ZSH_COMPL_DEST)
$(foreach i,$(USR_BIN), \
- install -m755 $(COMPILEDIR)/$(i) $(DESTDIR)$(BINDIR)/ ; \
+ install -m755 $(COMPILEDIR)/$(i) $(DESTDIR)/$(BINDIR)/ ; \
install -m644 zsh-completions/_$(i) $(DESTDIR)$(ZSH_COMPL_DEST)/ ;)
install -dm755 $(DESTDIR)$(SBINDIR)
$(foreach i,$(USR_SBIN), \
@@ -198,10 +168,10 @@ install: $(COMPILED_BINS)
$(foreach i,$(RESTORE_BIN), \
install -m755 $(COMPILEDIR)/$(i) $(DESTDIR)$(LIBEXECDIR)/proxmox-backup/file-restore/ ;)
# install sg-tape-cmd as setuid binary
- install -m4755 -o root -g root $(COMPILEDIR)/sg-tape-cmd $(DESTDIR)$(LIBEXECDIR)/proxmox-backup/sg-tape-cmd
+ #install -m4755 -o root -g root $(COMPILEDIR)/sg-tape-cmd $(DESTDIR)$(LIBEXECDIR)/proxmox-backup/sg-tape-cmd
$(foreach i,$(SERVICE_BIN), \
install -m755 $(COMPILEDIR)/$(i) $(DESTDIR)$(LIBEXECDIR)/proxmox-backup/ ;)
- $(MAKE) -C www install
+ #$(MAKE) -C www install
$(MAKE) -C docs install
.PHONY: upload
diff --git a/debian/control b/debian/control
index 286922b5..5ddeac2c 100644
--- a/debian/control
+++ b/debian/control
@@ -160,34 +160,6 @@ Vcs-Browser: https://git.proxmox.com/?p=proxmox-backup.git;a=summary
Homepage: https://www.proxmox.com
Rules-Requires-Root: binary-targets
-Package: proxmox-backup-server
-Architecture: any
-Depends: fonts-font-awesome,
- libjs-extjs (>= 7~),
- libjs-qrcodejs (>= 1.20201119),
- libproxmox-acme-plugins,
- libsgutils2-2,
- libzstd1 (>= 1.3.8),
- lvm2,
- openssh-server,
- pbs-i18n,
- postfix | mail-transport-agent,
- proxmox-backup-docs,
- proxmox-mini-journalreader,
- proxmox-widget-toolkit (>= 3.5.2),
- pve-xtermjs (>= 4.7.0-1),
- sg3-utils,
- smartmontools,
- ${misc:Depends},
- ${shlibs:Depends},
-Recommends: zfsutils-linux,
- ifupdown2,
- proxmox-offline-mirror-helper,
- proxmox-mail-forward,
-Description: Proxmox Backup Server daemon with tools and GUI
- This package contains the Proxmox Backup Server daemons and related
- tools. This includes a web-based graphical user interface.
-
Package: proxmox-backup-client
Architecture: any
Depends: qrencode,
@@ -196,26 +168,3 @@ Depends: qrencode,
Description: Proxmox Backup Client tools
This package contains the Proxmox Backup client, which provides a
simple command line tool to create and restore backups.
-
-Package: proxmox-backup-docs
-Build-Profiles: <!nodoc>
-Section: doc
-Depends: fonts-font-awesome,
- libjs-extjs,
- libjs-mathjax,
- ${misc:Depends},
-Architecture: all
-Description: Proxmox Backup Documentation
- This package contains the Proxmox Backup Documentation files.
-
-Package: proxmox-backup-file-restore
-Architecture: any
-Depends: ${misc:Depends},
- ${shlibs:Depends},
-Recommends: pve-qemu-kvm (>= 5.0.0-9),
- proxmox-backup-restore-image,
-Breaks: proxmox-backup-restore-image (<< 0.3.1)
-Description: Proxmox Backup single file restore tools for pxar and block device backups
- This package contains the Proxmox Backup single file restore client for
- restoring individual files and folders from both host/container and VM/block
- device backups. It includes a block device restore driver using QEMU.
diff --git a/debian/rules b/debian/rules
index cf94692e..1309ea1f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -36,12 +36,13 @@ override_dh_missing:
override_dh_auto_install:
dh_auto_install -- \
PROXY_USER=backup \
- LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
+ LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
+ DESTDIR=$(PWD)/debian/tmp
-override_dh_installsystemd:
- dh_installsystemd -pproxmox-backup-server proxmox-backup-daily-update.timer
+#override_dh_installsystemd:
+# dh_installsystemd -pproxmox-backup-server proxmox-backup-daily-update.timer
# note: we start/try-reload-restart services manually in postinst
- dh_installsystemd --no-start --no-restart-after-upgrade
+# dh_installsystemd --no-start --no-restart-after-upgrade
override_dh_fixperms:
dh_fixperms --exclude sg-tape-cmd
diff --git a/docs/Makefile b/docs/Makefile
index b06badff..32b51556 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -1,48 +1,15 @@
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
+ pxar/synopsis.rst
MAN1_PAGES := \
pxar.1 \
- pmtx.1 \
- pmt.1 \
- proxmox-tape.1 \
- proxmox-backup-proxy.1 \
- proxmox-backup-client.1 \
- proxmox-backup-manager.1 \
- proxmox-file-restore.1 \
- proxmox-backup-debug.1
-
-MAN5_PAGES := \
- media-pool.cfg.5 \
- tape.cfg.5 \
- tape-job.cfg.5 \
- acl.cfg.5 \
- user.cfg.5 \
- remote.cfg.5 \
- sync.cfg.5 \
- verification.cfg.5 \
- datastore.cfg.5 \
- domains.cfg.5
+ proxmox-backup-client.1
+
+MAN5_PAGES :=
PRUNE_SIMULATOR_FILES := \
prune-simulator/index.html \