From 2e8935daf2d97607a17f85d8b4d8037cae1807d8 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Tue, 11 Nov 2014 09:15:15 -0600 Subject: [PATCH 1/9] Add the ability to specify the zm configdir at build time. --- CMakeLists.txt | 6 ++++-- Makefile.am | 5 +++-- configure.ac | 10 ++++++++-- zm.conf.in | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d5608469f..e8acdc128 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,7 @@ include (CheckTypeSize) include (CheckStructHasMember) # Configuration options -mark_as_advanced(FORCE ZM_EXTRA_LIBS ZM_MYSQL_ENGINE ZM_NO_MMAP CMAKE_INSTALL_FULL_BINDIR ZM_PERL_SUBPREFIX ZM_PERL_USE_PATH ZM_TARGET_DISTRO) +mark_as_advanced(FORCE ZM_EXTRA_LIBS ZM_MYSQL_ENGINE ZM_NO_MMAP CMAKE_INSTALL_FULL_BINDIR ZM_PERL_SUBPREFIX ZM_PERL_USE_PATH ZM_TARGET_DISTRO ZM_CONFIG_DIR) set(ZM_RUNDIR "/var/run/zm" CACHE PATH "Location of transient process files, default: /var/run/zm") set(ZM_SOCKDIR "/var/run/zm" CACHE PATH "Location of Unix domain socket files, default /var/run/zm") set(ZM_TMPDIR "/var/tmp/zm" CACHE PATH "Location of temporary files, default: /tmp/zm") @@ -59,6 +59,7 @@ set(ZM_DB_PASS "zmpass" CACHE STRING "Password of ZoneMinder database user, defa set(ZM_WEB_USER "" CACHE STRING "The user apache or the local web server runs on. Leave empty for automatic detection. If that fails, you can use this variable to force") set(ZM_WEB_GROUP "" CACHE STRING "The group apache or the local web server runs on, Leave empty to be the same as the web user") # Advanced +set(ZM_CONFIG_DIR "/${CMAKE_INSTALL_SYSCONFDIR}" CACHE PATH "Location of ZoneMinder configuration, default system config directory") set(ZM_EXTRA_LIBS "" CACHE STRING "A list of optional libraries, separated by semicolons, e.g. ssl;theora") set(ZM_MYSQL_ENGINE "InnoDB" CACHE STRING "MySQL engine to use with database, default: InnoDB") set(ZM_NO_MMAP "OFF" CACHE BOOL "Set to ON to not use mmap shared memory. Shouldn't be enabled unless you experience problems with the shared memory. default: OFF") @@ -486,6 +487,7 @@ endif(NOT POLKIT_FOUND) # Some variables that zm expects set(ZM_PID "${ZM_RUNDIR}/zm.pid") +set(ZM_CONFIG "${ZM_CONFIG_DIR}/zm.conf") set(ZM_CONFIG "/${CMAKE_INSTALL_SYSCONFDIR}/zm.conf") set(VERSION "${zoneminder_VERSION}") set(PKGDATADIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/zoneminder") @@ -535,7 +537,7 @@ else(zmconfgen_result EQUAL 0) endif(zmconfgen_result EQUAL 0) # Install zm.conf -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zm.conf" DESTINATION "/${CMAKE_INSTALL_SYSCONFDIR}") +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zm.conf" DESTINATION "${ZM_CONFIG_DIR}") # Uninstall target configure_file( diff --git a/Makefile.am b/Makefile.am index 55cf10db8..84c18bcd4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,8 +3,9 @@ AUTOMAKE_OPTIONS = foreign # And these to the user and group of your webserver webuser = @WEB_USER@ webgroup = @WEB_GROUP@ +zmconfigdir = @ZM_CONFIG_DIR@ -sysconf_DATA = \ +zmconfig_DATA = \ zm.conf SUBDIRS = \ @@ -20,7 +21,7 @@ EXTRA_DIST = \ # Yes, you are correct. This is a HACK! install-data-hook: - ( cd $(DESTDIR)$(sysconfdir); chown $(webuser):$(webgroup) $(sysconf_DATA); chmod 600 $(sysconf_DATA) ) + ( cd $(DESTDIR)$(zmconfigdir); chown $(webuser):$(webgroup) $(zmconfig_DATA); chmod 600 $(zmconfig_DATA) ) ( if ! test -e $(DESTDIR)$(ZM_RUNDIR); then mkdir -p $(DESTDIR)$(ZM_RUNDIR); fi; if test "$(DESTDIR)$(ZM_RUNDIR)" != "/var/run"; then chown $(webuser):$(webgroup) $(DESTDIR)$(ZM_RUNDIR); chmod u+w $(DESTDIR)$(ZM_RUNDIR); fi ) ( if ! test -e $(DESTDIR)$(ZM_SOCKDIR); then mkdir -p $(DESTDIR)$(ZM_SOCKDIR); fi; if test "$(DESTDIR)$(ZM_SOCKDIR)" != "/var/run"; then chown $(webuser):$(webgroup) $(DESTDIR)$(ZM_SOCKDIR); chmod u+w $(DESTDIR)$(ZM_SOCKDIR); fi ) ( if ! test -e $(DESTDIR)$(ZM_TMPDIR); then mkdir -m 700 -p $(DESTDIR)$(ZM_TMPDIR); fi; if test "$(DESTDIR)$(ZM_TMPDIR)" != "/tmp" && test "$(DESTDIR)$(ZM_TMPDIR)" != "/var/tmp"; then chown $(webuser):$(webgroup) $(DESTDIR)$(ZM_TMPDIR); chmod u+w $(DESTDIR)$(ZM_TMPDIR); fi ) diff --git a/configure.ac b/configure.ac index efe61286d..11c7e95c6 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,7 @@ AC_ARG_VAR(ZM_RUNDIR,[Location of transient process files, default /var/run/zm]) AC_ARG_VAR(ZM_SOCKDIR,[Location of Unix domain socket files, default /var/run/zm]) AC_ARG_VAR(ZM_TMPDIR,[Location of temporary files, default /var/tmp/zm]) AC_ARG_VAR(ZM_LOGDIR,[Location of generated log files, default /var/log/zm]) +AC_ARG_VAR(ZM_CONFIG_DIR,[Location of ZoneMinder configuration, default system config directory]) if test "$ZM_DB_TYPE" == ""; then AC_SUBST(ZM_DB_TYPE,[mysql]) @@ -80,6 +81,10 @@ fi if test "$ZM_LOGDIR" == ""; then AC_SUBST(ZM_LOGDIR,[/var/log/zm]) fi +AC_DEFINE_DIR([SYSCONFDIR],[sysconfdir],[Expanded configuration directory]) +if test "$ZM_CONFIG_DIR" == ""; then + AC_SUBST(ZM_CONFIG_DIR,[$SYSCONFDIR]) +fi LIB_ARCH=lib AC_ARG_WITH(libarch, @@ -428,8 +433,9 @@ AC_DEFINE_DIR([LIBDIR],[libdir],[Expanded library directory]) AC_DEFINE_DIR([DATADIR],[datadir],[Expanded data directory]) AC_SUBST(PKGDATADIR,"$DATADIR/$PACKAGE") AC_SUBST(ZM_PID,"$ZM_RUNDIR/zm.pid") -AC_DEFINE_DIR([SYSCONFDIR],[sysconfdir],[Expanded configuration directory]) -AC_SUBST(ZM_CONFIG,"$SYSCONFDIR/zm.conf") +#AC_DEFINE_DIR([SYSCONFDIR],[sysconfdir],[Expanded configuration directory]) +#AC_SUBST(ZM_CONFIG,"$SYSCONFDIR/zm.conf") +AC_SUBST(ZM_CONFIG,"$ZM_CONFIG_DIR/zm.conf") # Slight hack for non-standard perl install paths if test "$prefix" != "NONE"; then diff --git a/zm.conf.in b/zm.conf.in index 37d654441..9cc3d42de 100644 --- a/zm.conf.in +++ b/zm.conf.in @@ -19,7 +19,7 @@ ZM_PATH_BIN=@BINDIR@ ZM_PATH_LIB=@LIBDIR@ # Path to ZoneMinder configuration (this file only at present) -ZM_PATH_CONF=@SYSCONFDIR@ +ZM_PATH_CONF=@ZM_CONFIG_DIR@ # Path to ZoneMinder web files ZM_PATH_WEB=@WEB_PREFIX@ From 9016e30f921b3d23cf0ab77fb47a1d272baa5b3f Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 13 Nov 2014 14:47:07 -0500 Subject: [PATCH 2/9] BSD uses /dev/bktr0 instead of /dev/video. This is actually pulled FreeBSD ports. --- src/zmc.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/zmc.cpp b/src/zmc.cpp index d84d30505..206810b19 100644 --- a/src/zmc.cpp +++ b/src/zmc.cpp @@ -32,7 +32,11 @@ void Usage() fprintf( stderr, "zmc -d or -r -H -P -p or -f or -m \n" ); fprintf( stderr, "Options:\n" ); +#if defined(BSD) + fprintf( stderr, " -d, --device : For local cameras, device to access. E.g /dev/bktr0 etc\n" ); +#else fprintf( stderr, " -d, --device : For local cameras, device to access. E.g /dev/video0 etc\n" ); +#endif fprintf( stderr, " -r -H -P -p : For remote cameras\n" ); fprintf( stderr, " -f, --file : For local images, jpg file to access.\n" ); fprintf( stderr, " -m, --monitor : For sources associated with a single monitor\n" ); From e87e69fa57be6acd8d5829808c41812ef5672bc3 Mon Sep 17 00:00:00 2001 From: SteveGilvarry Date: Fri, 5 Dec 2014 10:44:23 +1100 Subject: [PATCH 3/9] Ran script to replace all Short open tags --- web/includes/functions.php | 98 ++--- .../css/classic/views/timeline.css.php | 44 +- .../classic/css/flat/views/timeline.css.php | 44 +- .../classic/includes/control_functions.php | 92 ++-- .../classic/includes/export_functions.php | 80 ++-- web/skins/classic/includes/functions.php | 10 +- web/skins/classic/js/skin.js.php | 18 +- web/skins/classic/views/bandwidth.php | 10 +- web/skins/classic/views/console.php | 74 ++-- web/skins/classic/views/control.php | 12 +- web/skins/classic/views/controlcap.php | 396 +++++++++--------- web/skins/classic/views/controlcaps.php | 50 +-- web/skins/classic/views/controlpreset.php | 12 +- web/skins/classic/views/cycle.php | 8 +- web/skins/classic/views/device.php | 18 +- web/skins/classic/views/devices.php | 18 +- web/skins/classic/views/donate.php | 14 +- web/skins/classic/views/error.php | 8 +- web/skins/classic/views/event.php | 62 +-- web/skins/classic/views/eventdetail.php | 22 +- web/skins/classic/views/events.php | 92 ++-- web/skins/classic/views/export.php | 34 +- web/skins/classic/views/filter.php | 74 ++-- web/skins/classic/views/filtersave.php | 36 +- web/skins/classic/views/frame.php | 24 +- web/skins/classic/views/frames.php | 32 +- web/skins/classic/views/function.php | 14 +- web/skins/classic/views/group.php | 20 +- web/skins/classic/views/groups.php | 32 +- web/skins/classic/views/js/console.js.php | 6 +- .../classic/views/js/controlpreset.js.php | 2 +- web/skins/classic/views/js/cycle.js.php | 8 +- web/skins/classic/views/js/donate.js.php | 4 +- web/skins/classic/views/js/event.js.php | 60 +-- web/skins/classic/views/js/events.js.php | 16 +- web/skins/classic/views/js/export.js.php | 10 +- web/skins/classic/views/js/filter.js.php | 12 +- web/skins/classic/views/js/monitor.js.php | 82 ++-- web/skins/classic/views/js/montage.js.php | 36 +- web/skins/classic/views/js/options.js.php | 4 +- web/skins/classic/views/js/state.js.php | 4 +- web/skins/classic/views/js/timeline.js.php | 6 +- web/skins/classic/views/js/version.js.php | 2 +- web/skins/classic/views/js/video.js.php | 8 +- web/skins/classic/views/js/watch.js.php | 92 ++-- web/skins/classic/views/js/zone.js.php | 88 ++-- web/skins/classic/views/log.php | 58 +-- web/skins/classic/views/login.php | 12 +- web/skins/classic/views/logout.php | 12 +- web/skins/classic/views/monitor.php | 298 ++++++------- web/skins/classic/views/monitorpreset.php | 12 +- web/skins/classic/views/monitorprobe.php | 12 +- web/skins/classic/views/montage.php | 18 +- web/skins/classic/views/none.php | 4 +- web/skins/classic/views/optionhelp.php | 8 +- web/skins/classic/views/options.php | 106 ++--- web/skins/classic/views/plugin.php | 20 +- web/skins/classic/views/postlogin.php | 4 +- web/skins/classic/views/settings.php | 26 +- web/skins/classic/views/state.php | 30 +- web/skins/classic/views/stats.php | 46 +- web/skins/classic/views/status.php | 6 +- web/skins/classic/views/timeline.php | 52 +-- web/skins/classic/views/user.php | 56 +-- web/skins/classic/views/version.php | 28 +- web/skins/classic/views/video.php | 54 +-- web/skins/classic/views/watch.php | 62 +-- web/skins/classic/views/zone.php | 112 ++--- web/skins/classic/views/zones.php | 34 +- .../mobile/includes/control_functions.php | 10 +- web/skins/mobile/includes/functions.php | 6 +- web/skins/mobile/views/console.php | 18 +- web/skins/mobile/views/devices.php | 10 +- web/skins/mobile/views/error.php | 6 +- web/skins/mobile/views/event.php | 8 +- web/skins/mobile/views/eventdetails.php | 36 +- web/skins/mobile/views/events.php | 28 +- web/skins/mobile/views/filter.php | 8 +- web/skins/mobile/views/frame.php | 12 +- web/skins/mobile/views/function.php | 12 +- web/skins/mobile/views/login.php | 12 +- web/skins/mobile/views/montage.php | 6 +- web/skins/mobile/views/state.php | 14 +- web/skins/mobile/views/video.php | 46 +- web/skins/mobile/views/watch.php | 12 +- 85 files changed, 1601 insertions(+), 1601 deletions(-) diff --git a/web/includes/functions.php b/web/includes/functions.php index e41c82030..64a7e3953 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -247,20 +247,20 @@ function outputVideoStream( $id, $src, $width, $height, $format, $title="" ) if ( isWindows() ) { ?> - - +type=""> + - @@ -273,19 +273,19 @@ showcontrols="0"> case "video/quicktime" : { ?> - - +type=""> + - @@ -297,19 +297,19 @@ controller="true"> case "application/x-shockwave-flash" : { ?> - - +type=""> + - @@ -323,11 +323,11 @@ bgcolor="#ffffff"> if ( !$objectTag ) { ?> - -src="" -name="" -width="" -height="" + +src="" +name="" +width="" +height="" autostart="1" autoplay="1" showcontrols="0" @@ -341,11 +341,11 @@ function outputImageStream( $id, $src, $width, $height, $title="" ) { if ( canStreamIframe() ) { ?> -