You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
1.7 KiB
84 lines
1.7 KiB
4 years ago
|
# Copyright 1999-2021 Gentoo Authors
|
||
6 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
4 years ago
|
EAPI=7
|
||
|
|
||
6 years ago
|
MODULES_OPTIONAL_USE="modules"
|
||
4 years ago
|
inherit cmake linux-mod udev
|
||
6 years ago
|
|
||
|
MY_P=${P/-/_}
|
||
|
DESCRIPTION="Emulator driver for tpm"
|
||
|
HOMEPAGE="https://github.com/PeterHuewe/tpm-emulator"
|
||
|
SRC_URI="https://github.com/PeterHuewe/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||
|
|
||
4 years ago
|
LICENSE="GPL-2"
|
||
6 years ago
|
SLOT="0"
|
||
|
KEYWORDS="~amd64 ~x86"
|
||
|
IUSE="mtm-emulator"
|
||
4 years ago
|
|
||
|
RDEPEND="
|
||
|
acct-group/tpm
|
||
|
acct-user/tpm
|
||
|
dev-libs/gmp:="
|
||
6 years ago
|
DEPEND="${RDEPEND}"
|
||
|
|
||
|
PATCHES=(
|
||
4 years ago
|
"${FILESDIR}"/${P}-build.patch
|
||
|
"${FILESDIR}"/${P}-fno-common.patch
|
||
|
"${FILESDIR}"/${P}-static-libs.patch
|
||
6 years ago
|
)
|
||
|
|
||
|
pkg_setup() {
|
||
|
if use modules; then
|
||
|
CONFIG_CHECK="MODULES"
|
||
|
MODULE_NAMES="tpmd_dev(extra:tpmd_dev/linux:)"
|
||
|
BUILD_TARGETS="all tpmd_dev.rules"
|
||
|
BUILD_PARAMS="KERNEL_BUILD=${KERNEL_DIR}"
|
||
|
linux-mod_pkg_setup
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
src_configure() {
|
||
|
local mycmakeargs=(
|
||
|
-DMTM_EMULATOR=$(usex mtm-emulator ON OFF)
|
||
|
-DBUILD_DEV=OFF
|
||
|
)
|
||
4 years ago
|
cmake_src_configure
|
||
6 years ago
|
|
||
4 years ago
|
if use modules; then
|
||
|
ln -s "${BUILD_DIR}/config.h" tpmd_dev/linux || die
|
||
|
fi
|
||
6 years ago
|
}
|
||
|
|
||
|
src_compile() {
|
||
4 years ago
|
cmake_src_compile
|
||
6 years ago
|
use modules && linux-mod_src_compile
|
||
|
}
|
||
|
|
||
|
src_install() {
|
||
4 years ago
|
cmake_src_install
|
||
6 years ago
|
if use modules; then
|
||
|
linux-mod_src_install
|
||
|
udev_newrules "tpmd_dev/linux/tpmd_dev.rules" 60-tpmd_dev.rules
|
||
|
fi
|
||
|
|
||
|
newinitd "${FILESDIR}/${PN}.initd" "${PN}"
|
||
|
newconfd "${FILESDIR}/${PN}.confd" "${PN}"
|
||
|
|
||
|
keepdir /var/log/tpm
|
||
|
fowners tss:tss /var/log/tpm
|
||
|
}
|
||
|
|
||
|
pkg_postinst() {
|
||
|
if use modules; then
|
||
|
linux-mod_pkg_postinst
|
||
|
|
||
|
ewarn ""
|
||
|
ewarn "The new init.d script does not load the tpmd_dev any more as it is optional."
|
||
|
ewarn "If you use the tpmd_dev, please load it explicitly in /etc/conf.d/modules"
|
||
|
ewarn ""
|
||
|
fi
|
||
|
|
||
|
einfo "tpmd socket is located at /var/run/tpm/tpmd_socket:0"
|
||
|
}
|