SET(TARGET_TEF_SIMULATOR_OSAL ${TARGET_TEF_SIMULATOR}-osal)
SET(TARGET_TEF_SIMULATOR_DAEMON ${TARGET_TEF_SIMULATOR}-daemon)
SET(TARGET_TEF_SIMULATOR_SSFLIB ${TARGET_TEF_SIMULATOR}-ssflib)
-SET(TARGET_TEF_SIMULATOR_HELLO_WORLD_CA ${TARGET_TEF_SIMULATOR}-helloworld)
-
-# helloworld TA needs to be named after its UUID
-SET(TARGET_TEF_SIMULATOR_HELLO_WORLD_TA 00000000-0000-0000-0000-112233445566)
# below targets need different names due to linking with CAs and TAs (libteec for client)
SET(TARGET_TEF_SIMULATOR_TEEC_LIB teec)
# osal
SET(OSAL_PATH ${TEF_SIMULATOR_ROOT_PATH}/osal)
+# PackageMaker
+SET(PACKAGE_MAKER_PATH ${TEF_SIMULATOR_ROOT_PATH}/PackageMaker)
+
# ssflib
SET(SSFLIB_PATH ${TEF_SIMULATOR_ROOT_PATH}/ssflib)
SET(SSFLIB_DEP_PATH ${SSFLIB_PATH}/dep)
# TEEStub
SET(TEE_STUB_PATH ${TEF_SIMULATOR_ROOT_PATH}/TEEStub)
-# helloworld
-SET(HELLO_WORLD_PATH ${TEF_SIMULATOR_ROOT_PATH}/helloworld)
-SET(HELLO_WORLD_TA_PATH ${HELLO_WORLD_PATH}/ta)
-SET(HELLO_WORLD_CA_PATH ${HELLO_WORLD_PATH}/host)
-
-
############################# subdirectories ##################################
+ADD_SUBDIRECTORY(cmake)
ADD_SUBDIRECTORY(log)
ADD_SUBDIRECTORY(osal)
+ADD_SUBDIRECTORY(PackageMaker)
+ADD_SUBDIRECTORY(pkgconfig)
ADD_SUBDIRECTORY(simulatordaemon)
ADD_SUBDIRECTORY(ssflib)
ADD_SUBDIRECTORY(TEECLib)
ADD_SUBDIRECTORY(TEEStub)
-ADD_SUBDIRECTORY(helloworld)
--- /dev/null
+# Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# @file
+# @author Lukasz Kostyra (l.kostyra@samsung.com)
+# @brief CMakeLists for tef-simulator TA Package Maker
+#
+
+SET(PACKAGE_MAKER_BINARIES
+ ${PACKAGE_MAKER_PATH}/TA_PackageBuilder.sh
+ ${PACKAGE_MAKER_PATH}/TAPackageMaker
+ )
+
+INSTALL(PROGRAMS ${PACKAGE_MAKER_BINARIES} DESTINATION ${BIN_DIR})
--- /dev/null
+#!/bin/bash
+
+TA_SYS_PASS=$1
+INPUT_IMAGE_NAME=$2
+INPUT_IMAGE_MANIFEST=$3
+
+TARGET_SHA_TYPE=sha256
+TARGET_PAGE_SIZE=2048
+
+EXE_PATH=$(readlink -f $(dirname "$0"))
+
+cookie=~/cookies.txt
+
+function func_make_package()
+{
+ echo "Making package"
+
+ if [ "$TA_LAUNCH_MODE" = "debug" ]
+ then
+ #TA Packaging
+ $TA_SYS_PASS/TAPackageMaker $INPUT_IMAGE_NAME $INPUT_IMAGE_MANIFEST $TA_CERTIFICATE $TA_PRIVATE_KEY
+ elif [ "$TA_LAUNCH_MODE" = "release" ]
+ then
+ echo "Release building unimplemented"
+ #TA Packaging
+ $TA_SYS_PASS/TAPackageMaker $INPUT_IMAGE_NAME $INPUT_IMAGE_MANIFEST $TA_CERTIFICATE $TA_PRIVATE_KEY
+ else
+ echo "LAUNCH_MODE Error.!!!"
+ exit -1
+ fi
+
+}
+
+function func_create_certificate()
+{
+ # Generate private key
+ openssl genrsa -out $TA_PRIVATE_KEY 2048
+ # Generate CSR
+ openssl req -new -key $TA_PRIVATE_KEY -out $TA_CERTIFICATE_CSR -subj "/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd"
+
+ if [ "$TA_LAUNCH_MODE" = "debug" ]
+ then
+ #generate self-signed certificate
+ openssl x509 -req -days 3650 -in $TA_CERTIFICATE_CSR -extensions v3_ca -signkey $TA_PRIVATE_KEY -out $TA_CERTIFICATE
+ elif [ "$TA_LAUNCH_MODE" = "release" ]
+ then
+ echo "Need to implement.."
+ #generate self-signed certificate
+ openssl x509 -req -days 3650 -in $TA_CERTIFICATE_CSR -extensions v3_ca -signkey $TA_PRIVATE_KEY -out $TA_CERTIFICATE
+ else
+ echo "LAUNCH_MODE Error.!!!"
+ exit -1
+ fi
+}
+
+function func_package_build()
+{
+ # parse manifest
+ export TA_LAUNCH_MODE=$(grep -oP '(?<=launchMode).*(?=")' $INPUT_IMAGE_MANIFEST | grep -oP '(?<=").*(?=)')
+
+ export TA_PRIVILEGE=$(grep -oP '(?<=privilege name).*(?=/>)' $INPUT_IMAGE_MANIFEST | grep -oP '(?<=").*(?=")')
+
+ if [ "$TA_LAUNCH_MODE" = "debug" ]
+ then
+ TA_KEYFOLDER=keystore/debug/
+ elif [ "$TA_LAUNCH_MODE" = "release" ]
+ then
+ TA_KEYFOLDER=keystore/$TA_PRIVILEGE/
+ else
+ echo "LAUNCH_MODE Error.!!!"
+ exit -1
+ fi
+
+ export TA_PRIVATE_KEY=$TA_KEYFOLDER/Kaa_private.pem
+ export TA_CERTIFICATE_CSR=$TA_KEYFOLDER/Kaa_csr.pem
+ export TA_CERTIFICATE=$TA_KEYFOLDER/Kaa_cert.pem
+
+ mkdir -p $TA_KEYFOLDER
+
+ if [ -f $TA_KEYFOLDER/Kaa_cert.pem ]
+ then
+ echo "Certificate exists."
+ else
+ echo "Certificate does NOT exist."
+ func_create_certificate
+ fi
+
+ func_make_package
+}
+
+func_package_build
${TEEC_LIB_PATH}/src/teec_connection.c
)
+SET(TEEC_LIB_HEADERS
+ ${TEF_SIMULATOR_INCLUDE_PATH}/include/tee_client_api.h
+ )
+
ADD_LIBRARY(${TARGET_TEF_SIMULATOR_TEEC_LIB} SHARED
${TEEC_LIB_SOURCES}
)
${TARGET_TEF_SIMULATOR_LOG}
)
-INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_TEEC_LIB} DESTINATION ${LIB_INSTALL_DIR})
+INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_TEEC_LIB} DESTINATION ${LIB_DIR})
+INSTALL(FILES ${TEEC_LIB_HEADERS} DESTINATION ${INCLUDE_DIR})
${TEE_STUB_PATH}/TEEStubServer/TADebug.cpp
)
+SET(TEE_STUB_HEADERS
+ ${TEF_SIMULATOR_INCLUDE_PATH}/include/tee_internal_api.h
+ )
+
ADD_LIBRARY(${TARGET_TEF_SIMULATOR_TEE_STUB} STATIC
${TEE_STUB_SOURCES}
)
boost_system boost_thread
)
-INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_TEE_STUB} DESTINATION ${LIB_INSTALL_DIR})
+INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_TEE_STUB} DESTINATION ${LIB_DIR})
+INSTALL(FILES ${TEE_STUB_HEADERS} DESTINATION ${INCLUDE_DIR})
--- /dev/null
+# Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# @file CMakeLists.txt
+# @author Lukasz Kostyra (l.kostyra@samsung.com)
+# @brief CMakeLists file for TEF Simulator CMake Devkit module
+#
+
+INSTALL(FILES
+ ${TEF_SIMULATOR_ROOT_PATH}/cmake/TEFSimulatorDevkit.cmake
+ DESTINATION
+ ${DATA_DIR}/cmake/Modules/
+ )
--- /dev/null
+# @file
+# @author Lukasz Kostyra (l.kostyra@samsung.com)
+# @brief CMake TA development kit module
+
+MESSAGE(STATUS "TEF Simulator Devkit included!")
+
+FIND_PROGRAM(TA_PACKAGE_MAKER TAPackageMaker PATHS /usr/bin)
+FIND_PROGRAM(TA_PACKAGE_BUILDER TA_PackageBuilder.sh PATHS /usr/bin)
+
+IF(NOT TA_PACKAGE_MAKER)
+ MESSAGE(FATAL_ERROR "TAPacakgeMaker tool not found.")
+ENDIF()
+
+IF(NOT TA_PACKAGE_BUILDER)
+ MESSAGE(FATAL_ERROR "TA_PackageBuilder.sh script not found.")
+ENDIF()
+
+MACRO(TEF_GENERATE_TA_IMAGE TargetName TAManifestFile TAImageName)
+ SET(STRIPPED_TARGET_FILE ${CMAKE_CURRENT_BINARY_DIR}/${TargetName}.strip)
+
+ ADD_CUSTOM_COMMAND(TARGET ${TargetName} POST_BUILD
+ COMMAND ${CMAKE_STRIP} --strip-unneeded -o ${STRIPPED_TARGET_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${TargetName}
+ COMMENT "Stripping image")
+
+ STRING(TOUPPER "${TargetName}" TargetOutName)
+ STRING(REPLACE "-" "" TargetImage ${TargetOutName})
+
+ SET(${TAImageName} ${TargetImage})
+ ADD_CUSTOM_COMMAND(TARGET ${TargetName} POST_BUILD
+ COMMAND ${TA_PACKAGE_BUILDER} /usr/bin ${STRIPPED_TARGET_FILE} ${TAManifestFile}
+ COMMENT "Signing and encrypting image ${${TAImageName}}")
+ENDMACRO()
#
# @file
# @author Lukasz Kostyra (l.kostyra@samsung.com)
-# @brief CMakeLists for tef-simulator CA and TA
+# @brief CMakeLists for hello world CA and TA
#
+############# Entry defines #############
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT("tef-simulator-helloworld")
+
+INCLUDE(FindPkgConfig)
+
+PKG_CHECK_MODULES(HELLO_WORLD_TA_DEPS REQUIRED
+ tef-simulator-devkit
+ )
+
+# TODO CMake include provided by devkit to encrypt/sign TA
+INCLUDE(TEFSimulatorDevkit)
+
+SET(TARGET_HELLO_WORLD_CA tef-simulator-helloworld)
+SET(TARGET_HELLO_WORLD_TA 00000000-0000-0000-0000-112233445566)
+
+SET(HELLO_WORLD_PATH ${PROJECT_SOURCE_DIR})
+SET(HELLO_WORLD_TA_PATH ${HELLO_WORLD_PATH}/ta)
+SET(HELLO_WORLD_CA_PATH ${HELLO_WORLD_PATH}/host)
+
############# TA #############
SET(HELLO_WORLD_TA_SOURCES
${HELLO_WORLD_TA_PATH}/hello_world.c
)
-ADD_EXECUTABLE(${TARGET_TEF_SIMULATOR_HELLO_WORLD_TA}
+ADD_EXECUTABLE(${TARGET_HELLO_WORLD_TA}
${HELLO_WORLD_TA_SOURCES}
)
-ADD_DEPENDENCIES(${TARGET_TEF_SIMULATOR_HELLO_WORLD_TA}
- ${TARGET_TEF_SIMULATOR_TEE_STUB}
- )
-
-INCLUDE_DIRECTORIES(
- ${TEF_SIMULATOR_INCLUDE_PATH}/include
+# TEEStub is built in C++, so we must force linking using C++ linker
+SET_TARGET_PROPERTIES(${TARGET_HELLO_WORLD_TA} PROPERTIES
+ LINKER_LANGUAGE "CXX"
)
-TARGET_LINK_LIBRARIES(${TARGET_TEF_SIMULATOR_HELLO_WORLD_TA}
- ${TARGET_TEF_SIMULATOR_TEE_STUB}
+# TODO make pkgconfig to hide these deps
+TARGET_LINK_LIBRARIES(${TARGET_HELLO_WORLD_TA}
+ ${HELLO_WORLD_TA_DEPS_LIBRARIES}
)
-# TODO directory for TAs
-INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_HELLO_WORLD_TA} DESTINATION ${TASTORE_DIR})
+TEF_GENERATE_TA_IMAGE(${TARGET_HELLO_WORLD_TA} ${HELLO_WORLD_TA_PATH}/hello_world.xml HELLO_WORLD_TA_IMAGE)
+INSTALL(FILES ${HELLO_WORLD_TA_IMAGE} DESTINATION ${TASTORE_DIR})
############# CA #############
${HELLO_WORLD_CA_PATH}/main.c
)
-ADD_EXECUTABLE(${TARGET_TEF_SIMULATOR_HELLO_WORLD_CA}
+ADD_EXECUTABLE(${TARGET_HELLO_WORLD_CA}
${HELLO_WORLD_CA_SOURCES}
)
-ADD_DEPENDENCIES(${TARGET_TEF_SIMULATOR_HELLO_WORLD_CA}
- ${TARGET_TEF_SIMULATOR_TEEC_LIB}
- ${TARGET_TEF_SIMULATOR_HELLO_WORLD_TA}
- )
-
INCLUDE_DIRECTORIES(
- ${TEF_SIMULATOR_INCLUDE_PATH}/include
${HELLO_WORLD_TA_PATH}
)
-TARGET_LINK_LIBRARIES(${TARGET_TEF_SIMULATOR_HELLO_WORLD_CA}
- ${TARGET_TEF_SIMULATOR_TEEC_LIB}
+TARGET_LINK_LIBRARIES(${TARGET_HELLO_WORLD_CA}
+ teec
)
-INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_HELLO_WORLD_CA} DESTINATION ${BIN_DIR})
+INSTALL(TARGETS ${TARGET_HELLO_WORLD_CA} DESTINATION ${BIN_DIR})
return TEE_SUCCESS;
}
-void TA_CloseSessionEntryPoint(const void *sess_ctx)
+void TA_CloseSessionEntryPoint(void *sess_ctx)
{
(void)&sess_ctx;
LOG_FUNC();
return TEE_SUCCESS;
}
-TEE_Result TA_InvokeCommandEntryPoint(const void *sess_ctx,
+TEE_Result TA_InvokeCommandEntryPoint(void *sess_ctx,
uint32_t cmd_id,
uint32_t param_types,
TEE_Param params[4])
* @return his function can return no success or error code.
*
*/
-void TA_EXPORT TA_CloseSessionEntryPoint(const void* sessionContext);
+void TA_EXPORT TA_CloseSessionEntryPoint(void* sessionContext);
/**
* Invokes a command within the given sessionContext
* itself. In any case, the Implementation reports the error code to the client
* with the origin @ref TEEC_ORIGIN_TRUSTED_APP.
*/
-TEE_Result TA_EXPORT TA_InvokeCommandEntryPoint(const void* sessionContext,
+TEE_Result TA_EXPORT TA_InvokeCommandEntryPoint(void* sessionContext,
uint32_t commandID,
uint32_t paramTypes,
TEE_Param params[4]);
ADD_LIBRARY(${TARGET_TEF_SIMULATOR_LOG} ${LOG_SOURCES})
-INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_LOG} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
+INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_LOG} DESTINATION ${LIB_DIR})
ADD_LIBRARY(${TARGET_TEF_SIMULATOR_OSAL} ${OSAL_SOURCES})
-INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_OSAL} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
+INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_OSAL} DESTINATION ${LIB_DIR})
--- /dev/null
+Name: tef-simulator-helloworld
+Summary: Hello World application for TEF TrustZone simulator
+Version: 0.0.1
+Release: 1
+Group: Security
+License: Apache-2.0 and BSD-3-Clause
+Source0: %{name}-%{version}.tar.gz
+BuildRequires: cmake
+BuildRequires: boost-devel
+BuildRequires: pkgconfig(tef-simulator-devkit)
+BuildRequires: tef-simulator-client-devel
+Requires: tef-simulator
+
+%define bin_dir %{?TZ_SYS_BIN:%TZ_SYS_BIN}%{!?TZ_SYS_BIN:%_bindir}
+%define lib_dir %{?TZ_SYS_LIB:%TZ_SYS_LIB}%{!?TZ_SYS_LIB:%_libdir}
+%define include_dir %{?TZ_SYS_INCLUDE:%TZ_SYS_INCLUDE}%{!?TZ_SYS_INCLUDE:%_includedir}
+%define tastore_dir %{lib_dir}/tastore
+
+%define build_bin_dir %{buildroot}%{bin_dir}
+%define build_include_dir %{buildroot}%{include_dir}
+%define build_tastore_dir %{buildroot}%{tastore_dir}
+
+%description
+An example Hello World application, for TEF TrustZone simulator
+testing purposes.
+
+%prep
+%setup -q
+
+%build
+cd helloworld
+cmake . \
+ -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE} \
+ -DBIN_DIR=%{build_bin_dir} \
+ -DINCLUDE_DIR=%{include_dir} \
+ -DTASTORE_DIR=%{build_tastore_dir}
+make %{?jobs:-j%jobs}
+
+%install
+cd helloworld
+make install
+
+%pre
+
+%post
+tef-simulator-update-uuid-list.sh 00000000000000000000112233445566
+
+%preun
+
+%postun
+
+%files -n %{name}
+%{bin_dir}/tef-simulator-helloworld
+%{tastore_dir}/00000000000000000000112233445566
BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(security-manager)
-%global bin_dir %{?TZ_SYS_BIN:%TZ_SYS_BIN}%{!?TZ_SYS_BIN:%_bindir}
-%global sbin_dir %{?TZ_SYS_SBIN:%TZ_SYS_SBIN}%{!?TZ_SYS_SBIN:%_sbindir}
-%global lib_dir %{?TZ_SYS_LIB:%TZ_SYS_LIB}%{!?TZ_SYS_LIB:%_libdir}
-%global tastore_dir %{lib_dir}/tastore
+%define bin_dir %{?TZ_SYS_BIN:%TZ_SYS_BIN}%{!?TZ_SYS_BIN:%_bindir}
+%define sbin_dir %{?TZ_SYS_SBIN:%TZ_SYS_SBIN}%{!?TZ_SYS_SBIN:%_sbindir}
+%define lib_dir %{?TZ_SYS_LIB:%TZ_SYS_LIB}%{!?TZ_SYS_LIB:%_libdir}
+%define data_dir %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE}%{!?TZ_SYS_RO_SHARE:%_datadir}
+%define include_dir %{?TZ_SYS_INCLUDE:%TZ_SYS_INCLUDE}%{!?TZ_SYS_INCLUDE:%_includedir}
+%define tastore_dir %{lib_dir}/tastore
+
+%define build_bin_dir %{buildroot}%{bin_dir}
+%define build_sbin_dir %{buildroot}%{sbin_dir}
+%define build_lib_dir %{buildroot}%{lib_dir}
+%define build_data_dir %{buildroot}%{data_dir}
+%define build_include_dir %{buildroot}%{include_dir}
+%define build_tastore_dir %{buildroot}%{tastore_dir}
%description
TEF Simulator provides a TrustZone simulated environment
which can be used on platforms not supporting ARM TrustZone
environment natively (ex. on an emulator).
+
+%package -n %{name}-client
+Summary: TEF TrustZone simulator client for CA compilation
+Group: Security/Libraries
+License: Apache-2.0 and BSD-3-Clause
+Requires: tef-simulator
+
+%description -n %{name}-client
+TEF Simulator Client contains a libteec library compatible
+with TEF Simulator, required to build Client Applications.
+
+
+%package -n %{name}-client-devel
+Summary: TEF TrustZone simulator client development package
+Group: Security/Libraries
+License: Apache-2.0 and BSD-3-Clause
+
+Requires: tef-simulator-client
+
+%description -n %{name}-client-devel
+TEF Simulator Client Devel contains headers required to build
+Client Applications with TEF Simulator Client library.
+
+
+%package -n %{name}-devkit
+Summary: TEF TrustZone simulator devkit for TA compilation
+Group: Security/Libraries
+License: Apache-2.0 and BSD-3-Clause
+
+Requires: tef-simulator
+
+%description -n %{name}-devkit
+TEF Simulator Devkit provides a static library required to
+build Trusted Applications, which are meant to work together
+with TEF Simulator.
+
%prep
%setup -q
%build
-%cmake . \
+# cannot call cmake rpmbuild macro because of scripts removing libTEEStub.a, which is a part of devkit
+
+cmake . \
-DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE} \
- -DBIN_DIR=%{bin_dir} \
- -DSBIN_DIR=%{sbin_dir} \
- -DTASTORE_DIR=%{tastore_dir}
-make %{?silent:--silent} %{?jobs:-j%jobs}
+ -DBIN_DIR=%{build_bin_dir} \
+ -DSBIN_DIR=%{build_sbin_dir} \
+ -DLIB_DIR=%{build_lib_dir} \
+ -DDATA_DIR=%{build_data_dir} \
+ -DINCLUDE_DIR=%{build_include_dir} \
+ -DTASTORE_DIR=%{build_tastore_dir} \
+ -DPKGCFG_LIB_DIR=%{lib_dir} \
+ -DPKGCFG_PREFIX=/usr \
+ -DPKGCFG_VERSION=%{version}
+make %{?jobs:-j%jobs}
%install
-%make_install
+make install
%pre
%postun
-%files -n tef-simulator
+%files -n %{name}
%{bin_dir}/tef-simulator-daemon
-%{bin_dir}/tef-simulator-helloworld
-%{_libdir}/libtef-simulator-log.so
-%{_libdir}/libtef-simulator-osal.so
-%{_libdir}/libtef-simulator-ssflib.so
-%{_libdir}/libteec.so
-%{tastore_dir}/00000000-0000-0000-0000-112233445566
+%{lib_dir}/libtef-simulator-ssflib.so
%{sbin_dir}/tef-simulator-update-uuid-list.sh
+
+%files -n %{name}-client
+%{lib_dir}/libteec.so
+
+%files -n %{name}-client-devel
+%{include_dir}/tee_client_api.h
+
+%files -n %{name}-devkit
+%{bin_dir}/TA_PackageBuilder.sh
+%{bin_dir}/TAPackageMaker
+%{lib_dir}/libTEEStub.a
+%{lib_dir}/libtef-simulator-log.a
+%{lib_dir}/libtef-simulator-osal.a
+%{include_dir}/tee_internal_api.h
+%{lib_dir}/pkgconfig/tef-simulator-devkit.pc
+%{data_dir}/cmake/Modules/TEFSimulatorDevkit.cmake
--- /dev/null
+# Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# @file CMakeLists.txt
+# @author Lukasz Kostyra (l.kostyra@samsung.com)
+# @brief
+#
+
+CONFIGURE_FILE(tef-simulator-devkit.pc.in tef-simulator-devkit.pc @ONLY)
+
+INSTALL(FILES
+ ${TEF_SIMULATOR_ROOT_PATH}/pkgconfig/tef-simulator-devkit.pc
+ DESTINATION
+ ${LIB_DIR}/pkgconfig
+ )
--- /dev/null
+prefix=@PKGCFG_PREFIX@
+exec_prefix=${prefix}
+libdir=@PKGCFG_LIB_DIR@
+includedir=${prefix}/include
+
+Name: tef-simulator-devkit
+Description: TEF Simulator TA development kit
+Version: @PKGCFG_VERSION@
+Requires: boost dlog openssl
+Libs: -L${libdir} -lTEEStub -ltef-simulator-ssflib -ltef-simulator-log -lboost_thread -lboost_system -ldlog
+Cflags: -I${includedir}/
${TARGET_TEF_SIMULATOR_LOG}
)
-INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_SSFLIB} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
+INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_SSFLIB} LIBRARY DESTINATION ${LIB_DIR})