diff --git a/CMakeLists.txt b/CMakeLists.txt index 794b41fa6..97af402e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ # cmake_minimum_required (VERSION 2.6) project (zoneminder) -set(zoneminder_VERSION "1.26.5") +set(zoneminder_VERSION "1.27") # CMake does not allow out-of-source build if CMakeCache.exists in the source folder. Abort and notify the user to save him from headache why it doesn't work. if((NOT (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)) AND (EXISTS "${CMAKE_SOURCE_DIR}/CMakeCache.txt")) diff --git a/Dockerfile b/Dockerfile index 32cab3e75..6b5c5da97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,14 +12,17 @@ RUN apt-get update RUN apt-get upgrade -y # Install the prerequisites -RUN apt-get install -y build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libpcre3 libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm subversion automake autoconf libjpeg-turbo8-dev libjpeg-turbo8 libtheora-dev libvorbis-dev libvpx-dev libx264-dev libmp4v2-dev ffmpeg git wget mysql-client apache2 php5 php5-mysql apache2-mpm-prefork libapache2-mod-php5 php5-cli openssh-server mysql-server +RUN apt-get install -y build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libpcre3 libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm subversion automake autoconf libjpeg-turbo8-dev libjpeg-turbo8 libtheora-dev libvorbis-dev libvpx-dev libx264-dev libmp4v2-dev ffmpeg git wget mysql-client apache2 php5 php5-mysql apache2-mpm-prefork libapache2-mod-php5 php5-cli openssh-server mysql-server libvlc-dev libvlc5 libvlccore-dev libvlccore5 vlc-data vlc libcurl4-openssl-dev -# Grab the latest ZoneMinder code -RUN git clone https://github.com/ZoneMinder/ZoneMinder.git +# Grab the latest ZoneMinder code in master +RUN git clone https://github.com/kylejohnson/ZoneMinder.git # Change into the ZoneMinder directory WORKDIR ZoneMinder +# Check out the release-1.27 branch +RUN git checkout release-1.27 + # Setup the ZoneMinder build environment RUN aclocal && autoheader && automake --force-missing --add-missing && autoconf diff --git a/README.md b/README.md index 12a17d5e6..a86a75cfe 100644 --- a/README.md +++ b/README.md @@ -103,17 +103,29 @@ root@host:~# gdebi /root/zoneminder_1.26.4-1_amd64.deb; #### CentOS / RHEL -Two additional repositories must be added before one can build zoneminder on CentOS or RHEL: +Additional repositories must be added before one can build zoneminder on CentOS or RHEL: 1. RepoForge (formerly RPMForge) http://repoforge.org/use/ 2. EPEL https://fedoraproject.org/wiki/EPEL +3. Optional RPMFusion: http://rpmfusion.org/ [SEE NOTE] + +[NOTE]
+The RPMFusion repo contains significantly newer versions of ffmpeg and vlc. This leads to significantly better camera support. However, the RPMFusion repo contains packages that conflict with the other two repos. In order to resolve this, one must also install the yum priorities pacakge and use that to prioritize your repos in the following order: -Once those are added, install the following: +1. Base +2. RPMFusion +3. EPEL +4. RPMForge + +For instructions on yum priorities, visit this page: +http://wiki.centos.org/PackageManagement/Yum/Priorities + +Once your repos are in order, install the following: ```bash sudo yum install automake bzip2-devel ffmpeg ffmpeg-devel gnutls-devel httpd libjpeg-turbo libjpeg-turbo-devel mysql-devel mysql-server pcre-devel \ perl-Archive-Tar perl-Archive-Zip perl-Convert-BinHex perl-Date-Manip perl-DBD-MySQL perl-DBI perl-Device-SerialPort perl-Email-Date-Format perl-IO-stringy \ perl-IO-Zlib perl-MailTools perl-MIME-Lite perl-MIME-tools perl-MIME-Types perl-Module-Load perl-Package-Constants perl-Sys-Mmap perl-Time-HiRes \ -perl-TimeDate perl-YAML-Syck php php-cli php-mysql subversion x264 +perl-TimeDate perl-YAML-Syck php php-cli php-mysql subversion x264 vlc-devel vlc-core libcurl libcurl-devel ``` ### ffmpeg diff --git a/configure.ac b/configure.ac index 769991c5a..22276d7df 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.59) -AC_INIT(zm,1.26.5,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html) +AC_INIT(zm,1.27,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR(src/zm.h) AC_CONFIG_HEADERS(config.h) diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index c2906eeaf..c9f9e87f1 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -528,9 +528,9 @@ CREATE TABLE `Zones` ( insert into Users VALUES (NULL,'admin',password('admin'),'',1,'View','Edit','Edit','Edit','Edit','Edit','',''); -- --- Add a sample filter to purge the oldest 5 events when the disk is 95% full, delete is disabled though +-- Add a sample filter to purge the oldest 100 events when the disk is 95% full -- -insert into Filters values ('PurgeWhenFull','{"sort_field":"Id","terms":[{"val":0,"attr":"Archived","op":"="},{"cnj":"and","val":95,"attr":"DiskPercent","op":">="}],"limit":5,"sort_asc":1}',0,0,0,0,0,0,'',1,0); +insert into Filters values ('PurgeWhenFull','{"sort_field":"Id","terms":[{"val":0,"attr":"Archived","op":"="},{"cnj":"and","val":95,"attr":"DiskPercent","op":">="}],"limit":100,"sort_asc":1}',0,0,0,0,0,0,'',1,1); -- -- Add in some sample control protocol definitions diff --git a/distros/fedora/zoneminder.cmake.f19.spec b/distros/fedora/zoneminder.cmake.f19.spec index b6b737299..8609baa35 100644 --- a/distros/fedora/zoneminder.cmake.f19.spec +++ b/distros/fedora/zoneminder.cmake.f19.spec @@ -3,6 +3,8 @@ %define zmuid_final apache %define zmgid_final apache +%global _hardened_build 1 + ### Delete the lines below to build with ffmpeg and/or x10 %define _without_ffmpeg 1 %define _without_x10 1 @@ -34,6 +36,9 @@ BuildRequires: perl(Expect) perl(Sys::Syslog) BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel %{!?_without_ffmpeg:BuildRequires: ffmpeg-devel} %{!?_without_x10:BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)} +# cmake needs the following installed at build time due to the way it auto-detects certain parameters +BuildRequires: httpd +%{!?_without_ffmpeg:BuildRequires: ffmpeg} Requires: httpd php php-mysql cambozola Requires: libjpeg-turbo vlc-core libcurl @@ -168,6 +173,9 @@ fi %changelog +* Fri Mar 14 2014 Andrew Bauer - 1.27 +- Tweak build requirements for cmake + * Sat Feb 01 2014 Andrew Bauer - 1.27 - Add zmcamtool.pl. Bump version for 1.27 release. diff --git a/distros/fedora/zoneminder.f19.spec b/distros/fedora/zoneminder.f19.spec index 3cd8afac2..f383b5c0e 100644 --- a/distros/fedora/zoneminder.f19.spec +++ b/distros/fedora/zoneminder.f19.spec @@ -7,6 +7,8 @@ %define zmuid_final apache %define zmgid_final apache +%global _hardened_build 1 + ### Delete the lines below to build with ffmpeg and/or x10 %define _without_ffmpeg 1 %define _without_x10 1 diff --git a/distros/redhat/local_zoneminder.te b/distros/redhat/local_zoneminder.te index d164af1c5..4a060ffc3 100644 --- a/distros/redhat/local_zoneminder.te +++ b/distros/redhat/local_zoneminder.te @@ -1,7 +1,33 @@ -module local_zoneminder 1.0; +module local_zoneminder 1.1; require { + type afs_ka_port_t; + type netsupport_port_t; + type port_t; + type presence_port_t; + type postfix_pickup_t; + type httpd_t; + type var_lib_t; + type ionixnetmon_port_t; + type glance_port_t; + type mmcc_port_t; + type postfix_master_t; + type commplex_port_t; + type syslogd_port_t; + type dcc_port_t; + type sip_port_t; + type amqp_port_t; + type condor_port_t; + type afs_fs_port_t; + type nodejs_debug_port_t; + type httpd_var_lib_t; + type websm_port_t; + type afs_pt_port_t; + type postfix_qmgr_t; + type git_port_t; + type ipp_port_t; + type aol_port_t; type unconfined_t; type kernel_t; type init_t; @@ -24,10 +50,11 @@ require { type dhcpc_t; type v4l_device_t; type file_t; - class sock_file write; + class sock_file { write create unlink }; class unix_stream_socket { read connectto }; - class lnk_file { write getattr read lock unlink }; + class lnk_file { write create getattr read lock unlink }; class dir search; + class udp_socket name_bind; class file { write getattr read lock unlink open }; class shm { unix_read unix_write associate read write getattr }; class chr_file getattr; @@ -70,3 +97,27 @@ allow httpd_t unconfined_t:dir search; allow httpd_t unconfined_t:file { read getattr open }; allow httpd_t var_lib_t:lnk_file { write getattr read lock unlink }; allow httpd_t v4l_device_t:chr_file getattr; +allow httpd_t afs_fs_port_t:udp_socket name_bind; +allow httpd_t afs_ka_port_t:udp_socket name_bind; +allow httpd_t afs_pt_port_t:udp_socket name_bind; +allow httpd_t amqp_port_t:udp_socket name_bind; +allow httpd_t aol_port_t:udp_socket name_bind; +allow httpd_t commplex_port_t:udp_socket name_bind; +allow httpd_t condor_port_t:udp_socket name_bind; +allow httpd_t dcc_port_t:udp_socket name_bind; +allow httpd_t git_port_t:udp_socket name_bind; +allow httpd_t glance_port_t:udp_socket name_bind; +allow httpd_t httpd_var_lib_t:lnk_file create; +allow httpd_t ionixnetmon_port_t:udp_socket name_bind; +allow httpd_t ipp_port_t:udp_socket name_bind; +allow httpd_t mmcc_port_t:udp_socket name_bind; +allow httpd_t netsupport_port_t:udp_socket name_bind; +allow httpd_t nodejs_debug_port_t:udp_socket name_bind; +allow httpd_t port_t:udp_socket name_bind; +allow httpd_t postfix_master_t:dir search; +allow httpd_t postfix_master_t:file { read getattr open }; +allow httpd_t postfix_pickup_t:dir search; +allow httpd_t postfix_pickup_t:file { read getattr open }; +allow httpd_t postfix_qmgr_t:dir search; +allow httpd_t postfix_qmgr_t:file { read getattr open }; +allow httpd_t presence_port_t:udp_socket name_bind; diff --git a/distros/redhat/zoneminder.cmake.el6.spec b/distros/redhat/zoneminder.cmake.el6.spec index f2742e1e9..c877c0081 100644 --- a/distros/redhat/zoneminder.cmake.el6.spec +++ b/distros/redhat/zoneminder.cmake.el6.spec @@ -28,13 +28,15 @@ BuildRequires: perl(MIME::Entity) perl(MIME::Lite) BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap) BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign) BuildRequires: perl(Expect) perl(X10::ActiveHome) perl(Astro::SunTime) -BuildRequires: libcurl-devel vlc-devel ffmpeg-devel >= 0.4.9 +BuildRequires: libcurl-devel vlc-devel ffmpeg-devel +# cmake needs the following installed at build time due to the way it auto-detects certain parameters +BuildRequires: httpd ffmpeg Requires: httpd php php-mysql mysql-server libjpeg-turbo Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Requires: perl(DBD::mysql) perl(Archive::Tar) perl(Archive::Zip) Requires: perl(MIME::Entity) perl(MIME::Lite) perl(Net::SMTP) perl(Net::FTP) -Requires: libcurl vlc-core ffmpeg >= 0.4.9 +Requires: libcurl vlc-core ffmpeg Requires(post): /sbin/chkconfig Requires(post): /usr/bin/checkmodule @@ -158,6 +160,9 @@ rm -rf %{_docdir}/%{name}-%{version} %changelog +* Fri Mar 14 2014 Andrew Bauer - 1.27 +- Tweak build requirements for cmake + * Sat Feb 01 2014 Andrew Bauer - 1.27 - Add zmcamtool.pl. Bump version for 1.27 release. diff --git a/utils/bump-version.pl b/utils/bump-version.pl new file mode 100755 index 000000000..a8ae1d8e6 --- /dev/null +++ b/utils/bump-version.pl @@ -0,0 +1,39 @@ +#!/usr/bin/env perl + +# This script will bump the version number in any files listed in the below +# @files array. It can only bump versions up, and does so by use of sed. + +use strict; +use warnings; +use Getopt::Long; + +my @files = ( + "../version", + "../configure.ac", + "../CMakeLists.txt" +); + + +my ($new, $current); + +open my $file, "../version" or die $!; +chomp($current = <$file>); +close $file; + +sub usage { + print "Usage: bump-version.sh -n \n"; + exit 1; +} + +sub bump_version { + foreach my $file (@files) { + system("sed -i \"s/$current/$new/g\" $file"); + } +} + + +GetOptions ("n=s" => \$new) or usage; +usage if ! $new; +die("New version ($new) is not greater than old version ($current)!") if ( $new le $current); + +bump_version; diff --git a/version b/version index 8fe00a57f..b0c101e63 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.26.5 +1.27 diff --git a/web/skins/classic/skin.php b/web/skins/classic/skin.php index 9e0aea10f..c6af0dd59 100644 --- a/web/skins/classic/skin.php +++ b/web/skins/classic/skin.php @@ -36,18 +36,11 @@ foreach ( getSkinIncludes( 'includes/functions.php' ) as $includeFile ) if ( empty($view) ) $view = isset($user)?'console':'login'; -if ( !isset($user) && ZM_OPT_USE_AUTH ) +if ( !isset($user) && ZM_OPT_USE_AUTH && ZM_AUTH_TYPE == "remote" && !empty( $_SERVER['REMOTE_USER']) ) { - if ( ZM_AUTH_TYPE == "remote" && !empty( $_SERVER['REMOTE_USER'] ) ) - { - $view = "postlogin"; - $action = "login"; - $_REQUEST['username'] = $_SERVER['REMOTE_USER']; - } - else - { - $view = "login"; - } + $view = "postlogin"; + $action = "login"; + $_REQUEST['username'] = $_SERVER['REMOTE_USER']; } if ( isset($user) ) diff --git a/web/skins/classic/views/js/monitor.js.php b/web/skins/classic/views/js/monitor.js.php index e111b5e32..4bc797fc7 100644 --- a/web/skins/classic/views/js/monitor.js.php +++ b/web/skins/classic/views/js/monitor.js.php @@ -9,7 +9,9 @@ var controlOptions = new Object(); $SLANG['None'] ); - $sql = "select * from Controls where Type = '".$newMonitor['Type']."'"; +# Temporary workaround to show all ptz control types regardless of monitor source type +# $sql = "select * from Controls where Type = '".$newMonitor['Type']."'"; + $sql = "select * from Controls"; foreach( dbFetchAll( $sql ) as $row ) { $controlTypes[$row['Id']] = $row['Name']; diff --git a/web/skins/flat/js/skin.js b/web/skins/flat/js/skin.js index 911211204..a1f89bc06 100644 --- a/web/skins/flat/js/skin.js +++ b/web/skins/flat/js/skin.js @@ -24,7 +24,7 @@ // Javascript window sizes var popupSizes = { - 'bandwidth': { 'width': 200, 'height': 120 }, + 'bandwidth': { 'width': 260, 'height': 130 }, 'console': { 'width': 750, 'height': 312 }, 'control': { 'width': 380, 'height': 480 }, 'controlcaps': { 'width': 780, 'height': 320 }, @@ -43,25 +43,25 @@ var popupSizes = { 'frames': { 'width': 500, 'height': 300 }, 'function': { 'width': 248, 'height': 92 }, 'group': { 'width': 360, 'height': 180 }, - 'groups': { 'width': 400, 'height': 220 }, + 'groups': { 'width': 460, 'height': 220 }, 'image': { 'addWidth': 48, 'addHeight': 80 }, 'log': { 'width': 980, 'height': 720 }, 'login': { 'width': 720, 'height': 480 }, 'logout': { 'width': 240, 'height': 100 }, - 'monitor': { 'width': 380, 'height': 364 }, + 'monitor': { 'width': 480, 'height': 364 }, 'monitorpreset':{ 'width': 400, 'height': 200 }, 'monitorprobe': { 'width': 500, 'height': 240 }, 'monitorselect':{ 'width': 160, 'height': 200 }, 'montage': { 'width': -1, 'height': -1 }, 'optionhelp': { 'width': 400, 'height': 320 }, - 'options': { 'width': 960, 'height': 620 }, + 'options': { 'width': 1300, 'height': 620 }, 'preset': { 'width': 300, 'height': 120 }, 'settings': { 'width': 200, 'height': 225 }, - 'state': { 'width': 240, 'height': 124 }, + 'state': { 'width': 400, 'height': 154 }, 'stats': { 'width': 740, 'height': 200 }, 'timeline': { 'width': 760, 'height': 540 }, 'user': { 'width': 320, 'height': 420 }, - 'version': { 'width': 360, 'height': 140 }, + 'version': { 'width': 440, 'height': 160 }, 'video': { 'width': 420, 'height': 360 }, 'videoview': { 'addWidth': 48, 'addHeight': 80 }, 'watch': { 'addWidth': 96, 'minWidth': 420, 'addHeight': 384 }, diff --git a/web/skins/flat/skin.php b/web/skins/flat/skin.php index 9e0aea10f..31d72a79b 100644 --- a/web/skins/flat/skin.php +++ b/web/skins/flat/skin.php @@ -36,20 +36,14 @@ foreach ( getSkinIncludes( 'includes/functions.php' ) as $includeFile ) if ( empty($view) ) $view = isset($user)?'console':'login'; -if ( !isset($user) && ZM_OPT_USE_AUTH ) +if ( !isset($user) && ZM_OPT_USE_AUTH && ZM_AUTH_TYPE == "remote" && !empty( $_SERVER['REMOTE_USER']) ) { - if ( ZM_AUTH_TYPE == "remote" && !empty( $_SERVER['REMOTE_USER'] ) ) - { - $view = "postlogin"; - $action = "login"; - $_REQUEST['username'] = $_SERVER['REMOTE_USER']; - } - else - { - $view = "login"; - } + $view = "postlogin"; + $action = "login"; + $_REQUEST['username'] = $_SERVER['REMOTE_USER']; } + if ( isset($user) ) { // Bandwidth Limiter diff --git a/web/skins/flat/views/js/monitor.js.php b/web/skins/flat/views/js/monitor.js.php index e111b5e32..4bc797fc7 100644 --- a/web/skins/flat/views/js/monitor.js.php +++ b/web/skins/flat/views/js/monitor.js.php @@ -9,7 +9,9 @@ var controlOptions = new Object(); $SLANG['None'] ); - $sql = "select * from Controls where Type = '".$newMonitor['Type']."'"; +# Temporary workaround to show all ptz control types regardless of monitor source type +# $sql = "select * from Controls where Type = '".$newMonitor['Type']."'"; + $sql = "select * from Controls"; foreach( dbFetchAll( $sql ) as $row ) { $controlTypes[$row['Id']] = $row['Name']; diff --git a/web/skins/mobile/skin.php b/web/skins/mobile/skin.php index 0b7f59747..51ea63e01 100644 --- a/web/skins/mobile/skin.php +++ b/web/skins/mobile/skin.php @@ -83,18 +83,11 @@ foreach ( getSkinIncludes( 'includes/functions.php' ) as $includeFile ) if ( empty($view) ) $view = isset($user)?'console':'login'; -if ( !isset($user) && ZM_OPT_USE_AUTH ) +if ( !isset($user) && ZM_OPT_USE_AUTH && ZM_AUTH_TYPE == "remote" && !empty( $_SERVER['REMOTE_USER']) ) { - if ( ZM_AUTH_TYPE == "remote" && !empty( $_SERVER['REMOTE_USER'] ) ) - { - $view = "postlogin"; - $action = "login"; - $_REQUEST['username'] = $_SERVER['REMOTE_USER']; - } - else - { - $view = "login"; - } + $view = "postlogin"; + $action = "login"; + $_REQUEST['username'] = $_SERVER['REMOTE_USER']; } // If there are additional actions