-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial deb package support via cmake.
- Loading branch information
Showing
2 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
INCLUDE(InstallRequiredSystemLibraries) | ||
|
||
SET(CPACK_GENERATOR "DEB") | ||
|
||
IF(NOT UNIX) | ||
MESSAGE(FATAL_ERROR "Can only be run under Unix.") | ||
ENDIF(NOT UNIX) | ||
|
||
# | ||
# Define standard control properties | ||
# | ||
SET (CPACK_PACKAGE_NAME "openbmp") | ||
SET (CPACK_PACKAGE_VERSION_MAJOR ${OPENBMP_VER_MAJOR}) | ||
SET (CPACK_PACKAGE_VERSION_MINOR ${OPENBMP_VER_MINOR}) | ||
SET (CPACK_PACKAGE_VERSION_PATCH ${OPENBMP_VER_PATCH}) | ||
SET (CPACK_DEBIAN_PACKAGE_VERSION ${OPENBMPD_VERSION}) | ||
SET (CPACK_DEBIAN_PACKAGE_MAINTAINER "www.openbmp.org") | ||
SET (CPACK_DEBIAN_PACKAGE_DESCRIPTION "Open BGP monitoring protocol (OpenBMP) collector server. Receives BMP messages and stores them for real-time and historical analytics.") | ||
SET (CPACK_DEBIAN_PACKAGE_SECTION "main") | ||
|
||
# | ||
# Set the architecture | ||
# | ||
FIND_PROGRAM(DPKG_CMD dpkg) | ||
IF(NOT DPKG_CMD) | ||
MESSAGE(STATUS "Can not find dpkg in your path, default to i386.") | ||
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386) | ||
ENDIF(NOT DPKG_CMD) | ||
EXECUTE_PROCESS(COMMAND "${DPKG_CMD}" --print-architecture | ||
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
# | ||
# Define the depends | ||
# | ||
#set (CPACK_DEBIAN_PACKAGE_DEPENDS "libstdc++6 (>= 4.6), libmysqlcppconn7 (>= 1.1.3), libc6 (>= 2.14)") | ||
set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) | ||
|
||
|
||
# | ||
# Define the extras (post/pre install, etc.) | ||
# | ||
#SET (CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/deb_package/postinst;${CMAKE_CURRENT_SOURCE_DIR}/deb_package/prerm;" ) | ||
|
||
# | ||
# Set the package config filename | ||
# | ||
SET (CPACK_OUTPUT_CONFIG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/debPackageConfig.cmake") | ||
SET (CPACK_SOURCE_OUTPUT_CONFIG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/debPackageSourceConfig.cmake") | ||
|
||
# Define the package filename | ||
|
||
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${OPENBMP_VERSION}-src") | ||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${OPENBMPD_VERSION}") | ||
|
||
add_custom_target(deb_package | ||
COMMAND "${CMAKE_CPACK_COMMAND}" | ||
"--config" "${CMAKE_CURRENT_SOURCE_DIR}/debPackageConfig.cmake") | ||
|
||
|
||
# | ||
# include cpack module last (loads the config) | ||
# | ||
INCLUDE(CPack) | ||
|