system/ZoneMinder: Update script.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Daniel Prosser 2019-02-02 13:06:00 +07:00 committed by Willy Sudiarto Raharjo
parent 76efbc5d12
commit 4567789290
5 changed files with 62 additions and 7 deletions

View file

@ -7,9 +7,10 @@ be controlled via web or semi-automatically using a variety of
protocols. It can also be integrated into a home automation system
via X.10 or other protocols. This build includes cambozola and jscalendar.
Optional dependencies are perl-Archive-Zip (automatic event uploading),
perl-X10 (integration with X10-based home automation), perl-Device-SerialPort
(RS232/RS485 PTZ camera control), perl-MIME-Lite, and perl-MIME-Entity
(automatic event mail notification).
Optional dependencies are php-apcu (to enable the ZoneMinder API),
perl-Archive-Zip (automatic event uploading), perl-X10 (integration with
X10-based home automation), perl-Device-SerialPort (RS232/RS485 PTZ camera
control), perl-MIME-Lite, and perl-MIME-Entity (automatic event mail
notification).
See README.SLACKWARE for configuration information.

View file

@ -34,6 +34,7 @@ DOCGRP=${DOCGRP:-apache}
DOCROOT=${DOCROOT:-"/srv/httpd/htdocs/zm"}
CGIROOT=${CGIROOT:-"/srv/httpd/cgi-bin"}
CACHEDIR=${CACHEDIR:-"/var/cache/ZoneMinder"}
CONTENTDIR=${CONTENTDIR:-"/var/lib/ZoneMinder"}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@ -80,6 +81,12 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# Fails to encode mp4 videos without this patch
patch -p0 < $CWD/fix_video_file_format.patch
# Applies upstream commits 4937a686 and 4da95369
patch -p0 < $CWD/fix_zone_area_calc.patch
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS -D__STDC_CONSTANT_MACROS" \
cd $TMP/$PRGNAM-$VERSION
@ -90,7 +97,8 @@ cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DZM_WEBDIR=$DOCROOT \
-DZM_CGIDIR=$CGIROOT \
-DZM_WEB_USER=$DOCOWN \
-DZM_WEB_GROUP=$DOCGRP .
-DZM_WEB_GROUP=$DOCGRP \
-DZM_CONTENTDIR=$CONTENTDIR .
make
make install DESTDIR=$PKG INSTALLDIRS=vendor INSTALLVENDORMAN3DIR=/usr/man/man3
@ -128,7 +136,7 @@ mkdir -p $PKG$CACHEDIR
install -d -o $DOCOWN -g $DOCGRP $PKG$CACHEDIR
for DIR in events images sound; do
install -d -o $DOCOWN -g $DOCGRP $PKG/var/lib/ZoneMinder/$DIR
install -d -o $DOCOWN -g $DOCGRP $PKG/$CONTENTDIR/$DIR
done
# Install logrotate script

View file

@ -9,6 +9,6 @@ MD5SUM="fc986fcb7601d3fe463a2970ead67cf7 \
10f2160fe68294013efcd1473cd36f72"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="perl-Sys-MemInfo perl-Date-Manip perl-Sys-Mmap perl-LWP-Protocol-https SDL2 perl-JSON-MaybeXS perl-Number-Bites-Human perl-TimeDate perl-Sys-CPU ffmpeg"
REQUIRES="perl-Sys-MemInfo perl-Date-Manip perl-Sys-Mmap perl-LWP-Protocol-https SDL2 perl-JSON-MaybeXS perl-Number-Bites-Human perl-TimeDate perl-Sys-CPU ffmpeg libmp4v2 x264"
MAINTAINER="Geno Bob"
EMAIL="GenoBob@gmail.com"

View file

@ -0,0 +1,11 @@
--- src/zm_event.cpp 2019-01-21 23:17:19.881961455 -0500
+++ src/zm_event.cpp.new 2019-01-21 23:17:38.452315254 -0500
@@ -196,7 +196,7 @@
if ( monitor->GetOptVideoWriter() != 0 ) {
snprintf(video_name, sizeof(video_name), "%" PRIu64 "-%s", id, "video.mp4");
- snprintf(video_file, sizeof(video_file), staticConfig.video_file_format, path, video_name);
+ snprintf(video_file, sizeof(video_file), "%s/%s", path, video_name);
Debug(1,"Writing video file to %s", video_file );
/* X264 MP4 video writer */

View file

@ -0,0 +1,35 @@
--- web/skins/classic/views/js/zone.js 2019-01-23 00:24:26.094085919 -0500
+++ web/skins/classic/views/js/zone.js.new 2019-01-23 00:25:13.871710907 -0500
@@ -347,6 +347,7 @@
zone['Points'][index].x = x;
var Point = $('zonePoly').points.getItem(index);
Point.x = x;
+ updateArea();
}
function updateY( index ) {
@@ -359,6 +360,7 @@
zone['Points'][index].y = y;
var Point = $('zonePoly').points.getItem(index);
Point.y = y;
+ updateArea();
}
function saveChanges( element ) {
@@ -697,11 +699,12 @@
var n_coords = coords.length;
var float_area = 0.0;
- for ( i = 0, j = n_coords-1; i < n_coords; j = i++ ) {
- var trap_area = ( ( coords[i].x - coords[j].x ) * ( coords[i].y + coords[j].y ) ) / 2;
- float_area += trap_area;
- //printf( "%.2f (%.2f)\n", float_area, trap_area );
+ for ( i = 0; i < n_coords-1; i++ ) {
+ var trap_area = (coords[i].x*coords[i+1].y - coords[i+1].x*coords[i].y) / 2;
+ float_area += trap_area;
}
+ float_area += (coords[n_coords-1].x*coords[0].y - coords[0].x*coords[n_coords-1].y) / 2;
+
return Math.round( Math.abs( float_area ) );
}