[tncfhh] Initial packaging of tncfhh-0.8.2 Fixed cmake issues Fixed xerces issues Fixed memory leak and excep

avesh agarwal avesh at fedoraproject.org
Mon Jul 18 17:03:12 UTC 2011


commit dfdf2890a530b306193bf37531acb60f244a52ed
Author: Avesh Agarwal <avagarwa at redhat.com>
Date:   Mon Jul 18 13:03:02 2011 -0400

    Initial packaging of tncfhh-0.8.2
    Fixed cmake issues
    Fixed xerces issues
    Fixed memory leak and exception issue

 .gitignore                         |    1 +
 sources                            |    1 +
 tncfhh-cmake-issues.patch          |  350 ++++++++++++++++++++++++++++++++++++
 tncfhh-memory-leak-exception.patch |   16 ++
 tncfhh.spec                        |  166 +++++++++++++++++
 tncxacml-xerces.patch              |   49 +++++
 6 files changed, 583 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..a02e1cc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/tncfhh-0.8.2.tar.gz
diff --git a/sources b/sources
index e69de29..e75b806 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+866ada19c80146387ff91b971f199a8c  tncfhh-0.8.2.tar.gz
diff --git a/tncfhh-cmake-issues.patch b/tncfhh-cmake-issues.patch
new file mode 100644
index 0000000..962248b
--- /dev/null
+++ b/tncfhh-cmake-issues.patch
@@ -0,0 +1,350 @@
+diff -urNp tncfhh-0.8.2-orig/CMakeLists.txt tncfhh-0.8.2-current/CMakeLists.txt
+--- tncfhh-0.8.2-orig/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/CMakeLists.txt	2011-06-27 10:49:21.902351163 -0400
+@@ -11,6 +11,15 @@ SET(COMPONENT	"NOTHING" CACHE BOOL "Set 
+ SET(NAL		"NOTHING" CACHE BOOL "Set to 8021x or VPN to choose the underlying network layer technology.")
+ SET(TPM		"OFF" CACHE BOOL "Set to ON when using the TPM")
+ 
++#to avoid hardcoded directory paths
++IF(NOT DEFINED CMAKE_INSTALL_LIBDIR)
++   SET(CMAKE_INSTALL_LIBDIR "lib")
++ENDIF(NOT DEFINED CMAKE_INSTALL_LIBDIR)
++
++IF(NOT DEFINED SYSCONF_INSTALL_DIR)
++   SET(SYSCONF_INSTALL_DIR "/etc")
++ENDIF(NOT DEFINED SYSCONF_INSTALL_DIR)
++
+ # convert variables to uppercase
+ string(TOUPPER ${COMPONENT} COMPONENT)
+ string(TOUPPER ${NAL} NAL)
+diff -urNp tncfhh-0.8.2-orig/imcv/attestation/imc/CMakeLists.txt tncfhh-0.8.2-current/imcv/attestation/imc/CMakeLists.txt
+--- tncfhh-0.8.2-orig/imcv/attestation/imc/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/imcv/attestation/imc/CMakeLists.txt	2011-06-27 11:00:23.817821618 -0400
+@@ -15,7 +15,7 @@ MESSAGE( STATUS "-- ${PROJECT_NAME}${TYP
+ set(IMC_CONFIG_FILE  "attestationimc.file")
+ 
+ #set imc config dir
+-set(IMC_CONFIG_DIR  "/etc/tnc")
++set(IMC_CONFIG_DIR  "${SYSCONF_INSTALL_DIR}/tnc")
+ 
+ #set imc config
+ set(IMC_CONFIG  "${IMC_CONFIG_DIR}/${IMC_CONFIG_FILE}" )
+@@ -59,4 +59,4 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR
+         DESTINATION ${IMC_CONFIG_DIR})
+ ENDIF()
+ 
+-install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION lib)
++install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff -urNp tncfhh-0.8.2-orig/imcv/attestation/imv/CMakeLists.txt tncfhh-0.8.2-current/imcv/attestation/imv/CMakeLists.txt
+--- tncfhh-0.8.2-orig/imcv/attestation/imv/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/imcv/attestation/imv/CMakeLists.txt	2011-06-27 11:01:58.008891242 -0400
+@@ -15,7 +15,7 @@ MESSAGE( STATUS "-- ${PROJECT_NAME}${TYP
+ set(IMV_CONFIG_FILE  "attestationimv.policy")
+ 
+ #set imv config dir
+-set(IMV_CONFIG_DIR  "/etc/tnc")
++set(IMV_CONFIG_DIR  "${SYSCONF_INSTALL_DIR}/tnc")
+ 
+ #set imv config file
+ set(IMV_CONFIG  "${IMV_CONFIG_DIR}/${IMV_CONFIG_FILE}")
+@@ -58,4 +58,4 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR
+         DESTINATION ${IMV_CONFIG_DIR})
+ ENDIF()
+ 
+-install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION lib)
++install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff -urNp tncfhh-0.8.2-orig/imcv/clamav/imc/CMakeLists.txt tncfhh-0.8.2-current/imcv/clamav/imc/CMakeLists.txt
+--- tncfhh-0.8.2-orig/imcv/clamav/imc/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/imcv/clamav/imc/CMakeLists.txt	2011-06-27 11:06:58.582869867 -0400
+@@ -16,7 +16,7 @@ MESSAGE( STATUS "-- ${PROJECT_NAME}${TYP
+ set(IMC_CONFIG_FILE  "clamavimc.conf" CACHE PATH "configuration file for imc")
+ 
+ #set imc config dir
+-set(IMC_CONFIG_DIR  "/etc/tnc" CACHE PATH "path to imc configuration file")
++set(IMC_CONFIG_DIR  "${SYSCONF_INSTALL_DIR}/tnc" CACHE PATH "path to imc configuration file")
+ 
+ #set imc config
+ set(IMC_CONFIG  "${IMC_CONFIG_DIR}/${IMC_CONFIG_FILE}" CACHE PATH "path and file of imc configuration")
+@@ -51,4 +51,4 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR
+         DESTINATION ${IMC_CONFIG_DIR})
+ ENDIF()
+ 
+-install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION lib)
++install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff -urNp tncfhh-0.8.2-orig/imcv/clamav/imv/CMakeLists.txt tncfhh-0.8.2-current/imcv/clamav/imv/CMakeLists.txt
+--- tncfhh-0.8.2-orig/imcv/clamav/imv/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/imcv/clamav/imv/CMakeLists.txt	2011-06-27 11:08:11.385129482 -0400
+@@ -16,7 +16,7 @@ MESSAGE( STATUS "-- ${PROJECT_NAME}${TYP
+ set(IMV_CONFIG_FILE  "clamavimv.policy")
+ 
+ #set imv configuration dir
+-set(IMV_CONFIG_DIR  "/etc/tnc")
++set(IMV_CONFIG_DIR  "${SYSCONF_INSTALL_DIR}/tnc")
+ 
+ #set imv configuration
+ set(IMV_CONFIG "${IMV_CONFIG_DIR}/${IMV_CONFIG_FILE}")
+@@ -52,4 +52,4 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR
+         DESTINATION ${IMV_CONFIG_DIR})
+ ENDIF()
+ 
+-install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION lib)
++install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff -urNp tncfhh-0.8.2-orig/imcv/dummy/imc/CMakeLists.txt tncfhh-0.8.2-current/imcv/dummy/imc/CMakeLists.txt
+--- tncfhh-0.8.2-orig/imcv/dummy/imc/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/imcv/dummy/imc/CMakeLists.txt	2011-06-27 11:52:43.497317332 -0400
+@@ -16,7 +16,7 @@ MESSAGE( STATUS "-- ${PROJECT_NAME}${TYP
+ set(IMC_CONFIG_FILE  "dummyimc.file")
+ 
+ #set imc config dir
+-set(IMC_CONFIG_DIR  "/etc/tnc")
++set(IMC_CONFIG_DIR  "${SYSCONF_INSTALL_DIR}/tnc")
+ 
+ #set imc config
+ set(IMC_CONFIG  "${IMC_CONFIG_DIR}/${IMC_CONFIG_FILE}")
+@@ -51,5 +51,5 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR
+         DESTINATION ${IMC_CONFIG_DIR})
+ ENDIF()
+ 
+-install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION lib)
++install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+diff -urNp tncfhh-0.8.2-orig/imcv/dummy/imv/CMakeLists.txt tncfhh-0.8.2-current/imcv/dummy/imv/CMakeLists.txt
+--- tncfhh-0.8.2-orig/imcv/dummy/imv/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/imcv/dummy/imv/CMakeLists.txt	2011-06-27 10:59:27.817374375 -0400
+@@ -16,7 +16,7 @@ MESSAGE( STATUS "-- ${PROJECT_NAME}${TYP
+ set(IMV_CONFIG_FILE  "dummyimv.policy")
+ 
+ #set imv configuration dir
+-set(IMV_CONFIG_DIR  "/etc/tnc")
++set(IMV_CONFIG_DIR  "${SYSCONF_INSTALL_DIR}/tnc")
+ 
+ #set imv configuration
+ set(IMV_CONFIG "${IMV_CONFIG_DIR}/${IMV_CONFIG_FILE}")
+@@ -52,5 +52,5 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR
+         DESTINATION ${IMV_CONFIG_DIR})
+ ENDIF()
+ 
+-install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION lib)
++install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+diff -urNp tncfhh-0.8.2-orig/imcv/example/imc/CMakeLists.txt tncfhh-0.8.2-current/imcv/example/imc/CMakeLists.txt
+--- tncfhh-0.8.2-orig/imcv/example/imc/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/imcv/example/imc/CMakeLists.txt	2011-06-27 11:02:39.378480427 -0400
+@@ -27,4 +27,4 @@ target_link_libraries(${PROJECT_NAME}${T
+ # set version
+ SET_TARGET_PROPERTIES(${PROJECT_NAME}${TYPE} PROPERTIES VERSION ${TNCFHH_VERSION_MAJOR}.${TNCFHH_VERSION_MINOR}.${TNCFHH_VERSION_PATCH}  SOVERSION 0)
+ 
+-install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION lib)
++install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff -urNp tncfhh-0.8.2-orig/imcv/example/imv/CMakeLists.txt tncfhh-0.8.2-current/imcv/example/imv/CMakeLists.txt
+--- tncfhh-0.8.2-orig/imcv/example/imv/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/imcv/example/imv/CMakeLists.txt	2011-06-27 11:03:24.255035997 -0400
+@@ -27,5 +27,5 @@ target_link_libraries(${PROJECT_NAME}${T
+ # set version
+ SET_TARGET_PROPERTIES(${PROJECT_NAME}${TYPE} PROPERTIES VERSION ${TNCFHH_VERSION_MAJOR}.${TNCFHH_VERSION_MINOR}.${TNCFHH_VERSION_PATCH}  SOVERSION 0)
+ 
+-install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION lib)
++install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+diff -urNp tncfhh-0.8.2-orig/imcv/hostscanner/imc/CMakeLists.txt tncfhh-0.8.2-current/imcv/hostscanner/imc/CMakeLists.txt
+--- tncfhh-0.8.2-orig/imcv/hostscanner/imc/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/imcv/hostscanner/imc/CMakeLists.txt	2011-06-27 11:08:41.025827655 -0400
+@@ -27,5 +27,5 @@ target_link_libraries(${PROJECT_NAME}${T
+ # set version
+ SET_TARGET_PROPERTIES(${PROJECT_NAME}${TYPE} PROPERTIES VERSION ${TNCFHH_VERSION_MAJOR}.${TNCFHH_VERSION_MINOR}.${TNCFHH_VERSION_PATCH}  SOVERSION 0)
+ 
+-install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION lib)
++install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+diff -urNp tncfhh-0.8.2-orig/imcv/hostscanner/imv/CMakeLists.txt tncfhh-0.8.2-current/imcv/hostscanner/imv/CMakeLists.txt
+--- tncfhh-0.8.2-orig/imcv/hostscanner/imv/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/imcv/hostscanner/imv/CMakeLists.txt	2011-06-27 11:09:51.241114865 -0400
+@@ -16,7 +16,7 @@ MESSAGE( STATUS "-- ${PROJECT_NAME}${TYP
+ set(IMV_CONFIG_FILE  "hostscannerimv.policy")
+ 
+ #set imv configuration dir
+-set(IMV_CONFIG_DIR  "/etc/tnc")
++set(IMV_CONFIG_DIR  "${SYSCONF_INSTALL_DIR}/tnc")
+ 
+ #set imv configuration
+ set(IMV_CONFIG "${IMV_CONFIG_DIR}/${IMV_CONFIG_FILE}")
+@@ -51,5 +51,5 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR
+         DESTINATION ${IMV_CONFIG_DIR})
+ ENDIF()
+ 
+-install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION lib)
++install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+diff -urNp tncfhh-0.8.2-orig/imcv/platid/imc/CMakeLists.txt tncfhh-0.8.2-current/imcv/platid/imc/CMakeLists.txt
+--- tncfhh-0.8.2-orig/imcv/platid/imc/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/imcv/platid/imc/CMakeLists.txt	2011-06-27 11:28:20.231912406 -0400
+@@ -15,7 +15,7 @@ MESSAGE( STATUS "-- ${PROJECT_NAME}${TYP
+ set(IMC_CONFIG_FILE  "platidimc.file")
+ 
+ #set imc config dir
+-set(IMC_CONFIG_DIR  "/etc/tnc")
++set(IMC_CONFIG_DIR  "${SYSCONF_INSTALL_DIR}/tnc")
+ 
+ #set imc config
+ set(IMC_CONFIG  "${IMC_CONFIG_DIR}/${IMC_CONFIG_FILE}")
+@@ -58,5 +58,5 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR
+ 	      ${CMAKE_CURRENT_SOURCE_DIR}/conf/platidimc.test.cert
+         DESTINATION ${IMC_CONFIG_DIR})
+ 
+-install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION lib)
++install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+diff -urNp tncfhh-0.8.2-orig/imcv/platid/imv/CMakeLists.txt tncfhh-0.8.2-current/imcv/platid/imv/CMakeLists.txt
+--- tncfhh-0.8.2-orig/imcv/platid/imv/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/imcv/platid/imv/CMakeLists.txt	2011-06-27 11:06:02.505444855 -0400
+@@ -16,7 +16,7 @@ MESSAGE( STATUS "-- ${PROJECT_NAME}${TYP
+ set(IMV_CONFIG_FILE  "platidimv.certs")
+ 
+ #set imv configuration dir
+-set(IMV_CONFIG_DIR  "/etc/tnc")
++set(IMV_CONFIG_DIR  "${SYSCONF_INSTALL_DIR}/tnc")
+ 
+ #set imv configuration
+ set(IMV_CONFIG "${IMV_CONFIG_DIR}/${IMV_CONFIG_FILE}")
+@@ -59,5 +59,5 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR
+         DESTINATION ${IMV_CONFIG_DIR})
+ ENDIF()
+ 
+-install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION lib)
++install(TARGETS ${PROJECT_NAME}${TYPE} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+diff -urNp tncfhh-0.8.2-orig/imunit/CMakeLists.txt tncfhh-0.8.2-current/imunit/CMakeLists.txt
+--- tncfhh-0.8.2-orig/imunit/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/imunit/CMakeLists.txt	2011-06-27 10:53:01.112196582 -0400
+@@ -43,4 +43,4 @@ install(DIRECTORY src/ DESTINATION inclu
+                   PATTERN "*.h"
+                   PATTERN "*.svn*" EXCLUDE)
+ 
+-install(TARGETS ${PROJECT_NAME} DESTINATION lib)
++install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff -urNp tncfhh-0.8.2-orig/naaeap/CMakeLists.txt tncfhh-0.8.2-current/naaeap/CMakeLists.txt
+--- tncfhh-0.8.2-orig/naaeap/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/naaeap/CMakeLists.txt	2011-06-27 10:52:47.880326172 -0400
+@@ -37,4 +37,4 @@ install(DIRECTORY src/naaeap DESTINATION
+                   PATTERN "*.h"
+                   PATTERN "*.svn*" EXCLUDE)
+ 
+-install(TARGETS ${PROJECT_NAME} DESTINATION lib)
++install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff -urNp tncfhh-0.8.2-orig/tncs/CMakeLists.txt tncfhh-0.8.2-current/tncs/CMakeLists.txt
+--- tncfhh-0.8.2-orig/tncs/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/tncs/CMakeLists.txt	2011-06-27 11:11:10.625308296 -0400
+@@ -17,7 +17,7 @@ set(TNCS_CONFIG_FILE  "tnc_config" CACHE
+ set(XACML_IMF_IMV_CONFIG_FILE  "xacml-ifm-imv.conf" CACHE PATH "The XACML config file; maps IMVs to IF-M component types.")
+ 
+ #set tnc config dir
+-set(TNCS_CONFIG_DIR  "/etc" CACHE PATH "The directory where to copy the TNCS config file.")
++set(TNCS_CONFIG_DIR  "${SYSCONF_INSTALL_DIR}" CACHE PATH "The directory where to copy the TNCS config file.")
+ 
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../tncutil/src/)
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../tncxacml/src/)
+@@ -84,5 +84,5 @@ ENDIF()
+ 
+  
+ install(TARGETS ${PROJECT_NAME}
+-        DESTINATION lib)
++        DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+diff -urNp tncfhh-0.8.2-orig/tncsim/CMakeLists.txt tncfhh-0.8.2-current/tncsim/CMakeLists.txt
+--- tncfhh-0.8.2-orig/tncsim/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/tncsim/CMakeLists.txt	2011-06-27 10:52:09.874700845 -0400
+@@ -15,7 +15,7 @@ MESSAGE(STATUS "-- ${PROJECT_NAME} --")
+ #set tncsim_config file
+ set(TNCSIM_CONFIG_FILE  "tncsim_config" CACHE PATH "The tncsim configuration file.")
+ #set tncsim config dir
+-set(TNCSIM_CONFIG_DIR  "/etc/tnc" CACHE PATH "The directory where to copy the tncsim configuration file.")
++set(TNCSIM_CONFIG_DIR  "${SYSCONF_INSTALL_DIR}/tnc" CACHE PATH "The directory where to copy the tncsim configuration file.")
+ #set tncsim config
+ set(TNCSIM_CONFIG "${TNCSIM_CONFIG_DIR}/${TNCSIM_CONFIG_FILE}" CACHE PATH "The tncsim configuration.")
+ 
+@@ -90,6 +90,6 @@ install(TARGETS tncsim RUNTIME DESTINATI
+ 
+ # TODO add variables
+ IF(NOT EXISTS ${TNCSIM_CONFIG})
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/conf/tncsim_config DESTINATION /etc/tnc)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/conf/tncsim_config DESTINATION ${SYSCONF_INSTALL_DIR}/tnc)
+ ENDIF()
+ 
+diff -urNp tncfhh-0.8.2-orig/tncutil/CMakeLists.txt tncfhh-0.8.2-current/tncutil/CMakeLists.txt
+--- tncfhh-0.8.2-orig/tncutil/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/tncutil/CMakeLists.txt	2011-06-27 11:11:46.043950000 -0400
+@@ -46,4 +46,4 @@ install(DIRECTORY src/ DESTINATION inclu
+                   PATTERN "*.h"
+                   PATTERN "*.svn*" EXCLUDE)
+ 
+-install(TARGETS ${PROJECT_NAME} DESTINATION lib)
++install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff -urNp tncfhh-0.8.2-orig/tncxacml/CMakeLists.txt tncfhh-0.8.2-current/tncxacml/CMakeLists.txt
+--- tncfhh-0.8.2-orig/tncxacml/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/tncxacml/CMakeLists.txt	2011-06-27 11:27:49.797218224 -0400
+@@ -50,10 +50,10 @@ install(DIRECTORY src/ DESTINATION inclu
+                   PATTERN "*.svn*" EXCLUDE)
+ 
+ SET(CONFIG_FILE xacml-pdp.conf)
+-IF(NOT EXISTS /etc/tnc/xacml/${CONFIG_FILE})
++IF(NOT EXISTS ${SYSCONF_INSTALL_DIR}/tnc/xacml/${CONFIG_FILE})
+ 	install(FILES
+ 		${CMAKE_CURRENT_SOURCE_DIR}/conf/${CONFIG_FILE}
+-		DESTINATION /etc/tnc/xacml)
+-ENDIF(NOT EXISTS /etc/tnc/xacml/${CONFIG_FILE})
++		DESTINATION ${SYSCONF_INSTALL_DIR}/tnc/xacml)
++ENDIF(NOT EXISTS ${SYSCONF_INSTALL_DIR}/tnc/xacml/${CONFIG_FILE})
+ 
+-install(TARGETS ${PROJECT_NAME} DESTINATION lib)
++install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff -urNp tncfhh-0.8.2-orig/vpn/libtncvpn/CMakeLists.txt tncfhh-0.8.2-current/vpn/libtncvpn/CMakeLists.txt
+--- tncfhh-0.8.2-orig/vpn/libtncvpn/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/vpn/libtncvpn/CMakeLists.txt	2011-06-27 11:13:15.465043815 -0400
+@@ -43,4 +43,4 @@ install(DIRECTORY src/ DESTINATION inclu
+         PATTERN "*.h"
+         PATTERN "*.svn*" EXCLUDE)
+                   
+-install(TARGETS ${PROJECT_NAME} DESTINATION lib)
++install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff -urNp tncfhh-0.8.2-orig/vpn/naavpn/CMakeLists.txt tncfhh-0.8.2-current/vpn/naavpn/CMakeLists.txt
+--- tncfhh-0.8.2-orig/vpn/naavpn/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/vpn/naavpn/CMakeLists.txt	2011-06-27 11:15:01.327972954 -0400
+@@ -45,11 +45,11 @@ install(DIRECTORY src/naavpn
+ 
+ SET(CONFIGFILES ca.pem dh512.pem log4j.properties pdp.conf server.pem tnc_vpn.conf)
+ FOREACH(CFILE ${CONFIGFILES})
+-	IF(NOT EXISTS /etc/tnc/ifttls/pdp/${CFILE})
++	IF(NOT EXISTS ${SYSCONF_INSTALL_DIR}/tnc/ifttls/pdp/${CFILE})
+ 		install(FILES
+ 			${CMAKE_CURRENT_SOURCE_DIR}/conf/${CFILE}
+-			DESTINATION /etc/tnc/ifttls/pdp)
+-	ENDIF(NOT EXISTS /etc/tnc/ifttls/pdp/${CFILE})
++			DESTINATION ${SYSCONF_INSTALL_DIR}/tnc/ifttls/pdp)
++	ENDIF(NOT EXISTS ${SYSCONF_INSTALL_DIR}/tnc/ifttls/pdp/${CFILE})
+ ENDFOREACH(CFILE ${CONFIGFILES})
+ 
+ 
+diff -urNp tncfhh-0.8.2-orig/vpn/vpnclient/CMakeLists.txt tncfhh-0.8.2-current/vpn/vpnclient/CMakeLists.txt
+--- tncfhh-0.8.2-orig/vpn/vpnclient/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/vpn/vpnclient/CMakeLists.txt	2011-06-27 11:14:02.725566067 -0400
+@@ -38,7 +38,7 @@ target_link_libraries(${PROJECT_NAME} -l
+ 
+ install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
+ 
+-set(CONFIG_DIR  "/etc/tnc/ifttls/client")
++set(CONFIG_DIR  "${SYSCONF_INSTALL_DIR}/tnc/ifttls/client")
+ set(CONFIG_FILE  "${CONFIG_DIR}/client.conf" )
+ 
+ IF(NOT EXISTS ${CONFIG_FILE})
+diff -urNp tncfhh-0.8.2-orig/vpn/vpnpep/CMakeLists.txt tncfhh-0.8.2-current/vpn/vpnpep/CMakeLists.txt
+--- tncfhh-0.8.2-orig/vpn/vpnpep/CMakeLists.txt	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/vpn/vpnpep/CMakeLists.txt	2011-06-27 11:12:42.752374767 -0400
+@@ -12,7 +12,7 @@ MESSAGE(STATUS "")
+ MESSAGE(STATUS "-- ${PROJECT_NAME} --")
+ 
+ #set tnc config dir
+-set(PEP_CONFIG_DIR  "/etc/tnc/ifttls/pep" CACHE PATH "Where to copy PEP stuff.")
++set(PEP_CONFIG_DIR  "${SYSCONF_INSTALL_DIR}/tnc/ifttls/pep" CACHE PATH "Where to copy PEP stuff.")
+ 
+ find_package(OpenSSL REQUIRED)
+ include_directories(${OPENSSL_INCLUDE_DIRS})
diff --git a/tncfhh-memory-leak-exception.patch b/tncfhh-memory-leak-exception.patch
new file mode 100644
index 0000000..cb98995
--- /dev/null
+++ b/tncfhh-memory-leak-exception.patch
@@ -0,0 +1,16 @@
+diff -urNp tncfhh-0.8.2-cvs-patched/tncs/src/tncs/iel/Connection.cpp tncfhh-0.8.2-current/tncs/src/tncs/iel/Connection.cpp
+--- tncfhh-0.8.2-cvs-patched/tncs/src/tncs/iel/Connection.cpp	2011-06-29 13:37:27.124325063 -0400
++++ tncfhh-0.8.2-current/tncs/src/tncs/iel/Connection.cpp	2011-07-08 14:31:16.875752502 -0400
+@@ -338,9 +338,10 @@ void Connection::setAttribute(TNC_IMVID 
+ 	if (imvID == 0 && attributeID == TNC_ATTRIBUTEID_USERNAME) {
+ 		LOG4CXX_DEBUG(logger, "imvID is zero and attributeID is TNC_ATTRIBUTEID_USERNAME");
+ 		LOG4CXX_DEBUG(logger, "bufferLength is " << bufferLength);
+-		username = new TNC_Buffer[bufferLength];
++		username = new TNC_Buffer[bufferLength+1];
+ 		memcpy(username, buffer, bufferLength);
+-
++		username[bufferLength]='\0';
++		
+ 		attributeFound = true;
+ 		attributeNotSupported = false;
+ 	}
diff --git a/tncfhh.spec b/tncfhh.spec
new file mode 100644
index 0000000..da8dcd8
--- /dev/null
+++ b/tncfhh.spec
@@ -0,0 +1,166 @@
+%define build_attestation_imc_imv 1
+
+Summary: An open source implementation of the Trusted Network Connect (TNC) framework
+Name: tncfhh
+Version: 0.8.2
+
+Release: 1%{?dist}
+License: GPLv2
+Url: http://trust.inform.fh-hannover.de/joomla/index.php/projects/tncfhh
+Source0: http://trust.inform.fh-hannover.de/download/tncfhh/tncfhh-%{version}.tar.gz
+
+Group: Applications/System
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires: cmake log4cxx-devel xerces-c-devel trousers-devel libtnc-devel
+BuildRequires: libtool-ltdl-devel boost-devel openssl-devel
+
+Patch1: tncxacml-xerces.patch
+Patch2: tncfhh-cmake-issues.patch
+Patch3: tncfhh-memory-leak-exception.patch
+
+%description
+The TNC at FHH project is an open source implementation of the Trusted Network
+Connect (TNC) framework, which is specified by the Trusted Computing Group
+(TCG). TNC at FHH allows you to provision access to a network based upon
+factors like the user credentials and the requesting endpoint's integrity state.
+
+The following TNC components and their respective interfaces are implemented by
+TNC at FHH: IMCs (IF-IMC 1.2), IMVs (IF-IMV 1.2), TNCS (IF-TNCCS 1.1), 
+NAA (IF-T EAP 1.1).
+
+%package libs
+Summary: Dynamic library for TNC
+License: GPLv2
+Group: Development/Libraries
+Requires: %{name} = %{version}
+
+%description libs
+This package provides naaeap, tnsc, imunit, tncutil, and tncxacml 
+dynamic libraries for using TNC client and server interfaces.
+
+%package devel
+Summary: Development files for TNC
+License: GPLv2
+Group: Development/Libraries
+Requires: %{name}-libs = %{version}
+Requires: %{name}-examples = %{version}
+Requires: %{name}-utils = %{version}
+
+%description devel
+This package contains the header files needed for developing 
+IMC and IMV pairs.
+
+%package examples
+Summary: Example IMC/IMV implementations
+License: GPLv2
+Group: Applications/System
+Requires: %{name}-libs = %{version}
+
+%description examples
+This package provides some example implementations of several 
+IMC/IMV pairs.
+
+%package utils
+Summary: Dynamic library for TNC utilities
+License: GPLv2
+Group: Development/Libraries
+
+%description utils
+A shared library that offers simple configuration file parsing.
+
+%prep
+%setup -q -n tncfhh-%{version}
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+
+%build
+%cmake . -DCOMPONENT=all -DNAL=8021x \
+%if %{build_attestation_imc_imv}
+ -DTPM=on
+%endif
+make %{?_smp_mflags}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT%{_libdir}
+make install DESTDIR=${RPM_BUILD_ROOT} INSTALL='install -p'
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%post -n tncfhh-libs  -p /sbin/ldconfig
+%postun -n tncfhh-libs  -p /sbin/ldconfig
+
+%post -n tncfhh-utils  -p /sbin/ldconfig
+%postun -n tncfhh-utils -p /sbin/ldconfig
+
+%post -n tncfhh-examples  -p /sbin/ldconfig
+%postun -n tncfhh-examples  -p /sbin/ldconfig
+
+%files
+%defattr(-,root,root,-)
+%doc README LICENSE doc/tncfhh.pdf
+%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/tnc_config
+%{_libdir}/libimunit.so.?
+%{_libdir}/libimunit.so.?.?.?
+
+%files libs
+%{_libdir}/libnaaeap.so.?
+%{_libdir}/libnaaeap.so.?.?.?
+%{_libdir}/libtncs.so.?
+%{_libdir}/libtncs.so.?.?.?
+%{_libdir}/libtncxacml.so.?
+%{_libdir}/libtncxacml.so.?.?.?
+%attr(0755,root,root) %dir %{_sysconfdir}/tnc
+%attr(0755,root,root) %dir %{_sysconfdir}/tnc/xacml
+%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/tnc/xacml/*
+
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/tncfhhConfig.h
+%{_includedir}/naaeap/
+%attr(0755, root, root) %{_libdir}/libnaaeap.so
+%{_includedir}/tncs/
+%attr(0755, root, root) %{_libdir}/libtncs.so
+%{_includedir}/tcg/tnc/
+%{_includedir}/imunit/
+%attr(0755, root, root) %{_libdir}/libimunit.so
+%{_includedir}/tncutil/
+%attr(0755, root, root) %{_libdir}/libtncutil.so
+%{_includedir}/tncxacml/
+%attr(0755, root, root) %{_libdir}/libtncxacml.so
+%attr(0755, root, root) %{_libdir}/libdummy*.so
+%attr(0755, root, root) %{_libdir}/libhostscanner*.so
+%attr(0755, root, root) %{_libdir}/libclamav*.so
+%attr(0755, root, root) %{_libdir}/libexample*.so
+%attr(0755, root, root) %{_libdir}/libplatid*.so
+%if %{build_attestation_imc_imv}
+%attr(0755, root, root) %{_libdir}/libattestation*.so
+%endif
+
+%files examples
+%defattr(-,root,root,-)
+%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/tnc/*.*
+%{_libdir}/libdummy*.so.*
+%{_libdir}/libhostscanner*.so.*
+%{_libdir}/libclamav*.so.*
+%{_libdir}/libexample*.so.*
+%{_libdir}/libplatid*.so.*
+%if %{build_attestation_imc_imv}
+%{_libdir}/libattestation*.so.*
+%endif
+
+%files utils
+%{_libdir}/libtncutil.so.?
+%{_libdir}/libtncutil.so.?.?.?
+
+%changelog
+* Mon Jul 18 2011 Avesh Agarwal <avagarwa at redhat.com> - 0.8.2-1
+- Initial packaging of tncfhh-0.8.2
+- Fixed cmake issues
+- Fixed xerces issues
+- Fixed memory leak and exception issue
diff --git a/tncxacml-xerces.patch b/tncxacml-xerces.patch
new file mode 100644
index 0000000..ac47c94
--- /dev/null
+++ b/tncxacml-xerces.patch
@@ -0,0 +1,49 @@
+diff -urNp tncfhh-0.8.2-orig/tncxacml/src/tncxacml/XACMLHelper.cpp tncfhh-0.8.2-current/tncxacml/src/tncxacml/XACMLHelper.cpp
+--- tncfhh-0.8.2-orig/tncxacml/src/tncxacml/XACMLHelper.cpp	2011-04-27 09:40:15.000000000 -0400
++++ tncfhh-0.8.2-current/tncxacml/src/tncxacml/XACMLHelper.cpp	2011-06-23 17:40:09.195617433 -0400
+@@ -290,8 +290,11 @@ std::string dataType, /*in*/TNC_BufferRe
+ 
+ std::string XACMLHelper::writeRequestToString(xercesc::DOMDocument* request) {
+ 	DOMImplementation *pImplement = NULL;
++#if _XERCES_VERSION >= 30000
++	DOMLSSerializer *pSerializer = NULL;
++#else
+ 	DOMWriter *pSerializer = NULL;
+-
++#endif
+ 	/*
+ 	 Return the first registered implementation that has the desired features. In this case, we are after
+ 	 a DOM implementation that has the LS feature... or Load/Save.
+@@ -303,17 +306,32 @@ std::string XACMLHelper::writeRequestToS
+ 	 From the DOMImplementation, create a DOMWriter.
+ 	 DOMWriters are used to serialize a DOM tree [back] into an XML document.
+ 	 */
++
++#if _XERCES_VERSION >= 30000
++	pSerializer = ((DOMImplementationLS*) pImplement)->createLSSerializer();
++#else
+ 	pSerializer = ((DOMImplementationLS*) pImplement)->createDOMWriter();
++#endif
+ 
+ 	/*
+ 	 This line is optional. It just sets a feature of the Serializer to make the output
+ 	 more human-readable by inserting line-feeds, without actually inserting any new elements/nodes
+ 	 into the DOM tree. (There are many different features to set.) Comment it out and see the difference.
+ 	 */
++#if _XERCES_VERSION >= 30000
++	if (pSerializer->getDomConfig()->canSetParameter( xercesc::XMLUni::fgDOMWRTFormatPrettyPrint, true)) {
++		pSerializer->getDomConfig()->setParameter( xercesc::XMLUni::fgDOMWRTFormatPrettyPrint, true);
++	}
++#else
+ 	pSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true);
++#endif
+ 
+ 	// Write the serialized output to the target.
++#if _XERCES_VERSION >= 30000
++	XercesString result = XercesString(pSerializer->writeToString(request));
++#else	
+ 	XercesString result = XercesString(pSerializer->writeToString(*request));
++#endif
+ 
+ 	return result.toString();
+ }


More information about the scm-commits mailing list