pkgsrc-Changes archive

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

CVS commit: pkgsrc/security/zoneminder



Module Name:    pkgsrc
Committed By:   gdt
Date:           Sun Jan  4 23:29:55 UTC 2026

Modified Files:
        pkgsrc/security/zoneminder: Makefile distinfo
        pkgsrc/security/zoneminder/patches: patch-CMakeLists.txt
Added Files:
        pkgsrc/security/zoneminder/files: upstream-PR-3914
        pkgsrc/security/zoneminder/patches:
            patch-scripts_ZoneMinder_lib_ZoneMinder_Database.pm

Log Message:
security/zoneminder: Add support for mysql vs MariaDB

Cherry-pick commits from https://github.com/ZoneMinder/zoneminder/pull/3914/

Because of other upstream problems, there are two problems with using
MariaDB, which can be mostly worked around.  Leave hints in the
Makefile near the MariaDB option.

Hope that upstream addresses this soon.

Leave the default at mysql to make it easier for anyone starting out.
This has not been tested but is probably ok.


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 pkgsrc/security/zoneminder/Makefile
cvs rdiff -u -r1.24 -r1.25 pkgsrc/security/zoneminder/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/security/zoneminder/files/upstream-PR-3914
cvs rdiff -u -r1.2 -r1.3 \
    pkgsrc/security/zoneminder/patches/patch-CMakeLists.txt
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/security/zoneminder/patches/patch-scripts_ZoneMinder_lib_ZoneMinder_Database.pm

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

Modified files:

Index: pkgsrc/security/zoneminder/Makefile
diff -u pkgsrc/security/zoneminder/Makefile:1.95 pkgsrc/security/zoneminder/Makefile:1.96
--- pkgsrc/security/zoneminder/Makefile:1.95    Sun Jan  4 00:11:26 2026
+++ pkgsrc/security/zoneminder/Makefile Sun Jan  4 23:29:54 2026
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.95 2026/01/04 00:11:26 gdt Exp $
+# $NetBSD: Makefile,v 1.96 2026/01/04 23:29:54 gdt Exp $
 
 VERSION=       1.36.37
 # Distfile is ZoneMinder but package and tarball contents are zoneminder.
@@ -6,7 +6,7 @@ NAME_DIST=      ZoneMinder
 NAME_LOWER=    zoneminder
 
 PKGNAME=       ${DISTNAME:S/${NAME_DIST}-/${NAME_LOWER}-/}
-PKGREVISION=   2
+PKGREVISION=   3
 DISTNAME=      ${NAME_DIST}-${VERSION}
 WRKSRC=                ${WRKDIR}/${NAME_LOWER}-${VERSION}
 CATEGORIES=    security
@@ -29,14 +29,23 @@ HOMEPAGE=   https://www.zoneminder.com/
 COMMENT=       Video camera security and surveillance solution
 LICENSE=       gnu-gpl-v2
 
-# ZoneMinder without a web server does not really make sense, and if
-# it did, what is omitted is surely not right.  For now, require a
-# choice of webserver.
+# ZoneMinder without a web server does not really make sense (and if
+# it did, what is omitted is surely not right).  Require a webserver
+# (until someone wanting to not have one provides rationale and a
+# patch).
 PKG_OPTIONS_VAR=               PKG_OPTIONS.zoneminder
 PKG_OPTIONS_REQUIRED_GROUPS=   webserver
 PKG_OPTIONS_GROUP.webserver=   apache nginx
 PKG_SUGGESTED_OPTIONS=         apache
 
+# ZoneMinder requires a database, historically mysql only.  This
+# package supports mysql and MariaDB, which must be handled separately
+# because p5-DBD-mysql is (2026-01) mysql only, with p5-DBD-MariaDB
+# for MariaDB.
+PKG_OPTIONS_REQUIRED_GROUPS+=  database
+PKG_OPTIONS_GROUP.database=    mysql mariadb
+PKG_SUGGESTED_OPTIONS+=                mysql
+
 .include "../../mk/bsd.options.mk"
 
 ## NOTES
@@ -187,18 +196,6 @@ DEPENDS+=  p5-XML-Parser-[0-9]*:../../tex
 DEPENDS+=      p5-Number-Bytes-Human-[0-9]*:../../textproc/p5-Number-Bytes-Human
 DEPENDS+=      p5-libwww-[0-9]*:../../www/p5-libwww
 
-# zoneminder needs a database.  While the longstanding approach is
-# mysql, it's become normal to use mariadb instead.  p5-DBD-mysql used
-# to talk to mariadb just fine, but now it doesn't.  zoneminder has
-# improved DB type selection to deal with this and use p5-DBD-mariadb
-# instead.
-#   https://github.com/ZoneMinder/zoneminder/pull/3914/commits
-# \todo Figure out if those commits are in the packaged version, now
-# and after updating to the latest micro.  If not pull them in as a patch.
-# \todo Consider options, vs just saying you need to use mariadb.
-#DEPENDS+=     p5-DBD-mysql-[0-9]*:../../databases/p5-DBD-mysql
-#DEPENDS+=     p5-DBD-MariaDB-[0-9]*:../../databases/p5-DBD-MariaDB
-
 # A large subset of perl scripts set PATH explicitly and need to patched.
 # See "PATH FIXUPS" below.
 # \todo Teach pkglint that this variable is a list.
@@ -217,6 +214,44 @@ ZM_PERL_PATH+=     scripts/zmvideo.pl.in
 ZM_PERL_PATH+= scripts/zmwatch.pl.in
 ZM_PERL_PATH+= scripts/zmx10.pl.in
 
+## DATABASE
+
+# In case of trouble, see files/upstream-PR-3914 for p5-DBD-mysql woes
+# and changes to address them.n
+
+# There is no reason to suspect that any version in pkgsrc is
+# problematic, but most have not been tested.
+.if !empty(PKG_OPTIONS:Mmariadb)
+# 2026-01: 1.36 works with mariadb 10.6 on NetBSD
+# 2024-01: 1.36 works with mariadb 11.2 on GNU/Linux
+DEPENDS+=                      p5-DBD-MariaDB-[0-9]*:../../databases/p5-DBD-MariaDB
+MYSQL_VERSIONS_ACCEPTED=       mariadb118 mariadb114 mariadb1011 mariadb106 mariadb105
+CMAKE_CONFIGURE_ARGS+=         -DZM_DB_TYPE=MariaDB
+
+# Once you cross into p5-DBD-mysql 5, more changes are needed.
+# \todo Pull these into the package as patches or wait for upstream.
+#    https://github.com/ZoneMinder/zoneminder/pull/3914/
+
+# in Database.pm, comment out mysql_auto_reconnect because MariaDB doesn't have that.
+#$dbh->{mysql_auto_reconnect} = 1;
+#Fatal('Can\'t set mysql_auto_reconnect on in database connection')
+#  unless $dbh->{mysql_auto_reconnect};
+
+# add to includes/database.php: There is no pdo_MariaDB; use pdo_mysql instead.
+# $dsn = ZM_DB_TYPE;
+# if ( $dsn == 'MariaDB' ) {
+#   $dsn = 'mysql';
+# }
+
+.endif
+.if !empty(PKG_OPTIONS:Mmysql)
+DEPENDS+=                      p5-DBD-mysql-[0-9]*:../../databases/p5-DBD-mysql
+MYSQL_VERSIONS_ACCEPTED=       80
+CMAKE_CONFIGURE_ARGS+=         -DZM_DB_TYPE=mysql
+.endif
+
+.include "../../mk/mysql.buildlink3.mk"
+
 ## PHP
 
 # 20250103 1.36.37:
@@ -248,6 +283,12 @@ BUILD_DEFS+=               APACHE_USER APACHE_GROUP
 
 CMAKE_CONFIGURE_ARGS+= -DZM_WEB_USER=${APACHE_USER}
 CMAKE_CONFIGURE_ARGS+= -DZM_WEB_GROUP=${APACHE_GROUP}
+
+# We set ZM_PATH_ZMS to a zm-specific cgi-bin directory, so that
+# enabling that in apache (or nginx) exposes nph-zms, and not whatever
+# 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
 
 .if !empty(PKG_OPTIONS:Mapache)
@@ -255,28 +296,13 @@ CMAKE_CONFIGURE_ARGS+=    -DZM_PATH_ZMS=zm/
 DEPENDS+=      ${APACHE_PKG_PREFIX}-${PHP_PKG_PREFIX}-[0-9]*:../../www/ap-php
 .endif
 .if !empty(PKG_OPTIONS:Mnginx)
-# \todo Actually test this option.
+# \todo Actually test this option.  Add an nginx config fragment to files/examples.
 DEPENDS+=      nginx-[0-9]*:../../www/nginx
 DEPENDS+=      ${PHP_PKG_PREFIX}-fpm>=${PHP_BASE_VERS}:../../www/php-fpm
 .endif
 
-## MYSQL
-
-# 1.36 works with mariadb 10.6 on NetBSD
-# 1.36 works with mariadb 11.2 on GNU/Linux
-# \todo Evaluate and exclude troublesome versions.
-.include "../../mk/mysql.buildlink3.mk"
-
 ## PATH FIXUPS
 
-# \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.

Index: pkgsrc/security/zoneminder/distinfo
diff -u pkgsrc/security/zoneminder/distinfo:1.24 pkgsrc/security/zoneminder/distinfo:1.25
--- pkgsrc/security/zoneminder/distinfo:1.24    Sat Jan  3 19:49:04 2026
+++ pkgsrc/security/zoneminder/distinfo Sun Jan  4 23:29:54 2026
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.24 2026/01/03 19:49:04 gdt Exp $
+$NetBSD: distinfo,v 1.25 2026/01/04 23:29:54 gdt Exp $
 
 BLAKE2s (FriendsOfCake-crud-14292374ccf1328f2d5db20897bd06f99ba4d938.tar.gz) = 8877bf6718ecfe3cba2515629418fe5addc60cf8ce4650526b39db6a234922ad
 SHA512 (FriendsOfCake-crud-14292374ccf1328f2d5db20897bd06f99ba4d938.tar.gz) = 
da58528686baf05385ad08079f965bce10eba6d599133ab773e9ab1f9e4b7d82cf5431b4b773317b90effb16e0b026a029bdfabe08a9ef1a5e9b94e7a1c2ea9e
@@ -12,12 +12,13 @@ Size (ZoneMinder-CakePHP-Enum-Behavior-e
 BLAKE2s (ZoneMinder-RtspServer-055d81fe1293429e496b19104a9ed3360755a440.tar.gz) = 0feba45357a746173378193be365b164061cc9f20e84210ecfe9e991ad9971e4
 SHA512 (ZoneMinder-RtspServer-055d81fe1293429e496b19104a9ed3360755a440.tar.gz) = 
2f3bbd449269cba5afda3135e54cca114342956da3ce8fbfb05533ec7b1c3f75767d8b5f3d9b415254ad7b39817bc343b0790c591ef3cc64d2863819ab3a7551
 Size (ZoneMinder-RtspServer-055d81fe1293429e496b19104a9ed3360755a440.tar.gz) = 1396623 bytes
-SHA1 (patch-CMakeLists.txt) = dca040058ec7b389474dff9853c46f65fd5626da
+SHA1 (patch-CMakeLists.txt) = dd515b905c51b67112c273d20c96394010358381
 SHA1 (patch-dep_RtspServer_src_net_EventLoop.cpp) = bf1fe79c2ba1d602adf8895f29f61f7b961eece3
 SHA1 (patch-dep_RtspServer_src_net_Socket.h) = 789e90da4bfc15d6d43d942718538385cb6dfade
 SHA1 (patch-dep_RtspServer_src_net_SocketUtil.cpp) = c566652e8e7985a705682ef960118615b6777288
 SHA1 (patch-dep_RtspServer_src_xop_rtsp.h) = 20a014ce423d19549976c2158d39c46ea6892647
 SHA1 (patch-scripts_ZoneMinder_lib_ZoneMinder_ConfigData.pm.in) = 3bf4e5e8276a682695db640e6608dd14c7315320
+SHA1 (patch-scripts_ZoneMinder_lib_ZoneMinder_Database.pm) = 2e59b1d31c2dba9f719c60540d010ebeb216f5e9
 SHA1 (patch-scripts_ZoneMinder_lib_ZoneMinder_General_pm) = 996670d8a659c0624587da73f8083d9349aaa1ba
 SHA1 (patch-scripts_ZoneMinder_lib_ZoneMinder_Memory_Shared.pm) = b3de55618915fad3d9263954db71270c800ad6f1
 SHA1 (patch-scripts_zm_in) = a05727261bb8be6b707e9a14ae4ff52ea3770d51

Index: pkgsrc/security/zoneminder/patches/patch-CMakeLists.txt
diff -u pkgsrc/security/zoneminder/patches/patch-CMakeLists.txt:1.2 pkgsrc/security/zoneminder/patches/patch-CMakeLists.txt:1.3
--- pkgsrc/security/zoneminder/patches/patch-CMakeLists.txt:1.2 Sun Dec  1 13:49:47 2024
+++ pkgsrc/security/zoneminder/patches/patch-CMakeLists.txt     Sun Jan  4 23:29:54 2026
@@ -1,4 +1,4 @@
-$NetBSD: patch-CMakeLists.txt,v 1.2 2024/12/01 13:49:47 gdt Exp $
+$NetBSD: patch-CMakeLists.txt,v 1.3 2026/01/04 23:29:54 gdt Exp $
 
 Don't have a file called "version", to avoid conflict with C++20 <version>.
 
@@ -12,7 +12,9 @@ exist, so don't insist on librt being pr
 Let Pkgsrc be responsible for zm.conf into examples, rather than overwriting
 the existing configuration file.
 
---- CMakeLists.txt.orig        2023-02-23 21:44:01.000000000 +0000
+See ../files/upstream-PR-3914.
+
+--- CMakeLists.txt.orig        2025-12-07 16:18:50.000000000 +0000
 +++ CMakeLists.txt
 @@ -4,7 +4,7 @@
  #
@@ -23,7 +25,28 @@ the existing configuration file.
  # make API version a minor of ZM version
  set(zoneminder_API_VERSION "${zoneminder_VERSION}.1")
  
-@@ -267,7 +267,9 @@ check_include_file("ucontext.h" HAVE_UCO
+@@ -119,14 +119,16 @@ set(ZM_CONTENTDIR "/var/lib/zoneminder" 
+ set(ZM_FONTDIR "${CMAKE_INSTALL_FULL_DATADIR}/zoneminder/fonts" CACHE PATH
+   "Location of the font files used for timestamping, default: <prefix>/${CMAKE_INSTALL_DATADIR}/zoneminder/fonts")
+ 
++set(ZM_DB_TYPE "mysql" CACHE STRING
++  "Type of database where the ZoneMinder database located, default: mysql")
+ set(ZM_DB_HOST "localhost" CACHE STRING
+-  "Hostname where ZoneMinder database located, default: localhost")
++  "Hostname where the ZoneMinder database located, default: localhost")
+ set(ZM_DB_NAME "zm" CACHE STRING
+-  "Name of ZoneMinder database, default: zm")
++  "Name of the ZoneMinder database, default: zm")
+ set(ZM_DB_USER "zmuser" CACHE STRING
+-  "Name of ZoneMinder database user, default: zmuser")
++  "Name of the ZoneMinder database user, default: zmuser")
+ set(ZM_DB_PASS "zmpass" CACHE STRING
+-  "Password of ZoneMinder database user, default: zmpass")
++  "Password of the ZoneMinder database user, default: zmpass")
+ set(ZM_WEB_USER "" CACHE STRING
+   "The user apache or the local web server runs on. Leave empty for automatic detection.
+      If that fails, you can use this variable to force")
+@@ -269,7 +271,9 @@ check_include_file("ucontext.h" HAVE_UCO
  check_include_file("sys/sendfile.h" HAVE_SYS_SENDFILE_H)
  check_include_file("sys/syscall.h" HAVE_SYS_SYSCALL_H)
  check_function_exists("syscall" HAVE_SYSCALL)
@@ -33,7 +56,7 @@ the existing configuration file.
  check_function_exists("posix_memalign" HAVE_POSIX_MEMALIGN)
  check_type_size("siginfo_t" HAVE_SIGINFO_T)
  check_type_size("ucontext_t" HAVE_UCONTEXT_T)
-@@ -278,7 +280,8 @@ if(UNIX)
+@@ -280,7 +284,8 @@ if(UNIX)
    include(CheckLibraryExists)
    CHECK_LIBRARY_EXISTS(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME)
    if(NOT HAVE_CLOCK_GETTIME)
@@ -43,7 +66,15 @@ the existing configuration file.
    else()
      list(APPEND ZM_BIN_LIBS "-lrt")
    endif()
-@@ -863,8 +866,8 @@ else()
+@@ -810,7 +815,6 @@ set(WEB_PREFIX "${ZM_WEBDIR}")
+ set(CGI_PREFIX "${ZM_CGIDIR}")
+ set(WEB_USER "${ZM_WEB_USER}")
+ set(WEB_GROUP "${ZM_WEB_GROUP}")
+-set(ZM_DB_TYPE "mysql")
+ if(ZM_PERL_SEARCH_PATH)
+   set(EXTRA_PERL_LIB "use lib '${ZM_PERL_SEARCH_PATH}'; # Include custom perl install path")
+ else()
+@@ -873,8 +877,8 @@ else()
  endif()
  
  # Install zm.conf

Added files:

Index: pkgsrc/security/zoneminder/files/upstream-PR-3914
diff -u /dev/null pkgsrc/security/zoneminder/files/upstream-PR-3914:1.1
--- /dev/null   Sun Jan  4 23:29:55 2026
+++ pkgsrc/security/zoneminder/files/upstream-PR-3914   Sun Jan  4 23:29:54 2026
@@ -0,0 +1,74 @@
+$NetBSD: upstream-PR-3914,v 1.1 2026/01/04 23:29:54 gdt Exp $
+
+Because p5-DBD-mysql 5 withdrew support for using mariadb, programs
+must use p5-DBD-MariaDB instead, if using MariaDB, requiring that
+mysql and MariaDB be treated as separate database types.
+
+Zoneminder made this accomodation on master, but it does not appear in
+1.36.37.  See
+
+  https://github.com/ZoneMinder/zoneminder/pull/3914/
+
+
+This file contains the diff after cherry-picking the commits from the
+PR to 1.36.37:
+
+  434ce6a08 Use ZM_DB_TYPE when connecting to db.
+  649bceb24 Improve handling of ZM_DB_TYPE
+  c0c8a041e Fix missing ?
+
+This diff also exists also in patches/, in separate files, but is left
+here to make things easier to understand for future self or other
+maintainers.
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d1305aaff..ef6ef4413 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -119,14 +119,16 @@ set(ZM_CONTENTDIR "/var/lib/zoneminder" CACHE PATH
+ set(ZM_FONTDIR "${CMAKE_INSTALL_FULL_DATADIR}/zoneminder/fonts" CACHE PATH
+   "Location of the font files used for timestamping, default: <prefix>/${CMAKE_INSTALL_DATADIR}/zoneminder/fonts")
+ 
++set(ZM_DB_TYPE "mysql" CACHE STRING
++  "Type of database where the ZoneMinder database located, default: mysql")
+ set(ZM_DB_HOST "localhost" CACHE STRING
+-  "Hostname where ZoneMinder database located, default: localhost")
++  "Hostname where the ZoneMinder database located, default: localhost")
+ set(ZM_DB_NAME "zm" CACHE STRING
+-  "Name of ZoneMinder database, default: zm")
++  "Name of the ZoneMinder database, default: zm")
+ set(ZM_DB_USER "zmuser" CACHE STRING
+-  "Name of ZoneMinder database user, default: zmuser")
++  "Name of the ZoneMinder database user, default: zmuser")
+ set(ZM_DB_PASS "zmpass" CACHE STRING
+-  "Password of ZoneMinder database user, default: zmpass")
++  "Password of the ZoneMinder database user, default: zmpass")
+ set(ZM_WEB_USER "" CACHE STRING
+   "The user apache or the local web server runs on. Leave empty for automatic detection.
+      If that fails, you can use this variable to force")
+@@ -810,7 +812,6 @@ set(WEB_PREFIX "${ZM_WEBDIR}")
+ set(CGI_PREFIX "${ZM_CGIDIR}")
+ set(WEB_USER "${ZM_WEB_USER}")
+ set(WEB_GROUP "${ZM_WEB_GROUP}")
+-set(ZM_DB_TYPE "mysql")
+ if(ZM_PERL_SEARCH_PATH)
+   set(EXTRA_PERL_LIB "use lib '${ZM_PERL_SEARCH_PATH}'; # Include custom perl install path")
+ else()
+diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Database.pm b/scripts/ZoneMinder/lib/ZoneMinder/Database.pm
+index 80a4456d2..6de4621a8 100644
+--- a/scripts/ZoneMinder/lib/ZoneMinder/Database.pm
++++ b/scripts/ZoneMinder/lib/ZoneMinder/Database.pm
+@@ -103,11 +103,11 @@ sub zmDbConnect {
+ 
+     eval {
+       $dbh = DBI->connect(
+-        'DBI:mysql:database='.$ZoneMinder::Config::Config{ZM_DB_NAME}
++        'DBI:'.$ZoneMinder::Config::Config{ZM_DB_TYPE}.':database='.$ZoneMinder::Config::Config{ZM_DB_NAME}
+         .$socket . $sslOptions . ($options?join(';', '', map { $_.'='.$$options{$_} } keys %{$options} ) : '')
+         , $ZoneMinder::Config::Config{ZM_DB_USER}
+         , $ZoneMinder::Config::Config{ZM_DB_PASS}
+-        , { mysql_enable_utf8mb4 => 1, }
++        , { ($ZoneMinder::Config::Config{ZM_DB_TYPE} eq 'mysql' ? (mysql_enable_utf8mb4 => 1) : ()) }
+         );
+     };
+     if ( !$dbh or $@ ) {

Index: pkgsrc/security/zoneminder/patches/patch-scripts_ZoneMinder_lib_ZoneMinder_Database.pm
diff -u /dev/null pkgsrc/security/zoneminder/patches/patch-scripts_ZoneMinder_lib_ZoneMinder_Database.pm:1.1
--- /dev/null   Sun Jan  4 23:29:55 2026
+++ pkgsrc/security/zoneminder/patches/patch-scripts_ZoneMinder_lib_ZoneMinder_Database.pm      Sun Jan  4 23:29:54 2026
@@ -0,0 +1,20 @@
+$NetBSD: patch-scripts_ZoneMinder_lib_ZoneMinder_Database.pm,v 1.1 2026/01/04 23:29:54 gdt Exp $
+
+See ../files/upstream-PR-3914.
+
+--- scripts/ZoneMinder/lib/ZoneMinder/Database.pm.orig 2025-12-07 16:18:50.000000000 +0000
++++ scripts/ZoneMinder/lib/ZoneMinder/Database.pm
+@@ -103,11 +103,11 @@ sub zmDbConnect {
+ 
+     eval {
+       $dbh = DBI->connect(
+-        'DBI:mysql:database='.$ZoneMinder::Config::Config{ZM_DB_NAME}
++        'DBI:'.$ZoneMinder::Config::Config{ZM_DB_TYPE}.':database='.$ZoneMinder::Config::Config{ZM_DB_NAME}
+         .$socket . $sslOptions . ($options?join(';', '', map { $_.'='.$$options{$_} } keys %{$options} ) : '')
+         , $ZoneMinder::Config::Config{ZM_DB_USER}
+         , $ZoneMinder::Config::Config{ZM_DB_PASS}
+-        , { mysql_enable_utf8mb4 => 1, }
++        , { ($ZoneMinder::Config::Config{ZM_DB_TYPE} eq 'mysql' ? (mysql_enable_utf8mb4 => 1) : ()) }
+         );
+     };
+     if ( !$dbh or $@ ) {



Home | Main Index | Thread Index | Old Index