From 2db760078f0951c86ea378afdb0807c4632e2196 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Wed, 18 Jan 2023 11:30:44 +0100 Subject: Add borgbackup-is-borgbackup2 package. Thanks to Scott Kitterman. --- debian/borgbackup-is-borgbackup2.dirs | 2 ++ debian/control | 14 +++++++++++++- debian/rules | 9 ++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 debian/borgbackup-is-borgbackup2.dirs diff --git a/debian/borgbackup-is-borgbackup2.dirs b/debian/borgbackup-is-borgbackup2.dirs new file mode 100644 index 00000000..98d15831 --- /dev/null +++ b/debian/borgbackup-is-borgbackup2.dirs @@ -0,0 +1,2 @@ +usr/bin +usr/share/man/man1 diff --git a/debian/control b/debian/control index afc92b21..01fd680c 100644 --- a/debian/control +++ b/debian/control @@ -65,12 +65,24 @@ Description: deduplicating and compressing backup program (version 2.x) Please note that the server and the client should be on the same version of borgbackup. Using different versions of borgbackup on client and server might result in 'incompatible API version' error - messages and a non-working backup. + messages and a non-working backup. Borg 2.x can only read from Borg 1.x + repositories. . While there is no direct operations mode for pull-type backups, you can configure the backup target in append-only mode, preventing the backup source from deleting or altering previous backups. +Package: borgbackup-is-borgbackup2 +Architecture: any +Depends: ${misc:Depends}, borgbackup2 (= ${binary:Version}) +Conflicts: borgbackup +Description: deduplicating and compressing backup program (unversioned symlink) + This package makes the borg command refer to version 2.x of borgbackup. + If you prefer version 1.x, please install borgbackup instead. + . + Refer to the package descriptions of borgbackup and borgbackup2 for more + information about what borg is. + Package: borgbackup2-doc Architecture: all Multi-Arch: foreign diff --git a/debian/rules b/debian/rules index 0491ea39..dbbad4e1 100755 --- a/debian/rules +++ b/debian/rules @@ -9,6 +9,7 @@ VERSION_SUFFIX=2 MODULE_DIR=/usr/lib/borgbackup$(VERSION_SUFFIX) PACKAGE=borgbackup$(VERSION_SUFFIX) +SYMLINK_PACKAGE=borgbackup-is-borgbackup$(VERSION_SUFFIX) # Full hardening for the cython build. export DEB_BUILD_MAINT_OPTIONS=hardening=+all @@ -70,15 +71,21 @@ execute_after_dh_install-arch: ifneq (,$(VERSION_SUFFIX)) set -e; for f in debian/$(PACKAGE)/usr/bin/*; do \ mv "$$f" "$${f}$(VERSION_SUFFIX)"; \ + ln -s "$${f##*/}$(VERSION_SUFFIX)" "debian/$(SYMLINK_PACKAGE)$${f#debian/$(PACKAGE)}"; \ done mv 'debian/$(PACKAGE)/usr/share/bash-completion/completions/borg' 'debian/$(PACKAGE)/usr/share/bash-completion/completions/borg$(VERSION_SUFFIX)' execute_after_dh_installman-arch: set -e; for f in debian/$(PACKAGE)/usr/share/man/man1/*.1; do \ - mv "$$f" "$$(echo "$$f" | sed 's,^\(.*/[a-z]*\),&$(VERSION_SUFFIX),')"; \ + v=$$(echo "$$f" | sed 's,^\(.*/[a-z]*\),&$(VERSION_SUFFIX),'); \ + mv "$$f" "$$v"; \ + ln -s "$${v##*/}.gz" "debian/$(SYMLINK_PACKAGE)$${f#debian/$(PACKAGE)}.gz"; \ done endif +override_dh_installdocs-arch: + dh_installdocs --link-doc=borgbackup2 + # Do not compress .ico file (affects html documentation) override_dh_compress: dh_compress -X.ico -Xfonts -- cgit v1.2.3