Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 1 | if (UNIX) |
| 2 | set(CPACK_GENERATOR "RPM") |
| 3 | set(CPACK_SOURCE_TGZ "ON") |
| 4 | |
| 5 | set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "FlatBuffers serialization library and schema compiler.") |
| 6 | |
| 7 | set(CPACK_RPM_PACKAGE_HOMEPAGE "https://github.com/google/flatbuffers") |
| 8 | set(CPACK_RPM_PACKAGE_MAINTAINER "Marc Butler <mockbutler@gmail.com>") |
| 9 | |
| 10 | set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) |
| 11 | set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) |
| 12 | set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}) |
| 13 | set(CPACK_PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_COMMIT}") |
| 14 | set(CPACK_RPM_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}") |
| 15 | |
| 16 | set(CPACK_RPM_PACKAGE_NAME "flatbuffers") |
| 17 | |
| 18 | # Assume this is not a cross complation build. |
| 19 | if(NOT CPACK_RPM_PACKAGE_ARCHITECTURE) |
| 20 | set(CPACK_RPM_PACKAGE_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}") |
| 21 | endif(NOT CPACK_RPM_PACKAGE_ARCHITECTURE) |
| 22 | |
| 23 | set(CPACK_RPM_PACKAGE_VENDOR "Google, Inc.") |
| 24 | set(CPACK_RPM_PACKAGE_LICENSE "Apache 2.0") |
| 25 | set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE.txt) |
| 26 | set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_SOURCE_DIR}/CMake/DESCRIPTION.txt) |
| 27 | |
| 28 | # This may reduce rpm compatiblity with very old systems. |
| 29 | set(CPACK_RPM_COMPRESSION_TYPE lzma) |
| 30 | |
| 31 | set(CPACK_RPM_PACKAGE_NAME "flatbuffers") |
| 32 | set(CPACK_PACKAGE_FILE_NAME |
| 33 | "${CPACK_RPM_PACKAGE_NAME}_${CPACK_RPM_PACKAGE_VERSION}_${CPACK_RPM_PACKAGE_ARCHITECTURE}") |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 34 | if(NOT DEFINED ${CPACK_PACKAGING_INSTALL_PREFIX}) |
| 35 | # Default packaging install prefix on RedHat systems is /usr. |
| 36 | # This is the assumed value when this variable is not defined. |
| 37 | # There is currently a conflict with |
| 38 | # /usr/${CMAKE_INSTALL_LIBDIR}/cmake which is installed by default |
| 39 | # by other packages on RedHat (most notably cmake-filesystem). Ensure |
| 40 | # that on these systems, flatbuffers does not package this path. |
| 41 | # This patch is required for cmake pre-3.17. |
| 42 | list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/${CMAKE_INSTALL_LIBDIR}/cmake") |
| 43 | endif() |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 44 | endif(UNIX) |