summaryrefslogtreecommitdiff
path: root/app-crypt/tpm-emulator
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-01-22 20:28:19 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-01-22 20:28:19 +0000
commitabaa75b10f899ada8dd05b23cc03205064394bc6 (patch)
treeeca3dd248b73b92013cba00a0fcc1edf2696e19a /app-crypt/tpm-emulator
parent24fd814c326e282c4321965c31f341dad77e270d (diff)
gentoo resync : 22.01.2021
Diffstat (limited to 'app-crypt/tpm-emulator')
-rw-r--r--app-crypt/tpm-emulator/Manifest4
-rw-r--r--app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-fno-common.patch48
-rw-r--r--app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-static-libs.patch26
-rw-r--r--app-crypt/tpm-emulator/tpm-emulator-0.7.5-r3.ebuild (renamed from app-crypt/tpm-emulator/tpm-emulator-0.7.5-r2.ebuild)32
4 files changed, 96 insertions, 14 deletions
diff --git a/app-crypt/tpm-emulator/Manifest b/app-crypt/tpm-emulator/Manifest
index 33d0f9e1fa31..8aefd72dfbd2 100644
--- a/app-crypt/tpm-emulator/Manifest
+++ b/app-crypt/tpm-emulator/Manifest
@@ -1,6 +1,8 @@
AUX tpm-emulator-0.7.5-build.patch 1150 BLAKE2B ef771dc31982c3b288a61bd0537df2545276297d1f249ee9e046243bf5ee54d475de7f8f58a79de1bd6f72f87937ae6f116bd4b8ef70a64b781d02c318de32ee SHA512 c311a0f448579e21e1fda09157b88517365fd142bf604f3e2ae6cb68ef866a89845b7ba7126021c19369493a9c6b863267855fae29124470185a339183ea062b
+AUX tpm-emulator-0.7.5-fno-common.patch 1566 BLAKE2B a3f92467eeb5069d4d8ab39566fa13f855588e7732500f3e851c8ad3fb251a3d7796d8b7d99fb5795fec433ec43267955fc89fd52a3a8406b6056108b5b9ec9c SHA512 7ecde01229cad43595424e2cd1467eadf408babd63ff5e7e217aff176affe9fd6451d40d50376f834d20d8b8cb03c0a2c419c8e9cd989578b5278bcdfa451236
+AUX tpm-emulator-0.7.5-static-libs.patch 1156 BLAKE2B 9e301e0a6635405d5cdd7e83564338c478c68ecc3d70b72894840b6f5f0d740af22ee00f39bf5160cc51ebdb4400a3ca6f347cfd955141881725ffe5a961060d SHA512 c7c33eac3cd137a483c78aa51cc86807c9b7bd0539e1b728510e7112eca793a39b7bfcfb98043f8cdcf0512a9a3fcc2aaef417a0a487e7bd7653c1be8d966ba5
AUX tpm-emulator.confd 20 BLAKE2B 13dd9f09a0a4efb9a039bfeababb5f00b8b2c3c1777e60c531e874ef6f3b4d00319d7962bd321f8530289c797ea110f6cde91bc6af338e38be7d96f71f6474cb SHA512 824d35e037f1036d53353bd0e2bf9136cd94d07a71df9ebdf32a513ff53a47b25e38e3b760e58c18909559f1adbea2faae615c25f2cf9f1df03eef8582648bcc
AUX tpm-emulator.initd 776 BLAKE2B 0daa0247396d1b5f1c9542b28f825899a5cc45bd748b6b7e2328440fd466fd6b461e32487a955816a79827bf350cfb33bd71a6b197a8e67dbf5509750098cb59 SHA512 22d7b163dc6f567c1900a275ae545c4421b2d459ba535a24f48d7ad2609f5df36533849aa781d4dd704961db102eea08c99b79c01d0e3981fb46d2eb4e39d6fe
DIST tpm-emulator-0.7.5.tar.gz 222341 BLAKE2B c6dc7494800f4c6d1f5e622c6a47fdd5487e0f2cbc34173d9039d6eb5fd7541dd2c1f514efbf220c605424059844e18650b31ee9934eda6626427b915fd6bc53 SHA512 24c16ec36ca92c484d6e8dfa53c8ca00dbc5b58d78d7166041db1e9ae277d763f0fc0a6b0cbd7e62fcf4671f6ad2d8df1213256be0a4200b79b6ee61ab73b2ef
-EBUILD tpm-emulator-0.7.5-r2.ebuild 1714 BLAKE2B 2f744d0459de294b1dd33ee86c9e918a30049b1dae1f19fea6cb741bc5e6a918d48b04feeac02466d5526613ab948666cc89b572440a7b73e629f3f20446c902 SHA512 4c51b445c5743f89db230d5a4630cf1c3cac963fa5e485baac5fa0eeaf62fe0aa187e2b247a91fd42bafc095ac0d9aeab6ec445c0a5bf2c1edbaf809875e0afe
+EBUILD tpm-emulator-0.7.5-r3.ebuild 1761 BLAKE2B df8e42d04abd6aeda040e3e64f6136a6ffc581fe6f7626a29a81aa0a9741631976f25353c51544d1c083787ef0d5211f75999319f27361ffe0d179d158b7ccca SHA512 f512acce103dcef68660b7dad896865013a30c32153dc8b47baf479cea01da520024076532f5ed794eba98136f834a05165ebd9b3c758c2526b1ba8b94df5860
MISC metadata.xml 322 BLAKE2B 152476fdbb201eb989479f5d304b14075c7f0fabbc31776ce2c553659c60847a6c5c5ce94a8db678bf4d4100cc5fbc284982ceb790b6486723842deae903e9f0 SHA512 bedc51c7cf05986ce745bd848a7bca2be7230c53764bab7cbc3732b5c817bde999a09739dd02fdbee455eba5c2efd957ccc27ff3ccbcfcfe81eca7b9dc01b8f1
diff --git a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-fno-common.patch b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-fno-common.patch
new file mode 100644
index 000000000000..88bfb33433c1
--- /dev/null
+++ b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-fno-common.patch
@@ -0,0 +1,48 @@
+https://bugs.gentoo.org/707256
+--- a/tpm/tpm_emulator_extern.h
++++ b/tpm/tpm_emulator_extern.h
+@@ -29,7 +29,7 @@ enum {
+ TPM_LOG_ERROR
+ };
+
+-void (*tpm_log)(int priority, const char *fmt, ...);
++extern void (*tpm_log)(int priority, const char *fmt, ...);
+
+ #if defined(_WIN32) || defined(_WIN64)
+ #define __BFILE__ ((strrchr(__FILE__, '\\') ? : __FILE__ - 1) + 1)
+@@ -44,27 +44,27 @@ void (*tpm_log)(int priority, const char *fmt, ...);
+ #define error(fmt, ...) tpm_log(TPM_LOG_ERROR, "%s:%d: Error: " fmt "\n", \
+ __BFILE__, __LINE__, ## __VA_ARGS__)
+ /* initialization */
+-int (*tpm_extern_init)(void);
+-void (*tpm_extern_release)(void);
++extern int (*tpm_extern_init)(void);
++extern void (*tpm_extern_release)(void);
+
+ /* memory allocation */
+
+-void* (*tpm_malloc)(size_t size);
++extern void* (*tpm_malloc)(size_t size);
+
+-void (*tpm_free)(/*const*/ void *ptr);
++extern void (*tpm_free)(/*const*/ void *ptr);
+
+ /* random numbers */
+
+-void (*tpm_get_extern_random_bytes)(void *buf, size_t nbytes);
++extern void (*tpm_get_extern_random_bytes)(void *buf, size_t nbytes);
+
+ /* usec since last call */
+
+-uint64_t (*tpm_get_ticks)(void);
++extern uint64_t (*tpm_get_ticks)(void);
+
+ /* file handling */
+
+-int (*tpm_write_to_storage)(uint8_t *data, size_t data_length);
+-int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length);
++extern int (*tpm_write_to_storage)(uint8_t *data, size_t data_length);
++extern int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length);
+
+ #endif /* _TPM_EMULATOR_EXTERN_H_ */
+
diff --git a/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-static-libs.patch b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-static-libs.patch
new file mode 100644
index 000000000000..845229bd7670
--- /dev/null
+++ b/app-crypt/tpm-emulator/files/tpm-emulator-0.7.5-static-libs.patch
@@ -0,0 +1,26 @@
+https://bugs.gentoo.org/726492
+--- a/tddl/CMakeLists.txt
++++ b/tddl/CMakeLists.txt
+@@ -5,21 +5,18 @@
+
+ set(tddl-tpm-emulator_SRCS "tddl.c" "tddl-tpm-emulator.h")
+ add_library(tddl-tpm-emulator SHARED ${tddl-tpm-emulator_SRCS})
+-add_library(tddl-tpm-emulator_static STATIC ${tddl-tpm-emulator_SRCS})
+ if(UNIX)
+ set_target_properties(tddl-tpm-emulator PROPERTIES SOVERSION "1.2"
+ VERSION "1.2.${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}")
+- set_target_properties(tddl-tpm-emulator_static PROPERTIES OUTPUT_NAME tddl-tpm-emulator)
+ elseif(WIN32)
+ set_target_properties(tddl-tpm-emulator PROPERTIES OUTPUT_NAME ifxtpm)
+ set_target_properties(tddl-tpm-emulator PROPERTIES PREFIX "")
+ endif()
+
+ install(TARGETS tddl-tpm-emulator DESTINATION ${CMAKE_INSTALL_LIBDIR})
+-install(TARGETS tddl-tpm-emulator_static DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(FILES "tddl-tpm-emulator.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+ add_executable(test_tddl test_tddl.c)
+-target_link_libraries(test_tddl tddl-tpm-emulator_static)
++target_link_libraries(test_tddl tddl-tpm-emulator)
+
diff --git a/app-crypt/tpm-emulator/tpm-emulator-0.7.5-r2.ebuild b/app-crypt/tpm-emulator/tpm-emulator-0.7.5-r3.ebuild
index 9323c1f7edcb..38a0d0182708 100644
--- a/app-crypt/tpm-emulator/tpm-emulator-0.7.5-r2.ebuild
+++ b/app-crypt/tpm-emulator/tpm-emulator-0.7.5-r3.ebuild
@@ -1,30 +1,34 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=6
+EAPI=7
+
MODULES_OPTIONAL_USE="modules"
-inherit user linux-mod cmake-utils udev
+inherit cmake linux-mod udev
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"
-LICENSE="GPL-2"
+LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
-
IUSE="mtm-emulator"
-RDEPEND="dev-libs/gmp:="
+
+RDEPEND="
+ acct-group/tpm
+ acct-user/tpm
+ dev-libs/gmp:="
DEPEND="${RDEPEND}"
PATCHES=(
- "${FILESDIR}/${P}-build.patch"
+ "${FILESDIR}"/${P}-build.patch
+ "${FILESDIR}"/${P}-fno-common.patch
+ "${FILESDIR}"/${P}-static-libs.patch
)
pkg_setup() {
- enewgroup tss
- enewuser tss -1 -1 /var/lib/tpm tss
if use modules; then
CONFIG_CHECK="MODULES"
MODULE_NAMES="tpmd_dev(extra:tpmd_dev/linux:)"
@@ -39,18 +43,20 @@ src_configure() {
-DMTM_EMULATOR=$(usex mtm-emulator ON OFF)
-DBUILD_DEV=OFF
)
- cmake-utils_src_configure
+ cmake_src_configure
- use modules && ln -s "${BUILD_DIR}/config.h" tpmd_dev/linux
+ if use modules; then
+ ln -s "${BUILD_DIR}/config.h" tpmd_dev/linux || die
+ fi
}
src_compile() {
- cmake-utils_src_compile
+ cmake_src_compile
use modules && linux-mod_src_compile
}
src_install() {
- cmake-utils_src_install
+ cmake_src_install
if use modules; then
linux-mod_src_install
udev_newrules "tpmd_dev/linux/tpmd_dev.rules" 60-tpmd_dev.rules