Skip to content

Commit

Permalink
[#76] Set OPENSSL_API_COMPAT=10100
Browse files Browse the repository at this point in the history
Switch on openssl version required by detected version.
  • Loading branch information
JustinKyleJames authored and alanking committed Oct 17, 2023
1 parent 77e962d commit 38cd456
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ ELSE(CURL_FOUND)
ENDIF(CURL_FOUND)

set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
add_definitions(-DIRODS_HEADER_HPP)
add_definitions(-DIRODS_HEADER_HPP -DOPENSSL_API_COMPAT=10100)

add_compile_options(-Wall -Wextra -Werror -Wno-unused-parameter)

Expand Down Expand Up @@ -187,13 +187,21 @@ set(CPACK_RPM_RELOCATION_PATHS $ENV{DEST_LIB_DIR})
set(CPACK_ARCHIVE_COMPONENT_INSTALL OFF)

set(CPACK_DEBIAN_PACKAGE_NAME ${IRODS_CLIENT_NAME})
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${IRODS_PACKAGE_DEPENDENCIES_STRING}, irods-runtime (= ${IRODS_VERSION}), libc6, libssl1.1")

find_package(OpenSSL)
if (OPENSSL_VERSION VERSION_LESS "3.0.0")
message(STATUS "OPENSSL_VERSION < 3.0.0")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${IRODS_PACKAGE_DEPENDENCIES_STRING}, irods-runtime (= ${IRODS_VERSION}), libc6, libssl1.1")
else()
message(STATUS "OPENSSL_VERSION >= 3.0.0")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${IRODS_PACKAGE_DEPENDENCIES_STRING}, irods-runtime (= ${IRODS_VERSION}), libc6, libssl3")
endif()

set(CPACK_RPM_PACKAGE_NAME ${IRODS_CLIENT_NAME})
if (IRODS_LINUX_DISTRIBUTION_NAME STREQUAL "centos" OR IRODS_LINUX_DISTRIBUTION_NAME STREQUAL "centos linux")
set(CPACK_RPM_PACKAGE_REQUIRES "${IRODS_PACKAGE_DEPENDENCIES_STRING}, irods-runtime = ${IRODS_VERSION}, openssl")
elseif (IRODS_LINUX_DISTRIBUTION_NAME STREQUAL "opensuse")
if (IRODS_LINUX_DISTRIBUTION_NAME STREQUAL "opensuse")
set(CPACK_RPM_PACKAGE_REQUIRES "${IRODS_PACKAGE_DEPENDENCIES_STRING}, irods-runtime = ${IRODS_VERSION}, libopenssl1_0_0")
else()
set(CPACK_RPM_PACKAGE_REQUIRES "${IRODS_PACKAGE_DEPENDENCIES_STRING}, irods-runtime = ${IRODS_VERSION}, openssl")
endif()

include(CPack)
Expand Down

0 comments on commit 38cd456

Please sign in to comment.