Bug 262394 - net-mgmt/nagiosql: Support for PHP8.0
Summary: net-mgmt/nagiosql: Support for PHP8.0
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dan Langille
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-07 10:51 UTC by Helmut Ritter
Modified: 2023-02-24 21:13 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (dvl)


Attachments
Patch to support PHP8.0 (54.93 KB, patch)
2022-03-07 10:51 UTC, Helmut Ritter
no flags Details | Diff
Poudriere Log (28.37 KB, text/plain)
2022-03-07 10:52 UTC, Helmut Ritter
no flags Details
Patch to support PHP8.0 (48.91 KB, patch)
2022-03-07 18:50 UTC, Helmut Ritter
no flags Details | Diff
Poudriere Log (28.37 KB, text/plain)
2022-03-07 18:51 UTC, Helmut Ritter
no flags Details
Makefile.diff (1003 bytes, patch)
2022-04-07 13:15 UTC, Helmut Ritter
no flags Details | Diff
Patch to support PHP8.0 (54.53 KB, patch)
2022-04-08 08:22 UTC, Helmut Ritter
no flags Details | Diff
This patch adds nagios3/nagios4 flavors. (1.12 KB, patch)
2022-04-09 13:11 UTC, Dan Langille
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Ritter 2022-03-07 10:51:49 UTC
Created attachment 232293 [details]
Patch to support PHP8.0

Superseds https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262022
Comment 1 Helmut Ritter 2022-03-07 10:52:17 UTC
Created attachment 232294 [details]
Poudriere Log
Comment 2 Helmut Ritter 2022-03-07 18:50:45 UTC
Created attachment 232307 [details]
Patch to support PHP8.0
Comment 3 Helmut Ritter 2022-03-07 18:51:14 UTC
Created attachment 232308 [details]
Poudriere Log
Comment 4 Helmut Ritter 2022-04-04 08:06:13 UTC
Hi,

is anything missing, can I support somehow?

Thank you!
Comment 5 Dan Langille freebsd_committer freebsd_triage 2022-04-04 17:10:21 UTC
(In reply to Helmut Ritter from comment #4)

There is nothing missing but time for me to complete it. I got started, then had to stop because of other pending non-project issues. Sorry. Let's see if I can do it today.
Comment 6 Dan Langille freebsd_committer freebsd_triage 2022-04-04 17:17:05 UTC
What about users of net-mgmt/nagios?  This patch seems to leave them behind.
Comment 7 Dan Langille freebsd_committer freebsd_triage 2022-04-04 17:18:35 UTC
What is the intended purpose of:

IGNORE_WITH_PHP=74 81
Comment 8 Dan Langille freebsd_committer freebsd_triage 2022-04-04 17:21:56 UTC
It looks like this patch entirely removes support for existing PHP versions:

[pkg01 dan ~/ports/head/net-mgmt/nagiosql] % sudo make patch                                                                                                     17:20:31
===>  nagiosql-3.4.1 cannot be installed: doesn't work with lang/php74 port
(doesn't support PHP 7.4 81).
*** Error code 1

Stop.
make: stopped in /usr/home/dan/ports/head/net-mgmt/nagiosql
Comment 9 Dan Langille freebsd_committer freebsd_triage 2022-04-04 17:24:53 UTC
A side note, and this isn't the biggest issue, the patches should be created using 'make makepatch'. portlint indicates:

WARN: /usr/home/dan/ports/head/net-mgmt/nagiosql/files/patch-admin_dir.diff: patch was not generated using ``make makepatch''.  It is recommended to use ``make makepatch'' when you need to [re-]generate a patch to ensure proper patch format.
WARN: /usr/home/dan/ports/head/net-mgmt/nagiosql/files/patch-functions_dir.diff: patch was not generated using ``make makepatch''.  It is recommended to use ``make makepatch'' when you need to [re-]generate a patch to ensure proper patch format.
WARN: /usr/home/dan/ports/head/net-mgmt/nagiosql/files/patch-libraries_dir.diff: patch was not generated using ``make makepatch''.  It is recommended to use ``make makepatch'' when you need to [re-]generate a patch to ensure proper patch format.

Don't worry about that issue. Concentrate on the others. They are vital to not blocking existing users from this port.
Comment 10 Helmut Ritter 2022-04-05 08:21:27 UTC
Hi,

> There is nothing missing but time for me to complete it

Thanks for you efforts!

> What about users of net-mgmt/nagios?  This patch seems to leave them behind.

Nagios3 requires PHP7 which will deprecate soon. I for sure can add a FLAVOR but not sure if it is worth if for 5 months.

> IGNORE_WITH_PHP=74 81
and
> nagiosql-3.4.1 cannot be installed: doesn't work with lang/php74 port

Does not work with PHP74 (which will deprecate in 09/2022 afaik) and is not tested with PHP8.1. PHP8.0 is required for now.

> the patches should be created using 'make makepatch'. portlint indicates:

OK, next time. I tried hard to get a patch created at all.
Comment 11 Dan Langille freebsd_committer freebsd_triage 2022-04-05 17:17:08 UTC
Please add flavors. We can't block out Nagios 3 users - that's not fair to me (me included in that). This will need flavors I think. 5 months is a long time, and will affect 2022Q3, which means it will be in place until at least 1 Oct (6 months from now).

For the patches, if you need help, let me know. In short:

* with your current patch in place: make patch
* then, make makepatch
* this will take the .orig files and create new patch files in the files/ directory. The new files might not have the same names/exact same content, but they should be correct
Comment 12 Helmut Ritter 2022-04-07 07:29:10 UTC
I tried what you suggested and it fails with:

===>  License GPLv2 accepted by the user
===>   nagiosql-3.4.1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by nagiosql-3.4.1 for building
===>  Extracting for nagiosql-3.4.1
=> SHA256 Checksum OK for wizonet-nagiosql-365d4e0b5edc623b12ea96e8002e8ac66aad6aac_GL0.tar.gz.
===>  Patching for nagiosql-3.4.1
===>  Applying FreeBSD patches for nagiosql-3.4.1 from /var/jails/poudriere/ports/default/net-mgmt/nagiosql/files
Ignoring previously applied (or reversed) patch.
5 out of 5 hunks ignored--saving rejects to functions/prepend_content.php.rej
===>  FAILED Applying FreeBSD patch-functions_prepend__content.php.diff
===> Cleanly applied FreeBSD patch(es)  patch-admin_dir.diff patch-functions_dir.diff
===> FAILED to apply cleanly FreeBSD patch(es)  patch-functions_prepend__content.php.diff
*** Error code 1

Sorry, that's all too complicated for me, I'm no porter or FreeBSD expert. Here is the diff for the Makefile to support Nagios3. Feel free to use it or not:

--- /var/jails/poudriere/ports/test/net-mgmt/nagiosql/Makefile  2022-03-07 11:37:11.053905000 +0100
+++ ./Makefile  2022-04-07 09:19:20.489384000 +0200
@@ -10,7 +10,9 @@
 LICENSE=       GPLv2
 LICENSE_FILE=  ${WRKSRC}/LICENSE

-RUN_DEPENDS=   nagios:net-mgmt/nagios \
+#IGNORE_WITH_PHP=74 81
+
+RUN_DEPENDS=   nagios:net-mgmt/nagios4 \
                ${PEARDIR}/HTML/Template/IT.php:devel/pear-HTML_Template_IT@${PHP_FLAVOR}

 USES=          cpe gettext mysql php:web tar:bzip2
@@ -32,12 +34,15 @@

 PEARDIR?=      ${LOCALBASE}/share/pear

-OPTIONS_DEFINE=        CURL FTP
+OPTIONS_DEFINE=        CURL FTP NAGIOS3
 CURL_DESC=     Configure with cURL support
 FTP_DESC=      Configure with FTP support
+NAGIOS3_DESC=  Use Nagios3 (default: Nagios4)

 CURL_USE=      PHP=curl
 FTP_USE=       PHP=ftp
+NAGIOS3_USE=   RUN_DEPENDS=nagios:net-mgmt/nagios3 \
+               ${PEARDIR}/HTML/Template/IT.php:devel/pear-HTML_Template_IT@${PHP_FLAVOR}

 post-patch:
        ${REINPLACE_CMD} -e "s|'/etc/nagiosql/|'${ETCDIR}/|g" \

I tested it briefly along with "Patch to support PHP8.0" (which I'm also using actively since I opened the report) with Poudriere and it works for me but as I neiter have PHP7 anymore nor more time to dig into this I have to leave you with this alone.
Comment 13 Helmut Ritter 2022-04-07 12:04:27 UTC
This is the correct patch for Makefile:

--- /var/jails/poudriere/ports/test/net-mgmt/nagiosql/Makefile  2022-03-07 11:37:11.053905000 +0100
+++ ./Makefile  2022-04-07 14:02:07.274774000 +0200
@@ -10,7 +10,9 @@
 LICENSE=       GPLv2
 LICENSE_FILE=  ${WRKSRC}/LICENSE

-RUN_DEPENDS=   nagios:net-mgmt/nagios \
+#IGNORE_WITH_PHP=74 81
+
+RUN_DEPENDS=   nagios:net-mgmt/nagios4 \
                ${PEARDIR}/HTML/Template/IT.php:devel/pear-HTML_Template_IT@${PHP_FLAVOR}

 USES=          cpe gettext mysql php:web tar:bzip2
@@ -32,12 +34,15 @@

 PEARDIR?=      ${LOCALBASE}/share/pear

-OPTIONS_DEFINE=        CURL FTP
+OPTIONS_DEFINE=        CURL FTP NAGIOS3
 CURL_DESC=     Configure with cURL support
 FTP_DESC=      Configure with FTP support
+NAGIOS3_DESC=  Use Nagios3 (default: Nagios4)

 CURL_USE=      PHP=curl
 FTP_USE=       PHP=ftp
+NAGIOS3_RUN_DEPENDS=   nagios:net-mgmt/nagios \
+               ${PEARDIR}/HTML/Template/IT.php:devel/pear-HTML_Template_IT@${PHP_FLAVOR}

 post-patch:
        ${REINPLACE_CMD} -e "s|'/etc/nagiosql/|'${ETCDIR}/|g" \
Comment 14 Dan Langille freebsd_committer freebsd_triage 2022-04-07 12:58:08 UTC
I can help you with the patches

Can you attach the Makefile diff as a patch please? Copy/paste often messes with tabs etc.

Thank you.
Comment 15 Helmut Ritter 2022-04-07 13:15:50 UTC
Created attachment 233027 [details]
Makefile.diff
Comment 16 Helmut Ritter 2022-04-08 08:22:44 UTC
Created attachment 233044 [details]
Patch to support PHP8.0

Generated with "make makepatch"
Comment 17 Dan Langille freebsd_committer freebsd_triage 2022-04-09 13:11:45 UTC
Created attachment 233096 [details]
This patch adds nagios3/nagios4 flavors.

This patch adds nagios3/nagios4 flavors.
Comment 18 Dan Langille freebsd_committer freebsd_triage 2022-04-09 13:13:17 UTC
While reviewing the patches, have those code changes been sent upstream?
Comment 19 Dan Langille freebsd_committer freebsd_triage 2022-04-09 13:15:13 UTC
I ask this question because it doesn't seem right to be maintaining the code via patches.
Comment 20 Helmut Ritter 2022-04-09 16:47:25 UTC
(In reply to Dan Langille from comment #18)

I did so but the project seems...dead.

https://gitlab.com/wizonet/nagiosql/-/issues/35
Comment 21 Dan Langille freebsd_committer freebsd_triage 2022-04-09 21:14:55 UTC
(In reply to Helmut Ritter from comment #20)

How do you feel about forking the project?
Comment 22 Helmut Ritter 2022-04-13 15:27:31 UTC
(In reply to Dan Langille from comment #21)

I'm no developer :)