# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=5 inherit git-2 autotools DESCRIPTION="Command-line program for btrfs and ext4 snapshot management" HOMEPAGE="http://en.opensuse.org/Portal:Snapper" SRC_URI="" EGIT_REPO_URI="git://github.com/openSUSE/snapper.git" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64" RDEPEND="sys-apps/dbus" DEPEND="${RDEPEND} sys-devel/autoconf sys-devel/automake dev-libs/boost dev-libs/libxml2 sys-devel/libtool sys-devel/gettext" # Using default src_prepare() src_configure() { cd "${EGIT_SOURCEDIR}" # The following is taken right from the Makefile.repo file provided by # upstream, just using Gentoo-aware tools and omitting redundant data. # Should not be required in the long term. eautoreconf --force --install # Disabling the zypper plugin, as zypper is not in portage econf --disable-zypp --with-conf="/etc/conf.d" } # Using default src_compile() src_install() { cd "${EGIT_SOURCEDIR}" emake DESTDIR="${D}" install || die "Install failed" dodoc AUTHORS LIBVERSION VERSION package/snapper.changes || die } pkg_preinst() { # Snapper requires an exising configuration file to function. # Not certain if this is needed, now that Snapper is conf.d-aware. mkdir -p "${D}/etc/conf.d" cp -n "${EGIT_SOURCEDIR}/data/sysconfig.snapper" "${D}/etc/conf.d/snapper" } pkg_postinst() { elog "In order to use Snapper, you need to set up at least one config" elog "manually, or else the tool will get confused. Typically you should" elog "create a '/.snapshots' directory, then copy the file" elog "'/etc/snapper/config-templates/default' into '/etc/snapper/configs/'," elog "rename the file to 'root', and add its name into '/etc/conf.d/snapper'." elog "That will instruct Snapper to snapshot the root of the filesystem by" elog "default. For more information, see the snapper(8) manual page." }