summaryrefslogtreecommitdiff
path: root/CMake
diff options
context:
space:
mode:
authorMarc Butler <mockbutler@gmail.com>2019-02-22 06:06:04 +1100
committerWouter van Oortmerssen <aardappel@gmail.com>2019-02-21 20:06:04 +0100
commit4567b13115d5f19816055cb0ed765f0850f46f30 (patch)
tree29239bf6978a021daa8d5fcb9cbd1b21267867f2 /CMake
parent8f8fb2b3677f55529f126f1adcc70b5dcdcd3290 (diff)
downloadflatbuffers-4567b13115d5f19816055cb0ed765f0850f46f30.tar.gz
flatbuffers-4567b13115d5f19816055cb0ed765f0850f46f30.tar.bz2
flatbuffers-4567b13115d5f19816055cb0ed765f0850f46f30.zip
Add RPM packaging support (#5177)
* Add RPM packaging support Using the existing PackageDebian as template add support for generating an rpm with the package target. * Restore debian package target Also add an option to advertise the fact. * Update package description C-n-p from README.md * Update rpm package maintainer
Diffstat (limited to 'CMake')
-rw-r--r--CMake/DESCRIPTION.txt4
-rw-r--r--CMake/PackageDebian.cmake2
-rw-r--r--CMake/PackageRedhat.cmake34
3 files changed, 38 insertions, 2 deletions
diff --git a/CMake/DESCRIPTION.txt b/CMake/DESCRIPTION.txt
new file mode 100644
index 00000000..3698b034
--- /dev/null
+++ b/CMake/DESCRIPTION.txt
@@ -0,0 +1,4 @@
+FlatBuffers is a cross platform serialization library architected for
+maximum memory efficiency. It allows you to directly access serialized
+data without parsing/unpacking it first, while still having great
+forwards/backwards compatibility.
diff --git a/CMake/PackageDebian.cmake b/CMake/PackageDebian.cmake
index 6653181c..f587ff7f 100644
--- a/CMake/PackageDebian.cmake
+++ b/CMake/PackageDebian.cmake
@@ -37,5 +37,3 @@ if (UNIX)
"${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
endif(UNIX)
-
-INCLUDE(CPack)
diff --git a/CMake/PackageRedhat.cmake b/CMake/PackageRedhat.cmake
new file mode 100644
index 00000000..4545e729
--- /dev/null
+++ b/CMake/PackageRedhat.cmake
@@ -0,0 +1,34 @@
+if (UNIX)
+ set(CPACK_GENERATOR "RPM")
+ set(CPACK_SOURCE_TGZ "ON")
+
+ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "FlatBuffers serialization library and schema compiler.")
+
+ set(CPACK_RPM_PACKAGE_HOMEPAGE "https://github.com/google/flatbuffers")
+ set(CPACK_RPM_PACKAGE_MAINTAINER "Marc Butler <mockbutler@gmail.com>")
+
+ set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
+ set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
+ set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
+ set(CPACK_PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_COMMIT}")
+ set(CPACK_RPM_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
+
+ set(CPACK_RPM_PACKAGE_NAME "flatbuffers")
+
+ # Assume this is not a cross complation build.
+ if(NOT CPACK_RPM_PACKAGE_ARCHITECTURE)
+ set(CPACK_RPM_PACKAGE_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}")
+ endif(NOT CPACK_RPM_PACKAGE_ARCHITECTURE)
+
+ set(CPACK_RPM_PACKAGE_VENDOR "Google, Inc.")
+ set(CPACK_RPM_PACKAGE_LICENSE "Apache 2.0")
+ set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE.txt)
+ set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_SOURCE_DIR}/CMake/DESCRIPTION.txt)
+
+ # This may reduce rpm compatiblity with very old systems.
+ set(CPACK_RPM_COMPRESSION_TYPE lzma)
+
+ set(CPACK_RPM_PACKAGE_NAME "flatbuffers")
+ set(CPACK_PACKAGE_FILE_NAME
+ "${CPACK_RPM_PACKAGE_NAME}_${CPACK_RPM_PACKAGE_VERSION}_${CPACK_RPM_PACKAGE_ARCHITECTURE}")
+endif(UNIX)