From 2e9ce9681ab0c445f378ff477aad654d0cdc5e79 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Tue, 12 Sep 2017 23:50:22 -0700 Subject: [PATCH] Make sanoid a native Debian package It can be built with dpkg-buildpackage. --- debian/changelog | 9 +++++++++ debian/compat | 1 + debian/control | 14 ++++++++++++++ debian/copyright | 33 +++++++++++++++++++++++++++++++++ debian/rules | 20 ++++++++++++++++++++ debian/sanoid.README.Debian | 1 + debian/sanoid.docs | 1 + debian/sanoid.service | 9 +++++++++ debian/sanoid.timer | 9 +++++++++ debian/source/format | 1 + 10 files changed, 98 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100755 debian/rules create mode 100644 debian/sanoid.README.Debian create mode 100644 debian/sanoid.docs create mode 100644 debian/sanoid.service create mode 100644 debian/sanoid.timer create mode 100644 debian/source/format diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..ab530b0 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,9 @@ +sanoid (1.4.16) unstable; urgency=medium + + * merged @hrast01's extended fix to support -o option1=val,option2=val passthrough to SSH. merged @JakobR's + * off-by-one fix to stop unnecessary extra snapshots being taken under certain conditions. merged @stardude900's + * update to INSTALL for FreeBSD users re:symlinks. Implemented @LordAro's update to change DIE to WARN when + * encountering a dataset with no snapshots and --no-sync-snap set during recursive replication. Implemented + * @LordAro's update to sanoid.conf to add an ignore template which does not snap, prune, or monitor. + + -- Jim Salter Wed, 9 Aug 2017 12:28:49 -0400 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..f3368f9 --- /dev/null +++ b/debian/control @@ -0,0 +1,14 @@ +Source: sanoid +Section: unknown +Priority: optional +Maintainer: Dustin L. Howett +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.8 +Homepage: https://github.com/jimsalterjrs/sanoid +Vcs-Git: https://github.com/jimsalterjrs/sanoid.git +Vcs-Browser: https://github.com/jimsalterjrs/sanoid + +Package: sanoid +Architecture: all +Depends: ${misc:Depends}, ${perl:Depends}, zfsutils-linux, libconfig-inifiles-perl +Description: Policy-driven snapshot management and replication tools diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..c8ea7dc --- /dev/null +++ b/debian/copyright @@ -0,0 +1,33 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: sanoid +Source: + +Files: * +Copyright: 2017 Jim Salter +License: GPL-3.0+ + +Files: debian/* +Copyright: 2017 Jim Salter +License: GPL-3.0+ + +License: GPL-3.0+ + 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 3 of the License, or + (at your option) any later version. + . + This package 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 program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. +# Please avoid picking licenses with terms that are more restrictive than the +# packaged work, as it may make Debian's contributions unacceptable upstream. diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..58e8614 --- /dev/null +++ b/debian/rules @@ -0,0 +1,20 @@ +#!/usr/bin/make -f +# See debhelper(7) for more info + +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + +%: + dh $@ --with systemd + +DESTDIR = $(CURDIR)/debian/sanoid +override_dh_auto_install: + @mkdir -p $(DESTDIR)/usr/sbin; \ + cp sanoid syncoid findoid sleepymutex $(DESTDIR)/usr/sbin; + @mkdir -p $(DESTDIR)/etc/sanoid; \ + cp sanoid.defaults.conf $(DESTDIR)/etc/sanoid; + @mkdir -p $(DESTDIR)/usr/share/doc/sanoid; \ + cp sanoid.conf $(DESTDIR)/usr/share/doc/sanoid/sanoid.conf.example; + @mkdir -p $(DESTDIR)/lib/systemd/system; \ + cp debian/sanoid.timer $(DESTDIR)/lib/systemd/system; + diff --git a/debian/sanoid.README.Debian b/debian/sanoid.README.Debian new file mode 100644 index 0000000..afaa36b --- /dev/null +++ b/debian/sanoid.README.Debian @@ -0,0 +1 @@ +To start, copy the example config file in /usr/share/doc/sanoid to /etc/sanoid/sanoid.conf. diff --git a/debian/sanoid.docs b/debian/sanoid.docs new file mode 100644 index 0000000..b43bf86 --- /dev/null +++ b/debian/sanoid.docs @@ -0,0 +1 @@ +README.md diff --git a/debian/sanoid.service b/debian/sanoid.service new file mode 100644 index 0000000..b54c586 --- /dev/null +++ b/debian/sanoid.service @@ -0,0 +1,9 @@ +[Unit] +Description=Snapshot ZFS Pool +Requires=zfs.target +After=zfs.target +ConditionFileNotEmpty=/etc/sanoid/sanoid.conf + +[Service] +Type=oneshot +ExecStart=/usr/sbin/sanoid --cron diff --git a/debian/sanoid.timer b/debian/sanoid.timer new file mode 100644 index 0000000..3058430 --- /dev/null +++ b/debian/sanoid.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Run Sanoid Every 15 Minutes + +[Timer] +OnCalendar=*:0/15 +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native)