1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-22 09:29:52 +03:00

CMake: add support for RPM packaging with CPack

This commit is contained in:
Davide Beatrici 2018-08-13 05:48:45 +02:00
parent 4ed7c559f1
commit de656ba1a7
2 changed files with 17 additions and 2 deletions

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.6)
cmake_minimum_required(VERSION 3.7)
project(SoftEtherVPN
VERSION 5.01.9657
@ -17,7 +17,6 @@ set(BUILD_DIRECTORY ${SoftEtherVPN_SOURCE_DIR}/build)
add_subdirectory(src)
# Packaging
set(CPACK_GENERATOR "DEB")
set(CPACK_COMPONENTS_ALL vpnserver vpnclient vpnbridge vpncmd)
set(CPACK_PACKAGE_DIRECTORY ${BUILD_DIRECTORY})
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
@ -33,4 +32,10 @@ set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
set(CPACK_DEBIAN_PACKAGE_SECTION "net")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Unknown")
# RPM
set(CPACK_RPM_COMPONENT_INSTALL ON)
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
set(CPACK_RPM_PACKAGE_GROUP "Applications/Internet")
set(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
include(CPack)

10
configure vendored
View File

@ -35,6 +35,16 @@ if [ -z ${OPENSSL_ROOT_DIR} ]; then
fi
fi
if [ -x "$(command -v rpmbuild)" ]; then
echo "'rpmbuild' executable found, CPack will generate RPM packages."
CMAKE_FLAGS="-DCPACK_GENERATOR='RPM' ${CMAKE_FLAGS}"
else
echo "'rpmbuild' executable not found, CPack will generate DEB packages."
CMAKE_FLAGS="-DCPACK_GENERATOR='DEB' ${CMAKE_FLAGS}"
fi
echo ""
(cd tmp && cmake ${CMAKE_FLAGS} .. || exit 1)