Bug 276835

Summary: net/samba416: FLAVORify ldb dependency
Product: Ports & Packages Reporter: Xavier Beaudouin <kiwi>
Component: Individual Port(s)Assignee: Mateusz Piotrowski <0mp>
Status: Closed FIXED    
Severity: Affects Many People CC: 0mp
Priority: --- Flags: 0mp: maintainer-feedback-
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 276840    
Attachments:
Description Flags
add noldb flavor for Samba. none

Description Xavier Beaudouin 2024-02-05 10:17:40 UTC
Created attachment 248201 [details]
add noldb flavor for Samba.

This patch permit to add a "noldb" flavor for net/samba416.

This will require the database/ldb25 that was missing for a long time, but https://reviews.freebsd.org/D43748, will fix it.

Why adding a flavor? When compiling some tools with kerberos support (like for example security/sssd-devel), they need to have a separate ldb from samba for dependency purpose. This will allow to pull the right version of samba directly uppon building of such ports.

Sponsored-by: Klara Inc.
Comment 1 Xavier Beaudouin 2024-02-29 14:38:23 UTC
Notice this patch has been successfully tested on FreeBSD 13.2 and 14.0 poudriere, as well on some production environement.
Comment 2 Mateusz Piotrowski freebsd_committer freebsd_triage 2024-03-12 21:05:53 UTC
Comment on attachment 248201 [details]
add noldb flavor for Samba.

>--- ../samba416.old/Makefile	2024-02-05 10:10:58
>+++ Makefile	2024-01-24 13:58:27
>@@ -1,6 +1,6 @@
> PORTNAME=			${SAMBA4_BASENAME}416
> PORTVERSION=			${SAMBA4_VERSION}
>-PORTREVISION=			3
>+PORTREVISION=			4

There is no need to bump PORTREVISION as we are not modifying the default flavor.

>@@ -103,6 +103,9 @@
> WAF_CMD=			buildtools/bin/waf
> CONFIGURE_LOG=			bin/config.log
> 
>+FLAVORS=			default noldb

The usual line of "FLAVOR?=     ${FLAVORS:[1]}" seems to be missing.
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-03-12 21:38:18 UTC
A commit in branch main references this bug:

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

commit eaec7c2287315c50e79b137d94cee66054e4cec6
Author:     Xavier Beaudouin <xavier.beaudouin@klarasystems.com>
AuthorDate: 2024-03-12 21:19:04 +0000
Commit:     Mateusz Piotrowski <0mp@FreeBSD.org>
CommitDate: 2024-03-12 21:37:48 +0000

    net/samba416: Add externalldb flavor

    Why do we need the externalldb flavor? Compiling tools like
    security/sssd-devel with Kerberos support often requires a standalone
    ldb as a dependency. By adding a externalldb flavor, ports can depend on
    a flavor of Samba that does not depend on its bundled version of ldb.

    PR:             276835
    Approved by:    portmgr (maintainer timeout, 2+ weeks)
    Sponsored by:   Klara, Inc.
    Co-authored-by: Mateusz Piotrowski <0mp@FreeBSD.org>

 net/samba416/Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)
Comment 4 Mateusz Piotrowski freebsd_committer freebsd_triage 2024-03-12 21:43:34 UTC
Now that I think about it, perhaps we just don't need the externalldb flavor at all. Now that we have ldb25 in the ports, I don't see why cannot we just pick databases/ldb25 by default unless the user sets SAMBA4_BUNDLED_LDB=yes explicity in make.conf(5).

Thoughts?
Comment 5 Xavier Beaudouin 2024-03-13 09:02:58 UTC
Well since database/ldb25 is now on the ports, this is maybe a good idea to setup SAMBA4_BUNDLED_LDB=no (instead of SAMBA4_BUNDLED_LDB=yes which is currently the default on the port).
Will have a double check on poudriere and give you feedback about that.
Kind regards