From b1c76ad0b60a80a25d5fe19e11d59249a29a4ca9 Mon Sep 17 00:00:00 2001 From: Andy Bauer Date: Sat, 19 Oct 2013 08:49:47 -0500 Subject: [PATCH] Cmake support files for fedora distro --- distros/fedora/CMakeLists.txt | 42 +++++++++++++++++++++++++++++++++++ distros/fedora/jscalendar.sh | 1 + distros/redhat/jscalendar.sh | 7 ++++++ 3 files changed, 50 insertions(+) create mode 100644 distros/fedora/CMakeLists.txt create mode 120000 distros/fedora/jscalendar.sh create mode 100755 distros/redhat/jscalendar.sh diff --git a/distros/fedora/CMakeLists.txt b/distros/fedora/CMakeLists.txt new file mode 100644 index 000000000..7409a2e39 --- /dev/null +++ b/distros/fedora/CMakeLists.txt @@ -0,0 +1,42 @@ +# CMakeLists.txt for the Fedora Target Distro. + +# Download jscalendar & move files into position +file(DOWNLOAD http://downloads.sourceforge.net/jscalendar/jscalendar-1.0.zip ${CMAKE_CURRENT_SOURCE_DIR}/jscalendar-1.0.zip STATUS download_jsc) +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) + +# 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\")") + +# Fedora requires cambozola as a separate package so just link to it +install(CODE "execute_process(COMMAND ln -sf ../../java/cambozola.jar \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www/cambozola.jar\")") + +# Install auxillary files required to run zoneminder on Fedora +install(FILES zoneminder.conf DESTINATION /etc/httpd/conf.d PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) +install(FILES zoneminder.logrotate DESTINATION /etc/logrotate.d RENAME zoneminder PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) +install(FILES zoneminder.tmpfiles DESTINATION /etc/tmpfiles.d RENAME zoneminder.conf PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) +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) +install(FILES zoneminder.service DESTINATION /usr/lib/systemd/system PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) + +# 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 "") diff --git a/distros/fedora/jscalendar.sh b/distros/fedora/jscalendar.sh new file mode 120000 index 000000000..0d12509bb --- /dev/null +++ b/distros/fedora/jscalendar.sh @@ -0,0 +1 @@ +../redhat/jscalendar.sh \ No newline at end of file diff --git a/distros/redhat/jscalendar.sh b/distros/redhat/jscalendar.sh new file mode 100755 index 000000000..80acaafec --- /dev/null +++ b/distros/redhat/jscalendar.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +unzip -o jscalendar-1.0.zip +mkdir -v jscalendar-doc +cd jscalendar-1.0 +mv -v *html *php doc/* README ../jscalendar-doc +rmdir -v doc