Permalink
Browse files

Add RPM build for Red Hat

  • Loading branch information...
jaudibert-euronext committed Jul 27, 2015
1 parent 9d7221a commit 7f8f31cb8318e663f2ec145b63fb31278bdd7a76
Showing with 6 additions and 0 deletions.
  1. +6 −0 cmake/packaging.cmake
View
@@ -84,6 +84,12 @@ elseif(UNIX)
execute_process(COMMAND dpkg --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE})
elseif(distribution MATCHES "RedHat.*")
# extract the major version from RedHat full version (e.g. 6.7 --> 6)
execute_process(COMMAND lsb_release -sr COMMAND sed s/[.].*// OUTPUT_VARIABLE redhat_version_major OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CPACK_GENERATOR "RPM")
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}.el${redhat_version_major}.${CPACK_RPM_PACKAGE_ARCHITECTURE})
elseif(distribution MATCHES "openSUSE.*")
set(CPACK_GENERATOR "RPM")
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${release}.${CPACK_RPM_PACKAGE_ARCHITECTURE})

0 comments on commit 7f8f31c

Please sign in to comment.