From: Ralph Ronnquist Date: Sun, 9 Jun 2024 08:27:13 +0000 (+1000) Subject: packaging X-Git-Tag: v0.1.0-1~1 X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=aaada0d223d251ac2238b1111124b13688f64c3d;p=rrq%2Ftimeliner.git packaging --- diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..41ca4c1 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +timeliner (0.1.0-1) experimental; urgency=low + + * Initial release + + -- Ralph Ronnquist Fri, 07 Jun 2024 21:22:17 +1000 diff --git a/debian/config b/debian/config new file mode 100755 index 0000000..b9288d7 --- /dev/null +++ b/debian/config @@ -0,0 +1,42 @@ +#!/bin/sh + +case "$1" in + configure|reconfigure) # happy with these + : + ;; + *) # not happy + exit 1 + ;; +esac + +. /usr/share/debconf/confmodule + +db_settitle timeliner/title + +db_input medium timeliner/logfile || true +db_input medium timeliner/opmode || true +db_go || true + +db_get timeliner/opmode +case "$RET" in + disabled) + ;; + local) + db_input medium timeliner/sources || true + db_input medium timeliner/local/target || true + db_go || true + ;; + remote) + db_input medium timeliner/sources || true + db_input medium timeliner/remote/host || true + db_input medium timeliner/remote/target || true + db_go || true + ;; + mixed) + db_input medium timeliner/sources || true + db_input medium timeliner/local/target || true + db_input medium timeliner/remote/host || true + db_input medium timeliner/remote/target || true + db_go || true + ;; +esac diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..191d16d --- /dev/null +++ b/debian/control @@ -0,0 +1,15 @@ +Source: timeliner +Maintainer: Ralph Ronnquist +Section: admin +Priority: optional +Standards-Version: 4.6.2 +Origin: Devuan +Build-Depends: debhelper-compat (= 13), po-debconf +Vcs-Browser: https://git.devuan.org/devuan/timeliner +Vcs-git: https://git.devuan.org/devuan/timeliner.git + +Package: timeliner +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends}, rsync +Description: Simple shell scripting to create backup timeline with hard links. + A cron driven system for backup of directories into local or remote timeline. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..a5a05e1 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,20 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ + +Files: * +Copyright: 2024 Ralph Ronnquist +License: GPL-2+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this package; if not, see <https://www.gnu.org/licenses/>. +Comment: + On Debian systems, the full text of the GNU General Public License + version 2 can be found in the file '/usr/share/common-licenses/GPL-2'. diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000..1878159 --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,5 @@ +[DEFAULT] +debian-branch=debian +upstream-branch=master +upstream-tag=v%(version)s +compression-level=9 diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..d8cf1bb --- /dev/null +++ b/debian/install @@ -0,0 +1,4 @@ +timeliner /usr/bin +timeliner-backup /usr/bin +timeliner-cron /etc/cron.hourly +timeliner.8.gz /usr/share/man/man8 diff --git a/debian/lintian-overrides b/debian/lintian-overrides new file mode 100644 index 0000000..a825944 --- /dev/null +++ b/debian/lintian-overrides @@ -0,0 +1,2 @@ +timeliner: initial-upload-closes-no-bugs +timeliner: missing-systemd-timer-for-cron-script diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in new file mode 100644 index 0000000..cef83a3 --- /dev/null +++ b/debian/po/POTFILES.in @@ -0,0 +1 @@ +[type: gettext/rfc822deb] templates diff --git a/debian/po/templates.pot b/debian/po/templates.pot new file mode 100644 index 0000000..63d39c7 --- /dev/null +++ b/debian/po/templates.pot @@ -0,0 +1,182 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the timeliner package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: timeliner\n" +"Report-Msgid-Bugs-To: timeliner@packages.debian.org\n" +"POT-Creation-Date: 2024-06-09 16:28+1000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: title +#. Description +#: ../templates:1001 +msgid "timeliner-cron setup" +msgstr "" + +#. Type: string +#. Default +#: ../templates:2001 +msgid "/var/log/timeliner.log" +msgstr "" + +#. Type: string +#. Description +#: ../templates:2002 +msgid "Set timeliner logfile:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:2002 +msgid "" +"This file will be used both as log for timeliner-cron activations, and then " +"also as mutex lock file for it." +msgstr "" + +#. Type: select +#. Choices +#: ../templates:3001 +msgid "disabled, local, remote, mixed" +msgstr "" + +#. Type: select +#. Description +#: ../templates:3002 +msgid "Operation mode for timeliner-cron:" +msgstr "" + +#. Type: select +#. Description +#: ../templates:3002 +msgid "" +"There are four possble operation modes for timeliner-cron. You may choose " +"\"disabled\" now to defer the timeliner-cron setup and later run\n" +" dpkg-reconfigure timeliner\n" +"to configure it." +msgstr "" + +#. Type: select +#. Description +#: ../templates:3002 +msgid "" +" disabled = don't keep a timeline\n" +" local = keep a local timeline only\n" +" remote = keep a remote timeline only\n" +" mixed = keep a remote timeline with a local rolling window" +msgstr "" + +#. Type: string +#. Default +#: ../templates:4001 +msgid "/boot /etc /home /opt /root" +msgstr "" + +#. Type: string +#. Description +#: ../templates:4002 +msgid "Declare source directories to be backed up:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:4002 +msgid "" +"Give one or more space separated absolute pathnames to nominate directory " +"trees to be in the timeline." +msgstr "" + +#. Type: string +#. Default +#. Type: string +#. Default +#: ../templates:5001 ../templates:6001 +msgid "/backup" +msgstr "" + +#. Type: string +#. Description +#: ../templates:5002 +msgid "Set for the local timeline base pathname:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:5002 +msgid "This is an absolute pathname for the local timeline base directory." +msgstr "" + +#. Type: string +#. Description +#: ../templates:5002 +msgid "" +"The local timeline is made by _hourly rsync_ of the given sources into a " +"_current_ directory, combined with _daily hardlink_ copies into a series of " +"sub directories with name format yyyy-mm-dd. Thus, the base directory must " +"be in a filesystem capable of hard links." +msgstr "" + +#. Type: string +#. Description +#: ../templates:6002 +msgid "Set the remote timeline base pathname:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:6002 +msgid "This is an absolute pathname for the remote timeline base directory." +msgstr "" + +#. Type: string +#. Description +#: ../templates:6002 +msgid "" +"The remote timeline is made by _hourly rsync_ of the given sources into a " +"_current_ directory, combined with _daily hardlink_ copies into a series of " +"sub directories with name format yyyy-mm-dd. Thus, the base directory must " +"be to a filesystem capable of hardlinks." +msgstr "" + +#. Type: string +#. Description +#: ../templates:6002 +msgid "" +"In mixed mode, the remote timeline only has the daily sub directories and no " +"_current_ directory." +msgstr "" + +#. Type: string +#. Default +#: ../templates:7001 +msgid "backup" +msgstr "" + +#. Type: string +#. Description +#: ../templates:7002 +msgid "Set remote or mixed mode operation target host:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:7002 +msgid "This is the /ssh/ hostname to use for the remote timeline actions." +msgstr "" + +#. Type: string +#. Description +#: ../templates:7002 +msgid "" +"*Note* that ssh needs to be set up for this hostname, including a secure ssh " +"key for passwordless ssh access to the nominated remote host." +msgstr "" diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 0000000..8db4d98 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,26 @@ +#!/bin/sh + +#DEBHELPER# + +case "$1" in + configure) + . /usr/share/debconf/confmodule + + CRONFILE=/etc/cron.hourly/timeliner-cron + + # $1 = variable $2 = debconf + setconfig() { + db_get $2 + sed "s|.*$1=.*|$1=\"$RET\"|" -i $CRONFILE + } + + if [ -x "$CRONFILE" ] ; then + setconfig LOGFILE timeliner/logfile + setconfig LBASE timeliner/local/target + setconfig RBASE timeliner/remote/target + setconfig REMOTE timeliner/remote/host + setconfig DIRS timeliner/sources + setconfig OPMODE timeliner/opmode + fi + ;; +esac diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..2d33f6a --- /dev/null +++ b/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/templates b/debian/templates new file mode 100644 index 0000000..3f4179d --- /dev/null +++ b/debian/templates @@ -0,0 +1,66 @@ +Template: timeliner/title +Type: title +_Description: timeliner-cron setup + +Template: timeliner/logfile +Type: string +_Default: /var/log/timeliner.log +_Description: Set timeliner logfile: + This file will be used both as log for timeliner-cron activations, and + then also as mutex lock file for it. + +Template: timeliner/opmode +Type: select +__Choices: disabled, local, remote, mixed +Default: disabled +_Description: Operation mode for timeliner-cron: + There are four possble operation modes for timeliner-cron. You may choose + "disabled" now to defer the timeliner-cron setup and later run + dpkg-reconfigure timeliner + to configure it. + . + disabled = don't keep a timeline + local = keep a local timeline only + remote = keep a remote timeline only + mixed = keep a remote timeline with a local rolling window + +Template: timeliner/sources +Type: string +_Default: /boot /etc /home /opt /root +_Description: Declare source directories to be backed up: + Give one or more space separated absolute pathnames to nominate directory + trees to be in the timeline. + +Template: timeliner/local/target +Type: string +_Default: /backup +_Description: Set for the local timeline base pathname: + This is an absolute pathname for the local timeline base directory. + . + The local timeline is made by _hourly rsync_ of the given sources into a + _current_ directory, combined with _daily hardlink_ copies into a series + of sub directories with name format yyyy-mm-dd. Thus, the base directory + must be in a filesystem capable of hard links. + +Template: timeliner/remote/target +Type: string +_Default: /backup +_Description: Set the remote timeline base pathname: + This is an absolute pathname for the remote timeline base directory. + . + The remote timeline is made by _hourly rsync_ of the given sources into a + _current_ directory, combined with _daily hardlink_ copies into a series + of sub directories with name format yyyy-mm-dd. Thus, the base directory + must be to a filesystem capable of hardlinks. + . + In mixed mode, the remote timeline only has the daily sub directories and + no _current_ directory. + +Template: timeliner/remote/host +Type: string +_Default: backup +_Description: Set remote or mixed mode operation target host: + This is the /ssh/ hostname to use for the remote timeline actions. + . + *Note* that ssh needs to be set up for this hostname, including a secure + ssh key for passwordless ssh access to the nominated remote host. diff --git a/debian/testconfig b/debian/testconfig new file mode 100755 index 0000000..cc8936b --- /dev/null +++ b/debian/testconfig @@ -0,0 +1,5 @@ +#!/bin/bash + +sudo debconf-communicate <<< "purge" +sudo env DEBCONF_DEBUG=developer DEBIAN_PRIORITY=low ./config configure +sudo debconf-show unknown