|
@@ -4,6 +4,7 @@ include(CheckIncludeFile)
|
4
|
4
|
|
5
|
5
|
option(GENERATE_SRS_SECRET "Generate a random SRS secret if none exists during install" ON)
|
6
|
6
|
option(USE_APPARMOR "Enable AppArmor profile" OFF)
|
|
7
|
+option(USE_SELINUX "Enable SELinux policy module" OFF)
|
7
|
8
|
|
8
|
9
|
set(CHROOT_DIR "${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}" CACHE PATH "Chroot jail for daemon")
|
9
|
10
|
set(SYSCONF_DIR "/etc" CACHE PATH "Global system configuration folder")
|
|
@@ -107,6 +108,15 @@ if(USE_APPARMOR)
|
107
|
108
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.apparmor DESTINATION "${SYSCONF_DIR}/apparmor.d" RENAME "${APPARMOR_PROFILE}")
|
108
|
109
|
endif()
|
109
|
110
|
|
|
111
|
+if(USE_SELINUX)
|
|
112
|
+ file(COPY selinux/${PROJECT_NAME}.te selinux/${PROJECT_NAME}.fc DESTINATION selinux)
|
|
113
|
+ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
|
114
|
+ WORKING_DIRECTORY selinux
|
|
115
|
+ COMMAND make -f /usr/share/selinux/devel/Makefile)
|
|
116
|
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/selinux/${PROJECT_NAME}.pp
|
|
117
|
+ DESTINATION /usr/share/selinux/packages/${PROJECT_NAME})
|
|
118
|
+endif()
|
|
119
|
+
|
110
|
120
|
install(TARGETS ${PROJECT_NAME} DESTINATION "sbin")
|
111
|
121
|
install(FILES README.md README_UPGRADE.md main.cf.ex DESTINATION "${DOC_DIR}")
|
112
|
122
|
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/postinstall.cmake")
|