Merge branch 'master' into multi-server

Conflicts:
	distros/ubuntu1504/changelog
This commit is contained in:
Isaac Connor 2015-07-16 16:37:44 -04:00
commit 5a363273a2
28 changed files with 162 additions and 70 deletions

View File

@ -7,7 +7,7 @@ Standards-Version: 3.9.4
Package: zoneminder
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53 | libavdevice55, libjpeg8|libjpeg9|libjpeg62-turbo, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53 | libavdevice55, libjpeg8|libjpeg9|libjpeg62-turbo, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl, php5-gd
Recommends: mysql-server|mariadb-server
Description: Video camera security and surveillance solution
ZoneMinder is intended for use in single or multi-camera video security

View File

@ -86,7 +86,7 @@ Section: web
Architecture: any
Depends: zoneminder-core (= ${binary:Version}), ${shlibs:Depends},
${misc:Depends}, debconf, apache2, libapache2-mod-php5 | libapache2-mod-fcgid,
php5, php5-mysql | php5-mysqlnd
php5, php5-mysql | php5-mysqlnd, php5-gd
Description: Essential files for ZoneMinder's web user interface
ZoneMinder is a video camera security and surveillance solution.
.

View File

@ -7,7 +7,7 @@ Standards-Version: 3.9.4
Package: zoneminder
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2 | httpd, libapache2-mod-php5 | libapache2-mod-fcgid | php5-fpm, php5-mysqlnd | php5-mysql, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client | mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53, libjpeg8, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2 | httpd, libapache2-mod-php5 | libapache2-mod-fcgid | php5-fpm, php5-mysqlnd | php5-mysql, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client | mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53, libjpeg8, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, php5-gd
Recommends: mysql-server | mariadb-server
Description: Video camera security and surveillance solution
ZoneMinder is intended for use in single or multi-camera video security

View File

@ -38,7 +38,7 @@ BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel libv4l-devel
BuildRequires: httpd polkit-devel
%{!?_without_ffmpeg:BuildRequires: ffmpeg}
Requires: httpd php php-mysql cambozola polkit net-tools psmisc
Requires: httpd php php-gd php-mysql cambozola polkit net-tools psmisc
Requires: libjpeg-turbo vlc-core libcurl
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: perl(DBD::mysql) perl(Archive::Tar) perl(Archive::Zip)

View File

@ -38,7 +38,7 @@ BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel libv4l-devel
BuildRequires: httpd polkit-devel
%{!?_without_ffmpeg:BuildRequires: ffmpeg}
Requires: httpd php php-mysql cambozola polkit net-tools psmisc
Requires: httpd php php-gd php-mysql cambozola polkit net-tools psmisc
Requires: libjpeg-turbo vlc-core libcurl
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: perl(DBD::mysql) perl(Archive::Tar) perl(Archive::Zip)

View File

@ -30,7 +30,7 @@ BuildRequires: libcurl-devel vlc-devel ffmpeg-devel polkit-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 polkit net-tools psmisc
Requires: httpd php php-gd php-mysql mysql-server libjpeg-turbo polkit net-tools psmisc
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)

View File

@ -32,7 +32,7 @@ BuildRequires: ffmpeg ffmpeg-devel 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 polkit-devel
Requires: httpd php php-mysql mariadb-server polkit net-tools psmisc
Requires: httpd php php-gd php-mysql mariadb-server polkit net-tools psmisc
Requires: libjpeg-turbo vlc-core libcurl
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: perl(DBD::mysql) perl(Archive::Tar) perl(Archive::Zip)

View File

@ -1,3 +1,11 @@
zoneminder (1.28.1+1-trusty-SNAPSHOT2015071501) trusty; urgency=medium
* fix for issue #586 and #932
* fix for db not being upgraded
* version upgraded to .100
-- Isaac Connor <iconnor@connortechnology.com> Wed, 15 Jul 2015 11:56:28 -0400
zoneminder (1.28.1+1-trusty-SNAPSHOT2015030201) trusty; urgency=medium
* maybe fix for RTSP Basic Auth

View File

@ -7,7 +7,7 @@ Standards-Version: 3.9.4
Package: zoneminder
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client|mysql-client-5.6, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, libavdevice53 | libavdevice55, libjpeg8|libjpeg9|libjpeg62-turbo, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client|mysql-client-5.6, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, libavdevice53 | libavdevice55, libjpeg8|libjpeg9|libjpeg62-turbo, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl, php5-gd
Recommends: mysql-server|mariadb-server
Description: Video camera security and surveillance solution
ZoneMinder is intended for use in single or multi-camera video security

View File

@ -1,3 +1,11 @@
zoneminder (1.28.1+1-vivid-SNAPSHOT2015071501) vivid; urgency=medium
* fix for issue #586 and #932
* fix for db not being upgraded
* version upgraded to .100
-- Isaac Connor <iconnor@connortechnology.com> Wed, 15 Jul 2015 11:56:28 -0400
zoneminder (1.28.1+1-vivid-SNAPSHOT2015070402) vivid; urgency=medium
* Correct PRIMARY KEY update code on States table

View File

@ -7,7 +7,7 @@ Standards-Version: 3.9.4
Package: zoneminder
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client|mysql-client-5.6, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, libavdevice-ffmpeg56, libjpeg8|libjpeg9|libjpeg62-turbo, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client|mysql-client-5.6, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, libavdevice-ffmpeg56, libjpeg8|libjpeg9|libjpeg62-turbo, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl, php5-gd
Recommends: mysql-server|mariadb-server
Description: Video camera security and surveillance solution
ZoneMinder is intended for use in single or multi-camera video security

View File

@ -86,7 +86,7 @@ Section: web
Architecture: any
Depends: zoneminder-core (= ${binary:Version}), ${shlibs:Depends},
${misc:Depends}, debconf, apache2, libapache2-mod-php5 | libapache2-mod-fcgid,
php5, php5-mysql | php5-mysqlnd
php5, php5-mysql | php5-mysqlnd, php5-gd
Description: Essential files for ZoneMinder's web user interface
ZoneMinder is a video camera security and surveillance solution.
.

View File

@ -2,4 +2,4 @@ etc/zm
usr/bin
usr/share/polkit-1/actions
usr/share/polkit-1/rules.d
usr/share/man
usr/share/man/man8

View File

@ -1,15 +0,0 @@
# Automatically added by dh_installinit
# In case this system is running systemd, we need to ensure that all
# necessary tmpfiles (if any) are created before starting.
if [ -d /run/systemd/system ] ; then
systemd-tmpfiles --create /usr/lib/tmpfiles.d/zoneminder.conf >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installinit
if [ -x "/etc/init.d/zoneminder" ]; then
update-rc.d zoneminder defaults >/dev/null
fi
if [ -x "/etc/init.d/zoneminder" ] || [ -e "/etc/init/zoneminder.conf" ]; then
invoke-rc.d zoneminder start || exit $?
fi
# End automatically added section

View File

@ -1,18 +0,0 @@
# Automatically added by dh_installinit
if [ "$1" = "purge" ] ; then
update-rc.d zoneminder remove >/dev/null
fi
# In case this system is running systemd, we make systemd reload the unit files
# to pick up changes.
if [ -d /run/systemd/system ] ; then
systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installdebconf
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
db_purge
fi
# End automatically added section

View File

@ -1,5 +0,0 @@
# Automatically added by dh_installinit
if [ -x "/etc/init.d/zoneminder" ] || [ -e "/etc/init/zoneminder.conf" ]; then
invoke-rc.d zoneminder stop || exit $?
fi
# End automatically added section

View File

@ -1,6 +0,0 @@
# Automatically added by dh_installdebconf
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
db_purge
fi
# End automatically added section

View File

@ -1,6 +0,0 @@
# Automatically added by dh_installdebconf
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
db_purge
fi
# End automatically added section

View File

@ -107,7 +107,14 @@ sub sendCmd
printMsg( $cmd, "Tx" );
my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."$cmd" );
my $url;
if ( $self->{Monitor}->{ControlAddress} =~ /^http/ ) {
$url = $self->{Monitor}->{ControlAddress}.$cmd;
} else {
$url = 'http://'.$self->{Monitor}->{ControlAddress}.$cmd;
} # en dif
my $req = HTTP::Request->new( GET=>$url );
my $res = $self->{ua}->request($req);
if ( $res->is_success )

View File

@ -58,6 +58,12 @@ sub open
{
my $self = shift;
my $device = new Device::SerialPort( $self->{path} );
if ( ! $device )
{
Error( "Unable to open $$self{path}: $!" );
$self->{state} = 'closed';
return;
}
$device->baudrate(9600);
$device->databits(8);
$device->parity('none');

View File

@ -156,7 +156,7 @@ if ( !$server_up )
while (!connect( CLIENT, $saddr ))
{
$attempts++;
Fatal( "Can't connect: $!" ) if ($attempts > MAX_CONNECT_DELAY);
Fatal( "Can't connect: $! after $attempts attempts to $sock_file" ) if ($attempts > MAX_CONNECT_DELAY);
sleep(1);
}
}

View File

@ -558,9 +558,9 @@ sub kill_until_dead {
sub _stop {
my ($final, $process ) = @_;
delete( $cmd_hash{$$process{command}} );
my $pid = send_stop( $final, $process );
return if ! $pid;
delete( $cmd_hash{$$process{command}} );
kill_until_dead( $process );
}

View File

@ -28,7 +28,82 @@ zmtrigger.pl - ZoneMinder External Trigger Script
=head1 DESCRIPTION
This script is used to trigger and cancel alarms from external connections
using an arbitrary text based format
using an arbitrary text based format.
This script offers generic solution to external triggering of alarms. It
can handle external connections via either internet socket, unix socket or
file/device interfaces. You can either use it 'as is' if you can interface
with the existing format, or override connections and channels to customise
it to your needs.
If enabled by the OPT_TRIGGERS option, Zoneminder service start
zmtrigger.pl which listens for control messages on TCP port 6802.
=head1 TRIGGER MESSAGE FORMAT
B<id>|B<action>|B<score>|B<cause>|B<text>|B<showtext>
=over 4
=item B<id>
is the id number or name of the ZM monitor.
=item B<action>
Valid actions are 'on', 'off', 'cancel' or 'show' where
'on' forces an alarm condition on;
'off' forces an alarm condition off;
'cancel' negates the previous 'on' or 'off'.
The 'show' action merely updates some auxiliary text which can optionally
be displayed in the images captured by the monitor. Ordinarily you would
use 'on' and 'cancel', 'off' would tend to be used to suppress motion
based events. Additionally 'on' and 'off' can take an additional time
offset, e.g. on+20 which automatically 'cancel's the previous action
after that number of seconds.
=item B<score>
is the score given to the alarm, usually to indicate it's
importance. For 'on' triggers it should be non-zero, otherwise it should
be zero.
=item B<cause>
is a 32 char max string indicating the reason for, or source of
the alarm e.g. 'Relay 1 open'. This is saved in the 'Cause' field of the
event. Ignored for 'off' or 'cancel' messages.
=item B<text>
is a 256 char max additional info field, which is saved in the
'Description' field of an event. Ignored for 'off' or 'cancel' messages.
=item B<showtext>
is up to 32 characters of text that can be displayed in the
timestamp that is added to images. The 'show' action is designed to
update this text without affecting alarms but the text is updated, if
present, for any of the actions. This is designed to allow external input
to appear on the images captured, for instance temperature or personnel
identity etc.
=back
Note that multiple messages can be sent at once and should be LF or CRLF
delimited. This script is not necessarily intended to be a solution in
itself, but is intended to be used as 'glue' to help ZoneMinder interface
with other systems. It will almost certainly require some customisation
before you can make any use of it. If all you want to do is generate alarms
from external sources then using the ZoneMinder::SharedMem perl module is
likely to be easier.
=head1 EXAMPLES
3|on+10|1|motion|text|showtext
Triggers "alarm" on camera #3 for 10 seconds with score=1, cause="motion".
=cut
use strict;
@ -447,7 +522,7 @@ sub handleMessage
Debug( "Added timed event '$action_text', expires at $action_time (+$delay secs)\n" );
}
}
elsif ( $action =~ /^(on|off)(?:\+(\d+))?$/ )
elsif ( $action =~ /^(on|off)(?:[ \+](\d+))?$/ )
{
next if ( !$monitor->{Enabled} );

View File

@ -75,3 +75,38 @@ void zmDbClose()
zmDbConnected = false;
}
}
MYSQL_RES * zmDbFetch( const char * query ) {
if ( ! zmDbConnected ) {
Error( "Not connected." );
return NULL;
}
if ( mysql_query( &dbconn, query ) ) {
Error( "Can't run query: %s", mysql_error( &dbconn ) );
return NULL;
}
Debug( 4, "Success running query: %s", query );
MYSQL_RES *result = mysql_store_result( &dbconn );
if ( !result ) {
Error( "Can't use query result: %s for query %s", mysql_error( &dbconn ), query );
return NULL;
}
return result;
} // end MYSQL_RES * zmDbFetch( const char * query );
MYSQL_ROW zmDBFetchOne( const char *query ) {
MYSQL_RES *result = zmDbFetch( query );
int n_rows = mysql_num_rows( result );
if ( n_rows != 1 ) {
Error( "Bogus number of lines return from query, %d returned for query %s.", n_rows, query );
return NULL;
}
MYSQL_ROW dbrow = mysql_fetch_row( result );
if ( ! dbrow ) {
Error("Error getting row from query %s. Error is %s", query, mysql_error( &dbconn ) );
return NULL;
}
return dbrow;
}

View File

@ -32,6 +32,9 @@ extern int zmDbConnected;
void zmDbConnect();
void zmDbClose();
MYSQL_RES * zmDbFetch( const char *query );
MYSQL_ROW zmDBFetchOne( const char *query );
#ifdef __cplusplus
} /* extern "C" */
#endif

View File

@ -2596,8 +2596,8 @@ void Image::Scale( unsigned int factor )
return;
}
unsigned int new_width = (width*factor)/ZM_SCALE_BASE;
unsigned int new_height = (height*factor)/ZM_SCALE_BASE;
unsigned int new_width = (width*factor)/ZM_SCALE_BASE+1;
unsigned int new_height = (height*factor)/ZM_SCALE_BASE+1;
size_t scale_buffer_size = new_width * new_height * colours;

View File

@ -37,7 +37,7 @@ zmf - The ZoneMinder Frame daemon
This is an optional daemon that can run in concert with the Analysis daemon and
whose function it is to actually write captured frames to disk. This frees up
the Analysis daemon to do more analysis (!) and so keep up with the Capture
daemon better. If it isnt running or dies then the Analysis daemon just writes
daemon better. If it isn't running or dies then the Analysis daemon just writes
them itself.
=head1 OPTIONS

View File

@ -33,7 +33,7 @@ zmc - The ZoneMinder Utility
=head1 DESCRIPTION
This binary is a handy command line interface to several useful functions. Its
This binary is a handy command line interface to several useful functions. It's
not really meant to be used by anyone except the web page (there's only limited
'help' in it so far) but can be if necessary, especially for debugging video
problems.