Bug 267304 - multimedia/zoneminder: update 1.36.12 -> 1.36.33, add php 8.1 compat
Summary: multimedia/zoneminder: update 1.36.12 -> 1.36.33, add php 8.1 compat
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Kurt Jaeger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-24 07:53 UTC by Andriy Gapon
Modified: 2023-04-17 15:46 UTC (History)
4 users (show)

See Also:
bsd: maintainer-feedback+


Attachments
zoneminder 1.36.12 -> 1.36.33 update (10.56 KB, patch)
2023-02-24 12:56 UTC, Ivan
bsd: maintainer-approval+
Details | Diff
zoneminder 1.36.12 -> 1.36.33 update (10.56 KB, patch)
2023-02-24 13:24 UTC, Ivan
bsd: maintainer-approval+
Details | Diff
zoneminder 1.36.12 -> 1.36.33 update (10.40 KB, patch)
2023-04-09 15:07 UTC, Ivan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andriy Gapon freebsd_committer freebsd_triage 2022-10-24 07:53:54 UTC
It looks like the package installation does not create /var/log/zm directory and later the software complains about that.  At least in my case, I had to manually create that directory and set its ownership to www:www.

Another nit is that the package message suggests to set date.timezone in PHP configuration.  It looks like the newer zoneminder recommends to set the time zone in zoneminder's configuration. https://zoneminder.readthedocs.io/en/stable/userguide/gettingstarted.html
Comment 1 Andriy Gapon freebsd_committer freebsd_triage 2022-10-27 08:02:06 UTC
Yet another issue I noticed is that at least some files under /usr/local/www/zoneminder/lang/ use incorrect -- for FreeBSD -- locale names and, thus, those locales do not take effect.
For example, en_gb.php has 'en_GB.utf8' while on FreeBSD it should be 'en_GB.UTF-8'. As a result, dates are shown in the US / C format (e.g. month/day).  Fixing the locale name fixes the date display.
Comment 2 Fernando Apesteguía freebsd_committer freebsd_triage 2022-10-27 12:23:13 UTC
^Triage: reporter is committer, assign accordingly
Comment 3 Vladimir Druzenko freebsd_committer freebsd_triage 2023-01-14 13:36:51 UTC
1. Create /var/log/zm.
Also "events" dir must be in /var/db/zoneminder, not in /var/cache/zoneminder.
Patch:
diff -ur /usr/ports/multimedia/zoneminder.orig/pkg-plist /usr/ports/multimedia/zoneminder/pkg-plist
--- /usr/ports/multimedia/zoneminder.orig/pkg-plist
+++ /usr/ports/multimedia/zoneminder/pkg-plist
@@ -8149,8 +8149,9 @@
 @dir(%%WWWOWN%%,%%WWWGRP%%,) %%WWWDIR%%/api/app/tmp
 @dir(%%WWWOWN%%,%%WWWGRP%%,) %%WWWDIR%%/temp
 @dir(%%WWWOWN%%,%%WWWGRP%%,) /var/cache/zoneminder
-@dir(%%WWWOWN%%,%%WWWGRP%%,) /var/cache/zoneminder/events
 @dir(%%WWWOWN%%,%%WWWGRP%%,) /var/cache/zoneminder/images
 @dir(%%WWWOWN%%,%%WWWGRP%%,) /var/db/zoneminder
+@dir(%%WWWOWN%%,%%WWWGRP%%,) /var/db/zoneminder/events
+@dir(%%WWWOWN%%,%%WWWGRP%%,) /var/log/zm
 @dir(%%WWWOWN%%,%%WWWGRP%%,) /var/run/zm
 @dir(%%WWWOWN%%,%%WWWGRP%%,) /var/tmp/zm

2. About date.timezone:
> PHP throws warning if date.timezone option is not set.
So this recommendation for remove warning, AFAIU.

3. About /usr/local/www/zoneminder/lang/
> en_gb.php has 'en_GB.utf8' while on FreeBSD it should be 'en_GB.UTF-8'
Fixed in upstream: https://github.com/ZoneMinder/zoneminder/commit/9ad7ce3823b2cb296f5e5b615883c04af5238801

4. Work on update to 1.36.32 now: https://github.com/ZoneMinder/zoneminder/issues/3505.
Comment 4 Vladimir Druzenko freebsd_committer freebsd_triage 2023-01-14 14:01:05 UTC
1. Forgot post patch for Makefile:
--- multimedia/zoneminder.orig/Makefile           
+++ multimedia/zoneminder/Makefile           
@@ -105,9 +105,10 @@
        ${MKDIR} ${STAGEDIR}${WWWDIR}/temp
        ${MKDIR} ${STAGEDIR}${WWWDIR}/api/app/tmp
        ${MKDIR} ${STAGEDIR}/var/cache/zoneminder
-       ${MKDIR} ${STAGEDIR}/var/cache/zoneminder/events
        ${MKDIR} ${STAGEDIR}/var/cache/zoneminder/images
        ${MKDIR} ${STAGEDIR}/var/db/zoneminder
+       ${MKDIR} ${STAGEDIR}/var/db/zoneminder/events
+       ${MKDIR} ${STAGEDIR}/var/log/zm
        ${MKDIR} ${STAGEDIR}/var/run/zm
        ${MKDIR} ${STAGEDIR}/var/tmp/zm
Comment 5 Ivan 2023-01-14 14:16:38 UTC
I have a patch that integrates your efforts to bring 1.36.32 and fix for the issues, mentioned here.

I need testing though, however I can post the patch here.
Comment 6 Vladimir Druzenko freebsd_committer freebsd_triage 2023-01-14 17:14:27 UTC
(In reply to Ivan from comment #5)
https://pastebin.com/bRCug87r
Comment 7 Ivan 2023-02-24 12:56:03 UTC
Created attachment 240372 [details]
zoneminder 1.36.12 -> 1.36.33 update

Zoneminder update 1.36.12 -> 1.36.33

The latest version brings php 8.1 compatibility and numerous fixes.

---
It took a long time b/c 1.36.14 introduced an undefined behavior issue in packet queue under FreeBSD, crashing zmc processes every minute. Fortunately, ZM developers could identify and fix it.

More information here https://github.com/ZoneMinder/zoneminder/issues/3505 

Big thanks to everyone who helped me to update and test the port. Without your participation, 1.36.12 could be the last FreeBSD compatible version.
Comment 8 Vladimir Druzenko freebsd_committer freebsd_triage 2023-02-24 13:13:56 UTC
(In reply to Ivan from comment #7)
Maybe sort USE_PHP:
-USE_PHP=	json pdo_mysql session gd sockets ctype opcache openssl hash intl sysvsem
+USE_PHP=       ctype gd hash intl json opcache openssl pdo_mysql session sockets sysvsem
Comment 9 Ivan 2023-02-24 13:24:39 UTC
Created attachment 240373 [details]
zoneminder 1.36.12 -> 1.36.33 update

Sorted USE_PHP dependencies
Comment 10 Kurt Jaeger freebsd_committer freebsd_triage 2023-04-09 14:00:12 UTC
(In reply to Ivan from comment #9)
It needs -p6 to apply to a git tree:

git apply --check --verbose -p6 /tmp/zonem

It's cleaner to do this on a git ports tree with your changes applied:

git diff HEAD <port>

and add that diff to a PR.
Comment 11 Ivan 2023-04-09 15:07:59 UTC
Created attachment 241376 [details]
zoneminder 1.36.12 -> 1.36.33 update

Proper diff paths handling
Comment 12 Kurt Jaeger freebsd_committer freebsd_triage 2023-04-09 16:38:01 UTC
Committed, thanks!
Comment 13 commit-hook freebsd_committer freebsd_triage 2023-04-09 16:38:03 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=71909fff64eb4a3abd28ba6a2a77441c1acad7e9

commit 71909fff64eb4a3abd28ba6a2a77441c1acad7e9
Author:     Ivan <bsd@abinet.ru>
AuthorDate: 2023-04-09 16:33:08 +0000
Commit:     Kurt Jaeger <pi@FreeBSD.org>
CommitDate: 2023-04-09 16:37:29 +0000

    multimedia/zoneminder: update 1.36.12 -> 1.36.33, add php 8.1 compat

    - package installation now creates /var/log/zm
    - fixes some locale names

    PR:             267304
    Changes:        https://github.com/ZoneMinder/zoneminder/releases
    Tested-by:      VVD <vvd@unislabs.com>

 multimedia/zoneminder/Makefile             | 11 +++---
 multimedia/zoneminder/distinfo             | 10 ++---
 multimedia/zoneminder/files/pkg-message.in |  5 +++
 multimedia/zoneminder/pkg-plist            | 61 +++++++++++++++---------------
 4 files changed, 46 insertions(+), 41 deletions(-)
Comment 14 Vladimir Druzenko freebsd_committer freebsd_triage 2023-04-17 15:46:43 UTC
Just for information: updated to 1.36.33 and it work fine now.
Require "sudo -u www zmupdate.pl -f".