Skip to content

Commit

Permalink
CentOS 5 now requires python26
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Schoppmann authored and Florian Schoppmann committed Jun 16, 2011
1 parent 19569c6 commit bfb2797
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ list(APPEND CMAKE_MODULE_PATH
"${MAD_BUILD_TOOLS}")

include(Utils)
include(LinuxUtils)
include(OSXUtils)


Expand Down
11 changes: 11 additions & 0 deletions cmake/LinuxUtils.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Get the RedHat/CentOS version
macro(rh_version OUT_VERSION)
if(EXISTS "/etc/redhat-release")
file(READ "/etc/redhat-release" _REDHAT_RELEASE_CONTENT)
string(REGEX REPLACE "[^0-9.]*([0-9.]+)[^0-9.]*\$" "\\1" ${OUT_VERSION}
"${_REDHAT_RELEASE_CONTENT}"
)
else(EXISTS "/etc/redhat-release")
set(${OUT_VERSION} "${OUT_VERSION}-NOTFOUND")
endif(EXISTS "/etc/redhat-release")
endmacro(rh_version)
11 changes: 10 additions & 1 deletion deploy/RPM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@
# definition extends to the parent scope


# Get information about the environment
rh_version(RH_VERSION)

# -- Set RPM-specific variables ------------------------------------------------

set(CPACK_RPM_PACKAGE_ARCHITECTURE x86_64 PARENT_SCOPE)
set(CPACK_RPM_PACKAGE_LICENSE "New BSD License" PARENT_SCOPE)
set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries" PARENT_SCOPE)
set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.6, lapack >= 3.0, m4 >= 1.4" PARENT_SCOPE)

set(_PACKAGE_REQUIRES "lapack >= 3.0, m4 >= 1.4")
if(RH_VERSION AND RH_VERSION VERSION_LESS "6.0")
set(CPACK_RPM_PACKAGE_REQUIRES "python26, ${_PACKAGE_REQUIRES}" PARENT_SCOPE)
else()
set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.6, ${_PACKAGE_REQUIRES}" PARENT_SCOPE)
endif()

if(EXISTS "/etc/rpm/macros.python26")
# On RH 5/CentOS 5, /usr/bin/python is Python 2.4. Unfortunately,
Expand Down

0 comments on commit bfb2797

Please sign in to comment.