summaryrefslogtreecommitdiff
path: root/app-crypt/tpm-emulator
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-crypt/tpm-emulator
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'app-crypt/tpm-emulator')
-rw-r--r--app-crypt/tpm-emulator/Manifest5
-rw-r--r--app-crypt/tpm-emulator/files/tpm-emulator.confd-0.7.42
-rw-r--r--app-crypt/tpm-emulator/files/tpm-emulator.initd-0.7.459
-rw-r--r--app-crypt/tpm-emulator/metadata.xml11
-rw-r--r--app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild75
5 files changed, 152 insertions, 0 deletions
diff --git a/app-crypt/tpm-emulator/Manifest b/app-crypt/tpm-emulator/Manifest
new file mode 100644
index 000000000000..19e3c1e1929a
--- /dev/null
+++ b/app-crypt/tpm-emulator/Manifest
@@ -0,0 +1,5 @@
+AUX tpm-emulator.confd-0.7.4 34 BLAKE2B 39d858219bf12309c361bd65070df3a941de10d073e3014e0196bc3f100c605a7be1700c1e25d46fa94a27778c453732e9102be3fe11260f6b3bf617c47bb5ec SHA512 61b5145d3fa5b778ba09e66a25ea183165fafbdafe54aa77d171aed2a87f6b5febc918d33603a9bf58320e9ff3f79e3ec58d03d4674562d31c1c90b942faf504
+AUX tpm-emulator.initd-0.7.4 1100 BLAKE2B 19736ff8ad067390adb951f4b3f30656bf7345f36cba51b5a96114f3acc069391f3c4e7ecbb563f2ad6fbb25263b950b907c130b5dd0a6523a607a264de61469 SHA512 5fab6f4c9b7057fa1bf23b179747d125ec77729a1a69b762735c429824ce6dfee3033012b027a44e5c731ec86a4e78b8b64c44d27b207867a26a9663382a84f9
+DIST tpm_emulator-0.7.4.tar.gz 214145 BLAKE2B b8bbd53ecfb90e87f1306c03d2c65a472819d23d10bd63fa966bfadef4776c3876c2f6fc03cc878ece670bdfcd22c9f403ef4bc7f4593a0a6c7f8d17051ac3ba SHA512 4928b5b82f57645be9408362706ff2c4d9baa635b21b0d41b1c82930e8c60a759b1ea4fa74d7e6c7cae1b7692d006aa5cb72df0c3b88bf049779aa2b566f9d35
+EBUILD tpm-emulator-0.7.4-r1.ebuild 1722 BLAKE2B 7cfeaf2ccf0e9099fbe583182bbf7afcd744225bce28b295b6bbb191a624bb4814bd286bf055e68c88ba6cbda63fcd31ecd17846169bb1a81f1ab1da56d146f6 SHA512 31a65b04536fd43e20d6b6d5215e8eea7d5710fafa79ebd48757de80b1e9c0890269130f8f5ec4a764987d18b0dcd879405337a056a60d8ae2c33fd1a39c6eb6
+MISC metadata.xml 322 BLAKE2B c136948fea0130f683bd8ff1c52e03707b801a446859dd4e03ee34965ccf5babd69f28c437f5b568a6f9e308669b23c49127a3592ef702fa06323f368f1fd8fc SHA512 59ca2140630f6c408c51176a30ad8357ecaf8c1a3b37b495176b25cf2b1cb259882dded5072440cfbfe2d16741520a0b30b41384db89c794ec183b318419b578
diff --git a/app-crypt/tpm-emulator/files/tpm-emulator.confd-0.7.4 b/app-crypt/tpm-emulator/files/tpm-emulator.confd-0.7.4
new file mode 100644
index 000000000000..da24e57840b9
--- /dev/null
+++ b/app-crypt/tpm-emulator/files/tpm-emulator.confd-0.7.4
@@ -0,0 +1,2 @@
+STARTUP_MODE="save"
+#DEBUG="true"
diff --git a/app-crypt/tpm-emulator/files/tpm-emulator.initd-0.7.4 b/app-crypt/tpm-emulator/files/tpm-emulator.initd-0.7.4
new file mode 100644
index 000000000000..8d5b9be561b1
--- /dev/null
+++ b/app-crypt/tpm-emulator/files/tpm-emulator.initd-0.7.4
@@ -0,0 +1,59 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+STARTUP_MODE='save';
+
+extra_started_commands="clear save deactivated"
+command="/usr/bin/tpmd"
+command_args="-o tss -g tss"
+
+depend() {
+ use logger
+ after coldplug
+}
+
+checkconfig() {
+ lsmod | grep -q "^tpmd_dev\b" \
+ || modprobe tpmd_dev &>/dev/null \
+ || eerror "Failed to load module tpmd_dev";
+
+ if [ ! -c /dev/tpm ] && [ ! -c /dev/tpm0 ] ; then
+ eerror "No TPM device found!"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ ebegin "Starting tpm-emulator daemon with mode '$STARTUP_MODE' (tpmd)"
+ checkconfig || eend $?
+ checkpath -d -m 0775 -o tss /var/run/tpm
+ start-stop-daemon --start --exec "${command}" -- ${command_args} $STARTUP_MODE > /dev/null
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping tpm-emulator daemon (tpmd)"
+ start-stop-daemon --stop --exec "${command}" -- ${command_args} > /dev/null
+ eend $?
+}
+
+clear() {
+ STARTUP_MODE='clear';
+ stop
+ start
+}
+
+save() {
+ STARTUP_MODE='save';
+ stop
+ start
+}
+
+deactivated() {
+ STARTUP_MODE='deactivated';
+ stop
+ start
+}
+
diff --git a/app-crypt/tpm-emulator/metadata.xml b/app-crypt/tpm-emulator/metadata.xml
new file mode 100644
index 000000000000..e3da96029705
--- /dev/null
+++ b/app-crypt/tpm-emulator/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>crypto@gentoo.org</email>
+ <name>Crypto</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">tpm-emulator</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild b/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
new file mode 100644
index 000000000000..3bd4cc56bd52
--- /dev/null
+++ b/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+MODULES_OPTIONAL_USE="modules"
+inherit flag-o-matic user linux-mod cmake-utils udev
+
+MY_P=${P/-/_}
+DESCRIPTION="Emulator driver for tpm"
+HOMEPAGE="https://sourceforge.net/projects/tpm-emulator.berlios/"
+SRC_URI="mirror://sourceforge/tpm-emulator/${MY_P}.tar.gz"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="libressl ssl"
+RDEPEND="ssl? (
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )"
+DEPEND="${RDEPEND}
+ !ssl? ( dev-libs/gmp )"
+
+S=${WORKDIR}/${P/-/_}
+
+pkg_setup() {
+ enewuser tss -1 -1 /var/lib/tpm tss
+ if use modules; then
+ CONFIG_CHECK="MODULES"
+ linux-mod_pkg_setup
+ BUILD_TARGETS="all"
+ BUILD_PARAMS="KERNEL_BUILD=${KERNEL_DIR}"
+ fi
+}
+
+src_prepare() {
+ cmake-utils_src_prepare
+
+ # do not build and install the kernel module
+ sed -i 's/COMMAND ${tpmd_dev_BUILD_CMD}//' tpmd_dev/CMakeLists.txt || die
+ sed -i 's/install(CODE.*//' tpmd_dev/CMakeLists.txt || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DUSE_OPENSSL=$(usex ssl)
+ )
+ append-cflags -Wno-implicit-fallthrough
+ cmake-utils_src_configure
+
+ # only here we have BUILD_DIR
+ MODULE_NAMES="tpmd_dev(misc:${BUILD_DIR}/tpmd_dev/linux)"
+}
+
+src_compile() {
+ cmake-utils_src_compile
+ use modules && linux-mod_src_compile
+ emake -C "${BUILD_DIR}/tpmd_dev/linux" tpmd_dev.rules
+}
+
+src_install() {
+ cmake-utils_src_install
+ use modules && linux-mod_src_install
+
+ dodoc README
+
+ udev_newrules "${BUILD_DIR}/tpmd_dev/linux/tpmd_dev.rules" 60-tpmd_dev.rules
+
+ newinitd "${FILESDIR}"/${PN}.initd-0.7.4 ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd-0.7.4 ${PN}
+
+ keepdir /var/log/tpm
+ fowners tss:tss /var/log/tpm
+}