tdb depends on Python 2 for its bindings but the only port using them is
net/samba;  many other ports use tdb without Pyhton but still pull in
Python 2.

With -main and -python packages we can tell samba to also install the
-python package to be happy such that all other ports depending on tdb
can be installed without Python 2:

        net/netatalk3
        mail/neomutt
        mail/fdm
        audio/rhythmbox
        audio/pulseaudio

I've added the `@pkgpath databases/tdb' marker to PLIST-main such that
`pkg_add -U tdb' will happily upgrade, no quirks required here:

        Jan 23 14:48:52 eru pkg_add: Added tdb-1.3.18->1.3.18p0

For samba I have not checked which of its subpackages actually uses the
Python bindings do both of them now install the new subpackage, i.e.
no effective change for them.


Feedback? OK?

Index: databases/tdb/Makefile
===================================================================
RCS file: /cvs/ports/databases/tdb/Makefile,v
retrieving revision 1.32
diff -u -p -r1.32 Makefile
--- databases/tdb/Makefile      14 Mar 2020 15:35:29 -0000      1.32
+++ databases/tdb/Makefile      23 Jan 2021 13:46:25 -0000
@@ -1,9 +1,15 @@
 # $OpenBSD: Makefile,v 1.32 2020/03/14 15:35:29 kn Exp $
 
-COMMENT=       trivial database library
+COMMENT-main=  trivial database library
+COMMENT-python=        Python ${MODPY_VERSION} bindings for tdb
 
 # Keep in sync with the version bundled in net/samba
-DISTNAME=      tdb-1.3.18
+V=             1.3.18
+DISTNAME=      tdb-${V}
+PKGNAME-main=  tdb-${V}
+REVISION-main= 0
+PKGNAME-python=        tdb-python-${V}
+MULTI_PACKAGES=        -main -python
 
 # 0750 on Makefile and other files breaks update-patches with PORTS_PRIVSEP=Yes
 FIX_EXTRACT_PERMISSIONS=       Yes
@@ -19,7 +25,8 @@ MAINTAINER=   Jeremie Courreges-Anglas <jc
 # LGPLv3+
 PERMIT_PACKAGE=        Yes
 
-WANTLIB += c intl m pthread util ${MODPY_WANTLIB}
+WANTLIB-main=  c pthread
+WANTLIB-python=        intl m pthread tdb util ${MODPY_WANTLIB}
 
 MASTER_SITES=  https://download.samba.org/pub/tdb/
 
@@ -32,7 +39,8 @@ MODPY_ADJ_FILES= buildtools/bin/waf
 BUILD_DEPENDS= textproc/docbook-xsl \
                textproc/libxslt
 
-LIB_DEPENDS=   ${MODPY_LIB_DEPENDS}
+LIB_DEPENDS-python=    ${BUILD_PKGPATH} \
+                       ${MODPY_LIB_DEPENDS}
 
 WAF_ARGS=      -v -j ${MAKE_JOBS}
 MAKE_FLAGS=    WAF_ARGS="${WAF_ARGS}"
Index: databases/tdb/pkg/DESCR
===================================================================
RCS file: databases/tdb/pkg/DESCR
diff -N databases/tdb/pkg/DESCR
--- databases/tdb/pkg/DESCR     28 Jul 2007 21:37:26 -0000      1.1.1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,4 +0,0 @@
-TDB is a Trivial Database. In concept, it is very much like GDBM, and
-BSD's DB except that it allows multiple simultaneous writers and uses
-locking internally to keep writers from trampling on each other. TDB is
-also extremely small.
Index: databases/tdb/pkg/DESCR-main
===================================================================
RCS file: databases/tdb/pkg/DESCR-main
diff -N databases/tdb/pkg/DESCR-main
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ databases/tdb/pkg/DESCR-main        28 Jul 2007 21:37:26 -0000
@@ -0,0 +1,4 @@
+TDB is a Trivial Database. In concept, it is very much like GDBM, and
+BSD's DB except that it allows multiple simultaneous writers and uses
+locking internally to keep writers from trampling on each other. TDB is
+also extremely small.
Index: databases/tdb/pkg/DESCR-python
===================================================================
RCS file: databases/tdb/pkg/DESCR-python
diff -N databases/tdb/pkg/DESCR-python
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ databases/tdb/pkg/DESCR-python      23 Jan 2021 13:47:51 -0000
@@ -0,0 +1 @@
+Python ${MODPY_VERSION} bindings for tdb.
Index: databases/tdb/pkg/PLIST
===================================================================
RCS file: databases/tdb/pkg/PLIST
diff -N databases/tdb/pkg/PLIST
--- databases/tdb/pkg/PLIST     4 Dec 2019 00:14:45 -0000       1.10
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-@comment $OpenBSD: PLIST,v 1.10 2019/12/04 00:14:45 jca Exp $
-@conflict samba-<3.5.0
-@bin bin/tdbbackup
-@bin bin/tdbdump
-@bin bin/tdbrestore
-@bin bin/tdbtool
-include/tdb.h
-@lib lib/libtdb.so.${LIBtdb_VERSION}
-lib/pkgconfig/tdb.pc
-lib/python${MODPY_VERSION}/site-packages/_tdb_text.py
-lib/python${MODPY_VERSION}/site-packages/_tdb_text.pyc
-@so lib/python${MODPY_VERSION}/site-packages/tdb.so
-@man man/man8/tdbbackup.8
-@man man/man8/tdbdump.8
-@man man/man8/tdbrestore.8
-@man man/man8/tdbtool.8
Index: databases/tdb/pkg/PLIST-main
===================================================================
RCS file: databases/tdb/pkg/PLIST-main
diff -N databases/tdb/pkg/PLIST-main
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ databases/tdb/pkg/PLIST-main        23 Jan 2021 13:44:01 -0000
@@ -0,0 +1,13 @@
+@comment $OpenBSD: PLIST-main,v$
+@pkgpath databases/tdb
+@bin bin/tdbbackup
+@bin bin/tdbdump
+@bin bin/tdbrestore
+@bin bin/tdbtool
+include/tdb.h
+@lib lib/libtdb.so.${LIBtdb_VERSION}
+lib/pkgconfig/tdb.pc
+@man man/man8/tdbbackup.8
+@man man/man8/tdbdump.8
+@man man/man8/tdbrestore.8
+@man man/man8/tdbtool.8
Index: databases/tdb/pkg/PLIST-python
===================================================================
RCS file: databases/tdb/pkg/PLIST-python
diff -N databases/tdb/pkg/PLIST-python
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ databases/tdb/pkg/PLIST-python      23 Jan 2021 13:39:20 -0000
@@ -0,0 +1,6 @@
+@comment $OpenBSD: PLIST-python,v$
+lib/python${MODPY_VERSION}/
+lib/python${MODPY_VERSION}/site-packages/
+lib/python${MODPY_VERSION}/site-packages/_tdb_text.py
+lib/python${MODPY_VERSION}/site-packages/_tdb_text.pyc
+@so lib/python${MODPY_VERSION}/site-packages/tdb.so
Index: net/samba/Makefile
===================================================================
RCS file: /cvs/ports/net/samba/Makefile,v
retrieving revision 1.288
diff -u -p -r1.288 Makefile
--- net/samba/Makefile  16 Jan 2021 21:21:04 -0000      1.288
+++ net/samba/Makefile  23 Jan 2021 13:28:58 -0000
@@ -21,8 +21,8 @@ PKG_ARCH-docs =               *
 LDB_V =                        1.4.8
 TEVENT_V =             0.9.37
 
-REVISION-ldb =         1
-REVISION-main =                0
+REVISION-ldb =         2
+REVISION-main =                1
 REVISION-tevent =      0
 
 SHARED_LIBS =          asn1-samba4             0.0 \
@@ -121,6 +121,7 @@ LIB_DEPENDS-main =  ${BUILD_PKGPATH},-ldb
                        converters/libiconv \
                        databases/openldap \
                        databases/tdb>=1.3.18 \
+                       databases/tdb,-python>=1.3.18 \
                        devel/gettext,-runtime \
                        devel/jansson \
                        devel/libexecinfo \
@@ -136,6 +137,7 @@ LIB_DEPENDS-ldb =   ${BUILD_PKGPATH},-teve
                        devel/popt \
                        databases/openldap \
                        databases/tdb>=1.3.18 \
+                       databases/tdb,-python>=1.3.18 \
                        devel/libtalloc>=2.1.16
 
 LIB_DEPENDS-tevent =   devel/libtalloc>=2.1.16

Reply via email to