From: Georgy Yakovlev Date: Sun, 1 Apr 2018 06:33:13 +0000 (-0700) Subject: sys-fs/zfs-auto-snapshot: new package X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5d769a2585b1de6503acc1c1ecabb69623b7bd78;p=gentoo.git sys-fs/zfs-auto-snapshot: new package Closes: https://bugs.gentoo.org/437636 Closes: https://github.com/gentoo/gentoo/pull/7763 Package-Manager: Portage-2.3.27, Repoman-2.3.9 --- diff --git a/sys-fs/zfs-auto-snapshot/Manifest b/sys-fs/zfs-auto-snapshot/Manifest new file mode 100644 index 000000000000..f09910071734 --- /dev/null +++ b/sys-fs/zfs-auto-snapshot/Manifest @@ -0,0 +1 @@ +DIST zfs-auto-snapshot-upstream-1.2.4.tar.gz 13375 BLAKE2B 2a44cdecb7c4bb432c1804dba9a6674289aced9664ae0fcc6a33b604b128d852fce459367316f11961747594516916da51072ed10f84d0c01ea8cca553ce7eec SHA512 26382303fce8b90dfb40f69fcab92308e88c17c147b4a566c5d32f2e9aa241d64f5da56ad82b4becb824ba01a470037a724460d35676a1d46de9c578c02a57d9 diff --git a/sys-fs/zfs-auto-snapshot/files/README.gentoo b/sys-fs/zfs-auto-snapshot/files/README.gentoo new file mode 100644 index 000000000000..cb712d317ea0 --- /dev/null +++ b/sys-fs/zfs-auto-snapshot/files/README.gentoo @@ -0,0 +1,22 @@ +Use com.sun:auto-snapshot attribute to enable snapshots for datasets +the syntax is: + +zfs set com.sun:auto-snapshot=[true|false] + +or: + +zfs set com.sun:auto-snapshot:=[true|false] + +for example: + +# zfs set com.sun:auto-snapshot=false zroot +Will disalbe all snapshots for zroot and all nested datasets will inherit the property. + +# zfs set com.sun:auto-snapshot=true zroot/ROOT/default +Will enable all types of snapshots for given dataset. + +# zfs set com.sun:auto-snapshot:weekly=true pool/var +Will enable only weekly snapshots for given dataset. + +for details please visit: +https://docs.oracle.com/cd/E19120-01/open.solaris/817-2271/ghzuk/index.html diff --git a/sys-fs/zfs-auto-snapshot/metadata.xml b/sys-fs/zfs-auto-snapshot/metadata.xml new file mode 100644 index 000000000000..c89306c4869f --- /dev/null +++ b/sys-fs/zfs-auto-snapshot/metadata.xml @@ -0,0 +1,28 @@ + + + + + ya@sysdump.net + Georgy Yakovlev + + + proxy-maint@gentoo.org + Proxy Maintainers + + + An alternative implementation of the zfs-auto-snapshot service for Linux + that is compatible with zfs-linux and zfs-fuse. + + Automatically create, rotate, and destroy periodic ZFS snapshots. This is + the utility that creates the @zfs-auto-snap_frequent, @zfs-auto-snap_hourly, + @zfs-auto-snap_daily, @zfs-auto-snap_weekly, and @zfs-auto-snap_monthly + snapshots if it is installed. + + + Only take snapshots if dataset has com.sun:auto-snapshot=true property set + + + + zfsonlinux/zfs-auto-snapshot + + diff --git a/sys-fs/zfs-auto-snapshot/zfs-auto-snapshot-1.2.4.ebuild b/sys-fs/zfs-auto-snapshot/zfs-auto-snapshot-1.2.4.ebuild new file mode 100644 index 000000000000..e9006a5b9aac --- /dev/null +++ b/sys-fs/zfs-auto-snapshot/zfs-auto-snapshot-1.2.4.ebuild @@ -0,0 +1,52 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit readme.gentoo-r1 + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/zfsonlinux/${PN}.git" +else + MY_P="${PN}-upstream-${PV}" + SRC_URI="https://github.com/zfsonlinux/${PN}/archive/upstream/${PV}.tar.gz -> ${MY_P}.tar.gz" + KEYWORDS="~amd64" + S="${WORKDIR}/${MY_P}" +fi + +DESCRIPTION="ZFS Automatic Snapshot Service for Linux" +HOMEPAGE="https://github.com/zfsonlinux/zfs-auto-snapshot" + +LICENSE="GPL-2+" +SLOT="0" +IUSE="+default-exclude" + +RDEPEND="sys-fs/zfs + virtual/cron" + +src_install() { + if use default-exclude; then + for cronfile in etc/"${PN}".cron.{daily,hourly,monthly,weekly}; do + sed -i "s/\(^exec ${PN}\)/\1 --default-exclude/" "${cronfile}" || die + done + sed -i "s/\(; ${PN}\)/\1 --default-exclude/" etc/"${PN}".cron.frequent || die + fi + readme.gentoo_create_doc + emake PREFIX="${EPREFIX}/usr" DESTDIR="${D}" install +} + +pkg_postinst() { + readme.gentoo_print_elog + + if ! use default-exclude; then + ewarn "snapshots are enabled by default for ALL zfs datasets" + ewarn "set com.sun:auto-snapshot=false or enable 'default-exclude' flag" + elog + fi + + if has_version sys-process/fcron; then + ewarn "frequent snapshot may not work if you are using fcron" + ewarn "you should add frequent job to crontab manually" + fi +} diff --git a/sys-fs/zfs-auto-snapshot/zfs-auto-snapshot-9999.ebuild b/sys-fs/zfs-auto-snapshot/zfs-auto-snapshot-9999.ebuild new file mode 100644 index 000000000000..e9006a5b9aac --- /dev/null +++ b/sys-fs/zfs-auto-snapshot/zfs-auto-snapshot-9999.ebuild @@ -0,0 +1,52 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit readme.gentoo-r1 + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/zfsonlinux/${PN}.git" +else + MY_P="${PN}-upstream-${PV}" + SRC_URI="https://github.com/zfsonlinux/${PN}/archive/upstream/${PV}.tar.gz -> ${MY_P}.tar.gz" + KEYWORDS="~amd64" + S="${WORKDIR}/${MY_P}" +fi + +DESCRIPTION="ZFS Automatic Snapshot Service for Linux" +HOMEPAGE="https://github.com/zfsonlinux/zfs-auto-snapshot" + +LICENSE="GPL-2+" +SLOT="0" +IUSE="+default-exclude" + +RDEPEND="sys-fs/zfs + virtual/cron" + +src_install() { + if use default-exclude; then + for cronfile in etc/"${PN}".cron.{daily,hourly,monthly,weekly}; do + sed -i "s/\(^exec ${PN}\)/\1 --default-exclude/" "${cronfile}" || die + done + sed -i "s/\(; ${PN}\)/\1 --default-exclude/" etc/"${PN}".cron.frequent || die + fi + readme.gentoo_create_doc + emake PREFIX="${EPREFIX}/usr" DESTDIR="${D}" install +} + +pkg_postinst() { + readme.gentoo_print_elog + + if ! use default-exclude; then + ewarn "snapshots are enabled by default for ALL zfs datasets" + ewarn "set com.sun:auto-snapshot=false or enable 'default-exclude' flag" + elog + fi + + if has_version sys-process/fcron; then + ewarn "frequent snapshot may not work if you are using fcron" + ewarn "you should add frequent job to crontab manually" + fi +}