File proxmox-backup.spec of Package proxmox-backup
#
# spec file for package proxmox-backup-client
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define git_branch devel
%define git_version 3.4.0+git251.g47eda6ec
%define git_date 20250805
%define rust_target release
Name: proxmox-backup
Version: %{git_version}
Release: 0
Summary: Proxmox Backup Server
License: AGPL-3.0-only
Group: Productivity/Archiving/Backup
URL: https://www.proxmox.com/en/products/proxmox-backup-server/get-started
Source0: proxmox-backup.tar.gz
Source1: proxmox.tar.gz
Source2: pathpatterns.tar.gz
Source3: pxar.tar.gz
Source4: proxmox-fuse.tar.gz
#Source5: proxmox-biome.tar.gz
Source6: vendor.tar.gz
Patch0: localpath.patch
Patch1: vendor.patch
Patch2: skip_apt.patch
Patch3: pkgconfig.patch
Patch4: fuse.patch
Patch5: fix-tests.patch
Patch6: fix-make.patch
Patch7: groupbackup.patch
BuildRequires: curl
BuildRequires: ca-certificates
BuildRequires: fdupes
BuildRequires: sudo
BuildRequires: git
BuildRequires: jq
BuildRequires: python3-Sphinx
BuildRequires: pkg-config
BuildRequires: pkgconfig(libsystemd)
BuildRequires: systemd-rpm-macros
BuildRequires: libgudev-1_0-devel
BuildRequires: libsgutils-devel
BuildRequires: libopenssl-devel
BuildRequires: clang-devel
BuildRequires: pam-devel
BuildRequires: zlib-devel
BuildRequires: obs-service-obs_scm
BuildRequires: obs-service-recompress
BuildRequires: obs-service-set_version
BuildRequires: libuuid-devel
BuildRequires: systemd-rpm-macros
BuildRequires: proxmox-biome
BuildRequires: pam-devel
BuildRequires: proxmox-widget-toolkit
# Pull in the latest rust/cargo toolchain
BuildRequires: cargo
BuildRequires: rust-packaging
BuildRequires: libacl-devel
BuildRequires: libsgutils-devel
BuildRequires: fuse3-devel
BuildRequires: python3-pkgconfig
BuildRequires: rsync
BuildRequires: fdupes
BuildRequires: proxmox-systemuser
# In most situations, you will likely only target tier1 arches for user facing components.
ExclusiveArch: %{rust_tier1_arches}
%description
Base package will not be built since it has no files section
%package server
Summary: Server application for Proxmox Backup Server
Requires: proxmox-extjs
Requires: proxmox-qrcodejs
Requires: proxmox-widget-toolkit
Requires: proxmox-xtermjs
Requires: proxmox-termproxy
Requires: proxmox-backup-docs >= %{version}
Requires: fontawesome-fonts-web
Requires: proxmox-systemuser
%description server
Proxmox Backup Server is an enterprise backup solution, for backing up and restoring VMs, containers, and physical hosts. By supporting incremental, fully deduplicated backups, Proxmox Backup Server significantly reduces network load and saves valuable storage space. With strong encryption and methods of ensuring data integrity, you can feel safe when backing up data, even to targets which are not fully trusted.
%package client
Summary: Client application for Proxmox Backup Server
%description client
Client application for Proxmox Backup Server. Proxmox Backup Server is an enterprise backup solution, for backing up and restoring VMs, containers, and physical hosts. By supporting incremental, fully deduplicated backups, Proxmox Backup Server significantly reduces network load and saves valuable storage space. With strong encryption and methods of ensuring data integrity, you can feel safe when backing up data, even to targets which are not fully trusted.
%package docs
Summary: Docs for Proxmox Backup Server and Client
%description docs
Doc Files for Proxmox Backup Server and Client. The Doc Files are linked by Proxmox Backup Proxy Webfrontend. Proxmox Backup Server is an enterprise backup solution, for backing up and restoring VMs, containers, and physical hosts. By supporting incremental, fully deduplicated backups, Proxmox Backup Server significantly reduces network load and saves valuable storage space. With strong encryption and methods of ensuring data integrity, you can feel safe when backing up data, even to targets which are not fully trusted.
%prep
%setup -n proxmox-backup
%setup -n proxmox-backup -D -T -a 1
%setup -n proxmox-backup -D -T -a 2
%setup -n proxmox-backup -D -T -a 3
%setup -n proxmox-backup -D -T -a 4
%setup -n proxmox-backup -D -T -a 6
%patch0 -p0
%patch1 -p0
%patch2 -p0
%patch3 -p0
%patch4 -p0
%patch5 -p0
%patch6 -p0
%patch7 -p0
# Remove exec bits to prevent an issue in fedora shebang checking. Uncomment only if required.
# find vendor -type f -name \*.rs -exec chmod -x '{}' \;
%define cargo_registry $(pwd)/vendor
# % global cargo_args --keep-going
%build
export BUILD_MODE=release
export LIBEXECDIR=%{_libexecdir}
export PROXY_USER=backup
export PROXY_GROUP=groupbackup
export CARGO_NET_OFFLINE=true
cargo build --release --workspace --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 pbs2to3 --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
# Create Docs
cargo doc --release --workspace
touch etc/pbs-enterprise.list
make all -C etc
make all -C www
make all -C docs
make html -C docs
make all -C templates
%install
# create dir for backups
mkdir -p %{buildroot}/var/backups
# create default proxmox-backup config dir (/etc/proxmox-backup)
mkdir -p %{buildroot}%{_sysconfdir}
install -D -d -m 0700 %{buildroot}%{_sysconfdir}/%{name}
# using cargo_install (only supports bindir)
# % {cargo_install}
# manual process, this can place binaries in other directories like sbindin
# server components
install -D -d -m 0755 %{buildroot}%{_bindir}
install -m 0755 %{_builddir}/%{name}/target/%{rust_target}/pmt %{buildroot}%{_bindir}
install -m 0755 %{_builddir}/%{name}/target/%{rust_target}/pmtx %{buildroot}%{_bindir}
install -m 0755 %{_builddir}/%{name}/target/%{rust_target}/proxmox-tape %{buildroot}%{_bindir}
install -D -d -m 0755 %{buildroot}%{_sbindir}
install -m 0755 %{_builddir}/%{name}/target/%{rust_target}/pbs2to3 %{buildroot}%{_sbindir}
install -m 0755 %{_builddir}/%{name}/target/%{rust_target}/proxmox-backup-debug %{buildroot}%{_sbindir}
install -m 0755 %{_builddir}/%{name}/target/%{rust_target}/proxmox-backup-manager %{buildroot}%{_sbindir}
install -D -d -m 0755 %{buildroot}/%{_libexecdir}
install -D -d -m 0755 %{buildroot}/%{_libexecdir}%{name}
install -D -m 0755 -t %{buildroot}/%{_libexecdir}/%{name} %{_builddir}/%{name}/target/%{rust_target}/proxmox-backup-api
install -D -m 0755 -t %{buildroot}/%{_libexecdir}/%{name} %{_builddir}/%{name}/target/%{rust_target}/proxmox-backup-banner
install -D -m 0755 -t %{buildroot}/%{_libexecdir}/%{name} %{_builddir}/%{name}/target/%{rust_target}/proxmox-backup-proxy
install -D -m 0755 -t %{buildroot}/%{_libexecdir}/%{name} %{_builddir}/%{name}/target/%{rust_target}/proxmox-daily-update
install -D -m 0755 -t %{buildroot}/%{_libexecdir}/%{name} %{_builddir}/%{name}/target/%{rust_target}/sg-tape-cmd
ln -sf %{_sbindir}/service %{buildroot}/%{_sbindir}/rcproxmox-backup-banner
ln -sf %{_sbindir}/service %{buildroot}/%{_sbindir}/rcproxmox-backup-daily-update
ln -sf %{_sbindir}/service %{buildroot}/%{_sbindir}/rcproxmox-backup-proxy
ln -sf %{_sbindir}/service %{buildroot}/%{_sbindir}/rcproxmox-backup
ln -sf %{_sbindir}/service %{buildroot}/%{_sbindir}/rcremovable-device-attach@
ln -sf %{_sbindir}/service %{buildroot}/%{_sbindir}/rcpbs-network-config-commit
# zsh completions
for f in %{_builddir}/%{name}/zsh-completions/* ; do
install -D -m 0644 -t %{buildroot}/usr/share/zsh/vendor-completions $f;
done
# other components
install -m 0755 %{_builddir}/%{name}/target/%{rust_target}/docgen %{buildroot}%{_bindir}
install -m 0755 %{_builddir}/%{name}/target/%{rust_target}/dump-catalog-shell-cli %{buildroot}%{_bindir}
install -m 0755 %{_builddir}/%{name}/target/%{rust_target}/proxmox-file-restore %{buildroot}%{_bindir}
install -m 0755 %{_builddir}/%{name}/target/%{rust_target}/proxmox-restore-daemon %{buildroot}%{_bindir}
# systemd service files
for f in %{_builddir}/%{name}/etc/*.service ; do
install -D -m 0644 -t %{buildroot}%{_unitdir} $f;
done
# templates
for f in %{_builddir}/%{name}/templates/default/* ; do
install -D -m 0644 -t %{buildroot}/usr/share/%{name}/templates/default $f;
done
# docs
for f in %{_builddir}/%{name}/docs/output/man/*.1 ; do
install -D -m 0644 -t %{buildroot}/%{_mandir}/man1 $f;
done
for f in %{_builddir}/%{name}/docs/output/man/*.5 ; do
install -D -m 0644 -t %{buildroot}/%{_mandir}/man5 $f;
done
install -D -d -m 0755 %{buildroot}/usr/share/doc/
install -D -d -m 0755 %{buildroot}/usr/share/doc/%{name}/
install -D -d -m 0755 %{buildroot}/usr/share/doc/%{name}/html/
cp -r %{_builddir}/%{name}/docs/output/html/* %{buildroot}/usr/share/doc/%{name}/html/
%fdupes -s %{buildroot}/usr/share/doc/%{name}
# www
for f in %{_builddir}/%{name}/www/images/* ; do
install -D -m 0644 -t %{buildroot}/usr/share/javascript/%{name}/images/ $f;
done
install -D -m 0644 -t %{buildroot}/usr/share/javascript/%{name} %{_builddir}/%{name}/www/index.hbs
install -D -m 0644 -t %{buildroot}/usr/share/javascript/%{name}/css %{_builddir}/%{name}/www/css/ext6-pbs.css
install -D -m 0644 -t %{buildroot}/usr/share/javascript/%{name}/js %{_builddir}/%{name}/www/js/proxmox-backup-gui.js
# symbolic link für pam auth
install -D -d -m 0755 %{buildroot}/%{_sysconfdir}
install -D -d -m 0700 %{buildroot}/%{_sysconfdir}/pam.d
ln -s /etc/pam.d/common-auth %{buildroot}/%{_sysconfdir}/pam.d/proxmox-backup-auth
# client components
install -m 0755 %{_builddir}/%{name}/target/%{rust_target}/proxmox-backup-client %{buildroot}%{_bindir}
install -m 0755 %{_builddir}/%{name}/target/%{rust_target}/pxar %{buildroot}%{_bindir}
%pre server
%service_add_pre proxmox-backup-banner.service proxmox-backup-daily-update.service proxmox-backup-proxy.service proxmox-backup.service removable-device-attach@.service pbs-network-config-commit.service
%post server
%service_add_post proxmox-backup-banner.service proxmox-backup-daily-update.service proxmox-backup-proxy.service proxmox-backup.service removable-device-attach@.service pbs-network-config-commit.service
%preun server
%service_del_preun proxmox-backup-banner.service proxmox-backup-daily-update.service proxmox-backup-proxy.service proxmox-backup.service removable-device-attach@.service pbs-network-config-commit.service
%postun server
%service_del_postun proxmox-backup-banner.service proxmox-backup-daily-update.service proxmox-backup-proxy.service proxmox-backup.service removable-device-attach@.service pbs-network-config-commit.service
# % check
#cargo test --workspace
%files server
# % dir /var/backups
%dir %%attr(0700, backup, groupbackup) %{_sysconfdir}/%{name}
%{_bindir}/pmt
%{_bindir}/pmtx
%{_bindir}/proxmox-tape
%{_sbindir}/pbs2to3
%{_sbindir}/proxmox-backup-debug
%{_sbindir}/proxmox-backup-manager
%dir %{_libexecdir}/%{name}
%{_libexecdir}/%{name}/proxmox-backup-api
%{_libexecdir}/%{name}/proxmox-backup-banner
%{_libexecdir}/%{name}/proxmox-backup-proxy
%{_libexecdir}/%{name}/proxmox-daily-update
%{_libexecdir}/%{name}/sg-tape-cmd
%dir /usr/share/zsh
%dir /usr/share/zsh/vendor-completions
/usr/share/zsh/vendor-completions/_pmt
/usr/share/zsh/vendor-completions/_pmtx
/usr/share/zsh/vendor-completions/_proxmox-backup-debug
/usr/share/zsh/vendor-completions/_proxmox-backup-manager
/usr/share/zsh/vendor-completions/_proxmox-file-restore
/usr/share/zsh/vendor-completions/_proxmox-tape
%dir /usr/share/%{name}
%dir /usr/share/%{name}/templates
%dir /usr/share/%{name}/templates/default
/usr/share/%{name}/templates/default/*
%{_unitdir}/*.service
%{_sbindir}/rcproxmox-backup-banner
%{_sbindir}/rcproxmox-backup-daily-update
%{_sbindir}/rcproxmox-backup-proxy
%{_sbindir}/rcproxmox-backup
%{_sbindir}/rcremovable-device-attach@
%{_sbindir}/rcpbs-network-config-commit
%dir /usr/share/javascript
%dir /usr/share/javascript/%{name}
/usr/share/javascript/%{name}/index.hbs
%dir /usr/share/javascript/%{name}/images
/usr/share/javascript/%{name}/images/*
%dir /usr/share/javascript/%{name}/css
/usr/share/javascript/%{name}/css/ext6-pbs.css
%dir /usr/share/javascript/%{name}/js
/usr/share/javascript/%{name}/js/proxmox-backup-gui.js
# other components
%{_bindir}/dump-catalog-shell-cli
%{_bindir}/proxmox-file-restore
%{_bindir}/proxmox-restore-daemon
# man files
%{_mandir}/man1/pbs3to4.1.gz
%{_mandir}/man1/pmt.1.gz
%{_mandir}/man1/pmtx.1.gz
%{_mandir}/man1/proxmox-backup.1.gz
%{_mandir}/man1/proxmox-backup-debug.1.gz
%{_mandir}/man1/proxmox-backup-manager.1.gz
%{_mandir}/man1/proxmox-backup-proxy.1.gz
%{_mandir}/man1/proxmox-file-restore.1.gz
%{_mandir}/man1/proxmox-tape.1.gz
%{_mandir}/man5/acl.cfg.5.gz
%{_mandir}/man5/datastore.cfg.5.gz
%{_mandir}/man5/domains.cfg.5.gz
%{_mandir}/man5/media-pool.cfg.5.gz
%{_mandir}/man5/notifications.cfg.5.gz
%{_mandir}/man5/notifications-priv.cfg.5.gz
%{_mandir}/man5/proxmox-backup.node.cfg.5.gz
%{_mandir}/man5/prune.cfg.5.gz
%{_mandir}/man5/remote.cfg.5.gz
%{_mandir}/man5/sync.cfg.5.gz
%{_mandir}/man5/tape.cfg.5.gz
%{_mandir}/man5/tape-job.cfg.5.gz
%{_mandir}/man5/user.cfg.5.gz
%{_mandir}/man5/verification.cfg.5.gz
# pam config symbolic link
/etc/pam.d/proxmox-backup-auth
%files client
%{_bindir}/proxmox-backup-client
%{_bindir}/pxar
%{_mandir}/man1/proxmox-backup-client.1.gz
%{_mandir}/man1/pxar.1.gz
%dir /usr/share/zsh
%dir /usr/share/zsh/vendor-completions
/usr/share/zsh/vendor-completions/_proxmox-backup-client
/usr/share/zsh/vendor-completions/_pxar
%files docs
%{_bindir}/docgen
%dir /usr/share/doc/%{name}
/usr/share/doc/%{name}/*
%changelog