[Midnightbsd-cvs] mports [17323] trunk/emulators: tpm-emulator port added

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Mon Sep 15 21:38:23 EDT 2014


Revision: 17323
          http://svnweb.midnightbsd.org/mports/?rev=17323
Author:   laffer1
Date:     2014-09-15 21:38:22 -0400 (Mon, 15 Sep 2014)
Log Message:
-----------
tpm-emulator port added

Modified Paths:
--------------
    trunk/emulators/Makefile

Added Paths:
-----------
    trunk/emulators/tpm-emulator/
    trunk/emulators/tpm-emulator/Makefile
    trunk/emulators/tpm-emulator/distinfo
    trunk/emulators/tpm-emulator/files/
    trunk/emulators/tpm-emulator/files/patch-CMakeLists.txt
    trunk/emulators/tpm-emulator/files/patch-tddl-CMakeLists.txt
    trunk/emulators/tpm-emulator/files/patch-tpmd-CMakeLists.txt
    trunk/emulators/tpm-emulator/files/patch-tpmd-unix-CMakeLists.txt
    trunk/emulators/tpm-emulator/files/tpmd.in
    trunk/emulators/tpm-emulator/pkg-descr
    trunk/emulators/tpm-emulator/pkg-plist

Modified: trunk/emulators/Makefile
===================================================================
--- trunk/emulators/Makefile	2014-09-16 01:36:53 UTC (rev 17322)
+++ trunk/emulators/Makefile	2014-09-16 01:38:22 UTC (rev 17323)
@@ -17,6 +17,7 @@
 SUBDIR += pearpc
 SUBDIR += qemu
 SUBDIR += rtc
+SUBDIR += tpm-emulator
 SUBDIR += vMac
 SUBDIR += virtio-kmod
 SUBDIR += vxtools

Added: trunk/emulators/tpm-emulator/Makefile
===================================================================
--- trunk/emulators/tpm-emulator/Makefile	                        (rev 0)
+++ trunk/emulators/tpm-emulator/Makefile	2014-09-16 01:38:22 UTC (rev 17323)
@@ -0,0 +1,35 @@
+# $MidnightBSD$
+
+PORTNAME=	tpm-emulator
+PORTVERSION=	0.7.4
+CATEGORIES=	emulators security
+MASTER_SITES=	SF/${PORTNAME}.berlios
+DISTNAME=	${PORTNAME:S,-,_,}-${PORTVERSION}
+
+MAINTAINER=	ports at MidnightBSD.org
+COMMENT=	Trusted Platform Module (TPM) emulator
+
+LICENSE=	gpl2
+
+LIB_DEPENDS=	libgmp.so:${PORTSDIR}/math/gmp
+
+CONFLICTS=	trousers-tddl-[0-9]*
+
+USES=		cmake:outsource
+USE_RC_SUBR=	tpmd
+CMAKE_ENV=	PREFIX="${PREFIX}"
+CMAKE_ARGS=	-DTPM_INCLUDE_DIRS:STRING="${LOCALBASE}/include" \
+		-DTPM_LIBRARY_DIRS:STRING="${LOCALBASE}/lib"
+USE_LDCONFIG=	yes
+USERS=		_tss
+GROUPS=		_tss
+SUB_LIST=	USERS="${USERS}" GROUPS="${GROUPS}"
+
+post-install:
+	@${ECHO_CMD} "@exec ${INSTALL} -d -o ${USERS} -g ${GROUPS} -m 0700 /var/run/tpm" >> ${TMPPLIST}
+	@${MKDIR} ${STAGEDIR}/var/run/tpm
+	@${ECHO_CMD} "@dirrmtry /var/run/tpm" >> ${TMPPLIST}
+	@${ECHO_CMD} "@exec ${INSTALL} -d -o ${USERS} -g ${GROUPS} -m 0700 %D/var/db/tpm" >> ${TMPPLIST}
+	@${MKDIR} ${STAGEDIR}/${PREFIX}/var/db/tpm
+
+.include <bsd.port.mk>

Added: trunk/emulators/tpm-emulator/distinfo
===================================================================
--- trunk/emulators/tpm-emulator/distinfo	                        (rev 0)
+++ trunk/emulators/tpm-emulator/distinfo	2014-09-16 01:38:22 UTC (rev 17323)
@@ -0,0 +1,2 @@
+SHA256 (tpm_emulator-0.7.4.tar.gz) = 4e48ea0d83dd9441cc1af04ab18cd6c961b9fa54d5cbf2c2feee038988dea459
+SIZE (tpm_emulator-0.7.4.tar.gz) = 214145

Added: trunk/emulators/tpm-emulator/files/patch-CMakeLists.txt
===================================================================
--- trunk/emulators/tpm-emulator/files/patch-CMakeLists.txt	                        (rev 0)
+++ trunk/emulators/tpm-emulator/files/patch-CMakeLists.txt	2014-09-16 01:38:22 UTC (rev 17323)
@@ -0,0 +1,26 @@
+--- CMakeLists.txt.orig	2010-07-06 06:21:20.000000000 +0900
++++ CMakeLists.txt	2010-12-15 07:33:54.234887143 +0900
+@@ -36,19 +36,19 @@
+ else()
+ set(TPM_LOG_FILE "/var/log/tpmd.log")
+ set(TPM_SOCKET_NAME "/var/run/tpm/tpmd_socket:0")
+-set(TPM_STORAGE_NAME "/var/lib/tpm/tpm_emulator-1_2_${${PROJECT_NAME}_VERSION_MAJOR}_${${PROJECT_NAME}_VERSION_MINOR}")
++set(TPM_STORAGE_NAME "$ENV{PREFIX}/var/db/tpm/tpm_emulator-1_2_${${PROJECT_NAME}_VERSION_MAJOR}_${${PROJECT_NAME}_VERSION_MINOR}")
+ set(TPM_DEVICE_NAME "/dev/tpm")
+ endif()
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
+-add_definitions(-Wall -Werror -Wno-unused-parameter -Wpointer-arith -Wcast-align -Wwrite-strings)
++add_definitions(-Wall -Wno-unused-parameter -Wpointer-arith -Wcast-align -Wwrite-strings)
+ if("${CMAKE_SYSTEM}" MATCHES "Linux")
+     add_definitions(-Wextra)
+ endif()
+ if(USE_OPENSSL)
+     add_definitions(-DUSE_OPENSSL)
+ endif()
+-include_directories("/opt/local/include")
+-link_directories("/opt/local/lib")
++include_directories(${TPM_INCLUDE_DIRS})
++link_directories(${TPM_LIBRARY_DIRS})
+ 
+ # configure CPack
+ set(CPACK_PACKAGE_VERSION_MAJOR ${${PROJECT_NAME}_VERSION_MAJOR})

Added: trunk/emulators/tpm-emulator/files/patch-tddl-CMakeLists.txt
===================================================================
--- trunk/emulators/tpm-emulator/files/patch-tddl-CMakeLists.txt	                        (rev 0)
+++ trunk/emulators/tpm-emulator/files/patch-tddl-CMakeLists.txt	2014-09-16 01:38:22 UTC (rev 17323)
@@ -0,0 +1,18 @@
+--- tddl/CMakeLists.txt.orig	2011-12-21 03:30:06.000000000 +0900
++++ tddl/CMakeLists.txt	2012-10-10 01:01:00.000000000 +0900
+@@ -7,13 +7,13 @@
+ add_library(tddl SHARED ${tddl_SRCS})
+ add_library(tddl_static STATIC ${tddl_SRCS})
+ if(UNIX)
+-  set_target_properties(tddl PROPERTIES SOVERSION "1.2"
++  set_target_properties(tddl PROPERTIES SOVERSION "1"
+     VERSION "1.2.${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}")
+   set_target_properties(tddl_static PROPERTIES OUTPUT_NAME tddl)
+ elseif(WIN32)
+   set_target_properties(tddl PROPERTIES OUTPUT_NAME ifxtpm)
+   set_target_properties(tddl PROPERTIES PREFIX "")
+-endif()
++endif(UNIX)
+ 
+ install(TARGETS tddl DESTINATION lib)
+ install(TARGETS tddl_static DESTINATION lib)

Added: trunk/emulators/tpm-emulator/files/patch-tpmd-CMakeLists.txt
===================================================================
--- trunk/emulators/tpm-emulator/files/patch-tpmd-CMakeLists.txt	                        (rev 0)
+++ trunk/emulators/tpm-emulator/files/patch-tpmd-CMakeLists.txt	2014-09-16 01:38:22 UTC (rev 17323)
@@ -0,0 +1,9 @@
+--- tpmd/CMakeLists.txt.orig	2010-07-06 06:21:20.000000000 +0900
++++ tpmd/CMakeLists.txt	2010-10-25 02:56:43.624559116 +0900
+@@ -11,5 +11,5 @@
+ 
+ add_subdirectory(windows)
+ 
+-endif()
++endif(UNIX)
+ 

Added: trunk/emulators/tpm-emulator/files/patch-tpmd-unix-CMakeLists.txt
===================================================================
--- trunk/emulators/tpm-emulator/files/patch-tpmd-unix-CMakeLists.txt	                        (rev 0)
+++ trunk/emulators/tpm-emulator/files/patch-tpmd-unix-CMakeLists.txt	2014-09-16 01:38:22 UTC (rev 17323)
@@ -0,0 +1,13 @@
+--- tpmd/unix/CMakeLists.txt.orig	2011-12-21 03:30:06.000000000 +0900
++++ tpmd/unix/CMakeLists.txt	2012-10-10 01:03:34.000000000 +0900
+@@ -10,8 +10,8 @@
+ if(MTM_EMULATOR)
+ add_definitions(-DMTM_EMULATOR)
+ target_link_libraries(tpmd mtm tpm tpm_crypto)
+-else()
++else(MTM_EMULATOR)
+ target_link_libraries(tpmd tpm tpm_crypto)
+-endif()
++endif(MTM_EMULATOR)
+ install(TARGETS tpmd RUNTIME DESTINATION bin)
+ 

Added: trunk/emulators/tpm-emulator/files/tpmd.in
===================================================================
--- trunk/emulators/tpm-emulator/files/tpmd.in	                        (rev 0)
+++ trunk/emulators/tpm-emulator/files/tpmd.in	2014-09-16 01:38:22 UTC (rev 17323)
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# $FreeBSD: head/emulators/tpm-emulator/files/tpmd.in 340872 2014-01-24 00:14:07Z mat $
+#
+# PROVIDE: tpmd
+# REQUIRE: SERVERS
+# BEFORE:  tcsd
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# tpmd_enable (bool):	Set to NO by default.
+#			Set it to YES to enable tpmd.
+
+. /etc/rc.subr
+
+name=tpmd
+rcvar=tpmd_enable
+command="%%PREFIX%%/bin/${name}"
+
+load_rc_config $name
+
+tpmd_enable=${tpmd_enable-"NO"}
+tpmd_user=${tpmd_user-"%%USERS%%"}
+tpmd_group=${tpmd_group-"%%GROUPS%%"}
+
+command_args="-o ${tpmd_user} -g ${tpmd_group}"
+unset tpmd_user tpmd_group
+
+run_rc_command "$1"

Added: trunk/emulators/tpm-emulator/pkg-descr
===================================================================
--- trunk/emulators/tpm-emulator/pkg-descr	                        (rev 0)
+++ trunk/emulators/tpm-emulator/pkg-descr	2014-09-16 01:38:22 UTC (rev 17323)
@@ -0,0 +1,6 @@
+The project aims to create a fully working Trusted Platform Module (TPM)
+emulator follwing the specifications of the Trusted Computing Group. The
+port provides a driver library libtddl which can be linked against programs
+providing a Trusted Software Stack to redirect TPM calls to the emulator.
+
+WWW: http://tpm-emulator.berlios.de/

Added: trunk/emulators/tpm-emulator/pkg-plist
===================================================================
--- trunk/emulators/tpm-emulator/pkg-plist	                        (rev 0)
+++ trunk/emulators/tpm-emulator/pkg-plist	2014-09-16 01:38:22 UTC (rev 17323)
@@ -0,0 +1,10 @@
+bin/tpmd
+include/tddl.h
+lib/libtddl.a
+lib/libtddl.so
+lib/libtddl.so.1
+lib/libtddl.so.1.2.0.7
+ at dirrmtry var/db/tpm
+ at dirrmtry var/db
+ at exec mkdir -p %D/var
+ at dirrmtry var



More information about the Midnightbsd-cvs mailing list