2013-10-20 02:50:59 +08:00
# CMakeLists.txt for the Redhat/CentOS Target Distro.
2015-02-15 21:34:17 +08:00
# Display a message to show the RHEL build options are being processed.
message ( [STATUS] "Starting RHEL Build Options" ... )
2013-10-20 02:50:59 +08:00
# Create the zoneminder service file
2015-02-09 07:56:44 +08:00
if ( ZM_TARGET_DISTRO STREQUAL "el7" )
configure_file ( zoneminder.service.in ${ CMAKE_CURRENT_SOURCE_DIR } /zoneminder.service @ONLY )
2015-02-15 19:44:46 +08:00
configure_file ( zoneminder.el7.conf.in ${ CMAKE_CURRENT_SOURCE_DIR } /zoneminder.el7.conf @ONLY )
2015-02-15 23:50:21 +08:00
configure_file ( zoneminder.tmpfiles.in ${ CMAKE_CURRENT_SOURCE_DIR } /zoneminder.tmpfiles @ONLY )
configure_file ( zoneminder.el7.logrotate.in ${ CMAKE_CURRENT_SOURCE_DIR } /zoneminder.el7.logrotate @ONLY )
2015-02-09 08:07:46 +08:00
else ( ZM_TARGET_DISTRO STREQUAL "el7" )
2015-02-16 05:59:58 +08:00
configure_file ( zoneminder.sysvinit.in ${ CMAKE_CURRENT_SOURCE_DIR } /zoneminder.sysvinit @ONLY )
2015-02-15 23:50:21 +08:00
configure_file ( zoneminder.el6.logrotate.in ${ CMAKE_CURRENT_SOURCE_DIR } /zoneminder.el6.logrotate @ONLY )
configure_file ( zoneminder.el6.conf.in ${ CMAKE_CURRENT_SOURCE_DIR } /zoneminder.el6.conf @ONLY )
2015-02-09 07:56:44 +08:00
endif ( ZM_TARGET_DISTRO STREQUAL "el7" )
2013-10-20 02:50:59 +08:00
# Download jscalendar & move files into position
2016-03-03 22:33:49 +08:00
file ( DOWNLOAD http://iweb.dl.sourceforge.net/project/jscalendar/jscalendar/1.0/jscalendar-1.0.zip ${ CMAKE_CURRENT_SOURCE_DIR } /jscalendar-1.0.zip LOG jsc_log STATUS download_jsc )
2013-10-20 02:50:59 +08:00
#message(STATUS "Log of jscalender script was: ${jsc_log}")
if ( download_jsc EQUAL 0 )
message ( STATUS "Jscalander successfully downloaded. Installing..." )
execute_process ( COMMAND ${ CMAKE_CURRENT_SOURCE_DIR } /jscalendar.sh WORKING_DIRECTORY ${ CMAKE_CURRENT_SOURCE_DIR } ERROR_VARIABLE unzip_jsc )
message ( STATUS "Status of jscalender script was: ${unzip_jsc}" )
else ( download_jsc EQUAL 0 )
message ( STATUS "Unable to download optional jscalander. Skipping..." )
endif ( download_jsc EQUAL 0 )
2015-09-15 02:51:48 +08:00
# Cambozola is now packaged in zmrepo
2013-10-20 02:50:59 +08:00
# Download cambozola & move files into position
2015-09-15 02:51:48 +08:00
#file(DOWNLOAD http://www.andywilcock.com/code/cambozola/cambozola-0.931.tar.gz ${CMAKE_CURRENT_SOURCE_DIR}/cambozola-0.931.tar.gz STATUS download_camb)
#if(download_camb EQUAL 0)
# message(STATUS "Cambozola successfully downloaded. Installing...")
# execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/cambozola.sh WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ERROR_VARIABLE untar_camb)
# message(STATUS "Status of cambozola script was: ${untar_camb}")
#else(download_camb EQUAL 0)
# message(STATUS "Unable to download optional Cambozola. Skipping...")
#endif(download_camb EQUAL 0)
2013-10-20 02:50:59 +08:00
# Create several empty folders
file ( MAKE_DIRECTORY sock swap zoneminder zoneminder-upload events images temp )
# Install the empty folders
#install(DIRECTORY run DESTINATION /var DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_WRITE GROUP_READ GROUP_EXECUTE WORLD_WRITE WORLD_READ WORLD_EXECUTE)
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 )
install ( DIRECTORY zoneminder DESTINATION /run DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE )
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 )
# Create symlinks
install ( CODE "execute_process(COMMAND ln -sf ../../../../var/lib/zoneminder/events \" \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www/events\")")
install ( CODE "execute_process(COMMAND ln -sf ../../../../var/lib/zoneminder/images \" \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www/images\")")
install ( CODE "execute_process(COMMAND ln -sf ../../../../var/lib/zoneminder/temp \" \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www/temp\")")
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
2015-09-15 02:51:48 +08:00
# Link to Cambozola, which is now packaged in zmrepo
install ( CODE "execute_process(COMMAND ln -sf ../../java/cambozola.jar \" \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www/cambozola.jar\")")
2016-02-08 17:41:36 +08:00
# Install auxiliary files required to run zoneminder on CentOS
2013-10-20 02:50:59 +08:00
install ( FILES 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 )
2015-02-09 07:56:44 +08:00
if ( ZM_TARGET_DISTRO STREQUAL "el7" )
install ( FILES zoneminder.el7.conf DESTINATION /etc/httpd/conf.d RENAME zoneminder.conf PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ )
install ( FILES zoneminder.el7.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 )
2015-04-01 09:45:12 +08:00
install ( FILES ../../misc/zoneminder-tmpfiles.conf DESTINATION /etc/tmpfiles.d RENAME zoneminder.conf PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ )
2015-02-09 08:07:46 +08:00
else ( ZM_TARGET_DISTRO STREQUAL "el7" )
2015-02-09 07:56:44 +08:00
install ( FILES zoneminder.el6.conf DESTINATION /etc/httpd/conf.d RENAME zoneminder.conf PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ )
install ( FILES zoneminder.el6.logrotate DESTINATION /etc/logrotate.d RENAME zoneminder PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ )
2015-02-16 05:59:58 +08:00
install ( FILES zoneminder.sysvinit DESTINATION /etc/rc.d/init.d RENAME zoneminder PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ )
2015-02-09 07:56:44 +08:00
endif ( ZM_TARGET_DISTRO STREQUAL "el7" )
2013-10-20 02:50:59 +08:00
# Install jscalendar
if ( unzip_jsc STREQUAL "" )
install ( DIRECTORY jscalendar-1.0/ DESTINATION ${ CMAKE_INSTALL_PREFIX } / ${ CMAKE_INSTALL_DATAROOTDIR } /zoneminder/www/tools/jscalendar )
endif ( unzip_jsc STREQUAL "" )
# Install cambozola
if ( untar_camb STREQUAL "" )
install ( FILES cambozola-0.931/dist/cambozola.jar DESTINATION ${ CMAKE_INSTALL_PREFIX } / ${ CMAKE_INSTALL_DATAROOTDIR } /zoneminder/www )
endif ( untar_camb STREQUAL "" )