aboutsummaryrefslogtreecommitdiff
blob: fbdf2148fe70d4f56f7ac4e8b51dbef637124f1f (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
# Copyright 2019-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit optfeature

DESCRIPTION="Improves Grub by adding btrfs snapshots to the Grub menu."
HOMEPAGE="https://github.com/Antynea/grub-btrfs"

if [[ ${PV} == 9999 ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/Antynea/grub-btrfs"
else
	SRC_URI="https://github.com/Antynea/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
	KEYWORDS="~amd64 ~x86"
fi

LICENSE="GPL-3"
SLOT="0"
IUSE="systemd"
PATCHES=( "${FILESDIR}/${PN}-9999-remove-docs-from-make.patch" )

DEPEND="
	sys-fs/btrfs-progs
	sys-boot/grub
	virtual/awk
	>=app-shells/bash-4
	sys-fs/inotify-tools
"
RDEPEND="${DEPEND}"
BDEPEND=""

src_compile(){
	true
}

src_install(){
	local conf
	if use systemd; then
		conf+="SYSTEMD=true OPENRC=false"
	else
		conf+="OPENRC=true SYSTEMD=false"
	fi
	emake DESTDIR="${D}" ${conf} install || die
	dodoc README.md
	mv ./initramfs/readme.md initramfs-overlayfs.md || die
	dodoc initramfs-overlayfs.md
	doman temp/grub-btrfs.8
	doman temp/grub-btrfsd.8
}

pkg_postinst() {
	elog "run 'grub-mkconfig -o /boot/grub/grub.cfg' to update your Grub menu."
	elog "update the /etc/grub.d/41_snapshots-btrfs script if neccesary."
	elog "(e.g. with dispatch-conf or etc-update)"
	optfeature "LVM/ LUKS support" sys-boot/grub[device-mapper]
}