diff options
author | Georgy Yakovlev <ya@sysdump.net> | 2018-03-31 23:33:13 -0700 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2018-05-11 19:35:50 +0200 |
commit | 5d769a2585b1de6503acc1c1ecabb69623b7bd78 (patch) | |
tree | c9d567be4804802ba04f7fad0a396206e14c4cb6 /sys-fs/zfs-auto-snapshot/zfs-auto-snapshot-9999.ebuild | |
parent | app-backup/bacula: Revbump with dropped Qt4 support. (diff) | |
download | gentoo-5d769a2585b1de6503acc1c1ecabb69623b7bd78.tar.gz gentoo-5d769a2585b1de6503acc1c1ecabb69623b7bd78.tar.bz2 gentoo-5d769a2585b1de6503acc1c1ecabb69623b7bd78.zip |
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
Diffstat (limited to 'sys-fs/zfs-auto-snapshot/zfs-auto-snapshot-9999.ebuild')
-rw-r--r-- | sys-fs/zfs-auto-snapshot/zfs-auto-snapshot-9999.ebuild | 52 |
1 files changed, 52 insertions, 0 deletions
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 +} |