summaryrefslogtreecommitdiff
blob: c97002e5ea6d87c3f9f482b9158740dd3b7643e4 (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
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6

GITHUB_USER="fearedbliss"
GITHUB_REPO="bliss-initramfs"
GITHUB_TAG="${PV}"

DESCRIPTION="Boot your system's rootfs from ZFS, LVM, RAID, or a variety of other configs."
HOMEPAGE="https://github.com/${GITHUB_USER}/${GITHUB_REPO}"
SRC_URI="https://github.com/${GITHUB_USER}/${GITHUB_REPO}/archive/${GITHUB_TAG}.tar.gz -> ${P}.tar.gz"

RESTRICT="strip"
LICENSE="MPL-2.0"
SLOT="0"
KEYWORDS="-* ~amd64"
IUSE="luks raid lvm zfs"

RDEPEND="
	>=dev-lang/python-3.3
	app-arch/cpio
	virtual/udev

	luks? ( sys-fs/cryptsetup
			app-crypt/gnupg )

	raid? ( sys-fs/mdadm )

	lvm? ( sys-fs/lvm2 )

	zfs? ( sys-kernel/spl
		   sys-fs/zfs
		   sys-fs/zfs-kmod )"

S="${WORKDIR}/${GITHUB_REPO}-${GITHUB_TAG}"

src_install() {
	# Copy the main executable
	local executable="mkinitrd.py"
	exeinto "/opt/${PN}"
	doexe "${executable}"

	# Copy the libraries required by this executable
	cp -r "${S}/files" "${D}/opt/${PN}" || die
	cp -r "${S}/pkg" "${D}/opt/${PN}" || die

	# Copy documentation files
	dodoc CHANGES README USAGE

	# Make a symbolic link: /sbin/bliss-initramfs
	dosym "/opt/${PN}/${executable}" "/sbin/${PN}"
}