From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- app-crypt/tpm-emulator/Manifest | 7 +++ .../tpm-emulator/files/tpm-emulator.confd-0.7.4 | 2 + .../tpm-emulator/files/tpm-emulator.initd-0.7.4 | 59 ++++++++++++++++++ app-crypt/tpm-emulator/metadata.xml | 11 ++++ .../tpm-emulator/tpm-emulator-0.7.4-r1.ebuild | 72 ++++++++++++++++++++++ 5 files changed, 151 insertions(+) create mode 100644 app-crypt/tpm-emulator/Manifest create mode 100644 app-crypt/tpm-emulator/files/tpm-emulator.confd-0.7.4 create mode 100644 app-crypt/tpm-emulator/files/tpm-emulator.initd-0.7.4 create mode 100644 app-crypt/tpm-emulator/metadata.xml create mode 100644 app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild (limited to 'app-crypt/tpm-emulator') diff --git a/app-crypt/tpm-emulator/Manifest b/app-crypt/tpm-emulator/Manifest new file mode 100644 index 000000000000..17eedbe3131a --- /dev/null +++ b/app-crypt/tpm-emulator/Manifest @@ -0,0 +1,7 @@ +AUX tpm-emulator.confd-0.7.4 34 SHA256 3af4a1b3f83919225c4a66f3de3159bed4e8eec4d55e9da848018c5ea66541ee SHA512 61b5145d3fa5b778ba09e66a25ea183165fafbdafe54aa77d171aed2a87f6b5febc918d33603a9bf58320e9ff3f79e3ec58d03d4674562d31c1c90b942faf504 WHIRLPOOL e95e8e0326f2c64695b63ba8242bf0ff9cdf256411b05b9aff9553b5bb69266d5a8bc1aef0cca701502ad94852cec254dfa0e74fdf546952f13afdabd9cc3598 +AUX tpm-emulator.initd-0.7.4 1100 SHA256 db1036e23b953ce7568eec3fe0ad0842d102429c06c87655065a51d6924b0cf4 SHA512 5fab6f4c9b7057fa1bf23b179747d125ec77729a1a69b762735c429824ce6dfee3033012b027a44e5c731ec86a4e78b8b64c44d27b207867a26a9663382a84f9 WHIRLPOOL 25b5c8fc5689dc5625149e34fec2b9e8b0b503bbf31d2360f9a033f854b23b86858114dbd0262d687bc538d9878651307c2cf0d2e99eb9878e3eb28c1c4515ba +DIST tpm_emulator-0.7.4.tar.gz 214145 SHA256 4e48ea0d83dd9441cc1af04ab18cd6c961b9fa54d5cbf2c2feee038988dea459 SHA512 4928b5b82f57645be9408362706ff2c4d9baa635b21b0d41b1c82930e8c60a759b1ea4fa74d7e6c7cae1b7692d006aa5cb72df0c3b88bf049779aa2b566f9d35 WHIRLPOOL c75d49e834f8df6c810d7cb7ca3553e742fde0fd6050af7f7aeda8bbdf652084dda6600719eb0b816e1d51bbc5d9f0e119ea40ce3e59af05fd8d55971056fd6f +EBUILD tpm-emulator-0.7.4-r1.ebuild 1622 SHA256 1beca8929b6f101d95f409dfc1771db74a83a073f73abfebb7b98094f4fbf0de SHA512 0da1ea2ce5bb250d5c59b338b37e021095a775efdfda7874896f12bc60111d55e47f579f4459b5c7b893753e87bd6101ebc28e05c874b1340c48448909776292 WHIRLPOOL 4a0ab463e7d4afcb8ac6b5f08020ac19a72127d46ac1ea25c6b3f5aea585802fecb56c49b23695948d3b6f365d0852b864ea790a1ebbc84adfec2979f21aa2ef +MISC ChangeLog 3387 SHA256 f55e1133580bf004cfe86cdd6497dd73f9e4da8376f4f153f800836595d19e39 SHA512 f5282dd2eae01c78af9221eb8c04e4b66a9b5ca8e2a9f675354a8bfb0aeff852c6c589eb3710bee63ae7ade9601c6273ef1658408e69ff75d0808160e47d318a WHIRLPOOL 5a2ab0aeb39d795129ab9244babe18c93f3c013871110406bc60f1e4f9a078c0c31b53ba46d0c2f0c3ff45a85a7a6625cb7014db484da39bdbb8da74e8863839 +MISC ChangeLog-2015 4068 SHA256 cf829802bcc9ccc92c8962e33f031b5a73ea11e79d4bd4df8088db6bbc1b3101 SHA512 bbf9dd6c4bdbbb0a0dec33a11bbfebd995e8d50b78126d0c9281e856d41316b7593c5b4080319d50e1e923e3c7a01488f4b29cfff81187290870a9bd6ff77e3b WHIRLPOOL b53340261f9e958ff00ebfcdf0f6bd854b8dada9d4d4ff5ce62616fe0b5e15211fc771d7b569154da4d8f4659229cffc5bf6a7f72bb2b3551777ce4375050c63 +MISC metadata.xml 322 SHA256 cf1287a6ed50b56fe582bdf43aa900fc5c4d4cf6c14d5ff97d04c7012ed9370a SHA512 59ca2140630f6c408c51176a30ad8357ecaf8c1a3b37b495176b25cf2b1cb259882dded5072440cfbfe2d16741520a0b30b41384db89c794ec183b318419b578 WHIRLPOOL 7feeeddeadeaa17e666f1a304709b12ea88edbfc603f706eba71776e935b788e3d8462297166ff4bdab7079359be9448f8a4200cb01722845cfea1031d7e0156 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 @@ + + + + + crypto@gentoo.org + Crypto + + + tpm-emulator + + 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..8b41e36c664b --- /dev/null +++ b/app-crypt/tpm-emulator/tpm-emulator-0.7.4-r1.ebuild @@ -0,0 +1,72 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit 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 modules" +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() { + default + # 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() { + mycmakeargs=( + -DUSE_OPENSSL=$(usex ssl) + ) + 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 +} -- cgit v1.2.3