pkgsrc-WIP-changes archive

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

zoneminder: Multiple minor but crucial fixes



Module Name:	pkgsrc-wip
Committed By:	Greg Troxel <gdt%lexort.com@localhost>
Pushed By:	gdt
Date:		Tue Jul 28 18:43:45 2026 -0400
Changeset:	eeff4ee61f94d46a508845c6df0412b6c9874218

Modified Files:
	zoneminder/Makefile
	zoneminder/PLIST
	zoneminder/distinfo
Added Files:
	zoneminder/patches/patch-web_includes_database.php

Log Message:
zoneminder: Multiple minor but crucial fixes

  - Upstream provides some default files that were not previously
    installed.  Install them.
  - Work around zm searching for rm and finding it in tools wrappers.
  - Work around zm having the cgibin path coded as a PATH, which it
    really isn't, by adding a leading /.
  - Patch php database access to use php-pdo_mysql when ZM_DB_TYPE is
    MariaDB.  (PHP has one wrapper for mysql/MariaDB, and perl has
    separate ones.)

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

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

diffstat:
 zoneminder/Makefile                                | 16 +++++++++++++--
 zoneminder/PLIST                                   |  3 +++
 zoneminder/distinfo                                |  1 +
 zoneminder/patches/patch-web_includes_database.php | 23 ++++++++++++++++++++++
 4 files changed, 41 insertions(+), 2 deletions(-)

diffs:
diff --git a/zoneminder/Makefile b/zoneminder/Makefile
index bc1c3f15ea..b441772cfb 100644
--- a/zoneminder/Makefile
+++ b/zoneminder/Makefile
@@ -6,6 +6,7 @@ NAME_DIST=	ZoneMinder
 NAME_LOWER=	zoneminder
 
 PKGNAME=	${DISTNAME:S/${NAME_DIST}-/${NAME_LOWER}-/}
+PKGREVISION=	1
 DISTNAME=	${NAME_DIST}-${VERSION}
 #WRKSRC=		${WRKDIR}/${NAME_LOWER}-${VERSION}
 WRKSRC=		${WRKDIR}/${NAME_LOWER}-${GITHUB_TAG}
@@ -119,6 +120,10 @@ OWN_DIRS_PERMS+=	${VARBASE}/tmp/zm ${REAL_ROOT_USER} ${APACHE_GROUP} 775
 CMAKE_CONFIGURE_ARGS+=	-DZM_LOGDIR=${VARBASE}/log/zm
 OWN_DIRS_PERMS+=	${VARBASE}/log/zm ${REAL_ROOT_USER} ${APACHE_GROUP} 775
 
+# Remediate cmake searching for rm in the build environment, finding
+# tools wrappers, and assuming that is the runtime environment.
+CMAKE_CONFIGURE_ARGS+=	-DZM_PATH_RM=/bin/rm
+
 # Choose directory where zoneminder can create shm files (for zmc).
 # \todo Define this per-OS.
 ZM_SHM=			/var/shm	# NetBSD
@@ -274,7 +279,9 @@ CMAKE_CONFIGURE_ARGS+=	-DZM_WEB_GROUP=${APACHE_GROUP}
 # other random cgi scripts have been installed by other packages.
 # This sets the path to be used, and httpd/nginx config must alias
 # that path to $PREFIX/libexec/zoneminder/cgi-bin/.
-CMAKE_CONFIGURE_ARGS+=	-DZM_PATH_ZMS=zm/cgi-bin/nph-zms
+# \todo Add a leading / to avoid cmake deciding to make it absolute by
+# prepending workdir.
+CMAKE_CONFIGURE_ARGS+=	-DZM_PATH_ZMS=/zm/cgi-bin/nph-zms
 
 .if !empty(PKG_OPTIONS:Mapache)
 .include "../../mk/apache.mk"
@@ -336,10 +343,14 @@ pre-configure:
 
 EGDIR=			share/examples/${PKGBASE}
 DOCDIR=			share/doc/${PKGBASE}
-INSTALLATION_DIRS+=	${EGDIR} ${EGDIR}/config ${EGDIR}/apache
+INSTALLATION_DIRS+=	${EGDIR} ${EGDIR}/config ${EGDIR}/config/conf.d ${EGDIR}/apache
 CONF_FILES+=		${PREFIX}/${EGDIR}/config/zm.conf ${PKG_SYSCONFDIR}/zm.conf
+CONF_FILES+=		${PREFIX}/${EGDIR}/config/conf.d/01-system-paths.conf ${PKG_SYSCONFDIR}/conf.d/01-system-paths.conf
+CONF_FILES+=		${PREFIX}/${EGDIR}/config/conf.d/02-multiserver.conf ${PKG_SYSCONFDIR}/conf.d/02-multiserver.conf
+CONF_FILES+=		${PREFIX}/${EGDIR}/config/conf.d/README ${PKG_SYSCONFDIR}/conf.d/README
 INSTALLATION_DIRS+=	bin share/examples/rc.d share/zoneminder/db
 INSTALLATION_DIRS+=	${DOCDIR}
+
 post-install:
 	# Remediate bundled deps installing things.
 	${RM}		-rf ${DESTDIR}${PREFIX}/include/jwt-cpp
@@ -352,6 +363,7 @@ post-install:
 	# Config files to EGDIR.
 	${INSTALL_DATA} ${WRKSRC}/httpd-zoneminder.conf ${DESTDIR}${PREFIX}/${EGDIR}/apache/httpd-zoneminder.conf
 	${INSTALL_DATA} ${WRKSRC}/${CMAKE_BUILD_DIR}/zm.conf ${DESTDIR}${PREFIX}/${EGDIR}/config/zm.conf
+	${INSTALL_DATA} ${WRKSRC}/${CMAKE_BUILD_DIR}/conf.d/* ${DESTDIR}${PREFIX}/${EGDIR}/config/conf.d
 	# rc.d to examples
 .if ${INIT_SYSTEM} == "rc.d"
 	${INSTALL_SCRIPT} ${WRKSRC}/${CMAKE_BUILD_DIR}/scripts/zm ${DESTDIR}${PREFIX}/share/examples/rc.d/zoneminder
diff --git a/zoneminder/PLIST b/zoneminder/PLIST
index a1f5ec2931..7e4d1414bf 100644
--- a/zoneminder/PLIST
+++ b/zoneminder/PLIST
@@ -6229,6 +6229,9 @@ share/applications/zoneminder.desktop
 share/doc/zoneminder/README-pkgsrc.md
 ${PLIST.rcd}share/examples/rc.d/zoneminder
 share/examples/zoneminder/apache/httpd-zoneminder.conf
+share/examples/zoneminder/config/conf.d/01-system-paths.conf
+share/examples/zoneminder/config/conf.d/02-multiserver.conf
+share/examples/zoneminder/config/conf.d/README
 share/examples/zoneminder/config/zm.conf
 share/zoneminder/MacVendors.json
 share/zoneminder/db/Object_Types.sql
diff --git a/zoneminder/distinfo b/zoneminder/distinfo
index ad78055fb2..1d581645ee 100644
--- a/zoneminder/distinfo
+++ b/zoneminder/distinfo
@@ -26,3 +26,4 @@ SHA1 (patch-src_zm__remote__camera__nvsocket.cpp) = 7921c7cf74286ab63f26efb22aa3
 SHA1 (patch-src_zm__rtp__source.cpp) = ba46738d040ad0c83a49e0d5cc368f2752535b6e
 SHA1 (patch-src_zm__utils.cpp) = 43b50688fa0d4f51b8474c8cc31e860b3a43f864
 SHA1 (patch-src_zm_signal_cpp) = 97177023eec823ff5cba124fd5f2b636fd54001e
+SHA1 (patch-web_includes_database.php) = 7a990d96b4e21d7ad60545c0202abb14b060f280
diff --git a/zoneminder/patches/patch-web_includes_database.php b/zoneminder/patches/patch-web_includes_database.php
new file mode 100644
index 0000000000..70244c0880
--- /dev/null
+++ b/zoneminder/patches/patch-web_includes_database.php
@@ -0,0 +1,23 @@
+$NetBSD$
+
+In order to function in the presence of the latest p5-DBD-msyql --
+which refuse to work with MariaDB, we need to have the user patch the
+ZM_DB_TYPE to MariaDB so that the DBD::MariaDB is used.  However, in
+the land of PHP, there is only php-pdo_mysql, which does both.  Thus,
+point MariaDB-using systems at it.
+
+To be raised with upstream after zoneminder in pkgsrc has been working
+for a bit.
+
+--- web/includes/database.php.orig	2026-05-28 08:42:49.000000000 -0400
++++ web/includes/database.php	2026-07-28 18:39:21.597037296 -0400
+@@ -31,6 +31,9 @@
+   global $dbConn;
+ 
+   $dsn = ZM_DB_TYPE;
++  if ( $dsn = 'MariaDB' ) {
++    $dsn = 'mysql';
++  }
+   if ( ZM_DB_HOST ) {
+     if ( strpos(ZM_DB_HOST, ':') ) {
+       // Host variable may carry a port or socket.


Home | Main Index | Thread Index | Old Index