summaryrefslogtreecommitdiff
blob: 35a2551616d49b2365f1967b6649ff72c338ba61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DESCRIPTION="Policy-driven snapshot management and replication tools for OpenZFS."
HOMEPAGE="https://github.com/jimsalterjrs/sanoid"

if [[ "${PV}" = *9999 ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/jimsalterjrs/${PN^}.git"
else
	SRC_URI="https://github.com/jimsalterjrs/${PN^}/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz"
	KEYWORDS="~amd64"
fi

LICENSE="GPL-3"
SLOT="0"

IUSE="gzip lzop pigz zstd"
BDEPEND="
	dev-lang/perl
	sys-apps/groff
"
RDEPEND="
	dev-lang/perl
	dev-perl/Capture-Tiny
	dev-perl/Config-IniFiles
	sys-apps/pv
	sys-block/mbuffer
	sys-fs/zfs
	virtual/perl-Data-Dumper
	virtual/perl-Getopt-Long
	virtual/ssh
	gzip?    ( app-arch/gzip )
	lzop?    ( app-arch/lzop )
	pigz?    ( app-arch/pigz )
	zstd?    ( app-arch/zstd )
"

src_compile() {
	perldoc -onroff -dsanoid.1 sanoid || die "Failed to compile sanoid.1"
	perldoc -onroff -dsyncoid.1 syncoid || die "Failed to compile syncoid.1"
}

src_install() {
	dobin sanoid
	dobin syncoid

	doman sanoid.1 syncoid.1

	insinto /etc/sanoid
	doins "sanoid.defaults.conf"

	elog "You will need to set up your /etc/sanoid/sanoid.conf file before"
	elog "running sanoid for the first time. For details, please consult the"
	elog "documentation on https://github.com/jimsalterjrs/sanoid."
}