From 67a6e5bcc496c297fa32932f1fb7d68831b557da Mon Sep 17 00:00:00 2001 From: mharmsen Date: Thu, 27 Jan 2011 23:58:23 +0000 Subject: Bugzilla Bug #606944 - Convert TPS to use ldap utilities and API from OpenLDAP instead of the Mozldap (CMake diffs et. al.) git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@1787 c9f7a03b-bd48-0410-a16d-cbbf54688b0b --- pki/base/tps/CMakeLists.txt | 36 +++++++++++++++++++++++++ pki/base/tps/doc/CS.cfg.in | 4 +-- pki/base/tps/setup/registry_instance | 5 ++-- pki/base/tps/src/CMakeLists.txt | 9 +++---- pki/base/tps/src/authentication/CMakeLists.txt | 13 +++------ pki/base/tps/src/modules/tokendb/CMakeLists.txt | 4 +-- pki/base/tps/src/modules/tps/CMakeLists.txt | 4 +-- pki/base/tps/src/tus/CMakeLists.txt | 13 +++------ pki/base/tps/tools/raclient/CMakeLists.txt | 4 +-- 9 files changed, 55 insertions(+), 37 deletions(-) (limited to 'pki/base') diff --git a/pki/base/tps/CMakeLists.txt b/pki/base/tps/CMakeLists.txt index c7e3aad8d..cefe11cd3 100644 --- a/pki/base/tps/CMakeLists.txt +++ b/pki/base/tps/CMakeLists.txt @@ -1,5 +1,41 @@ project(tps CXX) +# NOTE: TPS utilizes internal libraries located under '%{_libdir}/tps'. +# +# One method of resolving this issue is the use of RPATH as +# described in 'http://www.cmake.org/Wiki/CMake_RPATH_handling'. +# +# While Fedora allows the use of RPATH for this purpose as documented +# in the section entitled 'Rpath_for_Internal_Libraries' in the URL +# called 'http://fedoraproject.org/wiki/Packaging/Guidelines', +# the RPM '%cmake' macro overrides use of RPATH on Fedora and RHEL. +# +# To resolve this issue on Fedora and RHEL, one of the following +# methods may be utilized: +# +# (1) Uncomment the 'SET(CMAKE_SKIP_RPATH FALSE)' line below, or +# (2) Implement the files described in the section entitled +# 'Alternatives to Rpath' in the URL called +# 'http://fedoraproject.org/wiki/Packaging/Guidelines'. + +# use, i.e. don't skip the full RPATH +# (overrides '%cmake' macro setting of true) +#SET(CMAKE_SKIP_RPATH FALSE) + +# use, i.e. don't skip the full RPATH for the build tree +SET(CMAKE_SKIP_BUILD_RPATH FALSE) + +# when building, don't use the install RPATH already +# (but later on when installing) +SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + +# the RPATH to be used when installing +SET(CMAKE_INSTALL_RPATH "${LIB_INSTALL_DIR}/tps") + +# add the automatically determined parts of the RPATH +# which point to directories outside the build tree to the install RPATH +SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + add_subdirectory(src) add_subdirectory(tools) diff --git a/pki/base/tps/doc/CS.cfg.in b/pki/base/tps/doc/CS.cfg.in index db3aecc99..2bbf81077 100644 --- a/pki/base/tps/doc/CS.cfg.in +++ b/pki/base/tps/doc/CS.cfg.in @@ -288,7 +288,7 @@ auth.instance._041=# where auth.instance._042=# - authentication connection ID auth.instance._043=######################################### auth.instance.0.type=LDAP_Authentication -auth.instance.0.libraryName=[SYSTEM_USER_LIBRARIES]/[LIB_PREFIX]ldapauth[OBJ_EXT] +auth.instance.0.libraryName=[SYSTEM_USER_LIBRARIES]/tps/[LIB_PREFIX]ldapauth[OBJ_EXT] auth.instance.0.libraryFactory=GetAuthentication auth.instance.0.authId=ldap1 auth.instance.0.hostport=[LDAP_HOST]:[LDAP_PORT] @@ -309,7 +309,7 @@ auth.instance.0.ui.id.PASSWORD.name.en=LDAP Password auth.instance.0.ui.id.UID.description.en=LDAP User ID auth.instance.0.ui.id.PASSWORD.description.en=LDAP Password auth.instance.1.type=LDAP_Authentication -auth.instance.1.libraryName=[SYSTEM_USER_LIBRARIES]/[LIB_PREFIX]ldapauth[OBJ_EXT] +auth.instance.1.libraryName=[SYSTEM_USER_LIBRARIES]/tps/[LIB_PREFIX]ldapauth[OBJ_EXT] auth.instance.1.libraryFactory=GetAuthentication auth.instance.1.authId=ldap2 auth.instance.1.bindDN=cn=Directory Manager diff --git a/pki/base/tps/setup/registry_instance b/pki/base/tps/setup/registry_instance index e02f19011..cb1c4b344 100644 --- a/pki/base/tps/setup/registry_instance +++ b/pki/base/tps/setup/registry_instance @@ -99,19 +99,18 @@ export httpd pki_logs_directory=${PKI_SERVER_ROOT}/logs export pki_logs_directory -# see if httpd is linked with the openldap libraries - we need to override them +# see if httpd is linked with the openldap libraries - we need to override +# their use of OpenSSL if [ ${OS} = "Linux" ]; then hasopenldap=0 /usr/bin/ldd ${httpd} 2>&1 | grep libldap- > /dev/null 2>&1 && hasopenldap=1 if [ ${hasopenldap} -eq 1 ] ; then - LD_PRELOAD="${PKI_SYSTEM_USER_LIBRARIES}/libldap60.so" LD_PRELOAD="${PKI_SYSTEM_USER_LIBRARIES}/libssl3.so:${LD_PRELOAD}" export LD_PRELOAD fi elif [ ${OS} = "SunOS" ]; then - LD_PRELOAD_64="${PKI_SYSTEM_USER_LIBRARIES}/libldap60.so" LD_PRELOAD_64="${PKI_SYSTEM_USER_LIBRARIES}/dirsec/libssl3.so:${LD_PRELOAD_64}" export LD_PRELOAD_64 fi diff --git a/pki/base/tps/src/CMakeLists.txt b/pki/base/tps/src/CMakeLists.txt index ae1301b00..5f588663c 100644 --- a/pki/base/tps/src/CMakeLists.txt +++ b/pki/base/tps/src/CMakeLists.txt @@ -1,8 +1,5 @@ project(tps_library CXX) -set(TPS_LIBRARY_VERSION ${APPLICATION_VERSION}) -set(TPS_LIBRARY_SOVERSION 9) - set(TPS_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) add_subdirectory(tus) @@ -21,7 +18,7 @@ set(TPS_PRIVATE_INCLUDE_DIRS ${NSPR_INCLUDE_DIRS} ${APR_INCLUDE_DIRS} ${SVRCORE_INCLUDE_DIRS} - ${MOZLDAP_INCLUDE_DIRS} + ${LDAP_INCLUDE_DIRS} ) set(TPS_SHARED_LIBRARY @@ -34,7 +31,7 @@ set(TPS_LINK_LIBRARIES ${NSS_LIBRARIES} ${APR_LIBRARIES} ${SVRCORE_LIBRARIES} - ${MOZLDAP_LIBRARIES} + ${LDAP_LIBRARIES} ${TOKENDB_SHARED_LIBRARY} ) @@ -143,7 +140,7 @@ set_target_properties( install( TARGETS ${TPS_SHARED_LIBRARY} - LIBRARY DESTINATION ${LIB_INSTALL_DIR} + LIBRARY DESTINATION ${LIB_INSTALL_DIR}/tps ) add_subdirectory(authentication) diff --git a/pki/base/tps/src/authentication/CMakeLists.txt b/pki/base/tps/src/authentication/CMakeLists.txt index 25cb4720b..ba8ca07dc 100644 --- a/pki/base/tps/src/authentication/CMakeLists.txt +++ b/pki/base/tps/src/authentication/CMakeLists.txt @@ -1,8 +1,5 @@ project(ldapauth_library CXX) -set(LDAPAUTH_LIBRARY_VERSION ${APPLICATION_VERSION}) -set(LDAPAUTH_LIBRARY_SOVERSION 9) - set(LDAPAUTH_PUBLIC_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} @@ -16,7 +13,7 @@ set(LDAPAUTH_PRIVATE_INCLUDE_DIRS ${NSPR_INCLUDE_DIRS} ${NSS_INCLUDE_DIRS} ${SVRCORE_INCLUDE_DIRS} - ${MOZLDAP_INCLUDE_DIRS} + ${LDAP_INCLUDE_DIRS} ) set(LDAPAUTH_SHARED_LIBRARY @@ -28,7 +25,7 @@ set(LDAPAUTH_LINK_LIBRARIES ${NSPR_LIBRARIES} ${NSS_LIBRARIES} ${SVRCORE_LIBRARIES} - ${MOZLDAP_LIBRARIES} + ${LDAP_LIBRARIES} ${TOKENDB_SHARED_LIBRARY} ${TPS_SHARED_LIBRARY} ) @@ -44,10 +41,6 @@ target_link_libraries(${LDAPAUTH_SHARED_LIBRARY} ${LDAPAUTH_LINK_LIBRARIES}) set_target_properties(${LDAPAUTH_SHARED_LIBRARY} PROPERTIES - VERSION - ${LDAPAUTH_LIBRARY_VERSION} - SOVERSION - ${LDAPAUTH_LIBRARY_SOVERSION} OUTPUT_NAME ldapauth ) @@ -55,5 +48,5 @@ set_target_properties(${LDAPAUTH_SHARED_LIBRARY} install( TARGETS ${LDAPAUTH_SHARED_LIBRARY} - LIBRARY DESTINATION ${LIB_INSTALL_DIR} + LIBRARY DESTINATION ${LIB_INSTALL_DIR}/tps ) diff --git a/pki/base/tps/src/modules/tokendb/CMakeLists.txt b/pki/base/tps/src/modules/tokendb/CMakeLists.txt index c152d80e7..7b6edae91 100644 --- a/pki/base/tps/src/modules/tokendb/CMakeLists.txt +++ b/pki/base/tps/src/modules/tokendb/CMakeLists.txt @@ -7,7 +7,7 @@ set(TOKENDB_PRIVATE_INCLUDE_DIRS ${NSS_INCLUDE_DIRS} ${APR_INCLUDE_DIRS} ${SVRCORE_INCLUDE_DIRS} - ${MOZLDAP_INCLUDE_DIRS} + ${LDAP_INCLUDE_DIRS} ) set(TOKENDB_MODULE @@ -21,7 +21,7 @@ set(TOKENDB_LINK_LIBRARIES ${NSS_LIBRARIES} ${APR_LIBRARIES} ${SVRCORE_LIBRARIES} - ${MOZLDAP_LIBRARIES} + ${LDAP_LIBRARIES} ) set(tokendb_module_SRCS diff --git a/pki/base/tps/src/modules/tps/CMakeLists.txt b/pki/base/tps/src/modules/tps/CMakeLists.txt index 069c87f89..275d8b30a 100644 --- a/pki/base/tps/src/modules/tps/CMakeLists.txt +++ b/pki/base/tps/src/modules/tps/CMakeLists.txt @@ -7,7 +7,7 @@ set(TPS_PRIVATE_INCLUDE_DIRS ${NSS_INCLUDE_DIRS} ${APR_INCLUDE_DIRS} ${SVRCORE_INCLUDE_DIRS} - ${MOZLDAP_INCLUDE_DIRS} + ${LDAP_INCLUDE_DIRS} ) set(TPS_MODULE @@ -21,7 +21,7 @@ set(TPS_LINK_LIBRARIES ${NSS_LIBRARIES} ${APR_LIBRARIES} ${SVRCORE_LIBRARIES} - ${MOZLDAP_LIBRARIES} + ${LDAP_LIBRARIES} ${TOKENDB_SHARED_LIBRARY} ${TPS_SHARED_LIBRARY} ) diff --git a/pki/base/tps/src/tus/CMakeLists.txt b/pki/base/tps/src/tus/CMakeLists.txt index 7cff9d73b..3148d9e59 100644 --- a/pki/base/tps/src/tus/CMakeLists.txt +++ b/pki/base/tps/src/tus/CMakeLists.txt @@ -1,8 +1,5 @@ project(tokendb_library C) -set(TOKENDB_LIBRARY_VERSION ${APPLICATION_VERSION}) -set(TOKENDB_LIBRARY_SOVERSION 9) - set(TOKENDB_PUBLIC_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} @@ -16,7 +13,7 @@ set(TOKENDB_PRIVATE_INCLUDE_DIRS ${NSPR_INCLUDE_DIRS} ${NSS_INCLUDE_DIRS} ${SVRCORE_INCLUDE_DIRS} - ${MOZLDAP_INCLUDE_DIRS} + ${LDAP_INCLUDE_DIRS} ) set(TOKENDB_SHARED_LIBRARY @@ -28,7 +25,7 @@ set(TOKENDB_LINK_LIBRARIES ${NSPR_LIBRARIES} ${NSS_LIBRARIES} ${SVRCORE_LIBRARIES} - ${MOZLDAP_LIBRARIES} + ${LDAP_LIBRARIES} ) set(tokendb_library_SRCS @@ -42,10 +39,6 @@ target_link_libraries(${TOKENDB_SHARED_LIBRARY} ${TOKENDB_LINK_LIBRARIES}) set_target_properties(${TOKENDB_SHARED_LIBRARY} PROPERTIES - VERSION - ${TOKENDB_LIBRARY_VERSION} - SOVERSION - ${TOKENDB_LIBRARY_SOVERSION} OUTPUT_NAME tokendb ) @@ -53,5 +46,5 @@ set_target_properties(${TOKENDB_SHARED_LIBRARY} install( TARGETS ${TOKENDB_SHARED_LIBRARY} - LIBRARY DESTINATION ${LIB_INSTALL_DIR} + LIBRARY DESTINATION ${LIB_INSTALL_DIR}/tps ) diff --git a/pki/base/tps/tools/raclient/CMakeLists.txt b/pki/base/tps/tools/raclient/CMakeLists.txt index 9f4020b31..8f01b34d8 100644 --- a/pki/base/tps/tools/raclient/CMakeLists.txt +++ b/pki/base/tps/tools/raclient/CMakeLists.txt @@ -33,8 +33,8 @@ install( TARGETS ${TPS_EXECUTABLE} RUNTIME DESTINATION ${BIN_INSTALL_DIR} - LIBRARY DESTINATION ${LIB_INSTALL_DIR} - ARCHIVE DESTINATION ${LIB_INSTALL_DIR} + LIBRARY DESTINATION ${LIB_INSTALL_DIR}/tps + ARCHIVE DESTINATION ${LIB_INSTALL_DIR}/tps ) install( -- cgit