commit:     c682f8e1e452a5c1d7e819559fcc1a137f5fd780
Author:     Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 13 07:12:32 2025 +0000
Commit:     Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
CommitDate: Mon Oct 13 07:12:44 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c682f8e1

sys-fs/sanoid: new package, add 2.3.0

Signed-off-by: Marc Schiffbauer <mschiff <AT> gentoo.org>

 sys-fs/sanoid/Manifest            |  1 +
 sys-fs/sanoid/metadata.xml        | 24 ++++++++++++
 sys-fs/sanoid/sanoid-2.3.0.ebuild | 80 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 105 insertions(+)

diff --git a/sys-fs/sanoid/Manifest b/sys-fs/sanoid/Manifest
new file mode 100644
index 000000000000..52f2b9217bbd
--- /dev/null
+++ b/sys-fs/sanoid/Manifest
@@ -0,0 +1 @@
+DIST sanoid-2.3.0.tar.gz 86514 BLAKE2B 
bb1d7284875ba6654ddebe712423f27f5b0ff2eaeacc759a301c7c75552aabf172b639504dfcd31b2bbc78a1f2eaf290c120509b1acdebdc79ee2978a809267a
 SHA512 
b1201cddd5aa04474307e2984a6d3625c54135730663e973c11834bc34c544f7771b1870dcf2820f774817ad2a689c5a2bc602d84b3b8f48db61acb3224edb72

diff --git a/sys-fs/sanoid/metadata.xml b/sys-fs/sanoid/metadata.xml
new file mode 100644
index 000000000000..cd60f785b38c
--- /dev/null
+++ b/sys-fs/sanoid/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Marc Schiffbauer</name>
+       </maintainer>
+       <use>
+               <flag name="cron">Installs cron file</flag>
+       </use>
+       <upstream>
+               <remote-id type="github">jimsalterjrs/sanoid</remote-id>
+       </upstream>
+       <longdescription lang="en">
+               Sanoid is a policy-driven snapshot management tool for ZFS 
filesystems.
+               When combined with the Linux KVM hypervisor, you can use it to 
make your
+               systems functionally immortal.
+               More prosaically, you can use Sanoid to create, automatically 
thin, and
+               monitor snapshots and pool health from a single eminently 
human-readable
+               TOML config file at /etc/sanoid/sanoid.conf.
+               (Sanoid also requires a "defaults" file located at
+               /etc/sanoid/sanoid.defaults.conf, which is not user-editable.)
+       </longdescription>
+</pkgmetadata>

diff --git a/sys-fs/sanoid/sanoid-2.3.0.ebuild 
b/sys-fs/sanoid/sanoid-2.3.0.ebuild
new file mode 100644
index 000000000000..e907688ce738
--- /dev/null
+++ b/sys-fs/sanoid/sanoid-2.3.0.ebuild
@@ -0,0 +1,80 @@
+# Copyright 2023-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit systemd
+
+DESCRIPTION="Policy-driven snapshot management and replication tools."
+HOMEPAGE="https://github.com/jimsalterjrs/sanoid";
+SRC_URI="https://github.com/jimsalterjrs/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="cron"
+
+RDEPEND="
+       dev-lang/perl
+       app-arch/gzip
+       app-arch/lz4
+       app-arch/lzop
+       app-arch/zstd
+       cron? ( virtual/cron )
+       dev-perl/Capture-Tiny
+       dev-perl/Config-IniFiles
+       sys-apps/pv
+       sys-block/mbuffer
+       virtual/ssh
+"
+DEPEND="${RDEPEND}"
+
+DOCS="CHANGELIST LICENSE README.md"
+
+src_prepare() {
+       default
+       sed -i 's|/usr/sbin|/usr/bin|g' \
+               "packages/debian/sanoid.timer" \
+               "packages/debian/sanoid.service" \
+               "packages/debian/sanoid.sanoid-prune.service" || die
+}
+
+src_install() {
+       # Documents
+       einstalldocs
+       # Configs
+       insinto /etc/sanoid
+       doins sanoid.defaults.conf
+       doins sanoid.conf
+       # Binaries
+       dobin sanoid syncoid findoid sleepymutex
+       # cron?
+       if use cron; then
+               insinto /etc/cron.d
+               echo "#* * * * * root TZ=UTC /usr/bin/sanoid --cron" > 
"${PN}.cron" || die
+               newins "${PN}.cron" "${PN}"
+       fi
+       # systemd units
+       systemd_dounit "packages/debian/sanoid.service"
+       systemd_dounit "packages/debian/sanoid.timer"
+       systemd_dounit "packages/debian/sanoid.sanoid-prune.service"
+}
+
+pkg_postinst() {
+       elog "Removing old cache files (if any)"
+       [[ -f /var/cache/sanoidsnapshots.txt ]] && rm -v 
/var/cache/sanoidsnapshots.txt
+       [[ -f /var/cache/sanoid/snapshots.txt ]] && rm -v 
/var/cache/sanoid/snapshots.txt
+       [[ -f /var/cache/sanoid/datasets.txt ]] && rm -v 
/var/cache/sanoid/datasets.txt
+
+       elog "Edit the /etc/sanoid/sanoid.conf file to configure sanoid."
+       if systemd_is_booted; then
+               elog "To enable sanoid via systemd timer, run:"
+               elog "  systemctl enable --now sanoid.timer"
+       fi
+       if use cron && systemd_is_booted; then
+               elog "OR"
+       fi
+       if use cron; then
+               elog "To enable sanoid via cron, uncomment the cron job in 
/etc/cron.d/sanoid."
+       fi
+}

Reply via email to