# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit toolchain-funcs

DESCRIPTION="Early unlocking of encrypted systems via ssh for dracut"
HOMEPAGE="https://github.com/kode54/dracut-hook-bcachefs"
SRC_URI="https://github.com/kode54/dracut-hook-bcachefs/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~x86"

DEPEND="sys-kernel/dracut"
RDEPEND="${DEPEND}
         sys-fs/bcachefs-tools"

src_compile() {
	if [[ ! -f Makefile ]]; then
		emake || die "emake failed"
	fi
}

src_install() {
    emake -j1 DESTDIR="${D}" install || die "emake failed"
}
