summaryrefslogtreecommitdiffstats
path: root/Modules/CPackRPM.cmake
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2012-08-13 17:50:14 (GMT)
committerBrad King <brad.king@kitware.com>2012-08-13 18:19:16 (GMT)
commit9db3116226cb99fcf54e936c833953abcde9b729 (patch)
treebd755ed9e616bbf1482a894bc7946980d81b7703 /Modules/CPackRPM.cmake
parent77543bde41b0e52c3959016698b529835945d62d (diff)
downloadCMake-9db3116226cb99fcf54e936c833953abcde9b729.zip
CMake-9db3116226cb99fcf54e936c833953abcde9b729.tar.gz
CMake-9db3116226cb99fcf54e936c833953abcde9b729.tar.bz2
Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block. This is no longer the preferred style. Run the following shell code: for c in else endif endforeach endfunction endmacro endwhile; do echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | egrep -z -v 'Tests/CMakeTests/While-Endwhile-' | xargs -0 sed -i -f convert.sed && rm convert.sed
Diffstat (limited to 'Modules/CPackRPM.cmake')
-rw-r--r--Modules/CPackRPM.cmake206
1 files changed, 103 insertions, 103 deletions
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 66237d8..066b295 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -241,11 +241,11 @@
if(CMAKE_BINARY_DIR)
message(FATAL_ERROR "CPackRPM.cmake may only be used by CPack internally.")
-endif(CMAKE_BINARY_DIR)
+endif()
if(NOT UNIX)
message(FATAL_ERROR "CPackRPM.cmake may only be used under UNIX.")
-endif(NOT UNIX)
+endif()
# rpmbuild is the basic command for building RPM package
# it may be a simple (symbolic) link to rpm command.
@@ -264,12 +264,12 @@ if(RPMBUILD_EXECUTABLE)
${_TMP_VERSION})
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: rpmbuild version is <${RPMBUILD_EXECUTABLE_VERSION}>")
- endif(CPACK_RPM_PACKAGE_DEBUG)
-endif(RPMBUILD_EXECUTABLE)
+ endif()
+endif()
if(NOT RPMBUILD_EXECUTABLE)
message(FATAL_ERROR "RPM package requires rpmbuild executable")
-endif(NOT RPMBUILD_EXECUTABLE)
+endif()
# Display lsb_release output if DEBUG mode enable
# This will help to diagnose problem with CPackRPM
@@ -284,11 +284,11 @@ if(CPACK_RPM_PACKAGE_DEBUG)
string(REGEX REPLACE "\n" ", "
LSB_RELEASE_OUTPUT
${_TMP_LSB_RELEASE_OUTPUT})
- else (LSB_RELEASE_EXECUTABLE)
+ else ()
set(LSB_RELEASE_OUTPUT "lsb_release not installed/found!")
- endif(LSB_RELEASE_EXECUTABLE)
+ endif()
message("CPackRPM:Debug: LSB_RELEASE = ${LSB_RELEASE_OUTPUT}")
-endif(CPACK_RPM_PACKAGE_DEBUG)
+endif()
# We may use RPM version in the future in order
# to shut down warning about space in buildtree
@@ -296,7 +296,7 @@ endif(CPACK_RPM_PACKAGE_DEBUG)
# not checked [yet].
if(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
message(FATAL_ERROR "${RPMBUILD_EXECUTABLE} can't handle paths with spaces, use a build directory without spaces for building RPMs.")
-endif(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
+endif()
# If rpmbuild is found
# we try to discover alien since we may be on non RPM distro like Debian.
@@ -306,18 +306,18 @@ endif(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
find_program(ALIEN_EXECUTABLE alien)
if(ALIEN_EXECUTABLE)
message(STATUS "alien found, we may be on a Debian based distro.")
-endif(ALIEN_EXECUTABLE)
+endif()
# Are we packaging components ?
if(CPACK_RPM_PACKAGE_COMPONENT)
set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "-${CPACK_RPM_PACKAGE_COMPONENT}")
set(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "/${CPACK_RPM_PACKAGE_COMPONENT}")
set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_RPM_PACKAGE_COMPONENT}")
-else(CPACK_RPM_PACKAGE_COMPONENT)
+else()
set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "")
set(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "")
set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
-endif(CPACK_RPM_PACKAGE_COMPONENT)
+endif()
#
# Use user-defined RPM specific variables value
@@ -333,23 +333,23 @@ if(NOT CPACK_RPM_PACKAGE_SUMMARY)
# if neither var is defined lets use the name as summary
if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_SUMMARY)
- else(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+ else()
set(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
- endif(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
-endif(NOT CPACK_RPM_PACKAGE_SUMMARY)
+ endif()
+endif()
# CPACK_RPM_PACKAGE_NAME (mandatory)
if(NOT CPACK_RPM_PACKAGE_NAME)
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME)
-endif(NOT CPACK_RPM_PACKAGE_NAME)
+endif()
# CPACK_RPM_PACKAGE_VERSION (mandatory)
if(NOT CPACK_RPM_PACKAGE_VERSION)
if(NOT CPACK_PACKAGE_VERSION)
message(FATAL_ERROR "RPM package requires a package version")
- endif(NOT CPACK_PACKAGE_VERSION)
+ endif()
set(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
-endif(NOT CPACK_RPM_PACKAGE_VERSION)
+endif()
# Replace '-' in version with '_'
# '-' character is an Illegal RPM version character
# it is illegal because it is used to separate
@@ -361,10 +361,10 @@ if(CPACK_RPM_PACKAGE_ARCHITECTURE)
set(TMP_RPM_BUILDARCH "Buildarch: ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: using user-specified build arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif(CPACK_RPM_PACKAGE_DEBUG)
-else(CPACK_RPM_PACKAGE_ARCHITECTURE)
+ endif()
+else()
set(TMP_RPM_BUILDARCH "")
-endif(CPACK_RPM_PACKAGE_ARCHITECTURE)
+endif()
# CPACK_RPM_PACKAGE_RELEASE
# The RPM release is the numbering of the RPM package ITSELF
@@ -376,26 +376,26 @@ endif(CPACK_RPM_PACKAGE_ARCHITECTURE)
# If not set, 1 is a good candidate
if(NOT CPACK_RPM_PACKAGE_RELEASE)
set(CPACK_RPM_PACKAGE_RELEASE 1)
-endif(NOT CPACK_RPM_PACKAGE_RELEASE)
+endif()
# CPACK_RPM_PACKAGE_LICENSE
if(NOT CPACK_RPM_PACKAGE_LICENSE)
set(CPACK_RPM_PACKAGE_LICENSE "unknown")
-endif(NOT CPACK_RPM_PACKAGE_LICENSE)
+endif()
# CPACK_RPM_PACKAGE_GROUP
if(NOT CPACK_RPM_PACKAGE_GROUP)
set(CPACK_RPM_PACKAGE_GROUP "unknown")
-endif(NOT CPACK_RPM_PACKAGE_GROUP)
+endif()
# CPACK_RPM_PACKAGE_VENDOR
if(NOT CPACK_RPM_PACKAGE_VENDOR)
if(CPACK_PACKAGE_VENDOR)
set(CPACK_RPM_PACKAGE_VENDOR "${CPACK_PACKAGE_VENDOR}")
- else(CPACK_PACKAGE_VENDOR)
+ else()
set(CPACK_RPM_PACKAGE_VENDOR "unknown")
- endif(CPACK_PACKAGE_VENDOR)
-endif(NOT CPACK_RPM_PACKAGE_VENDOR)
+ endif()
+endif()
# CPACK_RPM_PACKAGE_SOURCE
# The name of the source tarball in case we generate a source RPM
@@ -410,70 +410,70 @@ endif(NOT CPACK_RPM_PACKAGE_VENDOR)
if (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
if (CPACK_PACKAGE_DESCRIPTION_FILE)
file(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_RPM_PACKAGE_DESCRIPTION)
- else (CPACK_PACKAGE_DESCRIPTION_FILE)
+ else ()
set(CPACK_RPM_PACKAGE_DESCRIPTION "no package description available")
- endif (CPACK_PACKAGE_DESCRIPTION_FILE)
-endif (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
+ endif ()
+endif ()
# CPACK_RPM_COMPRESSION_TYPE
#
if (CPACK_RPM_COMPRESSION_TYPE)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: User Specified RPM compression type: ${CPACK_RPM_COMPRESSION_TYPE}")
- endif(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.lzdio")
- endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
+ endif()
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7.xzdio")
- endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
+ endif()
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.bzdio")
- endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
+ endif()
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.gzdio")
- endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
-else(CPACK_RPM_COMPRESSION_TYPE)
+ endif()
+else()
set(CPACK_RPM_COMPRESSION_TYPE_TMP "")
-endif(CPACK_RPM_COMPRESSION_TYPE)
+endif()
if(CPACK_PACKAGE_RELOCATABLE)
set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE)
-endif(CPACK_PACKAGE_RELOCATABLE)
+endif()
if(CPACK_RPM_PACKAGE_RELOCATABLE)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Trying to build a relocatable package")
- endif(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
if(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON"))
message("CPackRPM:Warning: CPACK_SET_DESTDIR is set (=${CPACK_SET_DESTDIR}) while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.")
- else(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON"))
+ else()
set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX})
- endif(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON"))
-endif(CPACK_RPM_PACKAGE_RELOCATABLE)
+ endif()
+endif()
# Check if additional fields for RPM spec header are given
# There may be some COMPONENT specific variables as well
foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}")
- endif(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER})
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: using CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}")
- endif(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}})
else()
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER} not defined")
message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
- endif(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
endif()
else()
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
- endif(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
endif()
@@ -486,13 +486,13 @@ foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLIC
set(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}")
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
- endif(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
set(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
- else(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
+ else()
# Do not forget to unset previously set header (from previous component)
unset(TMP_RPM_${_RPM_SPEC_HEADER})
- endif(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
-endforeach(_RPM_SPEC_HEADER)
+ endif()
+endforeach()
# CPACK_RPM_SPEC_INSTALL_POST
# May be used to define a RPM post intallation script
@@ -501,9 +501,9 @@ endforeach(_RPM_SPEC_HEADER)
if(CPACK_RPM_SPEC_INSTALL_POST)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: User defined CPACK_RPM_SPEC_INSTALL_POST = ${CPACK_RPM_SPEC_INSTALL_POST}")
- endif(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
set(TMP_RPM_SPEC_INSTALL_POST "%define __spec_install_post ${CPACK_RPM_SPEC_INSTALL_POST}")
-endif(CPACK_RPM_SPEC_INSTALL_POST)
+endif()
# CPACK_RPM_POST_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE)
# CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE)
@@ -518,39 +518,39 @@ if(CPACK_RPM_PACKAGE_COMPONENT)
endif()
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE)
set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE})
- else(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE)
+ else()
set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE})
- endif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE)
-else(CPACK_RPM_PACKAGE_COMPONENT)
+ endif()
+else()
set(CPACK_RPM_POST_INSTALL_READ_FILE ${CPACK_RPM_POST_INSTALL_SCRIPT_FILE})
set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE})
-endif(CPACK_RPM_PACKAGE_COMPONENT)
+endif()
# Handle post-install file if it has been specified
if(CPACK_RPM_POST_INSTALL_READ_FILE)
if(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE})
file(READ ${CPACK_RPM_POST_INSTALL_READ_FILE} CPACK_RPM_SPEC_POSTINSTALL)
- else(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE})
+ else()
message("CPackRPM:Warning: CPACK_RPM_POST_INSTALL_SCRIPT_FILE <${CPACK_RPM_POST_INSTALL_READ_FILE}> does not exists - ignoring")
- endif(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE})
-else(CPACK_RPM_POST_INSTALL_READ_FILE)
+ endif()
+else()
# reset SPEC var value if no post install file has been specified
# (either globally or component-wise)
set(CPACK_RPM_SPEC_POSTINSTALL "")
-endif(CPACK_RPM_POST_INSTALL_READ_FILE)
+endif()
# Handle post-uninstall file if it has been specified
if(CPACK_RPM_POST_UNINSTALL_READ_FILE)
if(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE})
file(READ ${CPACK_RPM_POST_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_POSTUNINSTALL)
- else(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE})
+ else()
message("CPackRPM:Warning: CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_POST_UNINSTALL_READ_FILE}> does not exists - ignoring")
- endif(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE})
-else(CPACK_RPM_POST_UNINSTALL_READ_FILE)
+ endif()
+else()
# reset SPEC var value if no post uninstall file has been specified
# (either globally or component-wise)
set(CPACK_RPM_SPEC_POSTUNINSTALL "")
-endif(CPACK_RPM_POST_UNINSTALL_READ_FILE)
+endif()
# CPACK_RPM_PRE_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE)
# CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE)
@@ -560,44 +560,44 @@ endif(CPACK_RPM_POST_UNINSTALL_READ_FILE)
if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE)
set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE})
- else(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE)
+ else()
set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE})
- endif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE)
+ endif()
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE)
set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE})
- else(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE)
+ else()
set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE})
- endif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE)
-else(CPACK_RPM_PACKAGE_COMPONENT)
+ endif()
+else()
set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE})
set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE})
-endif(CPACK_RPM_PACKAGE_COMPONENT)
+endif()
# Handle pre-install file if it has been specified
if(CPACK_RPM_PRE_INSTALL_READ_FILE)
if(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE})
file(READ ${CPACK_RPM_PRE_INSTALL_READ_FILE} CPACK_RPM_SPEC_PREINSTALL)
- else(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE})
+ else()
message("CPackRPM:Warning: CPACK_RPM_PRE_INSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_INSTALL_READ_FILE}> does not exists - ignoring")
- endif(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE})
-else(CPACK_RPM_PRE_INSTALL_READ_FILE)
+ endif()
+else()
# reset SPEC var value if no pre-install file has been specified
# (either globally or component-wise)
set(CPACK_RPM_SPEC_PREINSTALL "")
-endif(CPACK_RPM_PRE_INSTALL_READ_FILE)
+endif()
# Handle pre-uninstall file if it has been specified
if(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
if(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE})
file(READ ${CPACK_RPM_PRE_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_PREUNINSTALL)
- else(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE})
+ else()
message("CPackRPM:Warning: CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_UNINSTALL_READ_FILE}> does not exists - ignoring")
- endif(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE})
-else(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
+ endif()
+else()
# reset SPEC var value if no pre-uninstall file has been specified
# (either globally or component-wise)
set(CPACK_RPM_SPEC_PREUNINSTALL "")
-endif(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
+endif()
# CPACK_RPM_CHANGELOG_FILE
# May be used to embed a changelog in the spec file.
@@ -605,20 +605,20 @@ endif(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
if(CPACK_RPM_CHANGELOG_FILE)
if(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
file(READ ${CPACK_RPM_CHANGELOG_FILE} CPACK_RPM_SPEC_CHANGELOG)
- else(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
+ else()
message(SEND_ERROR "CPackRPM:Warning: CPACK_RPM_CHANGELOG_FILE <${CPACK_RPM_CHANGELOG_FILE}> does not exists - ignoring")
- endif(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
-else(CPACK_RPM_CHANGELOG_FILE)
+ endif()
+else()
set(CPACK_RPM_SPEC_CHANGELOG "* Sun Jul 4 2010 Erk <eric.noulard@gmail.com>\n Generated by CPack RPM (no Changelog file were provided)")
-endif(CPACK_RPM_CHANGELOG_FILE)
+endif()
# CPACK_RPM_SPEC_MORE_DEFINE
# This is a generated spec rpm file spaceholder
if(CPACK_RPM_SPEC_MORE_DEFINE)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: User defined more define spec line specified:\n ${CPACK_RPM_SPEC_MORE_DEFINE}")
- endif(CPACK_RPM_PACKAGE_DEBUG)
-endif(CPACK_RPM_SPEC_MORE_DEFINE)
+ endif()
+endif()
# Now we may create the RPM build tree structure
set(CPACK_RPM_ROOTDIR "${CPACK_TOPLEVEL_DIRECTORY}")
@@ -683,7 +683,7 @@ if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Handling Absolute Destination Files: <${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}>")
message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}")
- endif(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
endif()
else()
if(CPACK_ABSOLUTE_DESTINATION_FILES)
@@ -698,7 +698,7 @@ if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Handling User Filelist: <${CPACK_RPM_USER_FILELIST_INTERNAL}>")
message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}")
- endif(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
else()
set(CPACK_RPM_USER_FILELIST_INTERNAL "")
endif()
@@ -717,7 +717,7 @@ endif()
if(CPACK_RPM_USER_FILELIST_INTERNAL)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Handling User Filelist: <${CPACK_RPM_USER_FILELIST_INTERNAL}>")
- endif(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
# Create CMake list from CPACK_RPM_INSTALL_FILES
string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
@@ -747,7 +747,7 @@ if(CPACK_RPM_USER_FILELIST_INTERNAL)
set(CPACK_RPM_INSTALL_FILES "")
foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
- endforeach(F)
+ endforeach()
else()
set(CPACK_RPM_USER_INSTALL_FILES "")
endif()
@@ -755,7 +755,7 @@ endif()
if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Handling Absolute Destination Files: ${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}")
- endif(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
# Remove trailing space
string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
# Transform endline separated - string into CMake List
@@ -768,20 +768,20 @@ if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
set(CPACK_RPM_INSTALL_FILES "")
foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
- endforeach(F)
+ endforeach()
# Build ABSOLUTE_INSTALL_FILES
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "")
foreach(F IN LISTS CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "${CPACK_RPM_ABSOLUTE_INSTALL_FILES}%config \"${F}\"\n")
- endforeach(F)
+ endforeach()
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: CPACK_RPM_ABSOLUTE_INSTALL_FILES=${CPACK_RPM_ABSOLUTE_INSTALL_FILES}")
message("CPackRPM:Debug: CPACK_RPM_INSTALL_FILES=${CPACK_RPM_INSTALL_FILES}")
- endif(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
else()
# reset vars in order to avoid leakage of value(s) from one component to another
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "")
-endif(CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
+endif()
# Prepend directories in ${CPACK_RPM_INSTALL_FILES} with %dir
# This is necessary to avoid duplicate files since rpmbuild do
@@ -799,7 +799,7 @@ foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
else()
set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
endif()
-endforeach(F)
+endforeach()
set(CPACK_RPM_INSTALL_FILES_LIST "")
# The name of the final spec file to be used by rpmbuild
@@ -816,7 +816,7 @@ if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: CPACK_RPM_BINARY_SPECFILE = ${CPACK_RPM_BINARY_SPECFILE}")
message("CPackRPM:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
message("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
-endif(CPACK_RPM_PACKAGE_DEBUG)
+endif()
# USER generated spec file handling.
# We should generate a spec file template:
@@ -900,8 +900,8 @@ ${CPACK_RPM_USER_INSTALL_FILES}
# to customize their own spec file.
if(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
message(FATAL_ERROR "CPackRPM: STOP here Generated USER binary spec file templare is: ${CPACK_RPM_BINARY_SPECFILE}.in")
- endif(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
-endif(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
+ endif()
+endif()
# After that we may either use a user provided spec file
# or generate one using appropriate variables value.
@@ -910,12 +910,12 @@ if(CPACK_RPM_USER_BINARY_SPECFILE)
message("CPackRPM: Will use USER specified spec file: ${CPACK_RPM_USER_BINARY_SPECFILE}")
# The user provided file is processed for @var replacement
configure_file(${CPACK_RPM_USER_BINARY_SPECFILE} ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
-else(CPACK_RPM_USER_BINARY_SPECFILE)
+else()
# No User specified spec file, will use the generated spec file
message("CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}")
# Note the just created file is processed for @var replacement
configure_file(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
-endif(CPACK_RPM_USER_BINARY_SPECFILE)
+endif()
if(RPMBUILD_EXECUTABLE)
# Now call rpmbuild using the SPECFILE
@@ -936,9 +936,9 @@ if(RPMBUILD_EXECUTABLE)
message("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
message("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
message("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
- endif(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
-else(RPMBUILD_EXECUTABLE)
+ endif()
+else()
if(ALIEN_EXECUTABLE)
message(FATAL_ERROR "RPM packaging through alien not done (yet)")
- endif(ALIEN_EXECUTABLE)
-endif(RPMBUILD_EXECUTABLE)
+ endif()
+endif()