2015-02-03 05:21:36 +00:00
|
|
|
# make package
|
|
|
|
if(APPLE)
|
2015-07-13 19:24:58 +00:00
|
|
|
add_custom_target(
|
|
|
|
packages
|
2016-06-27 23:19:08 +00:00
|
|
|
COMMAND bash "${CMAKE_SOURCE_DIR}/tools/deployment/make_osx_package.sh"
|
|
|
|
COMMAND python "${CMAKE_SOURCE_DIR}/tools/codegen/genapi.py" "${CMAKE_SOURCE_DIR}"
|
2015-07-16 19:23:44 +00:00
|
|
|
"--output" "--directory" "${CMAKE_BINARY_DIR}"
|
2015-07-13 19:24:58 +00:00
|
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
|
|
COMMENT "Building default OS X package (no custom config)" VERBATIM
|
|
|
|
DEPENDS daemon shell
|
|
|
|
)
|
2015-02-03 05:21:36 +00:00
|
|
|
elseif(LINUX)
|
2015-06-03 01:10:43 +00:00
|
|
|
if(DEBIAN_BASED)
|
2016-01-06 02:53:40 +00:00
|
|
|
# Set basic catch-alls for debian-based systems.
|
2015-02-03 05:21:36 +00:00
|
|
|
set(PACKAGE_TYPE "deb")
|
2016-01-06 02:53:40 +00:00
|
|
|
set(PACKAGE_ITERATION "1.debian")
|
2015-02-03 05:21:36 +00:00
|
|
|
set(PACKAGE_DEPENDENCIES
|
|
|
|
"zlib1g"
|
|
|
|
"libbz2-1.0"
|
|
|
|
"libreadline6"
|
|
|
|
)
|
2016-01-06 02:53:40 +00:00
|
|
|
|
|
|
|
# Improve catch-alls for debian or ubuntu.
|
|
|
|
if(OSQUERY_BUILD_PLATFORM STREQUAL "ubuntu")
|
|
|
|
set(PACKAGE_DEPENDENCIES
|
|
|
|
"${PACKAGE_DEPENDENCIES}"
|
|
|
|
)
|
|
|
|
elseif(OSQUERY_BUILD_PLATFORM STREQUAL "debian")
|
|
|
|
set(PACKAGE_DEPENDENCIES
|
|
|
|
"${PACKAGE_DEPENDENCIES}"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2016-03-21 01:03:30 +00:00
|
|
|
# Ubuntu versions 2015+ will require libgcrypt20.
|
|
|
|
# Ubuntu versions 2014+ will require libudev1.
|
|
|
|
# Debian versions 8+ will require libgcrypt20 and libudev1.
|
|
|
|
|
2016-01-06 02:53:40 +00:00
|
|
|
# Improve package and iterations for each specific distribution.
|
2015-07-30 01:11:41 +00:00
|
|
|
if(NOT OSQUERY_BUILD_DISTRO STREQUAL "lucid")
|
|
|
|
set(PACKAGE_ITERATION "1.ubuntu10")
|
|
|
|
set(PACKAGE_DEPENDENCIES
|
|
|
|
"${PACKAGE_DEPENDENCIES}"
|
2016-03-18 22:11:05 +00:00
|
|
|
"libc6 (>=2.13)"
|
2015-07-30 01:11:41 +00:00
|
|
|
)
|
|
|
|
endif()
|
2016-01-06 02:53:40 +00:00
|
|
|
|
2015-04-19 02:51:00 +00:00
|
|
|
if(OSQUERY_BUILD_DISTRO STREQUAL "precise")
|
2015-06-03 01:10:43 +00:00
|
|
|
set(PACKAGE_ITERATION "1.ubuntu12")
|
2015-02-03 05:21:36 +00:00
|
|
|
set(PACKAGE_DEPENDENCIES
|
|
|
|
"${PACKAGE_DEPENDENCIES}"
|
|
|
|
"libstdc++6"
|
2016-03-21 01:03:30 +00:00
|
|
|
"libgcrypt11"
|
2015-02-03 05:21:36 +00:00
|
|
|
"libudev0"
|
|
|
|
)
|
2016-01-06 02:53:40 +00:00
|
|
|
elseif(OSQUERY_BUILD_DISTRO STREQUAL "wheezy")
|
|
|
|
set(PACKAGE_ITERATION "1.debian7")
|
|
|
|
set(PACKAGE_DEPENDENCIES
|
|
|
|
"${PACKAGE_DEPENDENCIES}"
|
|
|
|
"libstdc++6"
|
2016-03-18 22:11:05 +00:00
|
|
|
"libgcrypt11"
|
2016-01-06 02:53:40 +00:00
|
|
|
"libudev0"
|
|
|
|
)
|
2015-04-19 02:51:00 +00:00
|
|
|
elseif(OSQUERY_BUILD_DISTRO STREQUAL "trusty")
|
2015-06-03 01:10:43 +00:00
|
|
|
set(PACKAGE_ITERATION "1.ubuntu14")
|
2015-02-03 05:21:36 +00:00
|
|
|
set(PACKAGE_DEPENDENCIES
|
|
|
|
"${PACKAGE_DEPENDENCIES}"
|
|
|
|
"libstdc++6 (>= 4.8)"
|
2016-03-21 01:03:30 +00:00
|
|
|
"libgcrypt11"
|
2015-02-03 05:21:36 +00:00
|
|
|
"libudev1"
|
|
|
|
)
|
2016-01-06 02:53:40 +00:00
|
|
|
elseif(OSQUERY_BUILD_DISTRO STREQUAL "jessie")
|
|
|
|
set(PACKAGE_ITERATION "1.debian8")
|
|
|
|
set(PACKAGE_DEPENDENCIES
|
|
|
|
"${PACKAGE_DEPENDENCIES}"
|
|
|
|
"libstdc++6 (>= 4.8)"
|
2016-03-18 22:11:05 +00:00
|
|
|
"libgcrypt20"
|
2016-01-06 02:53:40 +00:00
|
|
|
"libudev1"
|
|
|
|
)
|
2015-02-03 05:21:36 +00:00
|
|
|
endif()
|
2015-06-03 01:10:43 +00:00
|
|
|
elseif(REDHAT_BASED)
|
2015-02-03 05:21:36 +00:00
|
|
|
set(PACKAGE_TYPE "rpm")
|
2015-03-28 02:19:55 +00:00
|
|
|
set(PACKAGE_ITERATION "1.el")
|
2015-02-13 10:45:43 +00:00
|
|
|
set(PACKAGE_DEPENDENCIES
|
|
|
|
"glibc >= 2.12"
|
|
|
|
"openssl >= 1.0"
|
|
|
|
"bzip2-libs"
|
|
|
|
"readline"
|
|
|
|
"zlib"
|
|
|
|
"rpm-libs"
|
|
|
|
)
|
2015-04-19 02:51:00 +00:00
|
|
|
if(OSQUERY_BUILD_DISTRO STREQUAL "centos6")
|
2015-06-03 01:10:43 +00:00
|
|
|
set(PACKAGE_ITERATION "1.el6")
|
2015-02-13 01:01:10 +00:00
|
|
|
set(PACKAGE_DEPENDENCIES
|
2015-02-13 10:45:43 +00:00
|
|
|
"${PACKAGE_DEPENDENCIES}"
|
2015-02-13 01:01:10 +00:00
|
|
|
"libudev"
|
|
|
|
)
|
2015-06-03 01:10:43 +00:00
|
|
|
elseif(OSQUERY_BUILD_DISTRO STREQUAL "rhel6")
|
|
|
|
set(PACKAGE_ITERATION "1.rhel6")
|
2015-04-03 23:53:02 +00:00
|
|
|
set(PACKAGE_DEPENDENCIES
|
|
|
|
"${PACKAGE_DEPENDENCIES}"
|
|
|
|
"libudev"
|
|
|
|
)
|
2016-03-30 06:41:52 +00:00
|
|
|
elseif(OSQUERY_BUILD_DISTRO STREQUAL "scientific6")
|
|
|
|
set(PACKAGE_ITERATION "1.el6")
|
|
|
|
set(PACKAGE_DEPENDENCIES
|
|
|
|
"${PACKAGE_DEPENDENCIES}"
|
|
|
|
"libudev"
|
|
|
|
)
|
2015-06-03 01:10:43 +00:00
|
|
|
elseif(OSQUERY_BUILD_DISTRO STREQUAL "oracle6")
|
|
|
|
set(PACKAGE_ITERATION "1.oel6")
|
2015-05-10 18:42:30 +00:00
|
|
|
set(PACKAGE_DEPENDENCIES
|
|
|
|
"${PACKAGE_DEPENDENCIES}"
|
|
|
|
"libudev"
|
|
|
|
)
|
2015-06-03 01:10:43 +00:00
|
|
|
elseif(OSQUERY_BUILD_DISTRO STREQUAL "centos7")
|
|
|
|
set(PACKAGE_ITERATION "1.el7")
|
2015-07-02 01:16:19 +00:00
|
|
|
set(PACKAGE_DEPENDENCIES
|
|
|
|
"${PACKAGE_DEPENDENCIES}"
|
|
|
|
)
|
2015-06-03 01:10:43 +00:00
|
|
|
elseif(OSQUERY_BUILD_DISTRO STREQUAL "rhel7")
|
|
|
|
set(PACKAGE_ITERATION "1.rhel7")
|
2015-07-02 02:06:08 +00:00
|
|
|
set(PACKAGE_DEPENDENCIES
|
|
|
|
"${PACKAGE_DEPENDENCIES}"
|
|
|
|
)
|
2016-03-30 06:41:52 +00:00
|
|
|
elseif(OSQUERY_BUILD_DISTRO STREQUAL "scientific7")
|
|
|
|
set(PACKAGE_ITERATION "1.el7")
|
|
|
|
set(PACKAGE_DEPENDENCIES
|
|
|
|
"${PACKAGE_DEPENDENCIES}"
|
|
|
|
)
|
2015-06-03 01:10:43 +00:00
|
|
|
elseif(OSQUERY_BUILD_DISTRO STREQUAL "oracle7")
|
|
|
|
set(PACKAGE_ITERATION "1.oel7")
|
2015-07-02 02:06:08 +00:00
|
|
|
set(PACKAGE_DEPENDENCIES
|
|
|
|
"${PACKAGE_DEPENDENCIES}"
|
|
|
|
)
|
2015-06-03 01:10:43 +00:00
|
|
|
elseif(OSQUERY_BUILD_DISTRO STREQUAL "amazon2015.03")
|
|
|
|
set(PACKAGE_ITERATION "1.amazon2015")
|
2015-07-02 02:06:08 +00:00
|
|
|
set(PACKAGE_DEPENDENCIES
|
|
|
|
"${PACKAGE_DEPENDENCIES}"
|
|
|
|
)
|
2015-05-10 18:42:30 +00:00
|
|
|
endif()
|
2015-02-03 05:21:36 +00:00
|
|
|
endif()
|
|
|
|
JOIN("${PACKAGE_DEPENDENCIES}" ", " PACKAGE_DEPENDENCIES)
|
|
|
|
|
|
|
|
add_custom_target(
|
|
|
|
packages
|
2016-06-27 23:19:08 +00:00
|
|
|
COMMAND bash "${CMAKE_SOURCE_DIR}/tools/deployment/make_linux_package.sh"
|
2015-03-28 02:19:55 +00:00
|
|
|
-t ${PACKAGE_TYPE} -i "${PACKAGE_ITERATION}"
|
|
|
|
-d "${PACKAGE_DEPENDENCIES}"
|
2016-06-27 23:19:08 +00:00
|
|
|
COMMAND python "${CMAKE_SOURCE_DIR}/tools/codegen/genapi.py" "${CMAKE_SOURCE_DIR}"
|
2015-07-16 19:23:44 +00:00
|
|
|
"--output" "--directory" "${CMAKE_BINARY_DIR}"
|
2015-02-03 05:21:36 +00:00
|
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
|
|
COMMENT "Building linux packages (no custom config)" VERBATIM
|
2015-05-04 21:15:19 +00:00
|
|
|
DEPENDS daemon shell
|
2015-02-03 05:21:36 +00:00
|
|
|
)
|
|
|
|
endif()
|
2015-07-16 22:23:29 +00:00
|
|
|
|
|
|
|
# Add dependencies and additional package data based on optional components.
|
|
|
|
|
2015-09-24 23:12:26 +00:00
|
|
|
if(NOT ${KERNEL_BINARY} STREQUAL "" AND
|
|
|
|
EXISTS "${CMAKE_BINARY_DIR}/kernel/${KERNEL_BINARY}")
|
2015-07-16 22:23:29 +00:00
|
|
|
# The osquery kernel was built
|
|
|
|
add_dependencies(packages kernel-build)
|
|
|
|
endif()
|