pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

zoneminder: Clean up previous fixes and modernize



Module Name:	pkgsrc-wip
Committed By:	Greg Troxel <gdt%lexort.com@localhost>
Pushed By:	gdt
Date:		Mon Jan 15 09:41:08 2024 -0500
Changeset:	d3bfc9bea89faa52a142ecb432a19f5271338a65

Modified Files:
	zoneminder/COMMIT_MSG
	zoneminder/Makefile
	zoneminder/PLIST
	zoneminder/distinfo
Removed Files:
	zoneminder/patches/patch-src_zm__rtp__ctrl.h

Log Message:
zoneminder: Clean up previous fixes and modernize

There were a lot of workarounds for problems in previous versions.
Many of those are no longer needed.  Remove workarounds, some by
inspection, some by build testing.  Leave a few commented if unsure to
reduce future work.

Add workaround from wiz@ to find target perl vs tool perl so that zm's
@PERL@ substitution gets the right answer.

Finish COMMIT_MSG.

Change to ffmpeg6 and add new dep lib.

Prune empty patch that adjusted unspecified array [].  It might end up
being necessary but the number of not upstream patches is too hard to
deal with at the moment.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=d3bfc9bea89faa52a142ecb432a19f5271338a65

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 zoneminder/COMMIT_MSG                        | 100 ++++++++++++++++++++----
 zoneminder/Makefile                          | 113 ++++++++++-----------------
 zoneminder/PLIST                             |  40 +++++-----
 zoneminder/distinfo                          |   1 -
 zoneminder/patches/patch-src_zm__rtp__ctrl.h |   7 --
 5 files changed, 146 insertions(+), 115 deletions(-)

diffs:
diff --git a/zoneminder/COMMIT_MSG b/zoneminder/COMMIT_MSG
index b70208c02a..40543cb6be 100644
--- a/zoneminder/COMMIT_MSG
+++ b/zoneminder/COMMIT_MSG
@@ -1,29 +1,99 @@
 security/zoneminder: Update to 1.36.33
 
+Significant packaging changes:
 
-Packaging changes:
+  + 1.36/1.34:
+    
+    - Switch to ffmpeg6 from ffmpeg2
+    - \todo mysql
+    - gc many workarounds that are no longer necessary
 
-  + 1.36
-
-
-  + 1.32
+  + 1.32:
 
     - Change config to etc/zm from etc, and provide etc/zm/conf.d, because
       migration from 1.30 writes there.
     - Rototill hard the cmake build options, and try to document what
       must be set as path configuration.
-    - Upstream removed zmf; drop patch.
     - Depend on mp4v2.
 
 Upstream NEWS:
 
-  + 1.36:
-
-    \todo
-
-  + 1.34
-
-    \todo
+  Generally, 1.X.0 is a significant release, and 1.X.Y, Y>0, are
+  bugfixes and minor improvements.
+
+  + 1.36 (The Memory Remains):
+
+    Filters
+
+	Moved event email options from global config to per Filter
+	Added user to run filter as, so that users without access to certain monitors can't just use a filter to access them.
+	Filters now have PreSQL and PostSQL conditions. The first Post SQL condition is ExistsInFileSystem. This can be used to cleanup after a crash instead of using zmaudit.
+	warnings on Filter edit page when you create a filter than can delete archived events.
+	Added Auto Unarchive function
+
+    UI Updates
+
+	bootstrap updated to version 3
+	removed mootools
+	events list now uses bootstrap-table to enable a more modern powerful ui
+	scaled thumbnail on mouseover on events list
+	thumbnails with scaling on console
+	frames view updates to include stats information
+	many popups turned into modals
+	monitor edit is now a full view instead of popup
+	Zone edit is now scaled so high res cameras don't take the entire screen or more.
+	Added Estimated RAM use to Buffers tab in Monitors.
+	Monitor edit no longer form submits/reloads between tabs it just hides/unhides tabs using bootstrap nav.
+	Monitors can now have Latitude/Longitude associated and displayed on a map
+
+    General
+
+	New Monitor type VNC for recording desktops
+	better use of scaling when streaming to reduce bandwidth/cpu use
+	dynamic loading of vlc, curl and other libraries that might not be used. Saves ram
+	ONVIF probe can now select a network to scan
+	Sessions now stored in database
+	Event Summary tables reorganized to improve locking performance
+	Clicking on username in header will now list other logged in users if you have SystemView permission.
+	ZoneMinder will now try other Storage Areas if it can't create the event in the assigned area.
+	New Monitor Setting: Decoding Enabled/Disabled
+	/dev/shm mmap use decoupled from image buffering. You should set ImageBufferCount to 3 or larger.
+	mp4v2 deprecated and removed.
+	zma process has been turned into a thread of zmc.
+	Added second ffmpeg input stream for when audio is coming from another source.
+	added RTSP re-streaming
+	hwaccel encoding support for intel vaapi and nvenc
+	Use onmousedown/onmouseup for PTZ start/stop in PTZ controls. Amcrest is the only Protocol that supports it so far.
+
+  + 1.34 (My Friend Of Misery):
+
+    This is largely a fixes & polish release. There are a number of bug fixes and security improvements in here.
+
+    Upgrading from 1.32.3 should be relatively painless although if your Logs table is large it may take some time to update it.
+
+    Security fixes:
+
+	We no longer store passwords using mysql's built-in password encryption.
+	We now support a modern JWT access token system
+	Replaced a lot of inline javascript.
+	There were a number of XSS and SQL injection issues fixed.
+	CVE-2019-13072
+	CVE-2019-6777
+
+    Other changes:
+
+	When adding a new monitor a random colour will be assigned to it instead of red.
+	We now have a handy resolution dropdown to help prevent typos in the width & height fields
+	Support for mysql8
+	Support for php 7.4
+	Can now delete database log entries for the logs popup
+	Timezone setting moved from php.ini to Options -> System
+	ffmpeg hwaccel support for h264 decoding
+	Improved recording to mp4 with audio
+	Added ZM_LOG_FFMPEG options which captures ffmpeg debug messages properly which can really help with debugging.
+	Added ability to use zms to stream mjpeg when the video is stored as h265. Most browsers can't play h265 so this allows you to use passthrough mode with an h265 camera and still watch the video.
+	Filters now have a Copy To action which copies the event files to a second storage area
+	We now display additional event information such as that generated by event server object detection
 
   + 1.32
 
@@ -55,9 +125,7 @@ Upstream NEWS:
 
     - Scalability improvements
 
-    - Support for Redhat el6 distros and clones has been removed
-
-Upstream upgrade notes (tweaked for pkgsrc):
+    Upstream upgrade notes (tweaked for pkgsrc):
 
     - The upgrade scripts will take longer than normal to run,
       especially if you have many events.
diff --git a/zoneminder/Makefile b/zoneminder/Makefile
index ab0f11c0e6..aefc7b31c8 100644
--- a/zoneminder/Makefile
+++ b/zoneminder/Makefile
@@ -127,13 +127,8 @@ SOEXT=	so
 CMAKE_ARGS+=	-D${lib}_INCLUDE_DIR=${BUILDLINK_PREFIX.ffmpeg6}/include/ffmpeg6
 CMAKE_ARGS+=	-D${lib}_LIBRARIES=${BUILDLINK_PREFIX.ffmpeg6}/lib/ffmpeg6/lib${lib:tl}.${SOEXT}
 .endfor
-# This is somewhat awkward.  ffmpeg's libavformat/avformat.h requires
-# constant macros from stdint.h, but these are only defined under C++ if
-# __STDC_CONSTANT_MACROS is requested, so we have to do that on behalf
-# of ffmpeg.  Failure to do so causes configure time failures, and
-# build failures complaining about UINT64_T not being defined.
-CFLAGS+=		-D__STDC_CONSTANT_MACROS
 
+# \todo Revisit this and see if there is a better way.
 # MySQL uses openssl.  Force zoneminder not to choose otherwise by
 # finding libraries that are present but not buildlinked.
 CMAKE_ARGS+=		-DGNUTLS_LIBRARIES=""
@@ -144,26 +139,15 @@ CMAKE_ARGS+=		-DGCRYPT_LIBRARIES=""
 # \todo Convert to cmake.
 # CONFIGURE_ARGS.Darwin+=	ac_cv_func_sendfile=no ac_cv_header_sys_sendfile_h=no
 
-# \todo After finding execinfo.h, cmake looks for and fails to find
-# "backtrace".
-# \todo Explain why we don't just depend on devel/libexecinfo.
-.if ${OPSYS} == "NetBSD" && exists(/usr/include/execinfo.h)
-LIBS+=		-lexecinfo
-.endif
+# \todo Depend on execinfo, because cmake looks for it.
 
 ## PERL
 
 PERL5_REQD+=		5.6.0
 
-# Set ZM_PERL_MM_PARMS in order to inhibit NO_PACKLIST
-#
+# zoneminder's build system will build modules, and there is far more
+# than perl, so tell the perl module code not to take over the build.
 PERL5_CONFIGURE=	no
-PERL5_CONFIGURE_DIRS=	${WRKSRC}/scripts/ZoneMinder
-PERL5_CONFIGURE_DIRS+=	${WRKSRC}/onvif/proxy
-PERL5_CONFIGURE_DIRS+=	${WRKSRC}/onvif/modules
-#PERL5_PACKLIST=		auto/ZoneMinder/.packlist
-#PERL5_PACKLIST+=	auto/ONVIF/.packlist
-#CMAKE_ARGS+=		-DZM_PERL_MM_PARMS="INSTALLDIRS=vendor"
 .include "../../lang/perl5/module.mk"
 
 # ZoneMinder discourages building from source and does not appear to
@@ -192,40 +176,31 @@ DEPENDS+=	p5-XML-Parser-[0-9]*:../../textproc/p5-XML-Parser
 DEPENDS+=	p5-Number-Bytes-Human-[0-9]*:../../textproc/p5-Number-Bytes-Human
 DEPENDS+=	p5-libwww-[0-9]*:../../www/p5-libwww
 
-# All perl scripts need interpreter patching (REPLACE_PERL), while a large
-# subset also need an include PATH line modified (ZM_REPLACE_PERL).
-ZM_REPLACE_PERL+=	scripts/zmaudit.pl.in
-ZM_REPLACE_PERL+=	scripts/zmcamtool.pl.in
-ZM_REPLACE_PERL+=	scripts/zmcontrol.pl.in
-ZM_REPLACE_PERL+=	scripts/zmdc.pl.in
-ZM_REPLACE_PERL+=	scripts/zmfilter.pl.in
-REPLACE_PERL+=		scripts/zmonvif-probe.pl.in
-ZM_REPLACE_PERL+=	scripts/zmpkg.pl.in
-ZM_REPLACE_PERL+=	scripts/zmstats.pl.in
-REPLACE_PERL+=		scripts/zmsystemctl.pl.in
-ZM_REPLACE_PERL+=	scripts/zmtelemetry.pl.in
-ZM_REPLACE_PERL+=	scripts/zmtrack.pl.in
-ZM_REPLACE_PERL+=	scripts/zmtrigger.pl.in
-ZM_REPLACE_PERL+=	scripts/zmupdate.pl.in
-ZM_REPLACE_PERL+=	scripts/zmvideo.pl.in
-ZM_REPLACE_PERL+=	scripts/zmwatch.pl.in
-ZM_REPLACE_PERL+=	scripts/zmx10.pl.in
-REPLACE_PERL+=	${ZM_REPLACE_PERL}
-
-# \todo Still necessary?
-# SUBST_CLASSES+=			systemd-perl
-# SUBST_MESSAGE.systemd-perl=	Adjusting systemd pkexec perl.
-# SUBST_STAGE.systemd-perl=	pre-configure
-# SUBST_FILES.systemd-perl=	scripts/zmsystemctl.pl.in
-# SUBST_SED.systemd-perl=		-e 's|/usr/bin/perl|${PERL5}|g'
+## PERL
+
+# Override perl detection so proper perl path is in installed binaries.
+CMAKE_ARGS+=	-DPERL_EXECUTABLE=${PREFIX}/bin/perl
+
+# A large subset of perl scripts set PATH explicitly and need to patched.
+# See "PATH FIXUPS" below.
+ZM_PERL_PATH=	scripts/zmaudit.pl.in
+ZM_PERL_PATH+=	scripts/zmcamtool.pl.in
+ZM_PERL_PATH+=	scripts/zmcontrol.pl.in
+ZM_PERL_PATH+=	scripts/zmdc.pl.in
+ZM_PERL_PATH+=	scripts/zmfilter.pl.in
+ZM_PERL_PATH+=	scripts/zmpkg.pl.in
+ZM_PERL_PATH+=	scripts/zmstats.pl.in
+ZM_PERL_PATH+=	scripts/zmtelemetry.pl.in
+ZM_PERL_PATH+=	scripts/zmtrack.pl.in
+ZM_PERL_PATH+=	scripts/zmtrigger.pl.in
+ZM_PERL_PATH+=	scripts/zmupdate.pl.in
+ZM_PERL_PATH+=	scripts/zmvideo.pl.in
+ZM_PERL_PATH+=	scripts/zmwatch.pl.in
+ZM_PERL_PATH+=	scripts/zmx10.pl.in
 
 ## PHP
 
-# ZoneMinder 1.32 with PHP 7.4 does not appear to have PHP-related problems.
-# Under PHP 8.0 <1.30 was logging at Error level type errors out of skin.js.
-# Under PHP 8.1 <1.30 was logging at Panic level that strftime is deprecated.
-#
-# Therefore 74 is the standard approach and it is \todo to try higher.
+# \todo Verify 74 and check higher versions.
 PHP_VERSIONS_ACCEPTED=	74
 
 .include "../../lang/php/phpversion.mk"
@@ -261,24 +236,21 @@ DEPENDS+=	${PHP_PKG_PREFIX}-fpm-[0-9]*:../../www/php-fpm
 
 ## PATH FIXUPS
 
-# Patch the db creation script so that default paths installed in the
-# db match how we have configured the package.
-SUBST_CLASSES+=			dbpaths-path
-SUBST_MESSAGE.dbpaths-path=	Adjusting default paths in configuration.
-SUBST_STAGE.dbpaths-path=	pre-configure
-SUBST_FILES.dbpaths-path=	db/zm_create.sql.in
-SUBST_SED.dbpaths-path=		-e 's|/usr/local/bin/|${PREFIX}/bin/|g'
-SUBST_SED.dbpaths-path+=	-e 's|/usr/bin|${PREFIX}/bin|g'
-SUBST_SED.dbpaths-path+=	-e 's|/cgi-bin/nph-zms|/zm/cgi-bin/nph-zms|g'
-
-# In most perl scripts, set the path to include $prefix/bin, rather
-# than looking in /usr/local/bin, so that mysql, sudo, and so on are
-# found.  (Scripts are in ZM_REPLACE_PERL rather than just
-# REPLACE_PERL if they should get this substitution.)
+# \todo Verify that this is truly no longer necessary with 1.36.
+# # Patch the db creation script for the cgi bin path.
+# SUBST_CLASSES+=			dbpaths-path
+# SUBST_MESSAGE.dbpaths-path=	Adjusting default paths in configuration.
+# SUBST_STAGE.dbpaths-path=	pre-configure
+# SUBST_FILES.dbpaths-path=	db/zm_create.sql.in
+# SUBST_SED.dbpaths-path+=	-e 's|/cgi-bin/nph-zms|/zm/cgi-bin/nph-zms|g'
+
+# Remediate idiom in perl scripts to set PATH, by adding ${PREFIX}/bin.
+# \todo Some scripts use zmconf to get a PATH and perhaps a change
+# towards that should be filed upstream.
 SUBST_CLASSES+=			script-path
 SUBST_MESSAGE.script-path=	Adjusting paths in scripts.
 SUBST_STAGE.script-path=	pre-configure
-SUBST_FILES.script-path=	${ZM_REPLACE_PERL}
+SUBST_FILES.script-path=	${ZM_PERL_PATH}
 SUBST_SED.script-path=		-e "s|^\\([\$$]ENV{PATH} *= *'\\).*';\$$|\\1${PREFIX}/bin:/bin:/usr/bin';|g"
 
 # Substitute configured path in pkgsrc-provided apache config.
@@ -287,18 +259,17 @@ SUBST_STAGE.files=	pre-configure
 SUBST_FILES.files=	httpd-zoneminder.conf
 SUBST_SED.files=	-e "s|@ZM_HTTPD_ROOT@|${PREFIX}/${ZM_HTTPD_ROOT}|g"
 SUBST_SED.files+=	-e "s|@ZM_HTTPD_CGIBIN@|${PREFIX}/${ZM_HTTPD_CGIBIN}|g"
-SUBST_MESSAGE.files=	Fixing ZoneMinder configuration file for Apache.
+SUBST_MESSAGE.files=	Setting paths in Apache configuration file.
 
 ## INIT SCRIPTS
 
-# \todo Figure out if this is really for pkgsrc rc.d, and maybe write one for
-# files/
-
+# \todo This script appears Linuxy rather than written for
+# NetBSD/pkgsrc-rcd.  Understand, and then adjust or replace.
 PLIST_VARS+=		rcd
 
 .if ${INIT_SYSTEM} == "rc.d"
 PLIST.rcd=		yes
-# \todo fix
+# \todo Hold installation until validated
 #RCD_SCRIPTS+=		zoneminder
 .endif
 PRINT_PLIST_AWK+=	{ gsub(/^.+\/examples\/rc.d/, "$${PLIST.rcd}&"); }
diff --git a/zoneminder/PLIST b/zoneminder/PLIST
index 09815f2025..38c5103568 100644
--- a/zoneminder/PLIST
+++ b/zoneminder/PLIST
@@ -6174,26 +6174,26 @@ ${PERL5_SUB_INSTALLVENDORMAN3DIR}/ZoneMinder::User.3
 ${PERL5_SUB_INSTALLVENDORMAN3DIR}/ZoneMinder::Zone.3
 ${ZM_HTTPD_CGIBIN}/nph-zms
 ${ZM_HTTPD_CGIBIN}/zms
-man/man8/zmaudit.pl.8.gz
-man/man8/zmc.8.gz
-man/man8/zmcamtool.pl.8.gz
-man/man8/zmcontrol.pl.8.gz
-man/man8/zmdc.pl.8.gz
-man/man8/zmfilter.pl.8.gz
-man/man8/zmonvif-probe.pl.8.gz
-man/man8/zmonvif-trigger.pl.8.gz
-man/man8/zmpkg.pl.8.gz
-man/man8/zmrecover.pl.8.gz
-man/man8/zmstats.pl.8.gz
-man/man8/zmsystemctl.pl.8.gz
-man/man8/zmtelemetry.pl.8.gz
-man/man8/zmtrack.pl.8.gz
-man/man8/zmtrigger.pl.8.gz
-man/man8/zmu.8.gz
-man/man8/zmupdate.pl.8.gz
-man/man8/zmvideo.pl.8.gz
-man/man8/zmwatch.pl.8.gz
-man/man8/zmx10.pl.8.gz
+man/man8/zmaudit.pl.8
+man/man8/zmc.8
+man/man8/zmcamtool.pl.8
+man/man8/zmcontrol.pl.8
+man/man8/zmdc.pl.8
+man/man8/zmfilter.pl.8
+man/man8/zmonvif-probe.pl.8
+man/man8/zmonvif-trigger.pl.8
+man/man8/zmpkg.pl.8
+man/man8/zmrecover.pl.8
+man/man8/zmstats.pl.8
+man/man8/zmsystemctl.pl.8
+man/man8/zmtelemetry.pl.8
+man/man8/zmtrack.pl.8
+man/man8/zmtrigger.pl.8
+man/man8/zmu.8
+man/man8/zmupdate.pl.8
+man/man8/zmvideo.pl.8
+man/man8/zmwatch.pl.8
+man/man8/zmx10.pl.8
 share/applications/zoneminder.desktop
 share/doc/zoneminder/README-pkgsrc.md
 ${PLIST.rcd}share/examples/rc.d/zoneminder
diff --git a/zoneminder/distinfo b/zoneminder/distinfo
index 5e5016bccb..5c89c07b19 100644
--- a/zoneminder/distinfo
+++ b/zoneminder/distinfo
@@ -26,7 +26,6 @@ SHA1 (patch-src_zm__event.cpp) = 2831f586f140f682dd107a1adb09531c388a1df8
 SHA1 (patch-src_zm__eventstream.cpp) = d2134edf09f142a6a545ca36d3263b13defcadd6
 SHA1 (patch-src_zm__monitor.cpp) = ac6eb821d5d72455b46165e74ea1d321faf9e431
 SHA1 (patch-src_zm__packet.h) = dd0426b46ab9fa192fe0b5ff3ce646b26b9e0749
-SHA1 (patch-src_zm__rtp__ctrl.h) = c0cd9358f63a7eee495db46d07fd3e130616fd62
 SHA1 (patch-src_zm__rtp__source.cpp) = 288b32cff869103b04e96487b92bb12533b29772
 SHA1 (patch-src_zm__utils.cpp) = e16ffd3f41bd05a32c80142e7246307df12801a8
 SHA1 (patch-src_zm_comms_h) = 33577ab0eac62eadc415fe6fb970b82eb473c8e7
diff --git a/zoneminder/patches/patch-src_zm__rtp__ctrl.h b/zoneminder/patches/patch-src_zm__rtp__ctrl.h
deleted file mode 100644
index b702331054..0000000000
--- a/zoneminder/patches/patch-src_zm__rtp__ctrl.h
+++ /dev/null
@@ -1,7 +0,0 @@
-$NetBSD: patch-src_zm__rtp__ctrl.h,v 1.1 2020/07/12 16:58:42 gdt Exp $
-
-Work around:
-  zm_rtp_ctrl.h:128:31: error: flexible array member 'RtpCtrlThread::RtcpPacket::<unnamed union>::Bye::srcN' in an otherwise empty 'struct RtpCtrlThread::RtcpPacket::<unnamed union>::Bye'
-
-Not reported upstream because pkgsrc is out of date; to be done if this is not resolved by updating.
-


Home | Main Index | Thread Index | Old Index