Bug 292266 - net-mgmt/librenms: drop mysql-client dep
Summary: net-mgmt/librenms: drop mysql-client dep
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: Dan Langille
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-08 09:34 UTC by Dries Michiels
Modified: 2026-01-11 12:56 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dries Michiels freebsd_committer freebsd_triage 2026-01-08 09:34:37 UTC
Hi,

At the moment it is not possible to run librenms with for example mariadb using packages. The issue is that the port pulls in the mysql-client by default preventing the use of any other database than the default mysql version database. Looking at another port like www/nextcloud, where this is optional, and any database can be installed besides it with packages. When I "pkg delete mysql80-lient", it deletes the librenms package too based on the dependency chain. Looking at databases/py-pymysql, it also doesn't pull in the client dependency.
So ideally, the MYSQLD_USES_OFF, drops the client requirement.
Comment 1 Dries Michiels freebsd_committer freebsd_triage 2026-01-08 09:35:39 UTC
If we do this, we need to add an UPDATING note for the port in question, and add an extra step in the pkg-message to manually install the wanted database and connector.
Comment 2 Dan Langille freebsd_committer freebsd_triage 2026-01-08 12:14:19 UTC
I think this is a fine idea.

Perhaps we can do this with flavors?
Comment 3 Dries Michiels freebsd_committer freebsd_triage 2026-01-08 12:35:51 UTC
Well this would be ideal indeed :)
Comment 4 Dries Michiels freebsd_committer freebsd_triage 2026-01-09 07:52:58 UTC
Another idea might be to have a flover "full" that includes a default database. And a flavor "nodatabase" or something.
Comment 5 Dan Langille freebsd_committer freebsd_triage 2026-01-09 11:58:11 UTC
(In reply to Dries Michiels from comment #4)

I found the flavor solution difficult to implement. I figured I was doing it wrong.

Turns out, someone elses agrees I was doing it wrong:

https://lists.freebsd.org/archives/freebsd-ports/2026-January/008947.html

Instead, let's make the port as agnostic about databases as we can.

That is, don't install anything which ties the resulting package to a particular database backend. Let the user decide at run-time which database to use. That approach also lets the user switch from one database to another without rebuilding/reinstalling the port.
Comment 6 Dan Langille freebsd_committer freebsd_triage 2026-01-09 12:34:28 UTC
With this proposed change (removal of mysql:client)

[12:33 pkg01 dvl ~/ports/head/net-mgmt/librenms] % git diff
diff --git a/net-mgmt/librenms/Makefile b/net-mgmt/librenms/Makefile
index 64232761c3fa..b65b750aa328 100644
--- a/net-mgmt/librenms/Makefile
+++ b/net-mgmt/librenms/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=      librenms
 PORTVERSION=   25.12.0
+PORTREVISION=  0
 PORTEPOCH=     1
 CATEGORIES=    net-mgmt
 MASTER_SITES=  LOCAL/dvl:vendor
@@ -104,7 +105,6 @@ FPING_RUN_DEPENDS=  fping:net/fping
 IPMITOOL_RUN_DEPENDS=  ipmitool:sysutils/ipmitool
 LIBVIRT_RUN_DEPENDS=   virsh:devel/libvirt
 MYSQLD_USES=           mysql:server
-MYSQLD_USES_OFF=       mysql:client
 NAGPLUGINS_RUN_DEPENDS=        ${LOCALBASE}/libexec/nagios/check_nagios:net-mgmt/nagios-plugins
 NMAP_RUN_DEPENDS=      nmap:security/nmap
 WMIC_RUN_DEPENDS=      wmic:net-mgmt/wmi-client


This is what gets installed:

nobody@143amd64-dvl-testing:/usr/ports/net-mgmt/librenms $ pkg info -x mysql
php84-mysqli-8.4.16
php84-pdo_mysql-8.4.16
py311-pymysql-1.1.1
Comment 7 Dries Michiels freebsd_committer freebsd_triage 2026-01-09 12:35:14 UTC
Seems sufficient IMO :).
Comment 8 Dan Langille freebsd_committer freebsd_triage 2026-01-09 12:37:14 UTC
Proposed UPDATING entry:

[12:36 pkg01 dvl ~/ports/head] % git diff UPDATING
diff --git a/UPDATING b/UPDATING
index 21099f05a8da..2a81ce5e13aa 100644
--- a/UPDATING
+++ b/UPDATING
@@ -5,6 +5,13 @@ they are unavoidable.
 You should get into the habit of checking this file for changes each time
 you update your ports collection, before attempting any port upgrades.
 
+20260109:
+  AFFECTS: users of net-mgmt/librenms
+  AUTHOR: dvl@FreeBSD.org
+
+  mysql-client is no longer a dependency. This allows users to select
+  mysql or mariadb at run time. This was not poossible before.
+
 20260103:
   AFFECTS: users of x11/nvidia-{driver, kmod}-devel variants
   AUTHOR: junchoon@dec.sakura.ne.jp
Comment 9 Dan Langille freebsd_committer freebsd_triage 2026-01-09 12:39:53 UTC
pkg-message changes:

[12:39 pkg01 dvl ~/ports/head/net-mgmt/librenms] % git diff files/pkg-message.in
diff --git a/net-mgmt/librenms/files/pkg-message.in b/net-mgmt/librenms/files/pkg-message.in
index c9437f5c008b..83552792bda1 100644
--- a/net-mgmt/librenms/files/pkg-message.in
+++ b/net-mgmt/librenms/files/pkg-message.in
@@ -94,6 +94,9 @@ started:
 cd %%WWWDIR%%
 echo ./validate.php | sudu su -fm www
 
+NOTE: The mysql client is no longer a run-time dependency.
+      If needed, you must install it.
+
 EOM
 }
 { type: upgrade
@@ -134,6 +137,9 @@ does not properly start. Monitor /var/log/librenms/*.log and if you see
 
  service librenms restart
 
+NOTE: The mysql client is no longer a run-time dependency.
+      If needed, you must install it.
+
 EOM
 }
 ]
Comment 10 Dries Michiels freebsd_committer freebsd_triage 2026-01-09 14:28:26 UTC
Thanks for this!
Comment 11 commit-hook freebsd_committer freebsd_triage 2026-01-09 16:46:17 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=00cf03dc769d7974c52b2e41f90b52b289ea45c7

commit 00cf03dc769d7974c52b2e41f90b52b289ea45c7
Author:     Dan Langille <dvl@FreeBSD.org>
AuthorDate: 2026-01-09 16:43:31 +0000
Commit:     Dan Langille <dvl@FreeBSD.org>
CommitDate: 2026-01-09 16:46:05 +0000

    net-mgmt/librenms: Allow for use of mariadb

    Remove the run-time dependency upon a mysql client.

    This update allows the mysql client to be removed and replaced by a
    mariadb client.
    PR:             292266

 UPDATING                               | 7 +++++++
 net-mgmt/librenms/Makefile             | 2 +-
 net-mgmt/librenms/files/pkg-message.in | 6 ++++++
 3 files changed, 14 insertions(+), 1 deletion(-)
Comment 12 commit-hook freebsd_committer freebsd_triage 2026-01-09 16:49:18 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=229082fe357d0c130cfd22ec9c324429292eee24

commit 229082fe357d0c130cfd22ec9c324429292eee24
Author:     Dan Langille <dvl@FreeBSD.org>
AuthorDate: 2026-01-09 16:48:36 +0000
Commit:     Dan Langille <dvl@FreeBSD.org>
CommitDate: 2026-01-09 16:48:36 +0000

    net-mgmt/librenms: bump PORTREVISION

    PR:             292266

 net-mgmt/librenms/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 13 Dan Langille freebsd_committer freebsd_triage 2026-01-11 12:56:58 UTC
Thank you.