2018-09-02 00:53:56 +08:00
|
|
|
# CMakeLists.txt for the Redhat Target Distros.
|
2013-10-20 02:50:59 +08:00
|
|
|
|
2018-11-18 00:45:08 +08:00
|
|
|
#
|
|
|
|
# General strategy is to configure and install all files specific to Apache and Nginx
|
|
|
|
# Then let the rpm specfile sort them into the appropriate sub-package
|
|
|
|
#
|
|
|
|
|
2015-02-15 21:34:17 +08:00
|
|
|
# Display a message to show the RHEL build options are being processed.
|
2016-12-24 03:06:44 +08:00
|
|
|
if(ZM_TARGET_DISTRO MATCHES "^el")
|
|
|
|
message([STATUS] "Starting RHEL Build Options" ...)
|
|
|
|
elseif(ZM_TARGET_DISTRO MATCHES "^fc")
|
|
|
|
message([STATUS] "Starting Fedora Build Options" ...)
|
|
|
|
else(ZM_TARGET_DISTRO MATCHES "^el")
|
|
|
|
message([WARNING] "Unknown Build Option Detected" ...)
|
|
|
|
endif(ZM_TARGET_DISTRO MATCHES "^el")
|
2015-02-15 21:34:17 +08:00
|
|
|
|
2018-11-18 00:45:08 +08:00
|
|
|
#
|
|
|
|
# CONFIGURE STAGE
|
|
|
|
#
|
2016-12-24 03:06:44 +08:00
|
|
|
|
2018-11-18 00:45:08 +08:00
|
|
|
# Configure the common zoneminder files
|
|
|
|
configure_file(common/zoneminder.logrotate.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.logrotate @ONLY)
|
|
|
|
configure_file(common/zoneminder.service.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.service @ONLY)
|
2017-04-15 21:51:59 +08:00
|
|
|
file(MAKE_DIRECTORY sock swap zoneminder zoneminder-upload events images temp)
|
2013-10-20 02:50:59 +08:00
|
|
|
|
2018-11-18 00:45:08 +08:00
|
|
|
# Configure the Apache zoneminder files
|
|
|
|
configure_file(apache/zm-apache.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zm-apache.conf @ONLY)
|
|
|
|
configure_file(apache/zoneminder.apache.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.apache.conf @ONLY)
|
|
|
|
configure_file(apache/zoneminder.apache.tmpfiles.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.apache.tmpfiles.conf @ONLY)
|
|
|
|
configure_file(apache/com.zoneminder.systemctl.rules.apache.in ${CMAKE_CURRENT_SOURCE_DIR}/com.zoneminder.systemctl.rules.apache @ONLY)
|
|
|
|
|
|
|
|
# Configure the Nginx zoneminder files
|
|
|
|
configure_file(nginx/zm-nginx.conf ${CMAKE_CURRENT_SOURCE_DIR}/zm-nginx.conf COPYONLY)
|
|
|
|
configure_file(nginx/zoneminder.nginx.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.nginx.conf @ONLY)
|
|
|
|
configure_file(nginx/zoneminder.nginx.tmpfiles.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.nginx.tmpfiles.conf @ONLY)
|
|
|
|
configure_file(nginx/zm-web-user.conf ${CMAKE_CURRENT_SOURCE_DIR}/zm-web-user.conf COPYONLY)
|
|
|
|
configure_file(nginx/zoneminder.php-fpm.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.php-fpm.conf @ONLY)
|
2018-11-18 00:47:53 +08:00
|
|
|
configure_file(nginx/com.zoneminder.systemctl.rules.nginx ${CMAKE_CURRENT_SOURCE_DIR}/com.zoneminder.systemctl.rules.nginx COPYONLY)
|
2018-11-18 00:45:08 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# INSTALLATION STAGE
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
# Install the common zoneminder files
|
|
|
|
install(FILES zoneminder.logrotate DESTINATION /etc/logrotate.d RENAME zoneminder PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
|
|
|
install(FILES zoneminder.service DESTINATION /usr/lib/systemd/system PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
|
|
|
|
2013-10-20 02:50:59 +08:00
|
|
|
install(DIRECTORY sock swap DESTINATION /var/lib/zoneminder DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
|
|
|
install(DIRECTORY zoneminder DESTINATION /var/log DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
2017-04-01 09:17:05 +08:00
|
|
|
install(DIRECTORY zoneminder DESTINATION /var/run DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
2018-04-20 03:01:46 +08:00
|
|
|
install(DIRECTORY zoneminder DESTINATION /var/cache DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
2013-10-20 02:50:59 +08:00
|
|
|
install(DIRECTORY zoneminder-upload DESTINATION /var/spool DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
|
|
|
install(DIRECTORY events images temp DESTINATION /var/lib/zoneminder DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
|
|
|
|
2018-11-18 00:45:08 +08:00
|
|
|
# Install the Apache zoneminder files
|
|
|
|
install(FILES zm-apache.conf DESTINATION /usr/lib/systemd/system/zoneminder.service.d PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
|
|
|
install(FILES zoneminder.apache.conf DESTINATION /etc/zm/www PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
|
|
|
install(FILES zoneminder.apache.tmpfiles.conf DESTINATION /usr/lib/tmpfiles.d PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
|
|
|
install(FILES com.zoneminder.systemctl.rules.apache DESTINATION /etc/zm/www PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
|
|
|
|
|
|
|
# Install the Nginx zoneminder files
|
|
|
|
install(FILES zm-nginx.conf DESTINATION /usr/lib/systemd/system/zoneminder.service.d PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
|
|
|
install(FILES zoneminder.nginx.conf DESTINATION /etc/zm/www PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
|
|
|
install(FILES zoneminder.nginx.tmpfiles.conf DESTINATION /usr/lib/tmpfiles.d PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
|
|
|
install(FILES com.zoneminder.systemctl.rules.nginx DESTINATION /etc/zm/www PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
|
|
|
install(FILES zm-web-user.conf DESTINATION /etc/zm/conf.d PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
|
|
|
install(FILES zoneminder.php-fpm.conf DESTINATION /etc/php-fpm.d PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
|
|
|
|
|
|
|
# Miscellaneous
|
|
|
|
|
2017-07-21 20:18:13 +08:00
|
|
|
# Symlink the cake php temp folder to the ZoneMinder temp folder
|
2015-08-30 07:04:26 +08:00
|
|
|
install(CODE "execute_process(COMMAND ln -sf ../../../../../../var/lib/zoneminder/temp \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www/api/app/tmp\")")
|
2013-10-20 02:50:59 +08:00
|
|
|
|
2016-12-24 03:06:44 +08:00
|
|
|
# Link to Cambozola
|
2015-09-15 02:51:48 +08:00
|
|
|
install(CODE "execute_process(COMMAND ln -sf ../../java/cambozola.jar \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www/cambozola.jar\")")
|
|
|
|
|
2018-04-20 04:36:43 +08:00
|
|
|
# Install auxiliary files
|
2018-11-18 00:45:08 +08:00
|
|
|
install(FILES common/redalert.wav DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www/sounds PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
2013-10-20 02:50:59 +08:00
|
|
|
|