Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] samba: update to 4.20.1.
@ 2024-05-22 10:43 otommod
  2024-05-23  8:15 ` [PR PATCH] [Updated] " otommod
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: otommod @ 2024-05-22 10:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2125 bytes --]

There is a new pull request by otommod against master on the void-packages repository

https://github.com/otommod/void-packages samba-4.20.1
https://github.com/void-linux/void-packages/pull/50464

samba: update to 4.20.1.
I don't have much experience with packaging and none with `Void Linux` packaging in particular, especially with a big project like Samba, so I'm not sure this is production ready yet.

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
- I built this PR locally for these architectures:
  - x86_64
  - aarch64
  - aarch64-musl

#### Questions & notes
  - `samba-libs` has a ton of private libraries that I could not build as builtin this time. Should I add all of them to `common/shlibs`?
  - I packaged `{uid,socket,nss,resolv}_wrapper` since they are needed by the `samba` testsuite but they can also be bundled in... Do we really need them? They are not used by anything else (yet).  On the other hand, `pam_wrapper`, that is also needed, is already in the repository.
  - On a related note, I tried to build the aforementioned testsuite but it ended up with a `cmocka` related build failure (`LargestIntegralType` was not defined). It did build successfully when `cmocka` was build as a bundled library though.
  - Should we break the `samba` package up? Fedora/Debian have a ton of subpackages for it and even Alpine has a few more than us.

A patch file from https://github.com/void-linux/void-packages/pull/50464.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-samba-4.20.1-50464.patch --]
[-- Type: text/x-diff, Size: 38909 bytes --]

From e10919b7cc9a0d3253f21e889ddead86aaf12404 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Mon, 20 May 2024 15:51:28 +0300
Subject: [PATCH 1/8] tevent: update to 0.16.1.

---
 .../tevent/patches/fix-public-headers.patch   | 13 ----------
 srcpkgs/tevent/template                       | 25 +++++++++++++------
 2 files changed, 17 insertions(+), 21 deletions(-)
 delete mode 100644 srcpkgs/tevent/patches/fix-public-headers.patch

diff --git a/srcpkgs/tevent/patches/fix-public-headers.patch b/srcpkgs/tevent/patches/fix-public-headers.patch
deleted file mode 100644
index 1710226d4580c9..00000000000000
--- a/srcpkgs/tevent/patches/fix-public-headers.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-tevent.h needs sys/types.h for pid_t
-
---- a/tevent.h	2018-07-12 05:51:30.000000000 +0000
-+++ b/tevent.h	2018-07-19 10:13:15.360128807 +0000
-@@ -31,6 +31,7 @@
- #include <stdint.h>
- #include <talloc.h>
- #include <sys/time.h>
-+#include <sys/types.h>
- #include <stdbool.h>
- 
- struct tevent_context;
-
diff --git a/srcpkgs/tevent/template b/srcpkgs/tevent/template
index 7dadd564db0bf5..1a3f49d8bb8d0b 100644
--- a/srcpkgs/tevent/template
+++ b/srcpkgs/tevent/template
@@ -1,28 +1,37 @@
 # Template file for 'tevent'
 pkgname=tevent
-version=0.11.0
-revision=3
+version=0.16.1
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
 configure_args="--sysconfdir=/etc --localstatedir=/var
  --disable-rpath --disable-rpath-install --without-gettext
  --builtin-libraries=replace --bundled-libraries=NONE"
-hostmakedepends="pkg-config docbook2x python3-setuptools"
-makedepends="python3-devel talloc-devel libxslt gettext-devel cmocka-devel"
+hostmakedepends="pkg-config docbook-xsl libxslt"
+makedepends="python3-devel talloc-devel cmocka-devel"
 short_desc="Event system based on the talloc memory management library"
 maintainer="Yuusha Spacewolf <xyuusha@paranoici.org>"
 license="GPL-3.0-or-later"
 homepage="https://tevent.samba.org"
 distfiles="https://download.samba.org/pub/tevent/tevent-${version}.tar.gz"
-checksum=ee9a86c8e808aac2fe1e924eaa139ff7f0269d0e8e4fafa850ae5c7489bc82ba
+checksum=362971e0f32dc1905f6fe4736319c4b8348c22dc85aa6c3f690a28efe548029e
+
+if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
+	makedepends+=" libxcrypt-devel"
+fi
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
+export PYTHONHASHSEED=1
+
+do_check() {
+	${configure_script} test
+}
 
 post_patch() {
-	# Avoid Python shlib extension noise in libpytallic-util.so
-	vsed -e "/env.pyext_PATTERN/s/dct\['SO'\]/'.so'/" \
-		-i third_party/waf/waflib/Tools/python.py
+	# Look for properly named python support libraries
+	vsed -i third_party/waf/waflib/Tools/python.py \
+		-e "s|env.pyext_PATTERN = .*$|env.pyext_PATTERN = '%s.so'|"
 }
 
 tevent-python3_package() {

From 048f2bd26d3101dc843d46a36a9b9a662e88a9e6 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Mon, 20 May 2024 18:06:26 +0300
Subject: [PATCH 2/8] tdb: update to 1.4.10.

---
 srcpkgs/tdb/template | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/tdb/template b/srcpkgs/tdb/template
index 0134d2dcc2fb91..6d1c3039ed914f 100644
--- a/srcpkgs/tdb/template
+++ b/srcpkgs/tdb/template
@@ -1,21 +1,25 @@
 # Template file for 'tdb'
 pkgname=tdb
-version=1.4.9
-revision=2
+version=1.4.10
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
-configure_args="--prefix=/usr --libdir=/usr/lib --sysconfdir=/etc
- --localstatedir=/var --disable-rpath --disable-rpath-install
- --builtin-libraries=replace --bundled-libraries=NONE --without-gettext"
-hostmakedepends="pkg-config docbook2x"
-makedepends="python3-devel libxslt gettext-devel"
+configure_args="--sysconfdir=/etc --localstatedir=/var
+ --disable-rpath --disable-rpath-install --without-gettext
+ --builtin-libraries=replace --bundled-libraries=NONE"
+hostmakedepends="pkg-config docbook-xsl libxslt"
+makedepends="python3-devel"
 short_desc="Trivial Database, similar to GDBM but allows simultaneous commits"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="https://tdb.samba.org/"
 distfiles="https://download.samba.org/pub/tdb/tdb-${version}.tar.gz"
-checksum=0ac226073e3a2db8648da7af744cb95f50766a52feeb001d558b2b321b74a765
+checksum=02338e33c16c21c9e29571cef523e76b2b708636254f6f30c6cf195d48c62daf
+
+if [ "$XBPS_TARGET_LIBC" = glibc ]; then
+	makedepends+=" libxcrypt-devel"
+fi
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
 export PYTHONHASHSEED=1

From cc4f2ad03ce2f92ae72a14f4afa25b0502efb550 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Mon, 20 May 2024 18:20:57 +0300
Subject: [PATCH 3/8] ldb: update to 2.9.0.

---
 srcpkgs/ldb/patches/strtoull.patch | 89 ++++++++++++++++++++++++++++++
 srcpkgs/ldb/template               | 29 +++++-----
 2 files changed, 104 insertions(+), 14 deletions(-)
 create mode 100644 srcpkgs/ldb/patches/strtoull.patch

diff --git a/srcpkgs/ldb/patches/strtoull.patch b/srcpkgs/ldb/patches/strtoull.patch
new file mode 100644
index 00000000000000..2fcd928a3d143c
--- /dev/null
+++ b/srcpkgs/ldb/patches/strtoull.patch
@@ -0,0 +1,89 @@
+diff --git a/lib/replace/replace.c b/lib/replace/replace.c
+index 0652cb4..02b6ebf 100644
+--- a/lib/replace/replace.c
++++ b/lib/replace/replace.c
+@@ -559,41 +559,6 @@ long long int rep_strtoll(const char *str, char **endptr, int base)
+ #endif /* HAVE_STRTOLL */
+ 
+ 
+-#ifndef HAVE_STRTOULL
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
+-{
+-#ifdef HAVE_STRTOUQ
+-	return strtouq(str, endptr, base);
+-#elif defined(HAVE___STRTOULL) 
+-	return __strtoull(str, endptr, base);
+-#elif SIZEOF_LONG == SIZEOF_LONG_LONG
+-	return (unsigned long long int) strtoul(str, endptr, base);
+-#else
+-# error "You need a strtoull function"
+-#endif
+-}
+-#else
+-#ifdef HAVE_BSD_STRTOLL
+-#undef strtoull
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
+-{
+-	int saved_errno = errno;
+-	unsigned long long int nb = strtoull(str, endptr, base);
+-	/* With glibc EINVAL is only returned if base is not ok */
+-	if (errno == EINVAL) {
+-		if (base == 0 || (base >1 && base <37)) {
+-			/* Base was ok so it's because we were not
+-			 * able to make the conversion.
+-			 * Let's reset errno.
+-			 */
+-			errno = saved_errno;
+-		}
+-	}
+-	return nb;
+-}
+-#endif /* HAVE_BSD_STRTOLL */
+-#endif /* HAVE_STRTOULL */
+-
+ #ifndef HAVE_SETENV
+ int rep_setenv(const char *name, const char *value, int overwrite) 
+ {
+diff --git a/lib/replace/replace.h b/lib/replace/replace.h
+index a8910e2..854b1a7 100644
+--- a/lib/replace/replace.h
++++ b/lib/replace/replace.h
+@@ -394,16 +394,6 @@ long long int rep_strtoll(const char *str, char **endptr, int base);
+ #endif
+ #endif
+ 
+-#ifndef HAVE_STRTOULL
+-#define strtoull rep_strtoull
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base);
+-#else
+-#ifdef HAVE_BSD_STRTOLL /* yes, it's not HAVE_BSD_STRTOULL */
+-#define strtoull rep_strtoull
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base);
+-#endif
+-#endif
+-
+ #ifndef HAVE_FTRUNCATE
+ #define ftruncate rep_ftruncate
+ int rep_ftruncate(int,off_t);
+diff --git a/lib/replace/wscript b/lib/replace/wscript
+index 4c774d9..a1dc6d0 100644
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -411,7 +411,7 @@ def configure(conf):
+     conf.CHECK_FUNCS('initgroups pread pwrite strndup strcasestr strsep')
+     conf.CHECK_FUNCS('strtok_r mkdtemp dup2 dprintf vdprintf isatty chown lchown')
+     conf.CHECK_FUNCS('link readlink symlink realpath snprintf vsnprintf')
+-    conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen strtoull __strtoull')
++    conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen')
+     conf.CHECK_FUNCS('strtouq strtoll __strtoll strtoq memalign posix_memalign')
+     conf.CHECK_FUNCS('fmemopen')
+ 
+@@ -866,7 +866,7 @@ REPLACEMENT_FUNCTIONS = {
+                   'memmove', 'strdup', 'setlinebuf', 'vsyslog', 'strnlen',
+                   'strndup', 'waitpid', 'seteuid', 'setegid', 'chroot',
+                   'mkstemp', 'mkdtemp', 'pread', 'pwrite', 'strcasestr',
+-                  'strsep', 'strtok_r', 'strtoll', 'strtoull', 'setenv', 'unsetenv',
++                  'strsep', 'strtok_r', 'strtoll', 'setenv', 'unsetenv',
+                   'utime', 'utimes', 'dup2', 'chown', 'link', 'readlink',
+                   'symlink', 'lchown', 'realpath', 'memmem', 'vdprintf',
+                   'dprintf', 'get_current_dir_name', 'copy_file_range',
diff --git a/srcpkgs/ldb/template b/srcpkgs/ldb/template
index 964a2c33009da0..f3dcb95611ceb4 100644
--- a/srcpkgs/ldb/template
+++ b/srcpkgs/ldb/template
@@ -1,7 +1,7 @@
 # Template file for 'ldb'
 pkgname=ldb
-version=2.3.2
-revision=3
+version=2.9.0
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
@@ -9,28 +9,29 @@ configure_args="--sysconfdir=/etc --localstatedir=/var
  --disable-rpath --disable-rpath-install --without-gettext
  --builtin-libraries=replace --bundled-libraries=NONE
  --with-modulesdir=/usr/lib/ldb/modules"
-hostmakedepends="pkg-config docbook2x tdb-python3 tevent-python3 python3-setuptools"
-makedepends="python3-devel tdb-devel tevent-devel talloc-devel
- popt-devel lmdb-devel libxslt gettext-devel cmocka-devel"
+hostmakedepends="pkg-config docbook-xsl libxslt tdb-python3 tevent-python3"
+makedepends="python3-devel tdb-devel tevent-devel talloc-devel popt-devel
+ lmdb-devel cmocka-devel"
 checkdepends="cmocka-devel"
 short_desc="LDAP-like database from samba"
 maintainer="Yuusha Spacewolf <xyuusha@paranoici.org>"
 license="LGPL-3.0-or-later"
 homepage="https://www.samba.org/ldb/"
 distfiles="https://download.samba.org/pub/ldb/ldb-${version}.tar.gz"
-checksum=1416c949dc4326e41c0d8a5ecf8ef784f8c0b6e9d3dad8fa971e84ad56227603
-
-# workaround for cmocka's broken uintptr_t definition on musl
-if [ "$XBPS_TARGET_WORDSIZE" = "64" -a "$XBPS_TARGET_LIBC" = "musl" ]; then
-	CFLAGS+=" -D__WORDSIZE=64"
-fi
+checksum=105aaff71ad881a7faeb582fd416ae28221b6fde338fff82828065062c2507a5
+make_check=extended # testsuite takes a long time
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
+export PYTHONHASHSEED=1
 
 post_patch() {
-	# Avoid Python shlib extension noise in libpyldb-util.so
-	vsed -e "/env.pyext_PATTERN/s/dct\['SO'\]/'.so'/" \
-		-i third_party/waf/waflib/Tools/python.py
+	# Look for properly named python support libraries
+	vsed -i third_party/waf/waflib/Tools/python.py \
+		-e "s|env.pyext_PATTERN = .*$|env.pyext_PATTERN = '%s.so'|"
+}
+
+do_check() {
+	${configure_script} test ${makejobs}
 }
 
 ldb-python3_package() {

From ba90a0b86f14cbbed6b8306db12ebf178d0decde Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 10:22:00 +0300
Subject: [PATCH 4/8] New package: uid_wrapper-1.3.0.

---
 .../uid_wrapper-fix-for-cmocka-1.1.6.patch    | 31 +++++++++++++++++++
 srcpkgs/uid_wrapper/template                  | 22 +++++++++++++
 2 files changed, 53 insertions(+)
 create mode 100644 srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch
 create mode 100644 srcpkgs/uid_wrapper/template

diff --git a/srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch b/srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch
new file mode 100644
index 00000000000000..c99c3ad6bce663
--- /dev/null
+++ b/srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch
@@ -0,0 +1,31 @@
+From 850f24c6366abda30bfd77734b90330b8809d306 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Fri, 17 Feb 2023 17:51:27 +0100
+Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
+---
+ tests/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 635e86e..68e050e 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ project(tests C)
+ 
++if (TARGET cmocka::cmocka)
++    set(CMOCKA_LIBRARY cmocka::cmocka)
++endif()
++
+ add_library(uwrap_fake_socket_wrapper SHARED uwrap_fake_socket_wrapper.c)
+ target_compile_options(uwrap_fake_socket_wrapper
+                        PRIVATE
+-- 
+2.34.1
+
diff --git a/srcpkgs/uid_wrapper/template b/srcpkgs/uid_wrapper/template
new file mode 100644
index 00000000000000..24a90e93767069
--- /dev/null
+++ b/srcpkgs/uid_wrapper/template
@@ -0,0 +1,22 @@
+# Template file for 'uid_wrapper'
+pkgname=uid_wrapper
+version=1.3.0
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Testing tool to fake privilege separation"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="https://cwrap.org/uid_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=f7e7c1bde533530051931414724453e14e02adbb614824b6fe27cbb98654b762
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel"
+	checkdepends+=" cmocka"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 95843b9bd20130b6e1eb3e14af20ed82e2ab312f Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 11:09:08 +0300
Subject: [PATCH 5/8] New package: socket_wrapper-1.4.2

---
 .../socket_wrapper-fix-for-cmocka-1.1.6.patch | 33 +++++++++++++++++++
 srcpkgs/socket_wrapper/template               | 22 +++++++++++++
 2 files changed, 55 insertions(+)
 create mode 100644 srcpkgs/socket_wrapper/patches/socket_wrapper-fix-for-cmocka-1.1.6.patch
 create mode 100644 srcpkgs/socket_wrapper/template

diff --git a/srcpkgs/socket_wrapper/patches/socket_wrapper-fix-for-cmocka-1.1.6.patch b/srcpkgs/socket_wrapper/patches/socket_wrapper-fix-for-cmocka-1.1.6.patch
new file mode 100644
index 00000000000000..1e1ef9894ddff1
--- /dev/null
+++ b/srcpkgs/socket_wrapper/patches/socket_wrapper-fix-for-cmocka-1.1.6.patch
@@ -0,0 +1,33 @@
+From 97fe09e583f6e2ef94623c872e0c56bcd8817303 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Fri, 17 Feb 2023 17:51:27 +0100
+Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
+---
+ tests/CMakeLists.txt | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 6c3aae9..3748461 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -7,6 +7,11 @@ include_directories(
+   ${CMOCKA_INCLUDE_DIR}
+ )
+ 
++# Required for cmocka >= 1.1.6
++if (TARGET cmocka::cmocka)
++    set(CMOCKA_LIBRARY cmocka::cmocka)
++endif()
++
+ set(TORTURE_LIBRARY torture)
+ 
+ # RFC862 echo server
+-- 
+2.39.2
+
diff --git a/srcpkgs/socket_wrapper/template b/srcpkgs/socket_wrapper/template
new file mode 100644
index 00000000000000..45d462668c5c4f
--- /dev/null
+++ b/srcpkgs/socket_wrapper/template
@@ -0,0 +1,22 @@
+# Template file for 'socket_wrapper'
+pkgname=socket_wrapper
+version=1.4.2
+revision=1
+archs="~*-musl" # socket_wrapper redefines libc funcs, you can't do that on musl
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Library for passing all socket communications through unix sockets"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="http://cwrap.org/socket_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=0a08ec249dd9ffbb3b16d577b352d573561f57beeec3596182ac6ec8e46b9ab6
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 82755658fbbab5afac1670d4161ac52500500a6b Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 10:21:20 +0300
Subject: [PATCH 6/8] New package: nss_wrapper-1.1.15.

---
 .../nss_wrapper-fix-for-cmocka-1.1.6.patch    | 31 +++++++++++++++++++
 srcpkgs/nss_wrapper/template                  | 27 ++++++++++++++++
 2 files changed, 58 insertions(+)
 create mode 100644 srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch
 create mode 100644 srcpkgs/nss_wrapper/template

diff --git a/srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch b/srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch
new file mode 100644
index 00000000000000..ba2589be2d0834
--- /dev/null
+++ b/srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch
@@ -0,0 +1,31 @@
+From 2c879a0ffa70cee33329291d7576ec971d420da2 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Fri, 17 Feb 2023 17:51:27 +0100
+Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
+---
+ tests/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 3b94076..733cc4e 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ project(tests C)
+ 
++if (TARGET cmocka::cmocka)
++    set(CMOCKA_LIBRARY cmocka::cmocka)
++endif()
++
+ set(TESTSUITE_LIBRARIES nss_utils ${NWRAP_REQUIRED_LIBRARIES} ${CMOCKA_LIBRARY})
+ string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
+ 
+-- 
+2.39.2
+
diff --git a/srcpkgs/nss_wrapper/template b/srcpkgs/nss_wrapper/template
new file mode 100644
index 00000000000000..94fa88b333cda9
--- /dev/null
+++ b/srcpkgs/nss_wrapper/template
@@ -0,0 +1,27 @@
+# Template file for 'nss_wrapper'
+pkgname=nss_wrapper
+version=1.1.15
+revision=1
+archs="~*-musl" # complains about the getXXent_r functions missing
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Wrapper for the user, group and hosts NSS API"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="http://cwrap.org/nss_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=36f874832a4f2158e04f69aa77e5515e16cf6e3bf81968d5dd8496db7d6906ad
+
+if [ "$XBPS_TARGET_LIBC" = glibc ]; then
+	makedepends+=" libxcrypt-devel"
+fi
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel uid_wrapper"
+	checkdepends+=" cmocka"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 7204447f805750196d898b43a42152a7ad778321 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 10:22:30 +0300
Subject: [PATCH 7/8] New package: resolv_wrapper-1.1.8

---
 .../resolv_wrapper-fix-for-cmocka-1.1.6.patch | 31 +++++++++++++++++++
 srcpkgs/resolv_wrapper/template               | 23 ++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100644 srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch
 create mode 100644 srcpkgs/resolv_wrapper/template

diff --git a/srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch b/srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch
new file mode 100644
index 00000000000000..5640be33053a8c
--- /dev/null
+++ b/srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch
@@ -0,0 +1,31 @@
+From f2e7f58025ecb4cf399494166abea01813b1d0f0 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Fri, 17 Feb 2023 17:51:27 +0100
+Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
+---
+ tests/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 1262bed..7f2f4ee 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ project(tests C)
+ 
++if (TARGET cmocka::cmocka)
++    set(CMOCKA_LIBRARY cmocka::cmocka)
++endif()
++
+ set(TORTURE_LIBRARY torture)
+ 
+ # A simple DNS server for testing
+-- 
+2.34.1
+
diff --git a/srcpkgs/resolv_wrapper/template b/srcpkgs/resolv_wrapper/template
new file mode 100644
index 00000000000000..4e1215c7b69867
--- /dev/null
+++ b/srcpkgs/resolv_wrapper/template
@@ -0,0 +1,23 @@
+# Template file for 'resolv_wrapper'
+pkgname=resolv_wrapper
+version=1.1.8
+revision=1
+archs="~*-musl" # missing res_ninit, res_nclose, etc
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Wrapper for DNS name resolving or DNS faking"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="https://cwrap.org/resolv_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=fbc30f77da3e12ecd4ef66ccf5ab77e0b744930ccd89062404082f928a8ec2e0
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel socket_wrapper"
+	checkdepends+=" cmocka"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 557420eb739aaeb19681676950643d3a55d911a3 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 13:06:38 +0300
Subject: [PATCH 8/8] samba: update to 4.20.1.

This also builds and packages the io_uring VFS and more importantly the
AD Domain Control part of Samba.
---
 common/shlibs                                 |   2 +-
 srcpkgs/samba-dc                              |   1 +
 srcpkgs/samba-iouring                         |   1 +
 srcpkgs/samba/patches/fix-glibc-2.36.patch    |  59 --------
 srcpkgs/samba/patches/missing-headers.patch   |  52 -------
 srcpkgs/samba/patches/netdb-defines.patch     |  19 ---
 .../patches/samba-bgqd-include-signal-h.patch |  14 ++
 srcpkgs/samba/template                        | 140 +++++++++++-------
 8 files changed, 105 insertions(+), 183 deletions(-)
 create mode 120000 srcpkgs/samba-dc
 create mode 120000 srcpkgs/samba-iouring
 delete mode 100644 srcpkgs/samba/patches/fix-glibc-2.36.patch
 delete mode 100644 srcpkgs/samba/patches/missing-headers.patch
 delete mode 100644 srcpkgs/samba/patches/netdb-defines.patch
 create mode 100644 srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch

diff --git a/common/shlibs b/common/shlibs
index ff14234e60cdba..7d5e7d16bfa2c9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4077,7 +4077,7 @@ libdcerpc-binding.so.0 samba-libs-4.13.2_1
 libndr-krb5pac.so.0 samba-libs-4.13.2_1
 libndr-nbt.so.0 samba-libs-4.13.2_1
 libndr-standard.so.0 samba-libs-4.13.2_1
-libndr.so.1 samba-libs-4.13.2_1
+libndr.so.4 samba-libs-4.20.1_1
 libsamba-credentials.so.1 samba-libs-4.13.2_1
 libsamba-errors.so.1 samba-libs-4.13.2_1
 libsamba-hostconfig.so.0 samba-libs-4.13.2_1
diff --git a/srcpkgs/samba-dc b/srcpkgs/samba-dc
new file mode 120000
index 00000000000000..cba1f39180b3aa
--- /dev/null
+++ b/srcpkgs/samba-dc
@@ -0,0 +1 @@
+samba
\ No newline at end of file
diff --git a/srcpkgs/samba-iouring b/srcpkgs/samba-iouring
new file mode 120000
index 00000000000000..cba1f39180b3aa
--- /dev/null
+++ b/srcpkgs/samba-iouring
@@ -0,0 +1 @@
+samba
\ No newline at end of file
diff --git a/srcpkgs/samba/patches/fix-glibc-2.36.patch b/srcpkgs/samba/patches/fix-glibc-2.36.patch
deleted file mode 100644
index beb84ce6a8ded2..00000000000000
--- a/srcpkgs/samba/patches/fix-glibc-2.36.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 766151bf5b7ef95ae4c8c98b8994e5c21c5bbec0 Mon Sep 17 00:00:00 2001
-From: Andreas Schneider <asn@samba.org>
-Date: Tue, 2 Aug 2022 07:55:46 +0200
-Subject: [PATCH] lib:replace: Only include <sys/mount.h> on non-Linux systems
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Details at:
-https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
-
-BUG: https://bugzilla.samba.org/show_bug.cgi?id=15132
-
-Signed-off-by: Andreas Schneider <asn@samba.org>
-Reviewed-by: Ralph Boehme <slow@samba.org>
-
-Autobuild-User(master): Ralph Böhme <slow@samba.org>
-Autobuild-Date(master): Tue Aug  2 11:05:14 UTC 2022 on sn-devel-184
----
- lib/replace/system/filesys.h | 4 +++-
- lib/replace/wscript          | 3 +++
- 2 files changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/lib/replace/system/filesys.h b/lib/replace/system/filesys.h
-index 034e5d5886c..bb9482c69af 100644
---- a/lib/replace/system/filesys.h
-+++ b/lib/replace/system/filesys.h
-@@ -36,7 +36,8 @@
- #include <sys/param.h>
- #endif
- 
--#ifdef HAVE_SYS_MOUNT_H
-+/* This include is required on UNIX (*BSD, AIX, ...) for statfs() */
-+#if !defined(LINUX) && defined(HAVE_SYS_MOUNT_H)
- #include <sys/mount.h>
- #endif
- 
-@@ -44,6 +45,7 @@
- #include <mntent.h>
- #endif
- 
-+/* This include is required on Linux for statfs() */
- #ifdef HAVE_SYS_VFS_H
- #include <sys/vfs.h>
- #endif
-diff --git a/lib/replace/wscript b/lib/replace/wscript
-index 4c774d9f0c3..dd9b19219a1 100644
---- a/lib/replace/wscript
-+++ b/lib/replace/wscript
-@@ -31,6 +31,9 @@ def configure(conf):
- 
-     conf.env.standalone_replace = conf.IN_LAUNCH_DIR()
- 
-+    if sys.platform.rfind('linux') > -1:
-+        conf.DEFINE('LINUX', '1')
-+
-     conf.DEFINE('BOOL_DEFINED', 1)
-     conf.DEFINE('HAVE_LIBREPLACE', 1)
-     conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
diff --git a/srcpkgs/samba/patches/missing-headers.patch b/srcpkgs/samba/patches/missing-headers.patch
deleted file mode 100644
index 820d7ecd903fbc..00000000000000
--- a/srcpkgs/samba/patches/missing-headers.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-diff --git lib/param/loadparm.h lib/param/loadparm.h
-index b5d79b9..3f4eae0 100644
---- a/lib/param/loadparm.h
-+++ b/lib/param/loadparm.h
-@@ -31,6 +31,7 @@
- #define _LOADPARM_H
- 
- #include <talloc.h>
-+#include <time.h>
- 
- struct parmlist_entry {
- 	struct parmlist_entry *prev, *next;
-diff --git source3/lib/system_smbd.c source3/lib/system_smbd.c
-index 3b1ac9c..4044d75 100644
---- a/source3/lib/system_smbd.c
-+++ b/source3/lib/system_smbd.c
-@@ -27,6 +27,8 @@
- #include "system/passwd.h"
- #include "nsswitch/winbind_client.h"
- #include "../lib/util/setid.h"
-+#include <grp.h>
-+#include <uuid/uuid.h>
- 
- #ifndef HAVE_GETGROUPLIST
- 
-diff --git source4/torture/local/nss_tests.c source4/torture/local/nss_tests.c
-index 2cd6122..0c84ec2 100644
---- a/source4/torture/local/nss_tests.c
-+++ b/source4/torture/local/nss_tests.c
-@@ -20,6 +20,8 @@
- */
- 
- #include "includes.h"
-+#include <grp.h>
-+#include <uuid/uuid.h>
- 
- #include "torture/torture.h"
- #include "torture/local/proto.h"
- 
-diff --git ctdb/tests/src/protocol_util_test.c ctdb/tests/src/protocol_util_test.c
-index edd2a34..48ce96e 100644
---- a/ctdb/tests/src/protocol_util_test.c
-+++ b/ctdb/tests/src/protocol_util_test.c
-@@ -20,6 +20,7 @@
- #include "replace.h"
- #include "system/network.h"
-
-+#include <unistd.h>
- #include <assert.h>
-
- #include "protocol/protocol_basic.c"
-
diff --git a/srcpkgs/samba/patches/netdb-defines.patch b/srcpkgs/samba/patches/netdb-defines.patch
deleted file mode 100644
index 15f79eebfb6ac1..00000000000000
--- a/srcpkgs/samba/patches/netdb-defines.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff --git nsswitch/wins.c nsswitch/wins.c
-index dccb6dd..bb24acb 100644
---- a/nsswitch/wins.c
-+++ b/nsswitch/wins.c
-@@ -39,6 +39,14 @@ static pthread_mutex_t wins_nss_mutex = PTHREAD_MUTEX_INITIALIZER;
- #define INADDRSZ 4
- #endif
- 
-+#ifndef NETDB_INTERNAL
-+#define NETDB_INTERNAL -1
-+#endif
-+
-+#ifndef NETDB_SUCCESS
-+#define NETDB_SUCCESS 0
-+#endif
-+
- NSS_STATUS _nss_wins_gethostbyname_r(const char *hostname,
- 				     struct hostent *he,
- 				     char *buffer,
diff --git a/srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch b/srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch
new file mode 100644
index 00000000000000..10dc1278cdc769
--- /dev/null
+++ b/srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch
@@ -0,0 +1,14 @@
+SIGTERM and SIGPIPE are used but undefined.
+diff --git a/source3/printing/samba-bgqd.c b/source3/printing/samba-bgqd.c
+index 8ac6ec5..09a5d12 100644
+--- a/source3/printing/samba-bgqd.c
++++ b/source3/printing/samba-bgqd.c
+@@ -40,6 +40,7 @@
+ #include "source3/lib/util_procid.h"
+ #include "source3/auth/proto.h"
+ #include "source3/printing/queue_process.h"
+ #include "source3/lib/substitute.h"
++#include <signal.h>
+ 
+ static void watch_handler(struct tevent_req *req)
+ {
diff --git a/srcpkgs/samba/template b/srcpkgs/samba/template
index 20af96624fdc2b..9dbd70674ec4fc 100644
--- a/srcpkgs/samba/template
+++ b/srcpkgs/samba/template
@@ -1,69 +1,73 @@
 # Template file for 'samba'
 pkgname=samba
-version=4.14.12
-revision=5
+version=4.20.1
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
-_idmap_modules="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2"
-_pdb_modules="pdb_tdbsam,pdb_ldap,pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4"
-_auth_modules="auth_unix,auth_wbc,auth_server,auth_netlogind,autH_script,auth_samba4"
-configure_args="--enable-fhs --sbindir=/usr/bin
- --localstatedir=/var --sysconfdir=/etc --with-piddir=/run/samba
+_idmap_modules="idmap_ad,idmap_rid,idmap_ldap,idmap_hash,idmap_tdb2"
+_pdb_modules="pdb_tdbsam,pdb_ldap,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4"
+_auth_modules="auth_unix,auth_wbc,auth_server,auth_samba4,auth_skel"
+_vfs_modules="vfs_io_uring"
+configure_args="--enable-fhs --sysconfdir=/etc --localstatedir=/var
+ --sbindir=/usr/bin --with-privatelibdir=/usr/lib
+ --with-privatedir=/etc/samba/private --with-piddir=/run/samba
  --with-sockets-dir=/run/samba --with-lockdir=/run/lock/samba
- --with-privatedir=/etc/samba/private --with-pammodulesdir=/usr/lib/security
- --with-modulesdir=/usr/lib/samba --disable-rpath --disable-rpath-install
- --without-systemd --without-gettext --bundled-libraries=NONE
- --with-system-mitkrb5 --without-ad-dc --with-cluster-support
- --with-shared-modules=${_idmap_modules},${_pdb_modules},${_auth_modules}"
-hostmakedepends="pkg-config perl-Parse-Yapp rpcsvc-proto docbook2x
- libtasn1-tools tdb-python3 tevent-python3 talloc-python3 python3-setuptools"
+ --disable-rpath --disable-rpath-install --nopyc --nopyo
+ --without-gettext --without-systemd --without-gpgme
+ --with-cluster-support --with-system-mitkrb5 --with-experimental-mit-ad-dc
+ --bundled-libraries=NONE --builtin-libraries=NONE
+ --with-shared-modules=${_idmap_modules},${_pdb_modules},${_auth_modules},${_vfs_modules}"
+hostmakedepends="pkg-config perl-Parse-Yapp rpcsvc-proto docbook-xsl libxslt
+ libtasn1-tools tdb-python3 tevent-python3 talloc-python3 ldb-python3 flex
+ bison mit-krb5 python3-Markdown python3-dnspython"
 makedepends="python3-devel libtirpc-devel popt-devel e2fsprogs-devel
  mit-krb5-devel pam-devel acl-devel cups-devel avahi-libs-devel tdb-devel
  talloc-devel tevent-devel ldb-devel cmocka-devel gnutls-devel zlib-devel
- ncurses-devel libldap-devel libarchive-devel jansson-devel"
+ ncurses-devel libldap-devel libarchive-devel jansson-devel liburing-devel"
 short_desc="SMB/CIFS file, print, and login server for Unix"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.samba.org"
 distfiles="https://download.samba.org/pub/samba/stable/${pkgname}-${version}.tar.gz"
-checksum=155d9c2dfb06a18104422987590858bfe5e9783ebebe63882e7e7f07eaaa512d
+checksum=f93c3af5295340d08106c7c0dcfb85e4f85057dfd14587aa8817beb31aff88f7
 lib32disabled=yes
 conf_files="/etc/pam.d/samba /etc/samba/smb.conf"
 make_dirs="/etc/samba/private 0750 root root"
-subpackages="smbclient samba-ctdb samba-cups samba-devel samba-libs samba-python3"
+subpackages="smbclient samba-ctdb samba-cups samba-devel samba-libs
+ samba-python3 samba-dc"
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-	makedepends+=" musl-legacy-compat musl-nscd-devel"
+	makedepends+=" musl-legacy-compat musl-nscd-devel libexecinfo-devel"
 else
 	makedepends+=" glusterfs-devel"
 	subpackages+=" samba-glusterfs"
-fi
 
-# By default, samba wants to install a bunch of private "*-samba4.so" shared
-# libraries that leak into shlib_requires dependencies. Most of these can be
-# built into the public shared libraries, avoiding the mess of tracking shlibs
-# that shouldn't be exposed locally. For those that cannot be built in, make
-# sure to install them into /usr/lib so xbps-src picks them up.
-_privlibs="CHARSET3 MESSAGING_SEND MESSAGING LIBWBCLIENT_OLD addns ads \
- asn1util auth authkrb5 cmdline_contexts cmdline-credentials cli_cldap \
- cli-ldap-common cli-nbt cli_smb_common cli_spoolss clidns common-auth \
- ctdb-event-client dbwrap dcerpc-pkt-auth events genrand gensec gse http \
- interfaces krb5samba ldbsamba libcli_lsa3 libcli_netlogon3 libsmb \
- messages_dgm messages_util mscat msghdr msrpc3 netif npa_tstream popt_samba3 \
- popt_samba3_cmdline registry replace samba-cluster-support samba-debug \
- samba-modules samba-security samba-sockets samba3-util samdb-common secrets3 \
- server_id_db server-role smbclient-raw smbd_shim socket-blocking sys_rw \
- talloc_report_printf talloc_report tevent-util time-basic trusts_util \
- util_reg util_setid util_tdb"
-configure_args+=" --with-privatelibdir=/usr/lib --builtin-libraries=${_privlibs// /,}"
+	if [ "$XBPS_CHECK_PKGS" ]; then
+		configure_args+=" --enable-selftest"
+		hostmakedepends+=" python3-cryptography python3-iso8601
+		 python3-pyasn1"
+		makedepends+=" nss_wrapper pam_wrapper resolv_wrapper
+		  socket_wrapper uid_wrapper"
+	fi
+fi
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
+export PYTHONHASHSEED=1
 
 post_patch() {
 	# Look for properly named python support libraries
 	vsed -i third_party/waf/waflib/Tools/python.py \
-		-e "/env.pyext_PATTERN/s/dct\['SO'\]/'.so'/"
+		-e "s|env.pyext_PATTERN = .*$|env.pyext_PATTERN = '%s.so'|g"
+
+	# Fix for our `kdb` linking against the system `db` package which
+	# doesn't distribute a pkg-config file and the samba build scripts just
+	# can't handle that.
+	cat >>wscript_configure_system_mitkrb5 <<_EOF
+if ("db" in conf.env["LIB_KDB5"]
+      and not conf.check_cfg(package="db", mandatory=False)):
+    krb5_define_syslib(conf, "db", [])
+_EOF
 
 	# Fix log and spool locations in conf file
 	vsed -i examples/smb.conf.default \
@@ -90,6 +94,8 @@ post_install() {
 	vmkdir usr/lib/cups/backend
 	ln -fs /usr/bin/smbspool ${DESTDIR}/usr/lib/cups/backend/smb
 
+	vinstall packaging/printing/smbprint 744 usr/bin/
+
 	# Do not ship sudo rule that grants nopasswd privileges by default
 	rm -rf ${DESTDIR}/etc/sudoers.d
 
@@ -110,10 +116,9 @@ smbclient_package() {
 		local _t _tools
 
 		# These utilities have man pages in section 1
-		_tools="findsmb dbwrap_tool mdfind mvxattr nmblookup ntlm_auth
-		 oLschema2ldif regdiff regpatch regshell regtree rpcclient
-		 sharesec smbcacls smbclient smbcquotas smbget smbtar smbtree
-		 wbinfo"
+		_tools="dbwrap_tool mdsearch mvxattr nmblookup oLschema2ldif
+		regdiff regpatch regshell rpcclient sharesec smbcacls smbclient
+		smbcquotas smbget smbtar smbtree wspsearch"
 
 		for _t in ${_tools}; do
 			vmove usr/bin/${_t}
@@ -127,11 +132,9 @@ smbclient_package() {
 			vmove usr/share/man/man8/${_t}.8
 		done
 
-		# No man page for this one
+		# No man page for these
 		vmove usr/bin/dumpmscat
-
-		# Extra man page for smbget
-		vmove usr/share/man/man5/smbgetrc.5
+		vmove usr/bin/smbprint
 
 		vmove usr/libexec/samba/smbspool_krb5_wrapper
 		vmove usr/share/man/man8/smbspool_krb5_wrapper.8
@@ -171,19 +174,40 @@ samba-libs_package() {
 	replaces="libsmbclient>=0"
 	pkg_install() {
 		local _libs _privlibs _lib
-		_libs="dcerpc dcerpc-binding ndr-krb5pac ndr-nbt ndr-standard ndr
-		 samba-credentials samba-errors samba-hostconfig samba-passdb
-		 samba-util samdb smbclient smbconf smbldap wbclient"
-		_privlibs="cli-ldap cliauth cluster common-auth dcerpc-samba
-		 flag-mapping gpo iov-buf ndr-samba ndr printer-driver
-		 smb-transport tdb-wrap util-cmdline winbind-client"
+		_libs="dcerpc dcerpc-binding dcerpc-samr dcerpc-server
+		 dcerpc-server-core ndr ndr-krb5pac ndr-nbt ndr-standard netapi
+		 nss_winbind nss_wins samba-credentials samba-errors
+		 samba-hostconfig samba-passdb samba-policy samba-util samdb
+		 smbclient smbconf smbldap tevent-util wbclient"
+		_privlibs="CHARSET3 LIBWBCLIENT-OLD MESSAGING MESSAGING-SEND
+		 REG-FULL RPC-SERVER-LOOP RPC-WORKER ad-claims addns ads
+		 asn1util auth auth-unix-token auth4 authkrb5 authn-policy-util
+		 cli-cldap cli-ldap cli-ldap-common cli-nbt cli-smb-common
+		 cli-spoolss cliauth clidns cluster cmdline cmdline-contexts
+		 common-auth ctdb-event-client db-glue dbwrap dcerpc-pkt-auth
+		 dcerpc-samba dcerpc-samba4 dfs-server-ad dlz-bind9-for-torture
+		 dnsserver-common dsdb-garbage-collect-tombstones dsdb-module
+		 events flag-mapping genrand gensec gpext gpo gse http idmap
+		 interfaces iov-buf krb5samba ldbsamba libcli-lsa3
+		 libcli-netlogon3 libsmb messages-dgm messages-util mscat
+		 msghdr msrpc3 ndr-samba ndr-samba4 net-keytab netif
+		 npa-tstream nss-info pac posix-eadb printer-driver
+		 printing-migrate process-model registry replace
+		 samba-cluster-support samba-debug samba-modules samba-net
+		 samba-python samba-security samba-sockets samba3-util
+		 samdb-common scavenge-dns-records secrets3 server-id-db
+		 server-role service shares smb-transport smbclient-raw
+		 smbd-base smbd-shim smbldaphelper smbpasswdparser
+		 socket-blocking stable-sort sys-rw talloc-report
+		 talloc-report-printf tdb-wrap time-basic torture trusts-util
+		 util-reg util-setid util-tdb xattr-tdb"
 
 		for _lib in ${_libs}; do
 			vmove "usr/lib/lib${_lib}.so.*"
 		done
 
 		for _lib in ${_privlibs}; do
-			vmove "usr/lib/lib${_lib}-samba4.so"
+			vmove "usr/lib/lib${_lib}-private-samba.so"
 		done
 
 		vmove usr/share/man/man7/libsmbclient.7
@@ -209,6 +233,9 @@ samba-devel_package() {
 }
 
 samba-python3_package() {
+	depends="samba-libs>=${version}_${revision} ldb-python3
+	 talloc-python3 tdb-python3 tevent-python3 python3-cryptography
+	 python3-dnspython python3-Markdown python3-requests"
 	short_desc+=" - Python3 bindings"
 	pkg_install() {
 		vmove ${py3_lib}
@@ -222,3 +249,12 @@ samba-glusterfs_package() {
 		vmove usr/share/man/man8/vfs_glusterfs.8
 	}
 }
+
+samba-dc_package() {
+	depends="samba-python3>=${version}_${revision}"
+	short_desc+=" - AD Domain Controller"
+	pkg_install() {
+		vmove "usr/bin/samba*"
+		vmove usr/share/samba
+	}
+}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PR PATCH] [Updated] samba: update to 4.20.1.
  2024-05-22 10:43 [PR PATCH] samba: update to 4.20.1 otommod
@ 2024-05-23  8:15 ` otommod
  2024-05-23  8:17 ` otommod
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: otommod @ 2024-05-23  8:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2130 bytes --]

There is an updated pull request by otommod against master on the void-packages repository

https://github.com/otommod/void-packages samba-4.20.1
https://github.com/void-linux/void-packages/pull/50464

samba: update to 4.20.1.
I don't have much experience with packaging and none with `Void Linux` packaging in particular, especially with a big project like Samba, so I'm not sure this is production ready yet.

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
- I built this PR locally for these architectures:
  - x86_64
  - aarch64
  - aarch64-musl

#### Questions & notes
  - `samba-libs` has a ton of private libraries that I could not build as builtin this time. Should I add all of them to `common/shlibs`?
  - I packaged `{uid,socket,nss,resolv}_wrapper` since they are needed by the `samba` testsuite but they can also be bundled in... Do we really need them? They are not used by anything else (yet).  On the other hand, `pam_wrapper`, that is also needed, is already in the repository.
  - On a related note, I tried to build the aforementioned testsuite but it ended up with a `cmocka` related build failure (`LargestIntegralType` was not defined). It did build successfully when `cmocka` was build as a bundled library though.
  - Should we break the `samba` package up? Fedora/Debian have a ton of subpackages for it and even Alpine has a few more than us.

A patch file from https://github.com/void-linux/void-packages/pull/50464.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-samba-4.20.1-50464.patch --]
[-- Type: text/x-diff, Size: 37502 bytes --]

From e10919b7cc9a0d3253f21e889ddead86aaf12404 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Mon, 20 May 2024 15:51:28 +0300
Subject: [PATCH 1/8] tevent: update to 0.16.1.

---
 .../tevent/patches/fix-public-headers.patch   | 13 ----------
 srcpkgs/tevent/template                       | 25 +++++++++++++------
 2 files changed, 17 insertions(+), 21 deletions(-)
 delete mode 100644 srcpkgs/tevent/patches/fix-public-headers.patch

diff --git a/srcpkgs/tevent/patches/fix-public-headers.patch b/srcpkgs/tevent/patches/fix-public-headers.patch
deleted file mode 100644
index 1710226d4580c9..00000000000000
--- a/srcpkgs/tevent/patches/fix-public-headers.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-tevent.h needs sys/types.h for pid_t
-
---- a/tevent.h	2018-07-12 05:51:30.000000000 +0000
-+++ b/tevent.h	2018-07-19 10:13:15.360128807 +0000
-@@ -31,6 +31,7 @@
- #include <stdint.h>
- #include <talloc.h>
- #include <sys/time.h>
-+#include <sys/types.h>
- #include <stdbool.h>
- 
- struct tevent_context;
-
diff --git a/srcpkgs/tevent/template b/srcpkgs/tevent/template
index 7dadd564db0bf5..1a3f49d8bb8d0b 100644
--- a/srcpkgs/tevent/template
+++ b/srcpkgs/tevent/template
@@ -1,28 +1,37 @@
 # Template file for 'tevent'
 pkgname=tevent
-version=0.11.0
-revision=3
+version=0.16.1
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
 configure_args="--sysconfdir=/etc --localstatedir=/var
  --disable-rpath --disable-rpath-install --without-gettext
  --builtin-libraries=replace --bundled-libraries=NONE"
-hostmakedepends="pkg-config docbook2x python3-setuptools"
-makedepends="python3-devel talloc-devel libxslt gettext-devel cmocka-devel"
+hostmakedepends="pkg-config docbook-xsl libxslt"
+makedepends="python3-devel talloc-devel cmocka-devel"
 short_desc="Event system based on the talloc memory management library"
 maintainer="Yuusha Spacewolf <xyuusha@paranoici.org>"
 license="GPL-3.0-or-later"
 homepage="https://tevent.samba.org"
 distfiles="https://download.samba.org/pub/tevent/tevent-${version}.tar.gz"
-checksum=ee9a86c8e808aac2fe1e924eaa139ff7f0269d0e8e4fafa850ae5c7489bc82ba
+checksum=362971e0f32dc1905f6fe4736319c4b8348c22dc85aa6c3f690a28efe548029e
+
+if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
+	makedepends+=" libxcrypt-devel"
+fi
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
+export PYTHONHASHSEED=1
+
+do_check() {
+	${configure_script} test
+}
 
 post_patch() {
-	# Avoid Python shlib extension noise in libpytallic-util.so
-	vsed -e "/env.pyext_PATTERN/s/dct\['SO'\]/'.so'/" \
-		-i third_party/waf/waflib/Tools/python.py
+	# Look for properly named python support libraries
+	vsed -i third_party/waf/waflib/Tools/python.py \
+		-e "s|env.pyext_PATTERN = .*$|env.pyext_PATTERN = '%s.so'|"
 }
 
 tevent-python3_package() {

From 048f2bd26d3101dc843d46a36a9b9a662e88a9e6 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Mon, 20 May 2024 18:06:26 +0300
Subject: [PATCH 2/8] tdb: update to 1.4.10.

---
 srcpkgs/tdb/template | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/tdb/template b/srcpkgs/tdb/template
index 0134d2dcc2fb91..6d1c3039ed914f 100644
--- a/srcpkgs/tdb/template
+++ b/srcpkgs/tdb/template
@@ -1,21 +1,25 @@
 # Template file for 'tdb'
 pkgname=tdb
-version=1.4.9
-revision=2
+version=1.4.10
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
-configure_args="--prefix=/usr --libdir=/usr/lib --sysconfdir=/etc
- --localstatedir=/var --disable-rpath --disable-rpath-install
- --builtin-libraries=replace --bundled-libraries=NONE --without-gettext"
-hostmakedepends="pkg-config docbook2x"
-makedepends="python3-devel libxslt gettext-devel"
+configure_args="--sysconfdir=/etc --localstatedir=/var
+ --disable-rpath --disable-rpath-install --without-gettext
+ --builtin-libraries=replace --bundled-libraries=NONE"
+hostmakedepends="pkg-config docbook-xsl libxslt"
+makedepends="python3-devel"
 short_desc="Trivial Database, similar to GDBM but allows simultaneous commits"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="https://tdb.samba.org/"
 distfiles="https://download.samba.org/pub/tdb/tdb-${version}.tar.gz"
-checksum=0ac226073e3a2db8648da7af744cb95f50766a52feeb001d558b2b321b74a765
+checksum=02338e33c16c21c9e29571cef523e76b2b708636254f6f30c6cf195d48c62daf
+
+if [ "$XBPS_TARGET_LIBC" = glibc ]; then
+	makedepends+=" libxcrypt-devel"
+fi
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
 export PYTHONHASHSEED=1

From cc4f2ad03ce2f92ae72a14f4afa25b0502efb550 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Mon, 20 May 2024 18:20:57 +0300
Subject: [PATCH 3/8] ldb: update to 2.9.0.

---
 srcpkgs/ldb/patches/strtoull.patch | 89 ++++++++++++++++++++++++++++++
 srcpkgs/ldb/template               | 29 +++++-----
 2 files changed, 104 insertions(+), 14 deletions(-)
 create mode 100644 srcpkgs/ldb/patches/strtoull.patch

diff --git a/srcpkgs/ldb/patches/strtoull.patch b/srcpkgs/ldb/patches/strtoull.patch
new file mode 100644
index 00000000000000..2fcd928a3d143c
--- /dev/null
+++ b/srcpkgs/ldb/patches/strtoull.patch
@@ -0,0 +1,89 @@
+diff --git a/lib/replace/replace.c b/lib/replace/replace.c
+index 0652cb4..02b6ebf 100644
+--- a/lib/replace/replace.c
++++ b/lib/replace/replace.c
+@@ -559,41 +559,6 @@ long long int rep_strtoll(const char *str, char **endptr, int base)
+ #endif /* HAVE_STRTOLL */
+ 
+ 
+-#ifndef HAVE_STRTOULL
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
+-{
+-#ifdef HAVE_STRTOUQ
+-	return strtouq(str, endptr, base);
+-#elif defined(HAVE___STRTOULL) 
+-	return __strtoull(str, endptr, base);
+-#elif SIZEOF_LONG == SIZEOF_LONG_LONG
+-	return (unsigned long long int) strtoul(str, endptr, base);
+-#else
+-# error "You need a strtoull function"
+-#endif
+-}
+-#else
+-#ifdef HAVE_BSD_STRTOLL
+-#undef strtoull
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
+-{
+-	int saved_errno = errno;
+-	unsigned long long int nb = strtoull(str, endptr, base);
+-	/* With glibc EINVAL is only returned if base is not ok */
+-	if (errno == EINVAL) {
+-		if (base == 0 || (base >1 && base <37)) {
+-			/* Base was ok so it's because we were not
+-			 * able to make the conversion.
+-			 * Let's reset errno.
+-			 */
+-			errno = saved_errno;
+-		}
+-	}
+-	return nb;
+-}
+-#endif /* HAVE_BSD_STRTOLL */
+-#endif /* HAVE_STRTOULL */
+-
+ #ifndef HAVE_SETENV
+ int rep_setenv(const char *name, const char *value, int overwrite) 
+ {
+diff --git a/lib/replace/replace.h b/lib/replace/replace.h
+index a8910e2..854b1a7 100644
+--- a/lib/replace/replace.h
++++ b/lib/replace/replace.h
+@@ -394,16 +394,6 @@ long long int rep_strtoll(const char *str, char **endptr, int base);
+ #endif
+ #endif
+ 
+-#ifndef HAVE_STRTOULL
+-#define strtoull rep_strtoull
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base);
+-#else
+-#ifdef HAVE_BSD_STRTOLL /* yes, it's not HAVE_BSD_STRTOULL */
+-#define strtoull rep_strtoull
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base);
+-#endif
+-#endif
+-
+ #ifndef HAVE_FTRUNCATE
+ #define ftruncate rep_ftruncate
+ int rep_ftruncate(int,off_t);
+diff --git a/lib/replace/wscript b/lib/replace/wscript
+index 4c774d9..a1dc6d0 100644
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -411,7 +411,7 @@ def configure(conf):
+     conf.CHECK_FUNCS('initgroups pread pwrite strndup strcasestr strsep')
+     conf.CHECK_FUNCS('strtok_r mkdtemp dup2 dprintf vdprintf isatty chown lchown')
+     conf.CHECK_FUNCS('link readlink symlink realpath snprintf vsnprintf')
+-    conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen strtoull __strtoull')
++    conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen')
+     conf.CHECK_FUNCS('strtouq strtoll __strtoll strtoq memalign posix_memalign')
+     conf.CHECK_FUNCS('fmemopen')
+ 
+@@ -866,7 +866,7 @@ REPLACEMENT_FUNCTIONS = {
+                   'memmove', 'strdup', 'setlinebuf', 'vsyslog', 'strnlen',
+                   'strndup', 'waitpid', 'seteuid', 'setegid', 'chroot',
+                   'mkstemp', 'mkdtemp', 'pread', 'pwrite', 'strcasestr',
+-                  'strsep', 'strtok_r', 'strtoll', 'strtoull', 'setenv', 'unsetenv',
++                  'strsep', 'strtok_r', 'strtoll', 'setenv', 'unsetenv',
+                   'utime', 'utimes', 'dup2', 'chown', 'link', 'readlink',
+                   'symlink', 'lchown', 'realpath', 'memmem', 'vdprintf',
+                   'dprintf', 'get_current_dir_name', 'copy_file_range',
diff --git a/srcpkgs/ldb/template b/srcpkgs/ldb/template
index 964a2c33009da0..f3dcb95611ceb4 100644
--- a/srcpkgs/ldb/template
+++ b/srcpkgs/ldb/template
@@ -1,7 +1,7 @@
 # Template file for 'ldb'
 pkgname=ldb
-version=2.3.2
-revision=3
+version=2.9.0
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
@@ -9,28 +9,29 @@ configure_args="--sysconfdir=/etc --localstatedir=/var
  --disable-rpath --disable-rpath-install --without-gettext
  --builtin-libraries=replace --bundled-libraries=NONE
  --with-modulesdir=/usr/lib/ldb/modules"
-hostmakedepends="pkg-config docbook2x tdb-python3 tevent-python3 python3-setuptools"
-makedepends="python3-devel tdb-devel tevent-devel talloc-devel
- popt-devel lmdb-devel libxslt gettext-devel cmocka-devel"
+hostmakedepends="pkg-config docbook-xsl libxslt tdb-python3 tevent-python3"
+makedepends="python3-devel tdb-devel tevent-devel talloc-devel popt-devel
+ lmdb-devel cmocka-devel"
 checkdepends="cmocka-devel"
 short_desc="LDAP-like database from samba"
 maintainer="Yuusha Spacewolf <xyuusha@paranoici.org>"
 license="LGPL-3.0-or-later"
 homepage="https://www.samba.org/ldb/"
 distfiles="https://download.samba.org/pub/ldb/ldb-${version}.tar.gz"
-checksum=1416c949dc4326e41c0d8a5ecf8ef784f8c0b6e9d3dad8fa971e84ad56227603
-
-# workaround for cmocka's broken uintptr_t definition on musl
-if [ "$XBPS_TARGET_WORDSIZE" = "64" -a "$XBPS_TARGET_LIBC" = "musl" ]; then
-	CFLAGS+=" -D__WORDSIZE=64"
-fi
+checksum=105aaff71ad881a7faeb582fd416ae28221b6fde338fff82828065062c2507a5
+make_check=extended # testsuite takes a long time
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
+export PYTHONHASHSEED=1
 
 post_patch() {
-	# Avoid Python shlib extension noise in libpyldb-util.so
-	vsed -e "/env.pyext_PATTERN/s/dct\['SO'\]/'.so'/" \
-		-i third_party/waf/waflib/Tools/python.py
+	# Look for properly named python support libraries
+	vsed -i third_party/waf/waflib/Tools/python.py \
+		-e "s|env.pyext_PATTERN = .*$|env.pyext_PATTERN = '%s.so'|"
+}
+
+do_check() {
+	${configure_script} test ${makejobs}
 }
 
 ldb-python3_package() {

From ba90a0b86f14cbbed6b8306db12ebf178d0decde Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 10:22:00 +0300
Subject: [PATCH 4/8] New package: uid_wrapper-1.3.0.

---
 .../uid_wrapper-fix-for-cmocka-1.1.6.patch    | 31 +++++++++++++++++++
 srcpkgs/uid_wrapper/template                  | 22 +++++++++++++
 2 files changed, 53 insertions(+)
 create mode 100644 srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch
 create mode 100644 srcpkgs/uid_wrapper/template

diff --git a/srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch b/srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch
new file mode 100644
index 00000000000000..c99c3ad6bce663
--- /dev/null
+++ b/srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch
@@ -0,0 +1,31 @@
+From 850f24c6366abda30bfd77734b90330b8809d306 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Fri, 17 Feb 2023 17:51:27 +0100
+Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
+---
+ tests/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 635e86e..68e050e 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ project(tests C)
+ 
++if (TARGET cmocka::cmocka)
++    set(CMOCKA_LIBRARY cmocka::cmocka)
++endif()
++
+ add_library(uwrap_fake_socket_wrapper SHARED uwrap_fake_socket_wrapper.c)
+ target_compile_options(uwrap_fake_socket_wrapper
+                        PRIVATE
+-- 
+2.34.1
+
diff --git a/srcpkgs/uid_wrapper/template b/srcpkgs/uid_wrapper/template
new file mode 100644
index 00000000000000..24a90e93767069
--- /dev/null
+++ b/srcpkgs/uid_wrapper/template
@@ -0,0 +1,22 @@
+# Template file for 'uid_wrapper'
+pkgname=uid_wrapper
+version=1.3.0
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Testing tool to fake privilege separation"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="https://cwrap.org/uid_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=f7e7c1bde533530051931414724453e14e02adbb614824b6fe27cbb98654b762
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel"
+	checkdepends+=" cmocka"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From d7b7b529547d351c383ea3a0821ebf15487ff038 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 11:09:08 +0300
Subject: [PATCH 5/8] New package: socket_wrapper-1.4.2

---
 srcpkgs/socket_wrapper/template | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/socket_wrapper/template

diff --git a/srcpkgs/socket_wrapper/template b/srcpkgs/socket_wrapper/template
new file mode 100644
index 00000000000000..45d462668c5c4f
--- /dev/null
+++ b/srcpkgs/socket_wrapper/template
@@ -0,0 +1,22 @@
+# Template file for 'socket_wrapper'
+pkgname=socket_wrapper
+version=1.4.2
+revision=1
+archs="~*-musl" # socket_wrapper redefines libc funcs, you can't do that on musl
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Library for passing all socket communications through unix sockets"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="http://cwrap.org/socket_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=0a08ec249dd9ffbb3b16d577b352d573561f57beeec3596182ac6ec8e46b9ab6
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 85dbbc13a1fdbd18c65e00436ea7773a7ba9b1b6 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 10:21:20 +0300
Subject: [PATCH 6/8] New package: nss_wrapper-1.1.15.

---
 .../nss_wrapper-fix-for-cmocka-1.1.6.patch    | 31 +++++++++++++++++++
 srcpkgs/nss_wrapper/template                  | 27 ++++++++++++++++
 2 files changed, 58 insertions(+)
 create mode 100644 srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch
 create mode 100644 srcpkgs/nss_wrapper/template

diff --git a/srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch b/srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch
new file mode 100644
index 00000000000000..ba2589be2d0834
--- /dev/null
+++ b/srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch
@@ -0,0 +1,31 @@
+From 2c879a0ffa70cee33329291d7576ec971d420da2 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Fri, 17 Feb 2023 17:51:27 +0100
+Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
+---
+ tests/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 3b94076..733cc4e 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ project(tests C)
+ 
++if (TARGET cmocka::cmocka)
++    set(CMOCKA_LIBRARY cmocka::cmocka)
++endif()
++
+ set(TESTSUITE_LIBRARIES nss_utils ${NWRAP_REQUIRED_LIBRARIES} ${CMOCKA_LIBRARY})
+ string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
+ 
+-- 
+2.39.2
+
diff --git a/srcpkgs/nss_wrapper/template b/srcpkgs/nss_wrapper/template
new file mode 100644
index 00000000000000..94fa88b333cda9
--- /dev/null
+++ b/srcpkgs/nss_wrapper/template
@@ -0,0 +1,27 @@
+# Template file for 'nss_wrapper'
+pkgname=nss_wrapper
+version=1.1.15
+revision=1
+archs="~*-musl" # complains about the getXXent_r functions missing
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Wrapper for the user, group and hosts NSS API"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="http://cwrap.org/nss_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=36f874832a4f2158e04f69aa77e5515e16cf6e3bf81968d5dd8496db7d6906ad
+
+if [ "$XBPS_TARGET_LIBC" = glibc ]; then
+	makedepends+=" libxcrypt-devel"
+fi
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel uid_wrapper"
+	checkdepends+=" cmocka"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 286b941799bca22044334c6e0999fb311ae209e7 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 10:22:30 +0300
Subject: [PATCH 7/8] New package: resolv_wrapper-1.1.8

---
 .../resolv_wrapper-fix-for-cmocka-1.1.6.patch | 31 +++++++++++++++++++
 srcpkgs/resolv_wrapper/template               | 23 ++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100644 srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch
 create mode 100644 srcpkgs/resolv_wrapper/template

diff --git a/srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch b/srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch
new file mode 100644
index 00000000000000..5640be33053a8c
--- /dev/null
+++ b/srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch
@@ -0,0 +1,31 @@
+From f2e7f58025ecb4cf399494166abea01813b1d0f0 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Fri, 17 Feb 2023 17:51:27 +0100
+Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
+---
+ tests/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 1262bed..7f2f4ee 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ project(tests C)
+ 
++if (TARGET cmocka::cmocka)
++    set(CMOCKA_LIBRARY cmocka::cmocka)
++endif()
++
+ set(TORTURE_LIBRARY torture)
+ 
+ # A simple DNS server for testing
+-- 
+2.34.1
+
diff --git a/srcpkgs/resolv_wrapper/template b/srcpkgs/resolv_wrapper/template
new file mode 100644
index 00000000000000..4e1215c7b69867
--- /dev/null
+++ b/srcpkgs/resolv_wrapper/template
@@ -0,0 +1,23 @@
+# Template file for 'resolv_wrapper'
+pkgname=resolv_wrapper
+version=1.1.8
+revision=1
+archs="~*-musl" # missing res_ninit, res_nclose, etc
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Wrapper for DNS name resolving or DNS faking"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="https://cwrap.org/resolv_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=fbc30f77da3e12ecd4ef66ccf5ab77e0b744930ccd89062404082f928a8ec2e0
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel socket_wrapper"
+	checkdepends+=" cmocka"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 7dece34235b4b8f91bc435ff7975a503f5f7d784 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 13:06:38 +0300
Subject: [PATCH 8/8] samba: update to 4.20.1.

This also builds and packages the io_uring VFS and more importantly the
AD Domain Control part of Samba.
---
 common/shlibs                                 |   2 +-
 srcpkgs/samba-dc                              |   1 +
 srcpkgs/samba-iouring                         |   1 +
 srcpkgs/samba/patches/fix-glibc-2.36.patch    |  59 --------
 srcpkgs/samba/patches/missing-headers.patch   |  52 -------
 srcpkgs/samba/patches/netdb-defines.patch     |  19 ---
 .../patches/samba-bgqd-include-signal-h.patch |  14 ++
 srcpkgs/samba/template                        | 140 +++++++++++-------
 8 files changed, 105 insertions(+), 183 deletions(-)
 create mode 120000 srcpkgs/samba-dc
 create mode 120000 srcpkgs/samba-iouring
 delete mode 100644 srcpkgs/samba/patches/fix-glibc-2.36.patch
 delete mode 100644 srcpkgs/samba/patches/missing-headers.patch
 delete mode 100644 srcpkgs/samba/patches/netdb-defines.patch
 create mode 100644 srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch

diff --git a/common/shlibs b/common/shlibs
index ff14234e60cdba..7d5e7d16bfa2c9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4077,7 +4077,7 @@ libdcerpc-binding.so.0 samba-libs-4.13.2_1
 libndr-krb5pac.so.0 samba-libs-4.13.2_1
 libndr-nbt.so.0 samba-libs-4.13.2_1
 libndr-standard.so.0 samba-libs-4.13.2_1
-libndr.so.1 samba-libs-4.13.2_1
+libndr.so.4 samba-libs-4.20.1_1
 libsamba-credentials.so.1 samba-libs-4.13.2_1
 libsamba-errors.so.1 samba-libs-4.13.2_1
 libsamba-hostconfig.so.0 samba-libs-4.13.2_1
diff --git a/srcpkgs/samba-dc b/srcpkgs/samba-dc
new file mode 120000
index 00000000000000..cba1f39180b3aa
--- /dev/null
+++ b/srcpkgs/samba-dc
@@ -0,0 +1 @@
+samba
\ No newline at end of file
diff --git a/srcpkgs/samba-iouring b/srcpkgs/samba-iouring
new file mode 120000
index 00000000000000..cba1f39180b3aa
--- /dev/null
+++ b/srcpkgs/samba-iouring
@@ -0,0 +1 @@
+samba
\ No newline at end of file
diff --git a/srcpkgs/samba/patches/fix-glibc-2.36.patch b/srcpkgs/samba/patches/fix-glibc-2.36.patch
deleted file mode 100644
index beb84ce6a8ded2..00000000000000
--- a/srcpkgs/samba/patches/fix-glibc-2.36.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 766151bf5b7ef95ae4c8c98b8994e5c21c5bbec0 Mon Sep 17 00:00:00 2001
-From: Andreas Schneider <asn@samba.org>
-Date: Tue, 2 Aug 2022 07:55:46 +0200
-Subject: [PATCH] lib:replace: Only include <sys/mount.h> on non-Linux systems
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Details at:
-https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
-
-BUG: https://bugzilla.samba.org/show_bug.cgi?id=15132
-
-Signed-off-by: Andreas Schneider <asn@samba.org>
-Reviewed-by: Ralph Boehme <slow@samba.org>
-
-Autobuild-User(master): Ralph Böhme <slow@samba.org>
-Autobuild-Date(master): Tue Aug  2 11:05:14 UTC 2022 on sn-devel-184
----
- lib/replace/system/filesys.h | 4 +++-
- lib/replace/wscript          | 3 +++
- 2 files changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/lib/replace/system/filesys.h b/lib/replace/system/filesys.h
-index 034e5d5886c..bb9482c69af 100644
---- a/lib/replace/system/filesys.h
-+++ b/lib/replace/system/filesys.h
-@@ -36,7 +36,8 @@
- #include <sys/param.h>
- #endif
- 
--#ifdef HAVE_SYS_MOUNT_H
-+/* This include is required on UNIX (*BSD, AIX, ...) for statfs() */
-+#if !defined(LINUX) && defined(HAVE_SYS_MOUNT_H)
- #include <sys/mount.h>
- #endif
- 
-@@ -44,6 +45,7 @@
- #include <mntent.h>
- #endif
- 
-+/* This include is required on Linux for statfs() */
- #ifdef HAVE_SYS_VFS_H
- #include <sys/vfs.h>
- #endif
-diff --git a/lib/replace/wscript b/lib/replace/wscript
-index 4c774d9f0c3..dd9b19219a1 100644
---- a/lib/replace/wscript
-+++ b/lib/replace/wscript
-@@ -31,6 +31,9 @@ def configure(conf):
- 
-     conf.env.standalone_replace = conf.IN_LAUNCH_DIR()
- 
-+    if sys.platform.rfind('linux') > -1:
-+        conf.DEFINE('LINUX', '1')
-+
-     conf.DEFINE('BOOL_DEFINED', 1)
-     conf.DEFINE('HAVE_LIBREPLACE', 1)
-     conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
diff --git a/srcpkgs/samba/patches/missing-headers.patch b/srcpkgs/samba/patches/missing-headers.patch
deleted file mode 100644
index 820d7ecd903fbc..00000000000000
--- a/srcpkgs/samba/patches/missing-headers.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-diff --git lib/param/loadparm.h lib/param/loadparm.h
-index b5d79b9..3f4eae0 100644
---- a/lib/param/loadparm.h
-+++ b/lib/param/loadparm.h
-@@ -31,6 +31,7 @@
- #define _LOADPARM_H
- 
- #include <talloc.h>
-+#include <time.h>
- 
- struct parmlist_entry {
- 	struct parmlist_entry *prev, *next;
-diff --git source3/lib/system_smbd.c source3/lib/system_smbd.c
-index 3b1ac9c..4044d75 100644
---- a/source3/lib/system_smbd.c
-+++ b/source3/lib/system_smbd.c
-@@ -27,6 +27,8 @@
- #include "system/passwd.h"
- #include "nsswitch/winbind_client.h"
- #include "../lib/util/setid.h"
-+#include <grp.h>
-+#include <uuid/uuid.h>
- 
- #ifndef HAVE_GETGROUPLIST
- 
-diff --git source4/torture/local/nss_tests.c source4/torture/local/nss_tests.c
-index 2cd6122..0c84ec2 100644
---- a/source4/torture/local/nss_tests.c
-+++ b/source4/torture/local/nss_tests.c
-@@ -20,6 +20,8 @@
- */
- 
- #include "includes.h"
-+#include <grp.h>
-+#include <uuid/uuid.h>
- 
- #include "torture/torture.h"
- #include "torture/local/proto.h"
- 
-diff --git ctdb/tests/src/protocol_util_test.c ctdb/tests/src/protocol_util_test.c
-index edd2a34..48ce96e 100644
---- a/ctdb/tests/src/protocol_util_test.c
-+++ b/ctdb/tests/src/protocol_util_test.c
-@@ -20,6 +20,7 @@
- #include "replace.h"
- #include "system/network.h"
-
-+#include <unistd.h>
- #include <assert.h>
-
- #include "protocol/protocol_basic.c"
-
diff --git a/srcpkgs/samba/patches/netdb-defines.patch b/srcpkgs/samba/patches/netdb-defines.patch
deleted file mode 100644
index 15f79eebfb6ac1..00000000000000
--- a/srcpkgs/samba/patches/netdb-defines.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff --git nsswitch/wins.c nsswitch/wins.c
-index dccb6dd..bb24acb 100644
---- a/nsswitch/wins.c
-+++ b/nsswitch/wins.c
-@@ -39,6 +39,14 @@ static pthread_mutex_t wins_nss_mutex = PTHREAD_MUTEX_INITIALIZER;
- #define INADDRSZ 4
- #endif
- 
-+#ifndef NETDB_INTERNAL
-+#define NETDB_INTERNAL -1
-+#endif
-+
-+#ifndef NETDB_SUCCESS
-+#define NETDB_SUCCESS 0
-+#endif
-+
- NSS_STATUS _nss_wins_gethostbyname_r(const char *hostname,
- 				     struct hostent *he,
- 				     char *buffer,
diff --git a/srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch b/srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch
new file mode 100644
index 00000000000000..10dc1278cdc769
--- /dev/null
+++ b/srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch
@@ -0,0 +1,14 @@
+SIGTERM and SIGPIPE are used but undefined.
+diff --git a/source3/printing/samba-bgqd.c b/source3/printing/samba-bgqd.c
+index 8ac6ec5..09a5d12 100644
+--- a/source3/printing/samba-bgqd.c
++++ b/source3/printing/samba-bgqd.c
+@@ -40,6 +40,7 @@
+ #include "source3/lib/util_procid.h"
+ #include "source3/auth/proto.h"
+ #include "source3/printing/queue_process.h"
+ #include "source3/lib/substitute.h"
++#include <signal.h>
+ 
+ static void watch_handler(struct tevent_req *req)
+ {
diff --git a/srcpkgs/samba/template b/srcpkgs/samba/template
index 20af96624fdc2b..9dbd70674ec4fc 100644
--- a/srcpkgs/samba/template
+++ b/srcpkgs/samba/template
@@ -1,69 +1,73 @@
 # Template file for 'samba'
 pkgname=samba
-version=4.14.12
-revision=5
+version=4.20.1
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
-_idmap_modules="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2"
-_pdb_modules="pdb_tdbsam,pdb_ldap,pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4"
-_auth_modules="auth_unix,auth_wbc,auth_server,auth_netlogind,autH_script,auth_samba4"
-configure_args="--enable-fhs --sbindir=/usr/bin
- --localstatedir=/var --sysconfdir=/etc --with-piddir=/run/samba
+_idmap_modules="idmap_ad,idmap_rid,idmap_ldap,idmap_hash,idmap_tdb2"
+_pdb_modules="pdb_tdbsam,pdb_ldap,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4"
+_auth_modules="auth_unix,auth_wbc,auth_server,auth_samba4,auth_skel"
+_vfs_modules="vfs_io_uring"
+configure_args="--enable-fhs --sysconfdir=/etc --localstatedir=/var
+ --sbindir=/usr/bin --with-privatelibdir=/usr/lib
+ --with-privatedir=/etc/samba/private --with-piddir=/run/samba
  --with-sockets-dir=/run/samba --with-lockdir=/run/lock/samba
- --with-privatedir=/etc/samba/private --with-pammodulesdir=/usr/lib/security
- --with-modulesdir=/usr/lib/samba --disable-rpath --disable-rpath-install
- --without-systemd --without-gettext --bundled-libraries=NONE
- --with-system-mitkrb5 --without-ad-dc --with-cluster-support
- --with-shared-modules=${_idmap_modules},${_pdb_modules},${_auth_modules}"
-hostmakedepends="pkg-config perl-Parse-Yapp rpcsvc-proto docbook2x
- libtasn1-tools tdb-python3 tevent-python3 talloc-python3 python3-setuptools"
+ --disable-rpath --disable-rpath-install --nopyc --nopyo
+ --without-gettext --without-systemd --without-gpgme
+ --with-cluster-support --with-system-mitkrb5 --with-experimental-mit-ad-dc
+ --bundled-libraries=NONE --builtin-libraries=NONE
+ --with-shared-modules=${_idmap_modules},${_pdb_modules},${_auth_modules},${_vfs_modules}"
+hostmakedepends="pkg-config perl-Parse-Yapp rpcsvc-proto docbook-xsl libxslt
+ libtasn1-tools tdb-python3 tevent-python3 talloc-python3 ldb-python3 flex
+ bison mit-krb5 python3-Markdown python3-dnspython"
 makedepends="python3-devel libtirpc-devel popt-devel e2fsprogs-devel
  mit-krb5-devel pam-devel acl-devel cups-devel avahi-libs-devel tdb-devel
  talloc-devel tevent-devel ldb-devel cmocka-devel gnutls-devel zlib-devel
- ncurses-devel libldap-devel libarchive-devel jansson-devel"
+ ncurses-devel libldap-devel libarchive-devel jansson-devel liburing-devel"
 short_desc="SMB/CIFS file, print, and login server for Unix"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.samba.org"
 distfiles="https://download.samba.org/pub/samba/stable/${pkgname}-${version}.tar.gz"
-checksum=155d9c2dfb06a18104422987590858bfe5e9783ebebe63882e7e7f07eaaa512d
+checksum=f93c3af5295340d08106c7c0dcfb85e4f85057dfd14587aa8817beb31aff88f7
 lib32disabled=yes
 conf_files="/etc/pam.d/samba /etc/samba/smb.conf"
 make_dirs="/etc/samba/private 0750 root root"
-subpackages="smbclient samba-ctdb samba-cups samba-devel samba-libs samba-python3"
+subpackages="smbclient samba-ctdb samba-cups samba-devel samba-libs
+ samba-python3 samba-dc"
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-	makedepends+=" musl-legacy-compat musl-nscd-devel"
+	makedepends+=" musl-legacy-compat musl-nscd-devel libexecinfo-devel"
 else
 	makedepends+=" glusterfs-devel"
 	subpackages+=" samba-glusterfs"
-fi
 
-# By default, samba wants to install a bunch of private "*-samba4.so" shared
-# libraries that leak into shlib_requires dependencies. Most of these can be
-# built into the public shared libraries, avoiding the mess of tracking shlibs
-# that shouldn't be exposed locally. For those that cannot be built in, make
-# sure to install them into /usr/lib so xbps-src picks them up.
-_privlibs="CHARSET3 MESSAGING_SEND MESSAGING LIBWBCLIENT_OLD addns ads \
- asn1util auth authkrb5 cmdline_contexts cmdline-credentials cli_cldap \
- cli-ldap-common cli-nbt cli_smb_common cli_spoolss clidns common-auth \
- ctdb-event-client dbwrap dcerpc-pkt-auth events genrand gensec gse http \
- interfaces krb5samba ldbsamba libcli_lsa3 libcli_netlogon3 libsmb \
- messages_dgm messages_util mscat msghdr msrpc3 netif npa_tstream popt_samba3 \
- popt_samba3_cmdline registry replace samba-cluster-support samba-debug \
- samba-modules samba-security samba-sockets samba3-util samdb-common secrets3 \
- server_id_db server-role smbclient-raw smbd_shim socket-blocking sys_rw \
- talloc_report_printf talloc_report tevent-util time-basic trusts_util \
- util_reg util_setid util_tdb"
-configure_args+=" --with-privatelibdir=/usr/lib --builtin-libraries=${_privlibs// /,}"
+	if [ "$XBPS_CHECK_PKGS" ]; then
+		configure_args+=" --enable-selftest"
+		hostmakedepends+=" python3-cryptography python3-iso8601
+		 python3-pyasn1"
+		makedepends+=" nss_wrapper pam_wrapper resolv_wrapper
+		  socket_wrapper uid_wrapper"
+	fi
+fi
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
+export PYTHONHASHSEED=1
 
 post_patch() {
 	# Look for properly named python support libraries
 	vsed -i third_party/waf/waflib/Tools/python.py \
-		-e "/env.pyext_PATTERN/s/dct\['SO'\]/'.so'/"
+		-e "s|env.pyext_PATTERN = .*$|env.pyext_PATTERN = '%s.so'|g"
+
+	# Fix for our `kdb` linking against the system `db` package which
+	# doesn't distribute a pkg-config file and the samba build scripts just
+	# can't handle that.
+	cat >>wscript_configure_system_mitkrb5 <<_EOF
+if ("db" in conf.env["LIB_KDB5"]
+      and not conf.check_cfg(package="db", mandatory=False)):
+    krb5_define_syslib(conf, "db", [])
+_EOF
 
 	# Fix log and spool locations in conf file
 	vsed -i examples/smb.conf.default \
@@ -90,6 +94,8 @@ post_install() {
 	vmkdir usr/lib/cups/backend
 	ln -fs /usr/bin/smbspool ${DESTDIR}/usr/lib/cups/backend/smb
 
+	vinstall packaging/printing/smbprint 744 usr/bin/
+
 	# Do not ship sudo rule that grants nopasswd privileges by default
 	rm -rf ${DESTDIR}/etc/sudoers.d
 
@@ -110,10 +116,9 @@ smbclient_package() {
 		local _t _tools
 
 		# These utilities have man pages in section 1
-		_tools="findsmb dbwrap_tool mdfind mvxattr nmblookup ntlm_auth
-		 oLschema2ldif regdiff regpatch regshell regtree rpcclient
-		 sharesec smbcacls smbclient smbcquotas smbget smbtar smbtree
-		 wbinfo"
+		_tools="dbwrap_tool mdsearch mvxattr nmblookup oLschema2ldif
+		regdiff regpatch regshell rpcclient sharesec smbcacls smbclient
+		smbcquotas smbget smbtar smbtree wspsearch"
 
 		for _t in ${_tools}; do
 			vmove usr/bin/${_t}
@@ -127,11 +132,9 @@ smbclient_package() {
 			vmove usr/share/man/man8/${_t}.8
 		done
 
-		# No man page for this one
+		# No man page for these
 		vmove usr/bin/dumpmscat
-
-		# Extra man page for smbget
-		vmove usr/share/man/man5/smbgetrc.5
+		vmove usr/bin/smbprint
 
 		vmove usr/libexec/samba/smbspool_krb5_wrapper
 		vmove usr/share/man/man8/smbspool_krb5_wrapper.8
@@ -171,19 +174,40 @@ samba-libs_package() {
 	replaces="libsmbclient>=0"
 	pkg_install() {
 		local _libs _privlibs _lib
-		_libs="dcerpc dcerpc-binding ndr-krb5pac ndr-nbt ndr-standard ndr
-		 samba-credentials samba-errors samba-hostconfig samba-passdb
-		 samba-util samdb smbclient smbconf smbldap wbclient"
-		_privlibs="cli-ldap cliauth cluster common-auth dcerpc-samba
-		 flag-mapping gpo iov-buf ndr-samba ndr printer-driver
-		 smb-transport tdb-wrap util-cmdline winbind-client"
+		_libs="dcerpc dcerpc-binding dcerpc-samr dcerpc-server
+		 dcerpc-server-core ndr ndr-krb5pac ndr-nbt ndr-standard netapi
+		 nss_winbind nss_wins samba-credentials samba-errors
+		 samba-hostconfig samba-passdb samba-policy samba-util samdb
+		 smbclient smbconf smbldap tevent-util wbclient"
+		_privlibs="CHARSET3 LIBWBCLIENT-OLD MESSAGING MESSAGING-SEND
+		 REG-FULL RPC-SERVER-LOOP RPC-WORKER ad-claims addns ads
+		 asn1util auth auth-unix-token auth4 authkrb5 authn-policy-util
+		 cli-cldap cli-ldap cli-ldap-common cli-nbt cli-smb-common
+		 cli-spoolss cliauth clidns cluster cmdline cmdline-contexts
+		 common-auth ctdb-event-client db-glue dbwrap dcerpc-pkt-auth
+		 dcerpc-samba dcerpc-samba4 dfs-server-ad dlz-bind9-for-torture
+		 dnsserver-common dsdb-garbage-collect-tombstones dsdb-module
+		 events flag-mapping genrand gensec gpext gpo gse http idmap
+		 interfaces iov-buf krb5samba ldbsamba libcli-lsa3
+		 libcli-netlogon3 libsmb messages-dgm messages-util mscat
+		 msghdr msrpc3 ndr-samba ndr-samba4 net-keytab netif
+		 npa-tstream nss-info pac posix-eadb printer-driver
+		 printing-migrate process-model registry replace
+		 samba-cluster-support samba-debug samba-modules samba-net
+		 samba-python samba-security samba-sockets samba3-util
+		 samdb-common scavenge-dns-records secrets3 server-id-db
+		 server-role service shares smb-transport smbclient-raw
+		 smbd-base smbd-shim smbldaphelper smbpasswdparser
+		 socket-blocking stable-sort sys-rw talloc-report
+		 talloc-report-printf tdb-wrap time-basic torture trusts-util
+		 util-reg util-setid util-tdb xattr-tdb"
 
 		for _lib in ${_libs}; do
 			vmove "usr/lib/lib${_lib}.so.*"
 		done
 
 		for _lib in ${_privlibs}; do
-			vmove "usr/lib/lib${_lib}-samba4.so"
+			vmove "usr/lib/lib${_lib}-private-samba.so"
 		done
 
 		vmove usr/share/man/man7/libsmbclient.7
@@ -209,6 +233,9 @@ samba-devel_package() {
 }
 
 samba-python3_package() {
+	depends="samba-libs>=${version}_${revision} ldb-python3
+	 talloc-python3 tdb-python3 tevent-python3 python3-cryptography
+	 python3-dnspython python3-Markdown python3-requests"
 	short_desc+=" - Python3 bindings"
 	pkg_install() {
 		vmove ${py3_lib}
@@ -222,3 +249,12 @@ samba-glusterfs_package() {
 		vmove usr/share/man/man8/vfs_glusterfs.8
 	}
 }
+
+samba-dc_package() {
+	depends="samba-python3>=${version}_${revision}"
+	short_desc+=" - AD Domain Controller"
+	pkg_install() {
+		vmove "usr/bin/samba*"
+		vmove usr/share/samba
+	}
+}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: samba: update to 4.20.1.
  2024-05-22 10:43 [PR PATCH] samba: update to 4.20.1 otommod
  2024-05-23  8:15 ` [PR PATCH] [Updated] " otommod
@ 2024-05-23  8:17 ` otommod
  2024-05-23 14:02 ` [PR PATCH] [Updated] " otommod
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: otommod @ 2024-05-23  8:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 269 bytes --]

New comment by otommod on void-packages repository

https://github.com/void-linux/void-packages/pull/50464#issuecomment-2126507346

Comment:
I fixed the `socket_wrapper` patch, the `tevent` check I've not idea why it's failing, all the tests pass locally (x86_64-musl)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PR PATCH] [Updated] samba: update to 4.20.1.
  2024-05-22 10:43 [PR PATCH] samba: update to 4.20.1 otommod
  2024-05-23  8:15 ` [PR PATCH] [Updated] " otommod
  2024-05-23  8:17 ` otommod
@ 2024-05-23 14:02 ` otommod
  2024-05-23 14:04 ` otommod
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: otommod @ 2024-05-23 14:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2130 bytes --]

There is an updated pull request by otommod against master on the void-packages repository

https://github.com/otommod/void-packages samba-4.20.1
https://github.com/void-linux/void-packages/pull/50464

samba: update to 4.20.1.
I don't have much experience with packaging and none with `Void Linux` packaging in particular, especially with a big project like Samba, so I'm not sure this is production ready yet.

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
- I built this PR locally for these architectures:
  - x86_64
  - aarch64
  - aarch64-musl

#### Questions & notes
  - `samba-libs` has a ton of private libraries that I could not build as builtin this time. Should I add all of them to `common/shlibs`?
  - I packaged `{uid,socket,nss,resolv}_wrapper` since they are needed by the `samba` testsuite but they can also be bundled in... Do we really need them? They are not used by anything else (yet).  On the other hand, `pam_wrapper`, that is also needed, is already in the repository.
  - On a related note, I tried to build the aforementioned testsuite but it ended up with a `cmocka` related build failure (`LargestIntegralType` was not defined). It did build successfully when `cmocka` was build as a bundled library though.
  - Should we break the `samba` package up? Fedora/Debian have a ton of subpackages for it and even Alpine has a few more than us.

A patch file from https://github.com/void-linux/void-packages/pull/50464.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-samba-4.20.1-50464.patch --]
[-- Type: text/x-diff, Size: 45746 bytes --]

From d200d7137e0fe2a50a5fae1fa65b4b637a93c445 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Mon, 20 May 2024 15:51:28 +0300
Subject: [PATCH 1/8] tevent: update to 0.16.1.

---
 .../tevent/patches/fix-public-headers.patch   | 13 ----------
 srcpkgs/tevent/template                       | 25 +++++++++++++------
 2 files changed, 17 insertions(+), 21 deletions(-)
 delete mode 100644 srcpkgs/tevent/patches/fix-public-headers.patch

diff --git a/srcpkgs/tevent/patches/fix-public-headers.patch b/srcpkgs/tevent/patches/fix-public-headers.patch
deleted file mode 100644
index 1710226d4580c9..00000000000000
--- a/srcpkgs/tevent/patches/fix-public-headers.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-tevent.h needs sys/types.h for pid_t
-
---- a/tevent.h	2018-07-12 05:51:30.000000000 +0000
-+++ b/tevent.h	2018-07-19 10:13:15.360128807 +0000
-@@ -31,6 +31,7 @@
- #include <stdint.h>
- #include <talloc.h>
- #include <sys/time.h>
-+#include <sys/types.h>
- #include <stdbool.h>
- 
- struct tevent_context;
-
diff --git a/srcpkgs/tevent/template b/srcpkgs/tevent/template
index 7dadd564db0bf5..1a3f49d8bb8d0b 100644
--- a/srcpkgs/tevent/template
+++ b/srcpkgs/tevent/template
@@ -1,28 +1,37 @@
 # Template file for 'tevent'
 pkgname=tevent
-version=0.11.0
-revision=3
+version=0.16.1
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
 configure_args="--sysconfdir=/etc --localstatedir=/var
  --disable-rpath --disable-rpath-install --without-gettext
  --builtin-libraries=replace --bundled-libraries=NONE"
-hostmakedepends="pkg-config docbook2x python3-setuptools"
-makedepends="python3-devel talloc-devel libxslt gettext-devel cmocka-devel"
+hostmakedepends="pkg-config docbook-xsl libxslt"
+makedepends="python3-devel talloc-devel cmocka-devel"
 short_desc="Event system based on the talloc memory management library"
 maintainer="Yuusha Spacewolf <xyuusha@paranoici.org>"
 license="GPL-3.0-or-later"
 homepage="https://tevent.samba.org"
 distfiles="https://download.samba.org/pub/tevent/tevent-${version}.tar.gz"
-checksum=ee9a86c8e808aac2fe1e924eaa139ff7f0269d0e8e4fafa850ae5c7489bc82ba
+checksum=362971e0f32dc1905f6fe4736319c4b8348c22dc85aa6c3f690a28efe548029e
+
+if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
+	makedepends+=" libxcrypt-devel"
+fi
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
+export PYTHONHASHSEED=1
+
+do_check() {
+	${configure_script} test
+}
 
 post_patch() {
-	# Avoid Python shlib extension noise in libpytallic-util.so
-	vsed -e "/env.pyext_PATTERN/s/dct\['SO'\]/'.so'/" \
-		-i third_party/waf/waflib/Tools/python.py
+	# Look for properly named python support libraries
+	vsed -i third_party/waf/waflib/Tools/python.py \
+		-e "s|env.pyext_PATTERN = .*$|env.pyext_PATTERN = '%s.so'|"
 }
 
 tevent-python3_package() {

From b33ecfc10008f0f180ccf7f54c0b65518e17e014 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Mon, 20 May 2024 18:06:26 +0300
Subject: [PATCH 2/8] tdb: update to 1.4.10.

---
 srcpkgs/tdb/template | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/tdb/template b/srcpkgs/tdb/template
index 0134d2dcc2fb91..6d1c3039ed914f 100644
--- a/srcpkgs/tdb/template
+++ b/srcpkgs/tdb/template
@@ -1,21 +1,25 @@
 # Template file for 'tdb'
 pkgname=tdb
-version=1.4.9
-revision=2
+version=1.4.10
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
-configure_args="--prefix=/usr --libdir=/usr/lib --sysconfdir=/etc
- --localstatedir=/var --disable-rpath --disable-rpath-install
- --builtin-libraries=replace --bundled-libraries=NONE --without-gettext"
-hostmakedepends="pkg-config docbook2x"
-makedepends="python3-devel libxslt gettext-devel"
+configure_args="--sysconfdir=/etc --localstatedir=/var
+ --disable-rpath --disable-rpath-install --without-gettext
+ --builtin-libraries=replace --bundled-libraries=NONE"
+hostmakedepends="pkg-config docbook-xsl libxslt"
+makedepends="python3-devel"
 short_desc="Trivial Database, similar to GDBM but allows simultaneous commits"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="https://tdb.samba.org/"
 distfiles="https://download.samba.org/pub/tdb/tdb-${version}.tar.gz"
-checksum=0ac226073e3a2db8648da7af744cb95f50766a52feeb001d558b2b321b74a765
+checksum=02338e33c16c21c9e29571cef523e76b2b708636254f6f30c6cf195d48c62daf
+
+if [ "$XBPS_TARGET_LIBC" = glibc ]; then
+	makedepends+=" libxcrypt-devel"
+fi
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
 export PYTHONHASHSEED=1

From 953e05c68fd4d066e82c353f7213006aa2dc8d17 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Mon, 20 May 2024 18:20:57 +0300
Subject: [PATCH 3/8] ldb: update to 2.9.0.

---
 srcpkgs/ldb/patches/strtoull.patch | 89 ++++++++++++++++++++++++++++++
 srcpkgs/ldb/template               | 29 +++++-----
 2 files changed, 104 insertions(+), 14 deletions(-)
 create mode 100644 srcpkgs/ldb/patches/strtoull.patch

diff --git a/srcpkgs/ldb/patches/strtoull.patch b/srcpkgs/ldb/patches/strtoull.patch
new file mode 100644
index 00000000000000..2fcd928a3d143c
--- /dev/null
+++ b/srcpkgs/ldb/patches/strtoull.patch
@@ -0,0 +1,89 @@
+diff --git a/lib/replace/replace.c b/lib/replace/replace.c
+index 0652cb4..02b6ebf 100644
+--- a/lib/replace/replace.c
++++ b/lib/replace/replace.c
+@@ -559,41 +559,6 @@ long long int rep_strtoll(const char *str, char **endptr, int base)
+ #endif /* HAVE_STRTOLL */
+ 
+ 
+-#ifndef HAVE_STRTOULL
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
+-{
+-#ifdef HAVE_STRTOUQ
+-	return strtouq(str, endptr, base);
+-#elif defined(HAVE___STRTOULL) 
+-	return __strtoull(str, endptr, base);
+-#elif SIZEOF_LONG == SIZEOF_LONG_LONG
+-	return (unsigned long long int) strtoul(str, endptr, base);
+-#else
+-# error "You need a strtoull function"
+-#endif
+-}
+-#else
+-#ifdef HAVE_BSD_STRTOLL
+-#undef strtoull
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
+-{
+-	int saved_errno = errno;
+-	unsigned long long int nb = strtoull(str, endptr, base);
+-	/* With glibc EINVAL is only returned if base is not ok */
+-	if (errno == EINVAL) {
+-		if (base == 0 || (base >1 && base <37)) {
+-			/* Base was ok so it's because we were not
+-			 * able to make the conversion.
+-			 * Let's reset errno.
+-			 */
+-			errno = saved_errno;
+-		}
+-	}
+-	return nb;
+-}
+-#endif /* HAVE_BSD_STRTOLL */
+-#endif /* HAVE_STRTOULL */
+-
+ #ifndef HAVE_SETENV
+ int rep_setenv(const char *name, const char *value, int overwrite) 
+ {
+diff --git a/lib/replace/replace.h b/lib/replace/replace.h
+index a8910e2..854b1a7 100644
+--- a/lib/replace/replace.h
++++ b/lib/replace/replace.h
+@@ -394,16 +394,6 @@ long long int rep_strtoll(const char *str, char **endptr, int base);
+ #endif
+ #endif
+ 
+-#ifndef HAVE_STRTOULL
+-#define strtoull rep_strtoull
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base);
+-#else
+-#ifdef HAVE_BSD_STRTOLL /* yes, it's not HAVE_BSD_STRTOULL */
+-#define strtoull rep_strtoull
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base);
+-#endif
+-#endif
+-
+ #ifndef HAVE_FTRUNCATE
+ #define ftruncate rep_ftruncate
+ int rep_ftruncate(int,off_t);
+diff --git a/lib/replace/wscript b/lib/replace/wscript
+index 4c774d9..a1dc6d0 100644
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -411,7 +411,7 @@ def configure(conf):
+     conf.CHECK_FUNCS('initgroups pread pwrite strndup strcasestr strsep')
+     conf.CHECK_FUNCS('strtok_r mkdtemp dup2 dprintf vdprintf isatty chown lchown')
+     conf.CHECK_FUNCS('link readlink symlink realpath snprintf vsnprintf')
+-    conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen strtoull __strtoull')
++    conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen')
+     conf.CHECK_FUNCS('strtouq strtoll __strtoll strtoq memalign posix_memalign')
+     conf.CHECK_FUNCS('fmemopen')
+ 
+@@ -866,7 +866,7 @@ REPLACEMENT_FUNCTIONS = {
+                   'memmove', 'strdup', 'setlinebuf', 'vsyslog', 'strnlen',
+                   'strndup', 'waitpid', 'seteuid', 'setegid', 'chroot',
+                   'mkstemp', 'mkdtemp', 'pread', 'pwrite', 'strcasestr',
+-                  'strsep', 'strtok_r', 'strtoll', 'strtoull', 'setenv', 'unsetenv',
++                  'strsep', 'strtok_r', 'strtoll', 'setenv', 'unsetenv',
+                   'utime', 'utimes', 'dup2', 'chown', 'link', 'readlink',
+                   'symlink', 'lchown', 'realpath', 'memmem', 'vdprintf',
+                   'dprintf', 'get_current_dir_name', 'copy_file_range',
diff --git a/srcpkgs/ldb/template b/srcpkgs/ldb/template
index 964a2c33009da0..f3dcb95611ceb4 100644
--- a/srcpkgs/ldb/template
+++ b/srcpkgs/ldb/template
@@ -1,7 +1,7 @@
 # Template file for 'ldb'
 pkgname=ldb
-version=2.3.2
-revision=3
+version=2.9.0
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
@@ -9,28 +9,29 @@ configure_args="--sysconfdir=/etc --localstatedir=/var
  --disable-rpath --disable-rpath-install --without-gettext
  --builtin-libraries=replace --bundled-libraries=NONE
  --with-modulesdir=/usr/lib/ldb/modules"
-hostmakedepends="pkg-config docbook2x tdb-python3 tevent-python3 python3-setuptools"
-makedepends="python3-devel tdb-devel tevent-devel talloc-devel
- popt-devel lmdb-devel libxslt gettext-devel cmocka-devel"
+hostmakedepends="pkg-config docbook-xsl libxslt tdb-python3 tevent-python3"
+makedepends="python3-devel tdb-devel tevent-devel talloc-devel popt-devel
+ lmdb-devel cmocka-devel"
 checkdepends="cmocka-devel"
 short_desc="LDAP-like database from samba"
 maintainer="Yuusha Spacewolf <xyuusha@paranoici.org>"
 license="LGPL-3.0-or-later"
 homepage="https://www.samba.org/ldb/"
 distfiles="https://download.samba.org/pub/ldb/ldb-${version}.tar.gz"
-checksum=1416c949dc4326e41c0d8a5ecf8ef784f8c0b6e9d3dad8fa971e84ad56227603
-
-# workaround for cmocka's broken uintptr_t definition on musl
-if [ "$XBPS_TARGET_WORDSIZE" = "64" -a "$XBPS_TARGET_LIBC" = "musl" ]; then
-	CFLAGS+=" -D__WORDSIZE=64"
-fi
+checksum=105aaff71ad881a7faeb582fd416ae28221b6fde338fff82828065062c2507a5
+make_check=extended # testsuite takes a long time
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
+export PYTHONHASHSEED=1
 
 post_patch() {
-	# Avoid Python shlib extension noise in libpyldb-util.so
-	vsed -e "/env.pyext_PATTERN/s/dct\['SO'\]/'.so'/" \
-		-i third_party/waf/waflib/Tools/python.py
+	# Look for properly named python support libraries
+	vsed -i third_party/waf/waflib/Tools/python.py \
+		-e "s|env.pyext_PATTERN = .*$|env.pyext_PATTERN = '%s.so'|"
+}
+
+do_check() {
+	${configure_script} test ${makejobs}
 }
 
 ldb-python3_package() {

From 3fa890c670718b1a96f911a800416fccc2d57129 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 10:22:00 +0300
Subject: [PATCH 4/8] New package: uid_wrapper-1.3.0.

---
 .../uid_wrapper-fix-for-cmocka-1.1.6.patch    | 31 +++++++++++++++++++
 srcpkgs/uid_wrapper/template                  | 22 +++++++++++++
 2 files changed, 53 insertions(+)
 create mode 100644 srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch
 create mode 100644 srcpkgs/uid_wrapper/template

diff --git a/srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch b/srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch
new file mode 100644
index 00000000000000..c99c3ad6bce663
--- /dev/null
+++ b/srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch
@@ -0,0 +1,31 @@
+From 850f24c6366abda30bfd77734b90330b8809d306 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Fri, 17 Feb 2023 17:51:27 +0100
+Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
+---
+ tests/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 635e86e..68e050e 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ project(tests C)
+ 
++if (TARGET cmocka::cmocka)
++    set(CMOCKA_LIBRARY cmocka::cmocka)
++endif()
++
+ add_library(uwrap_fake_socket_wrapper SHARED uwrap_fake_socket_wrapper.c)
+ target_compile_options(uwrap_fake_socket_wrapper
+                        PRIVATE
+-- 
+2.34.1
+
diff --git a/srcpkgs/uid_wrapper/template b/srcpkgs/uid_wrapper/template
new file mode 100644
index 00000000000000..24a90e93767069
--- /dev/null
+++ b/srcpkgs/uid_wrapper/template
@@ -0,0 +1,22 @@
+# Template file for 'uid_wrapper'
+pkgname=uid_wrapper
+version=1.3.0
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Testing tool to fake privilege separation"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="https://cwrap.org/uid_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=f7e7c1bde533530051931414724453e14e02adbb614824b6fe27cbb98654b762
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel"
+	checkdepends+=" cmocka"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 3279660419002213c5557ec0a10c0a4fc4fab683 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 11:09:08 +0300
Subject: [PATCH 5/8] New package: socket_wrapper-1.4.2

---
 srcpkgs/socket_wrapper/template | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/socket_wrapper/template

diff --git a/srcpkgs/socket_wrapper/template b/srcpkgs/socket_wrapper/template
new file mode 100644
index 00000000000000..45d462668c5c4f
--- /dev/null
+++ b/srcpkgs/socket_wrapper/template
@@ -0,0 +1,22 @@
+# Template file for 'socket_wrapper'
+pkgname=socket_wrapper
+version=1.4.2
+revision=1
+archs="~*-musl" # socket_wrapper redefines libc funcs, you can't do that on musl
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Library for passing all socket communications through unix sockets"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="http://cwrap.org/socket_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=0a08ec249dd9ffbb3b16d577b352d573561f57beeec3596182ac6ec8e46b9ab6
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 440aa36bfe59867bca88006b16284325f4e5aab6 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 10:21:20 +0300
Subject: [PATCH 6/8] New package: nss_wrapper-1.1.15.

---
 .../nss_wrapper-fix-for-cmocka-1.1.6.patch    | 31 +++++++++++++++++++
 srcpkgs/nss_wrapper/template                  | 27 ++++++++++++++++
 2 files changed, 58 insertions(+)
 create mode 100644 srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch
 create mode 100644 srcpkgs/nss_wrapper/template

diff --git a/srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch b/srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch
new file mode 100644
index 00000000000000..ba2589be2d0834
--- /dev/null
+++ b/srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch
@@ -0,0 +1,31 @@
+From 2c879a0ffa70cee33329291d7576ec971d420da2 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Fri, 17 Feb 2023 17:51:27 +0100
+Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
+---
+ tests/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 3b94076..733cc4e 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ project(tests C)
+ 
++if (TARGET cmocka::cmocka)
++    set(CMOCKA_LIBRARY cmocka::cmocka)
++endif()
++
+ set(TESTSUITE_LIBRARIES nss_utils ${NWRAP_REQUIRED_LIBRARIES} ${CMOCKA_LIBRARY})
+ string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
+ 
+-- 
+2.39.2
+
diff --git a/srcpkgs/nss_wrapper/template b/srcpkgs/nss_wrapper/template
new file mode 100644
index 00000000000000..94fa88b333cda9
--- /dev/null
+++ b/srcpkgs/nss_wrapper/template
@@ -0,0 +1,27 @@
+# Template file for 'nss_wrapper'
+pkgname=nss_wrapper
+version=1.1.15
+revision=1
+archs="~*-musl" # complains about the getXXent_r functions missing
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Wrapper for the user, group and hosts NSS API"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="http://cwrap.org/nss_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=36f874832a4f2158e04f69aa77e5515e16cf6e3bf81968d5dd8496db7d6906ad
+
+if [ "$XBPS_TARGET_LIBC" = glibc ]; then
+	makedepends+=" libxcrypt-devel"
+fi
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel uid_wrapper"
+	checkdepends+=" cmocka"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 75b633eef8b1f44ad9a205f316b03666c45144dd Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 10:22:30 +0300
Subject: [PATCH 7/8] New package: resolv_wrapper-1.1.8

---
 .../resolv_wrapper-fix-for-cmocka-1.1.6.patch | 31 +++++++++++++++++++
 srcpkgs/resolv_wrapper/template               | 23 ++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100644 srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch
 create mode 100644 srcpkgs/resolv_wrapper/template

diff --git a/srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch b/srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch
new file mode 100644
index 00000000000000..5640be33053a8c
--- /dev/null
+++ b/srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch
@@ -0,0 +1,31 @@
+From f2e7f58025ecb4cf399494166abea01813b1d0f0 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Fri, 17 Feb 2023 17:51:27 +0100
+Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
+---
+ tests/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 1262bed..7f2f4ee 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ project(tests C)
+ 
++if (TARGET cmocka::cmocka)
++    set(CMOCKA_LIBRARY cmocka::cmocka)
++endif()
++
+ set(TORTURE_LIBRARY torture)
+ 
+ # A simple DNS server for testing
+-- 
+2.34.1
+
diff --git a/srcpkgs/resolv_wrapper/template b/srcpkgs/resolv_wrapper/template
new file mode 100644
index 00000000000000..4e1215c7b69867
--- /dev/null
+++ b/srcpkgs/resolv_wrapper/template
@@ -0,0 +1,23 @@
+# Template file for 'resolv_wrapper'
+pkgname=resolv_wrapper
+version=1.1.8
+revision=1
+archs="~*-musl" # missing res_ninit, res_nclose, etc
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Wrapper for DNS name resolving or DNS faking"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="https://cwrap.org/resolv_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=fbc30f77da3e12ecd4ef66ccf5ab77e0b744930ccd89062404082f928a8ec2e0
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel socket_wrapper"
+	checkdepends+=" cmocka"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 85445fd788e96b42f2107bfbfb7fce2c8c6256d1 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 13:06:38 +0300
Subject: [PATCH 8/8] samba: update to 4.20.1.

This also builds and packages the io_uring VFS and more importantly the
AD Domain Control part of Samba.
---
 common/shlibs                                 | 183 +++++++++++++-----
 srcpkgs/samba-dc                              |   1 +
 srcpkgs/samba/patches/fix-glibc-2.36.patch    |  59 ------
 srcpkgs/samba/patches/missing-headers.patch   |  52 -----
 srcpkgs/samba/patches/netdb-defines.patch     |  19 --
 .../patches/samba-bgqd-include-signal-h.patch |  14 ++
 srcpkgs/samba/template                        | 140 +++++++++-----
 7 files changed, 234 insertions(+), 234 deletions(-)
 create mode 120000 srcpkgs/samba-dc
 delete mode 100644 srcpkgs/samba/patches/fix-glibc-2.36.patch
 delete mode 100644 srcpkgs/samba/patches/missing-headers.patch
 delete mode 100644 srcpkgs/samba/patches/netdb-defines.patch
 create mode 100644 srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch

diff --git a/common/shlibs b/common/shlibs
index ff14234e60cdba..1d0b5f3bbb8d8b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4051,58 +4051,137 @@ libevemu.so.3 evemu-2.7.0_1
 libinih.so.0 inih-52_1
 libINIReader.so.0 inih-57_1
 libpcaudio.so.0 pcaudiolib-1.1_1
-libdcerpc-samr.so.0 samba-4.13.2_1
-libdcerpc-server-core.so.0 samba-4.13.2_1
-libnetapi.so.0 samba-4.13.2_1
-libnss_winbind.so.2 samba-4.13.2_1
-libnss_wins.so.2 samba-4.13.2_1
-libsamba-policy.so.0 samba-4.13.2_1
-libauth-unix-token-samba4.so samba-4.13.2_1
-libauth4-samba4.so samba-4.13.3_1
-libdcerpc-samba4.so samba-4.13.2_1
-libdsdb-module-samba4.so samba-4.13.2_1
-libgpext-samba4.so samba-4.13.2_1
-libnet-keytab-samba4.so samba-4.13.3_1
-libposix-eadb-samba4.so samba-4.13.2_1
-libprinting-migrate-samba4.so samba-4.13.2_1
-libsamba-net-samba4.so samba-4.13.2_1
-libsamba-python-samba4.so samba-4.13.3_1
-libshares-samba4.so samba-4.13.2_1
-libsmbd-base-samba4.so samba-4.13.2_1
-libsmbd-conn-samba4.so samba-4.13.2_1
-libsmbpasswordparser-samba4.so samba-4.13.3_1
-libxattr-tdb-samba4.so samba-4.13.2_1
-libdcerpc.so.0 samba-libs-4.13.2_1
-libdcerpc-binding.so.0 samba-libs-4.13.2_1
-libndr-krb5pac.so.0 samba-libs-4.13.2_1
-libndr-nbt.so.0 samba-libs-4.13.2_1
-libndr-standard.so.0 samba-libs-4.13.2_1
-libndr.so.1 samba-libs-4.13.2_1
-libsamba-credentials.so.1 samba-libs-4.13.2_1
-libsamba-errors.so.1 samba-libs-4.13.2_1
-libsamba-hostconfig.so.0 samba-libs-4.13.2_1
-libsamba-passdb.so.0 samba-libs-4.13.2_1
-libsamba-util.so.0 samba-libs-4.13.2_1
-libsamdb.so.0 samba-libs-4.13.2_1
-libsmbclient.so.0 samba-libs-4.13.2_1
-libsmbconf.so.0 samba-libs-4.13.2_1
-libsmbldap.so.2 samba-libs-4.13.2_1
-libwbclient.so.0 samba-libs-4.13.2_1
-libcli-ldap-samba4.so samba-libs-4.13.2_1
-libcliauth-samba4.so samba-libs-4.13.2_1
-libcluster-samba4.so samba-libs-4.13.3_1
-libcommon-auth-samba4.so samba-libs-4.13.2_1
-libdcerpc-samba-samba4.so samba-libs-4.13.2_1
-libflag-mapping-samba4.so samba-libs-4.13.3_1
-libgpo-samba4.so samba-libs-4.13.2_1
-libiov-buf-samba4.so samba-libs-4.13.3_1
-libndr-samba-samba4.so samba-libs-4.13.2_1
-libndr-samba4.so samba-libs-4.13.2_1
-libprinter-driver-samba4.so samba-libs-4.13.3_1
-libsmb-transport-samba4.so samba-libs-4.13.2_1
-libtdb-wrap-samba4.so samba-libs-4.13.3_1
-libutil-cmdline-samba4.so samba-libs-4.13.2_1
-libwinbind-client-samba4.so samba-libs-4.13.2_1
+libdcerpc.so.0 samba-libs-4.20.1_1
+libdcerpc-binding.so.0 samba-libs-4.20.1_1
+libdcerpc-samr.so.0 samba-libs-4.20.1_1
+libdcerpc-server.so.0 samba-libs-4.20.1_1
+libdcerpc-server-core.so.0 samba-libs-4.20.1_1
+libndr.so.4 samba-libs-4.20.1_1
+libndr-krb5pac.so.0 samba-libs-4.20.1_1
+libndr-nbt.so.0 samba-libs-4.20.1_1
+libndr-standard.so.0 samba-libs-4.20.1_1
+libnetapi.so.1 samba-libs-4.20.1_1
+libnss_winbind.so.2 samba-libs-4.20.1_1
+libnss_wins.so.2 samba-libs-4.20.1_1
+libsamba-credentials.so.1 samba-libs-4.20.1_1
+libsamba-errors.so.1 samba-libs-4.20.1_1
+libsamba-hostconfig.so.0 samba-libs-4.20.1_1
+libsamba-passdb.so.0 samba-libs-4.20.1_1
+libsamba-policy.so.0 samba-libs-4.20.1_1
+libsamba-util.so.0 samba-libs-4.20.1_1
+libsamdb.so.0 samba-libs-4.20.1_1
+libsmbclient.so.0 samba-libs-4.20.1_1
+libsmbconf.so.0 samba-libs-4.20.1_1
+libsmbldap.so.2 samba-libs-4.20.1_1
+libtevent-util.so.0 samba-libs-4.20.1_1
+libwbclient.so.0 samba-libs-4.20.1_1
+libCHARSET3-private-samba.so samba-libs-4.20.1_1
+libLIBWBCLIENT-OLD-private-samba.so samba-libs-4.20.1_1
+libMESSAGING-private-samba.so samba-libs-4.20.1_1
+libMESSAGING-SEND-private-samba.so samba-libs-4.20.1_1
+libREG-FULL-private-samba.so samba-libs-4.20.1_1
+libRPC-SERVER-LOOP-private-samba.so samba-libs-4.20.1_1
+libRPC-WORKER-private-samba.so samba-libs-4.20.1_1
+libad-claims-private-samba.so samba-libs-4.20.1_1
+libaddns-private-samba.so samba-libs-4.20.1_1
+libads-private-samba.so samba-libs-4.20.1_1
+libasn1util-private-samba.so samba-libs-4.20.1_1
+libauth-private-samba.so samba-libs-4.20.1_1
+libauth-unix-token-private-samba.so samba-libs-4.20.1_1
+libauth4-private-samba.so samba-libs-4.20.1_1
+libauthkrb5-private-samba.so samba-libs-4.20.1_1
+libauthn-policy-util-private-samba.so samba-libs-4.20.1_1
+libcli-cldap-private-samba.so samba-libs-4.20.1_1
+libcli-ldap-private-samba.so samba-libs-4.20.1_1
+libcli-ldap-common-private-samba.so samba-libs-4.20.1_1
+libcli-nbt-private-samba.so samba-libs-4.20.1_1
+libcli-smb-common-private-samba.so samba-libs-4.20.1_1
+libcli-spoolss-private-samba.so samba-libs-4.20.1_1
+libcliauth-private-samba.so samba-libs-4.20.1_1
+libclidns-private-samba.so samba-libs-4.20.1_1
+libcluster-private-samba.so samba-libs-4.20.1_1
+libcmdline-private-samba.so samba-libs-4.20.1_1
+libcmdline-contexts-private-samba.so samba-libs-4.20.1_1
+libcommon-auth-private-samba.so samba-libs-4.20.1_1
+libctdb-event-client-private-samba.so samba-libs-4.20.1_1
+libdb-glue-private-samba.so samba-libs-4.20.1_1
+libdbwrap-private-samba.so samba-libs-4.20.1_1
+libdcerpc-pkt-auth-private-samba.so samba-libs-4.20.1_1
+libdcerpc-samba-private-samba.so samba-libs-4.20.1_1
+libdcerpc-samba4-private-samba.so samba-libs-4.20.1_1
+libdfs-server-ad-private-samba.so samba-libs-4.20.1_1
+libdlz-bind9-for-torture-private-samba.so samba-libs-4.20.1_1
+libdnsserver-common-private-samba.so samba-libs-4.20.1_1
+libdsdb-garbage-collect-tombstones-private-samba.so samba-libs-4.20.1_1
+libdsdb-module-private-samba.so samba-libs-4.20.1_1
+libevents-private-samba.so samba-libs-4.20.1_1
+libflag-mapping-private-samba.so samba-libs-4.20.1_1
+libgenrand-private-samba.so samba-libs-4.20.1_1
+libgensec-private-samba.so samba-libs-4.20.1_1
+libgpext-private-samba.so samba-libs-4.20.1_1
+libgpo-private-samba.so samba-libs-4.20.1_1
+libgse-private-samba.so samba-libs-4.20.1_1
+libhttp-private-samba.so samba-libs-4.20.1_1
+libidmap-private-samba.so samba-libs-4.20.1_1
+libinterfaces-private-samba.so samba-libs-4.20.1_1
+libiov-buf-private-samba.so samba-libs-4.20.1_1
+libkrb5samba-private-samba.so samba-libs-4.20.1_1
+libldbsamba-private-samba.so samba-libs-4.20.1_1
+liblibcli-lsa3-private-samba.so samba-libs-4.20.1_1
+liblibcli-netlogon3-private-samba.so samba-libs-4.20.1_1
+liblibsmb-private-samba.so samba-libs-4.20.1_1
+libmessages-dgm-private-samba.so samba-libs-4.20.1_1
+libmessages-util-private-samba.so samba-libs-4.20.1_1
+libmscat-private-samba.so samba-libs-4.20.1_1
+libmsghdr-private-samba.so samba-libs-4.20.1_1
+libmsrpc3-private-samba.so samba-libs-4.20.1_1
+libndr-samba-private-samba.so samba-libs-4.20.1_1
+libndr-samba4-private-samba.so samba-libs-4.20.1_1
+libnet-keytab-private-samba.so samba-libs-4.20.1_1
+libnetif-private-samba.so samba-libs-4.20.1_1
+libnpa-tstream-private-samba.so samba-libs-4.20.1_1
+libnss-info-private-samba.so samba-libs-4.20.1_1
+libpac-private-samba.so samba-libs-4.20.1_1
+libposix-eadb-private-samba.so samba-libs-4.20.1_1
+libprinter-driver-private-samba.so samba-libs-4.20.1_1
+libprinting-migrate-private-samba.so samba-libs-4.20.1_1
+libprocess-model-private-samba.so samba-libs-4.20.1_1
+libregistry-private-samba.so samba-libs-4.20.1_1
+libreplace-private-samba.so samba-libs-4.20.1_1
+libsamba-cluster-support-private-samba.so samba-libs-4.20.1_1
+libsamba-debug-private-samba.so samba-libs-4.20.1_1
+libsamba-modules-private-samba.so samba-libs-4.20.1_1
+libsamba-net-private-samba.so samba-libs-4.20.1_1
+libsamba-python-private-samba.so samba-libs-4.20.1_1
+libsamba-security-private-samba.so samba-libs-4.20.1_1
+libsamba-sockets-private-samba.so samba-libs-4.20.1_1
+libsamba3-util-private-samba.so samba-libs-4.20.1_1
+libsamdb-common-private-samba.so samba-libs-4.20.1_1
+libscavenge-dns-records-private-samba.so samba-libs-4.20.1_1
+libsecrets3-private-samba.so samba-libs-4.20.1_1
+libserver-id-db-private-samba.so samba-libs-4.20.1_1
+libserver-role-private-samba.so samba-libs-4.20.1_1
+libservice-private-samba.so samba-libs-4.20.1_1
+libshares-private-samba.so samba-libs-4.20.1_1
+libsmb-transport-private-samba.so samba-libs-4.20.1_1
+libsmbclient-raw-private-samba.so samba-libs-4.20.1_1
+libsmbd-base-private-samba.so samba-libs-4.20.1_1
+libsmbd-shim-private-samba.so samba-libs-4.20.1_1
+libsmbldaphelper-private-samba.so samba-libs-4.20.1_1
+libsmbpasswdparser-private-samba.so samba-libs-4.20.1_1
+libsocket-blocking-private-samba.so samba-libs-4.20.1_1
+libstable-sort-private-samba.so samba-libs-4.20.1_1
+libsys-rw-private-samba.so samba-libs-4.20.1_1
+libtalloc-report-private-samba.so samba-libs-4.20.1_1
+libtalloc-report-printf-private-samba.so samba-libs-4.20.1_1
+libtdb-wrap-private-samba.so samba-libs-4.20.1_1
+libtime-basic-private-samba.so samba-libs-4.20.1_1
+libtorture-private-samba.so samba-libs-4.20.1_1
+libtrusts-util-private-samba.so samba-libs-4.20.1_1
+libutil-reg-private-samba.so samba-libs-4.20.1_1
+libutil-setid-private-samba.so samba-libs-4.20.1_1
+libutil-tdb-private-samba.so samba-libs-4.20.1_1
+libxattr-tdb-private-samba.so samba-libs-4.20.1_1
 libsixel.so.1 libsixel-1.8.6_1
 libpamtest.so.0 pam_wrapper-1.1.3_1
 libopenaptx.so.0 libopenaptx-0.2.0_1
diff --git a/srcpkgs/samba-dc b/srcpkgs/samba-dc
new file mode 120000
index 00000000000000..cba1f39180b3aa
--- /dev/null
+++ b/srcpkgs/samba-dc
@@ -0,0 +1 @@
+samba
\ No newline at end of file
diff --git a/srcpkgs/samba/patches/fix-glibc-2.36.patch b/srcpkgs/samba/patches/fix-glibc-2.36.patch
deleted file mode 100644
index beb84ce6a8ded2..00000000000000
--- a/srcpkgs/samba/patches/fix-glibc-2.36.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 766151bf5b7ef95ae4c8c98b8994e5c21c5bbec0 Mon Sep 17 00:00:00 2001
-From: Andreas Schneider <asn@samba.org>
-Date: Tue, 2 Aug 2022 07:55:46 +0200
-Subject: [PATCH] lib:replace: Only include <sys/mount.h> on non-Linux systems
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Details at:
-https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
-
-BUG: https://bugzilla.samba.org/show_bug.cgi?id=15132
-
-Signed-off-by: Andreas Schneider <asn@samba.org>
-Reviewed-by: Ralph Boehme <slow@samba.org>
-
-Autobuild-User(master): Ralph Böhme <slow@samba.org>
-Autobuild-Date(master): Tue Aug  2 11:05:14 UTC 2022 on sn-devel-184
----
- lib/replace/system/filesys.h | 4 +++-
- lib/replace/wscript          | 3 +++
- 2 files changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/lib/replace/system/filesys.h b/lib/replace/system/filesys.h
-index 034e5d5886c..bb9482c69af 100644
---- a/lib/replace/system/filesys.h
-+++ b/lib/replace/system/filesys.h
-@@ -36,7 +36,8 @@
- #include <sys/param.h>
- #endif
- 
--#ifdef HAVE_SYS_MOUNT_H
-+/* This include is required on UNIX (*BSD, AIX, ...) for statfs() */
-+#if !defined(LINUX) && defined(HAVE_SYS_MOUNT_H)
- #include <sys/mount.h>
- #endif
- 
-@@ -44,6 +45,7 @@
- #include <mntent.h>
- #endif
- 
-+/* This include is required on Linux for statfs() */
- #ifdef HAVE_SYS_VFS_H
- #include <sys/vfs.h>
- #endif
-diff --git a/lib/replace/wscript b/lib/replace/wscript
-index 4c774d9f0c3..dd9b19219a1 100644
---- a/lib/replace/wscript
-+++ b/lib/replace/wscript
-@@ -31,6 +31,9 @@ def configure(conf):
- 
-     conf.env.standalone_replace = conf.IN_LAUNCH_DIR()
- 
-+    if sys.platform.rfind('linux') > -1:
-+        conf.DEFINE('LINUX', '1')
-+
-     conf.DEFINE('BOOL_DEFINED', 1)
-     conf.DEFINE('HAVE_LIBREPLACE', 1)
-     conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
diff --git a/srcpkgs/samba/patches/missing-headers.patch b/srcpkgs/samba/patches/missing-headers.patch
deleted file mode 100644
index 820d7ecd903fbc..00000000000000
--- a/srcpkgs/samba/patches/missing-headers.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-diff --git lib/param/loadparm.h lib/param/loadparm.h
-index b5d79b9..3f4eae0 100644
---- a/lib/param/loadparm.h
-+++ b/lib/param/loadparm.h
-@@ -31,6 +31,7 @@
- #define _LOADPARM_H
- 
- #include <talloc.h>
-+#include <time.h>
- 
- struct parmlist_entry {
- 	struct parmlist_entry *prev, *next;
-diff --git source3/lib/system_smbd.c source3/lib/system_smbd.c
-index 3b1ac9c..4044d75 100644
---- a/source3/lib/system_smbd.c
-+++ b/source3/lib/system_smbd.c
-@@ -27,6 +27,8 @@
- #include "system/passwd.h"
- #include "nsswitch/winbind_client.h"
- #include "../lib/util/setid.h"
-+#include <grp.h>
-+#include <uuid/uuid.h>
- 
- #ifndef HAVE_GETGROUPLIST
- 
-diff --git source4/torture/local/nss_tests.c source4/torture/local/nss_tests.c
-index 2cd6122..0c84ec2 100644
---- a/source4/torture/local/nss_tests.c
-+++ b/source4/torture/local/nss_tests.c
-@@ -20,6 +20,8 @@
- */
- 
- #include "includes.h"
-+#include <grp.h>
-+#include <uuid/uuid.h>
- 
- #include "torture/torture.h"
- #include "torture/local/proto.h"
- 
-diff --git ctdb/tests/src/protocol_util_test.c ctdb/tests/src/protocol_util_test.c
-index edd2a34..48ce96e 100644
---- a/ctdb/tests/src/protocol_util_test.c
-+++ b/ctdb/tests/src/protocol_util_test.c
-@@ -20,6 +20,7 @@
- #include "replace.h"
- #include "system/network.h"
-
-+#include <unistd.h>
- #include <assert.h>
-
- #include "protocol/protocol_basic.c"
-
diff --git a/srcpkgs/samba/patches/netdb-defines.patch b/srcpkgs/samba/patches/netdb-defines.patch
deleted file mode 100644
index 15f79eebfb6ac1..00000000000000
--- a/srcpkgs/samba/patches/netdb-defines.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff --git nsswitch/wins.c nsswitch/wins.c
-index dccb6dd..bb24acb 100644
---- a/nsswitch/wins.c
-+++ b/nsswitch/wins.c
-@@ -39,6 +39,14 @@ static pthread_mutex_t wins_nss_mutex = PTHREAD_MUTEX_INITIALIZER;
- #define INADDRSZ 4
- #endif
- 
-+#ifndef NETDB_INTERNAL
-+#define NETDB_INTERNAL -1
-+#endif
-+
-+#ifndef NETDB_SUCCESS
-+#define NETDB_SUCCESS 0
-+#endif
-+
- NSS_STATUS _nss_wins_gethostbyname_r(const char *hostname,
- 				     struct hostent *he,
- 				     char *buffer,
diff --git a/srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch b/srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch
new file mode 100644
index 00000000000000..10dc1278cdc769
--- /dev/null
+++ b/srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch
@@ -0,0 +1,14 @@
+SIGTERM and SIGPIPE are used but undefined.
+diff --git a/source3/printing/samba-bgqd.c b/source3/printing/samba-bgqd.c
+index 8ac6ec5..09a5d12 100644
+--- a/source3/printing/samba-bgqd.c
++++ b/source3/printing/samba-bgqd.c
+@@ -40,6 +40,7 @@
+ #include "source3/lib/util_procid.h"
+ #include "source3/auth/proto.h"
+ #include "source3/printing/queue_process.h"
+ #include "source3/lib/substitute.h"
++#include <signal.h>
+ 
+ static void watch_handler(struct tevent_req *req)
+ {
diff --git a/srcpkgs/samba/template b/srcpkgs/samba/template
index 20af96624fdc2b..9dbd70674ec4fc 100644
--- a/srcpkgs/samba/template
+++ b/srcpkgs/samba/template
@@ -1,69 +1,73 @@
 # Template file for 'samba'
 pkgname=samba
-version=4.14.12
-revision=5
+version=4.20.1
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
-_idmap_modules="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2"
-_pdb_modules="pdb_tdbsam,pdb_ldap,pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4"
-_auth_modules="auth_unix,auth_wbc,auth_server,auth_netlogind,autH_script,auth_samba4"
-configure_args="--enable-fhs --sbindir=/usr/bin
- --localstatedir=/var --sysconfdir=/etc --with-piddir=/run/samba
+_idmap_modules="idmap_ad,idmap_rid,idmap_ldap,idmap_hash,idmap_tdb2"
+_pdb_modules="pdb_tdbsam,pdb_ldap,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4"
+_auth_modules="auth_unix,auth_wbc,auth_server,auth_samba4,auth_skel"
+_vfs_modules="vfs_io_uring"
+configure_args="--enable-fhs --sysconfdir=/etc --localstatedir=/var
+ --sbindir=/usr/bin --with-privatelibdir=/usr/lib
+ --with-privatedir=/etc/samba/private --with-piddir=/run/samba
  --with-sockets-dir=/run/samba --with-lockdir=/run/lock/samba
- --with-privatedir=/etc/samba/private --with-pammodulesdir=/usr/lib/security
- --with-modulesdir=/usr/lib/samba --disable-rpath --disable-rpath-install
- --without-systemd --without-gettext --bundled-libraries=NONE
- --with-system-mitkrb5 --without-ad-dc --with-cluster-support
- --with-shared-modules=${_idmap_modules},${_pdb_modules},${_auth_modules}"
-hostmakedepends="pkg-config perl-Parse-Yapp rpcsvc-proto docbook2x
- libtasn1-tools tdb-python3 tevent-python3 talloc-python3 python3-setuptools"
+ --disable-rpath --disable-rpath-install --nopyc --nopyo
+ --without-gettext --without-systemd --without-gpgme
+ --with-cluster-support --with-system-mitkrb5 --with-experimental-mit-ad-dc
+ --bundled-libraries=NONE --builtin-libraries=NONE
+ --with-shared-modules=${_idmap_modules},${_pdb_modules},${_auth_modules},${_vfs_modules}"
+hostmakedepends="pkg-config perl-Parse-Yapp rpcsvc-proto docbook-xsl libxslt
+ libtasn1-tools tdb-python3 tevent-python3 talloc-python3 ldb-python3 flex
+ bison mit-krb5 python3-Markdown python3-dnspython"
 makedepends="python3-devel libtirpc-devel popt-devel e2fsprogs-devel
  mit-krb5-devel pam-devel acl-devel cups-devel avahi-libs-devel tdb-devel
  talloc-devel tevent-devel ldb-devel cmocka-devel gnutls-devel zlib-devel
- ncurses-devel libldap-devel libarchive-devel jansson-devel"
+ ncurses-devel libldap-devel libarchive-devel jansson-devel liburing-devel"
 short_desc="SMB/CIFS file, print, and login server for Unix"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.samba.org"
 distfiles="https://download.samba.org/pub/samba/stable/${pkgname}-${version}.tar.gz"
-checksum=155d9c2dfb06a18104422987590858bfe5e9783ebebe63882e7e7f07eaaa512d
+checksum=f93c3af5295340d08106c7c0dcfb85e4f85057dfd14587aa8817beb31aff88f7
 lib32disabled=yes
 conf_files="/etc/pam.d/samba /etc/samba/smb.conf"
 make_dirs="/etc/samba/private 0750 root root"
-subpackages="smbclient samba-ctdb samba-cups samba-devel samba-libs samba-python3"
+subpackages="smbclient samba-ctdb samba-cups samba-devel samba-libs
+ samba-python3 samba-dc"
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-	makedepends+=" musl-legacy-compat musl-nscd-devel"
+	makedepends+=" musl-legacy-compat musl-nscd-devel libexecinfo-devel"
 else
 	makedepends+=" glusterfs-devel"
 	subpackages+=" samba-glusterfs"
-fi
 
-# By default, samba wants to install a bunch of private "*-samba4.so" shared
-# libraries that leak into shlib_requires dependencies. Most of these can be
-# built into the public shared libraries, avoiding the mess of tracking shlibs
-# that shouldn't be exposed locally. For those that cannot be built in, make
-# sure to install them into /usr/lib so xbps-src picks them up.
-_privlibs="CHARSET3 MESSAGING_SEND MESSAGING LIBWBCLIENT_OLD addns ads \
- asn1util auth authkrb5 cmdline_contexts cmdline-credentials cli_cldap \
- cli-ldap-common cli-nbt cli_smb_common cli_spoolss clidns common-auth \
- ctdb-event-client dbwrap dcerpc-pkt-auth events genrand gensec gse http \
- interfaces krb5samba ldbsamba libcli_lsa3 libcli_netlogon3 libsmb \
- messages_dgm messages_util mscat msghdr msrpc3 netif npa_tstream popt_samba3 \
- popt_samba3_cmdline registry replace samba-cluster-support samba-debug \
- samba-modules samba-security samba-sockets samba3-util samdb-common secrets3 \
- server_id_db server-role smbclient-raw smbd_shim socket-blocking sys_rw \
- talloc_report_printf talloc_report tevent-util time-basic trusts_util \
- util_reg util_setid util_tdb"
-configure_args+=" --with-privatelibdir=/usr/lib --builtin-libraries=${_privlibs// /,}"
+	if [ "$XBPS_CHECK_PKGS" ]; then
+		configure_args+=" --enable-selftest"
+		hostmakedepends+=" python3-cryptography python3-iso8601
+		 python3-pyasn1"
+		makedepends+=" nss_wrapper pam_wrapper resolv_wrapper
+		  socket_wrapper uid_wrapper"
+	fi
+fi
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
+export PYTHONHASHSEED=1
 
 post_patch() {
 	# Look for properly named python support libraries
 	vsed -i third_party/waf/waflib/Tools/python.py \
-		-e "/env.pyext_PATTERN/s/dct\['SO'\]/'.so'/"
+		-e "s|env.pyext_PATTERN = .*$|env.pyext_PATTERN = '%s.so'|g"
+
+	# Fix for our `kdb` linking against the system `db` package which
+	# doesn't distribute a pkg-config file and the samba build scripts just
+	# can't handle that.
+	cat >>wscript_configure_system_mitkrb5 <<_EOF
+if ("db" in conf.env["LIB_KDB5"]
+      and not conf.check_cfg(package="db", mandatory=False)):
+    krb5_define_syslib(conf, "db", [])
+_EOF
 
 	# Fix log and spool locations in conf file
 	vsed -i examples/smb.conf.default \
@@ -90,6 +94,8 @@ post_install() {
 	vmkdir usr/lib/cups/backend
 	ln -fs /usr/bin/smbspool ${DESTDIR}/usr/lib/cups/backend/smb
 
+	vinstall packaging/printing/smbprint 744 usr/bin/
+
 	# Do not ship sudo rule that grants nopasswd privileges by default
 	rm -rf ${DESTDIR}/etc/sudoers.d
 
@@ -110,10 +116,9 @@ smbclient_package() {
 		local _t _tools
 
 		# These utilities have man pages in section 1
-		_tools="findsmb dbwrap_tool mdfind mvxattr nmblookup ntlm_auth
-		 oLschema2ldif regdiff regpatch regshell regtree rpcclient
-		 sharesec smbcacls smbclient smbcquotas smbget smbtar smbtree
-		 wbinfo"
+		_tools="dbwrap_tool mdsearch mvxattr nmblookup oLschema2ldif
+		regdiff regpatch regshell rpcclient sharesec smbcacls smbclient
+		smbcquotas smbget smbtar smbtree wspsearch"
 
 		for _t in ${_tools}; do
 			vmove usr/bin/${_t}
@@ -127,11 +132,9 @@ smbclient_package() {
 			vmove usr/share/man/man8/${_t}.8
 		done
 
-		# No man page for this one
+		# No man page for these
 		vmove usr/bin/dumpmscat
-
-		# Extra man page for smbget
-		vmove usr/share/man/man5/smbgetrc.5
+		vmove usr/bin/smbprint
 
 		vmove usr/libexec/samba/smbspool_krb5_wrapper
 		vmove usr/share/man/man8/smbspool_krb5_wrapper.8
@@ -171,19 +174,40 @@ samba-libs_package() {
 	replaces="libsmbclient>=0"
 	pkg_install() {
 		local _libs _privlibs _lib
-		_libs="dcerpc dcerpc-binding ndr-krb5pac ndr-nbt ndr-standard ndr
-		 samba-credentials samba-errors samba-hostconfig samba-passdb
-		 samba-util samdb smbclient smbconf smbldap wbclient"
-		_privlibs="cli-ldap cliauth cluster common-auth dcerpc-samba
-		 flag-mapping gpo iov-buf ndr-samba ndr printer-driver
-		 smb-transport tdb-wrap util-cmdline winbind-client"
+		_libs="dcerpc dcerpc-binding dcerpc-samr dcerpc-server
+		 dcerpc-server-core ndr ndr-krb5pac ndr-nbt ndr-standard netapi
+		 nss_winbind nss_wins samba-credentials samba-errors
+		 samba-hostconfig samba-passdb samba-policy samba-util samdb
+		 smbclient smbconf smbldap tevent-util wbclient"
+		_privlibs="CHARSET3 LIBWBCLIENT-OLD MESSAGING MESSAGING-SEND
+		 REG-FULL RPC-SERVER-LOOP RPC-WORKER ad-claims addns ads
+		 asn1util auth auth-unix-token auth4 authkrb5 authn-policy-util
+		 cli-cldap cli-ldap cli-ldap-common cli-nbt cli-smb-common
+		 cli-spoolss cliauth clidns cluster cmdline cmdline-contexts
+		 common-auth ctdb-event-client db-glue dbwrap dcerpc-pkt-auth
+		 dcerpc-samba dcerpc-samba4 dfs-server-ad dlz-bind9-for-torture
+		 dnsserver-common dsdb-garbage-collect-tombstones dsdb-module
+		 events flag-mapping genrand gensec gpext gpo gse http idmap
+		 interfaces iov-buf krb5samba ldbsamba libcli-lsa3
+		 libcli-netlogon3 libsmb messages-dgm messages-util mscat
+		 msghdr msrpc3 ndr-samba ndr-samba4 net-keytab netif
+		 npa-tstream nss-info pac posix-eadb printer-driver
+		 printing-migrate process-model registry replace
+		 samba-cluster-support samba-debug samba-modules samba-net
+		 samba-python samba-security samba-sockets samba3-util
+		 samdb-common scavenge-dns-records secrets3 server-id-db
+		 server-role service shares smb-transport smbclient-raw
+		 smbd-base smbd-shim smbldaphelper smbpasswdparser
+		 socket-blocking stable-sort sys-rw talloc-report
+		 talloc-report-printf tdb-wrap time-basic torture trusts-util
+		 util-reg util-setid util-tdb xattr-tdb"
 
 		for _lib in ${_libs}; do
 			vmove "usr/lib/lib${_lib}.so.*"
 		done
 
 		for _lib in ${_privlibs}; do
-			vmove "usr/lib/lib${_lib}-samba4.so"
+			vmove "usr/lib/lib${_lib}-private-samba.so"
 		done
 
 		vmove usr/share/man/man7/libsmbclient.7
@@ -209,6 +233,9 @@ samba-devel_package() {
 }
 
 samba-python3_package() {
+	depends="samba-libs>=${version}_${revision} ldb-python3
+	 talloc-python3 tdb-python3 tevent-python3 python3-cryptography
+	 python3-dnspython python3-Markdown python3-requests"
 	short_desc+=" - Python3 bindings"
 	pkg_install() {
 		vmove ${py3_lib}
@@ -222,3 +249,12 @@ samba-glusterfs_package() {
 		vmove usr/share/man/man8/vfs_glusterfs.8
 	}
 }
+
+samba-dc_package() {
+	depends="samba-python3>=${version}_${revision}"
+	short_desc+=" - AD Domain Controller"
+	pkg_install() {
+		vmove "usr/bin/samba*"
+		vmove usr/share/samba
+	}
+}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PR PATCH] [Updated] samba: update to 4.20.1.
  2024-05-22 10:43 [PR PATCH] samba: update to 4.20.1 otommod
                   ` (2 preceding siblings ...)
  2024-05-23 14:02 ` [PR PATCH] [Updated] " otommod
@ 2024-05-23 14:04 ` otommod
  2024-05-23 14:12 ` otommod
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: otommod @ 2024-05-23 14:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2130 bytes --]

There is an updated pull request by otommod against master on the void-packages repository

https://github.com/otommod/void-packages samba-4.20.1
https://github.com/void-linux/void-packages/pull/50464

samba: update to 4.20.1.
I don't have much experience with packaging and none with `Void Linux` packaging in particular, especially with a big project like Samba, so I'm not sure this is production ready yet.

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
- I built this PR locally for these architectures:
  - x86_64
  - aarch64
  - aarch64-musl

#### Questions & notes
  - `samba-libs` has a ton of private libraries that I could not build as builtin this time. Should I add all of them to `common/shlibs`?
  - I packaged `{uid,socket,nss,resolv}_wrapper` since they are needed by the `samba` testsuite but they can also be bundled in... Do we really need them? They are not used by anything else (yet).  On the other hand, `pam_wrapper`, that is also needed, is already in the repository.
  - On a related note, I tried to build the aforementioned testsuite but it ended up with a `cmocka` related build failure (`LargestIntegralType` was not defined). It did build successfully when `cmocka` was build as a bundled library though.
  - Should we break the `samba` package up? Fedora/Debian have a ton of subpackages for it and even Alpine has a few more than us.

A patch file from https://github.com/void-linux/void-packages/pull/50464.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-samba-4.20.1-50464.patch --]
[-- Type: text/x-diff, Size: 45709 bytes --]

From d200d7137e0fe2a50a5fae1fa65b4b637a93c445 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Mon, 20 May 2024 15:51:28 +0300
Subject: [PATCH 1/8] tevent: update to 0.16.1.

---
 .../tevent/patches/fix-public-headers.patch   | 13 ----------
 srcpkgs/tevent/template                       | 25 +++++++++++++------
 2 files changed, 17 insertions(+), 21 deletions(-)
 delete mode 100644 srcpkgs/tevent/patches/fix-public-headers.patch

diff --git a/srcpkgs/tevent/patches/fix-public-headers.patch b/srcpkgs/tevent/patches/fix-public-headers.patch
deleted file mode 100644
index 1710226d4580c9..00000000000000
--- a/srcpkgs/tevent/patches/fix-public-headers.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-tevent.h needs sys/types.h for pid_t
-
---- a/tevent.h	2018-07-12 05:51:30.000000000 +0000
-+++ b/tevent.h	2018-07-19 10:13:15.360128807 +0000
-@@ -31,6 +31,7 @@
- #include <stdint.h>
- #include <talloc.h>
- #include <sys/time.h>
-+#include <sys/types.h>
- #include <stdbool.h>
- 
- struct tevent_context;
-
diff --git a/srcpkgs/tevent/template b/srcpkgs/tevent/template
index 7dadd564db0bf5..1a3f49d8bb8d0b 100644
--- a/srcpkgs/tevent/template
+++ b/srcpkgs/tevent/template
@@ -1,28 +1,37 @@
 # Template file for 'tevent'
 pkgname=tevent
-version=0.11.0
-revision=3
+version=0.16.1
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
 configure_args="--sysconfdir=/etc --localstatedir=/var
  --disable-rpath --disable-rpath-install --without-gettext
  --builtin-libraries=replace --bundled-libraries=NONE"
-hostmakedepends="pkg-config docbook2x python3-setuptools"
-makedepends="python3-devel talloc-devel libxslt gettext-devel cmocka-devel"
+hostmakedepends="pkg-config docbook-xsl libxslt"
+makedepends="python3-devel talloc-devel cmocka-devel"
 short_desc="Event system based on the talloc memory management library"
 maintainer="Yuusha Spacewolf <xyuusha@paranoici.org>"
 license="GPL-3.0-or-later"
 homepage="https://tevent.samba.org"
 distfiles="https://download.samba.org/pub/tevent/tevent-${version}.tar.gz"
-checksum=ee9a86c8e808aac2fe1e924eaa139ff7f0269d0e8e4fafa850ae5c7489bc82ba
+checksum=362971e0f32dc1905f6fe4736319c4b8348c22dc85aa6c3f690a28efe548029e
+
+if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
+	makedepends+=" libxcrypt-devel"
+fi
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
+export PYTHONHASHSEED=1
+
+do_check() {
+	${configure_script} test
+}
 
 post_patch() {
-	# Avoid Python shlib extension noise in libpytallic-util.so
-	vsed -e "/env.pyext_PATTERN/s/dct\['SO'\]/'.so'/" \
-		-i third_party/waf/waflib/Tools/python.py
+	# Look for properly named python support libraries
+	vsed -i third_party/waf/waflib/Tools/python.py \
+		-e "s|env.pyext_PATTERN = .*$|env.pyext_PATTERN = '%s.so'|"
 }
 
 tevent-python3_package() {

From b33ecfc10008f0f180ccf7f54c0b65518e17e014 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Mon, 20 May 2024 18:06:26 +0300
Subject: [PATCH 2/8] tdb: update to 1.4.10.

---
 srcpkgs/tdb/template | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/tdb/template b/srcpkgs/tdb/template
index 0134d2dcc2fb91..6d1c3039ed914f 100644
--- a/srcpkgs/tdb/template
+++ b/srcpkgs/tdb/template
@@ -1,21 +1,25 @@
 # Template file for 'tdb'
 pkgname=tdb
-version=1.4.9
-revision=2
+version=1.4.10
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
-configure_args="--prefix=/usr --libdir=/usr/lib --sysconfdir=/etc
- --localstatedir=/var --disable-rpath --disable-rpath-install
- --builtin-libraries=replace --bundled-libraries=NONE --without-gettext"
-hostmakedepends="pkg-config docbook2x"
-makedepends="python3-devel libxslt gettext-devel"
+configure_args="--sysconfdir=/etc --localstatedir=/var
+ --disable-rpath --disable-rpath-install --without-gettext
+ --builtin-libraries=replace --bundled-libraries=NONE"
+hostmakedepends="pkg-config docbook-xsl libxslt"
+makedepends="python3-devel"
 short_desc="Trivial Database, similar to GDBM but allows simultaneous commits"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="https://tdb.samba.org/"
 distfiles="https://download.samba.org/pub/tdb/tdb-${version}.tar.gz"
-checksum=0ac226073e3a2db8648da7af744cb95f50766a52feeb001d558b2b321b74a765
+checksum=02338e33c16c21c9e29571cef523e76b2b708636254f6f30c6cf195d48c62daf
+
+if [ "$XBPS_TARGET_LIBC" = glibc ]; then
+	makedepends+=" libxcrypt-devel"
+fi
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
 export PYTHONHASHSEED=1

From 953e05c68fd4d066e82c353f7213006aa2dc8d17 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Mon, 20 May 2024 18:20:57 +0300
Subject: [PATCH 3/8] ldb: update to 2.9.0.

---
 srcpkgs/ldb/patches/strtoull.patch | 89 ++++++++++++++++++++++++++++++
 srcpkgs/ldb/template               | 29 +++++-----
 2 files changed, 104 insertions(+), 14 deletions(-)
 create mode 100644 srcpkgs/ldb/patches/strtoull.patch

diff --git a/srcpkgs/ldb/patches/strtoull.patch b/srcpkgs/ldb/patches/strtoull.patch
new file mode 100644
index 00000000000000..2fcd928a3d143c
--- /dev/null
+++ b/srcpkgs/ldb/patches/strtoull.patch
@@ -0,0 +1,89 @@
+diff --git a/lib/replace/replace.c b/lib/replace/replace.c
+index 0652cb4..02b6ebf 100644
+--- a/lib/replace/replace.c
++++ b/lib/replace/replace.c
+@@ -559,41 +559,6 @@ long long int rep_strtoll(const char *str, char **endptr, int base)
+ #endif /* HAVE_STRTOLL */
+ 
+ 
+-#ifndef HAVE_STRTOULL
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
+-{
+-#ifdef HAVE_STRTOUQ
+-	return strtouq(str, endptr, base);
+-#elif defined(HAVE___STRTOULL) 
+-	return __strtoull(str, endptr, base);
+-#elif SIZEOF_LONG == SIZEOF_LONG_LONG
+-	return (unsigned long long int) strtoul(str, endptr, base);
+-#else
+-# error "You need a strtoull function"
+-#endif
+-}
+-#else
+-#ifdef HAVE_BSD_STRTOLL
+-#undef strtoull
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
+-{
+-	int saved_errno = errno;
+-	unsigned long long int nb = strtoull(str, endptr, base);
+-	/* With glibc EINVAL is only returned if base is not ok */
+-	if (errno == EINVAL) {
+-		if (base == 0 || (base >1 && base <37)) {
+-			/* Base was ok so it's because we were not
+-			 * able to make the conversion.
+-			 * Let's reset errno.
+-			 */
+-			errno = saved_errno;
+-		}
+-	}
+-	return nb;
+-}
+-#endif /* HAVE_BSD_STRTOLL */
+-#endif /* HAVE_STRTOULL */
+-
+ #ifndef HAVE_SETENV
+ int rep_setenv(const char *name, const char *value, int overwrite) 
+ {
+diff --git a/lib/replace/replace.h b/lib/replace/replace.h
+index a8910e2..854b1a7 100644
+--- a/lib/replace/replace.h
++++ b/lib/replace/replace.h
+@@ -394,16 +394,6 @@ long long int rep_strtoll(const char *str, char **endptr, int base);
+ #endif
+ #endif
+ 
+-#ifndef HAVE_STRTOULL
+-#define strtoull rep_strtoull
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base);
+-#else
+-#ifdef HAVE_BSD_STRTOLL /* yes, it's not HAVE_BSD_STRTOULL */
+-#define strtoull rep_strtoull
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base);
+-#endif
+-#endif
+-
+ #ifndef HAVE_FTRUNCATE
+ #define ftruncate rep_ftruncate
+ int rep_ftruncate(int,off_t);
+diff --git a/lib/replace/wscript b/lib/replace/wscript
+index 4c774d9..a1dc6d0 100644
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -411,7 +411,7 @@ def configure(conf):
+     conf.CHECK_FUNCS('initgroups pread pwrite strndup strcasestr strsep')
+     conf.CHECK_FUNCS('strtok_r mkdtemp dup2 dprintf vdprintf isatty chown lchown')
+     conf.CHECK_FUNCS('link readlink symlink realpath snprintf vsnprintf')
+-    conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen strtoull __strtoull')
++    conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen')
+     conf.CHECK_FUNCS('strtouq strtoll __strtoll strtoq memalign posix_memalign')
+     conf.CHECK_FUNCS('fmemopen')
+ 
+@@ -866,7 +866,7 @@ REPLACEMENT_FUNCTIONS = {
+                   'memmove', 'strdup', 'setlinebuf', 'vsyslog', 'strnlen',
+                   'strndup', 'waitpid', 'seteuid', 'setegid', 'chroot',
+                   'mkstemp', 'mkdtemp', 'pread', 'pwrite', 'strcasestr',
+-                  'strsep', 'strtok_r', 'strtoll', 'strtoull', 'setenv', 'unsetenv',
++                  'strsep', 'strtok_r', 'strtoll', 'setenv', 'unsetenv',
+                   'utime', 'utimes', 'dup2', 'chown', 'link', 'readlink',
+                   'symlink', 'lchown', 'realpath', 'memmem', 'vdprintf',
+                   'dprintf', 'get_current_dir_name', 'copy_file_range',
diff --git a/srcpkgs/ldb/template b/srcpkgs/ldb/template
index 964a2c33009da0..f3dcb95611ceb4 100644
--- a/srcpkgs/ldb/template
+++ b/srcpkgs/ldb/template
@@ -1,7 +1,7 @@
 # Template file for 'ldb'
 pkgname=ldb
-version=2.3.2
-revision=3
+version=2.9.0
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
@@ -9,28 +9,29 @@ configure_args="--sysconfdir=/etc --localstatedir=/var
  --disable-rpath --disable-rpath-install --without-gettext
  --builtin-libraries=replace --bundled-libraries=NONE
  --with-modulesdir=/usr/lib/ldb/modules"
-hostmakedepends="pkg-config docbook2x tdb-python3 tevent-python3 python3-setuptools"
-makedepends="python3-devel tdb-devel tevent-devel talloc-devel
- popt-devel lmdb-devel libxslt gettext-devel cmocka-devel"
+hostmakedepends="pkg-config docbook-xsl libxslt tdb-python3 tevent-python3"
+makedepends="python3-devel tdb-devel tevent-devel talloc-devel popt-devel
+ lmdb-devel cmocka-devel"
 checkdepends="cmocka-devel"
 short_desc="LDAP-like database from samba"
 maintainer="Yuusha Spacewolf <xyuusha@paranoici.org>"
 license="LGPL-3.0-or-later"
 homepage="https://www.samba.org/ldb/"
 distfiles="https://download.samba.org/pub/ldb/ldb-${version}.tar.gz"
-checksum=1416c949dc4326e41c0d8a5ecf8ef784f8c0b6e9d3dad8fa971e84ad56227603
-
-# workaround for cmocka's broken uintptr_t definition on musl
-if [ "$XBPS_TARGET_WORDSIZE" = "64" -a "$XBPS_TARGET_LIBC" = "musl" ]; then
-	CFLAGS+=" -D__WORDSIZE=64"
-fi
+checksum=105aaff71ad881a7faeb582fd416ae28221b6fde338fff82828065062c2507a5
+make_check=extended # testsuite takes a long time
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
+export PYTHONHASHSEED=1
 
 post_patch() {
-	# Avoid Python shlib extension noise in libpyldb-util.so
-	vsed -e "/env.pyext_PATTERN/s/dct\['SO'\]/'.so'/" \
-		-i third_party/waf/waflib/Tools/python.py
+	# Look for properly named python support libraries
+	vsed -i third_party/waf/waflib/Tools/python.py \
+		-e "s|env.pyext_PATTERN = .*$|env.pyext_PATTERN = '%s.so'|"
+}
+
+do_check() {
+	${configure_script} test ${makejobs}
 }
 
 ldb-python3_package() {

From 3fa890c670718b1a96f911a800416fccc2d57129 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 10:22:00 +0300
Subject: [PATCH 4/8] New package: uid_wrapper-1.3.0.

---
 .../uid_wrapper-fix-for-cmocka-1.1.6.patch    | 31 +++++++++++++++++++
 srcpkgs/uid_wrapper/template                  | 22 +++++++++++++
 2 files changed, 53 insertions(+)
 create mode 100644 srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch
 create mode 100644 srcpkgs/uid_wrapper/template

diff --git a/srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch b/srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch
new file mode 100644
index 00000000000000..c99c3ad6bce663
--- /dev/null
+++ b/srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch
@@ -0,0 +1,31 @@
+From 850f24c6366abda30bfd77734b90330b8809d306 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Fri, 17 Feb 2023 17:51:27 +0100
+Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
+---
+ tests/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 635e86e..68e050e 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ project(tests C)
+ 
++if (TARGET cmocka::cmocka)
++    set(CMOCKA_LIBRARY cmocka::cmocka)
++endif()
++
+ add_library(uwrap_fake_socket_wrapper SHARED uwrap_fake_socket_wrapper.c)
+ target_compile_options(uwrap_fake_socket_wrapper
+                        PRIVATE
+-- 
+2.34.1
+
diff --git a/srcpkgs/uid_wrapper/template b/srcpkgs/uid_wrapper/template
new file mode 100644
index 00000000000000..24a90e93767069
--- /dev/null
+++ b/srcpkgs/uid_wrapper/template
@@ -0,0 +1,22 @@
+# Template file for 'uid_wrapper'
+pkgname=uid_wrapper
+version=1.3.0
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Testing tool to fake privilege separation"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="https://cwrap.org/uid_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=f7e7c1bde533530051931414724453e14e02adbb614824b6fe27cbb98654b762
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel"
+	checkdepends+=" cmocka"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 3279660419002213c5557ec0a10c0a4fc4fab683 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 11:09:08 +0300
Subject: [PATCH 5/8] New package: socket_wrapper-1.4.2

---
 srcpkgs/socket_wrapper/template | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/socket_wrapper/template

diff --git a/srcpkgs/socket_wrapper/template b/srcpkgs/socket_wrapper/template
new file mode 100644
index 00000000000000..45d462668c5c4f
--- /dev/null
+++ b/srcpkgs/socket_wrapper/template
@@ -0,0 +1,22 @@
+# Template file for 'socket_wrapper'
+pkgname=socket_wrapper
+version=1.4.2
+revision=1
+archs="~*-musl" # socket_wrapper redefines libc funcs, you can't do that on musl
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Library for passing all socket communications through unix sockets"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="http://cwrap.org/socket_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=0a08ec249dd9ffbb3b16d577b352d573561f57beeec3596182ac6ec8e46b9ab6
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 440aa36bfe59867bca88006b16284325f4e5aab6 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 10:21:20 +0300
Subject: [PATCH 6/8] New package: nss_wrapper-1.1.15.

---
 .../nss_wrapper-fix-for-cmocka-1.1.6.patch    | 31 +++++++++++++++++++
 srcpkgs/nss_wrapper/template                  | 27 ++++++++++++++++
 2 files changed, 58 insertions(+)
 create mode 100644 srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch
 create mode 100644 srcpkgs/nss_wrapper/template

diff --git a/srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch b/srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch
new file mode 100644
index 00000000000000..ba2589be2d0834
--- /dev/null
+++ b/srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch
@@ -0,0 +1,31 @@
+From 2c879a0ffa70cee33329291d7576ec971d420da2 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Fri, 17 Feb 2023 17:51:27 +0100
+Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
+---
+ tests/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 3b94076..733cc4e 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ project(tests C)
+ 
++if (TARGET cmocka::cmocka)
++    set(CMOCKA_LIBRARY cmocka::cmocka)
++endif()
++
+ set(TESTSUITE_LIBRARIES nss_utils ${NWRAP_REQUIRED_LIBRARIES} ${CMOCKA_LIBRARY})
+ string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
+ 
+-- 
+2.39.2
+
diff --git a/srcpkgs/nss_wrapper/template b/srcpkgs/nss_wrapper/template
new file mode 100644
index 00000000000000..94fa88b333cda9
--- /dev/null
+++ b/srcpkgs/nss_wrapper/template
@@ -0,0 +1,27 @@
+# Template file for 'nss_wrapper'
+pkgname=nss_wrapper
+version=1.1.15
+revision=1
+archs="~*-musl" # complains about the getXXent_r functions missing
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Wrapper for the user, group and hosts NSS API"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="http://cwrap.org/nss_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=36f874832a4f2158e04f69aa77e5515e16cf6e3bf81968d5dd8496db7d6906ad
+
+if [ "$XBPS_TARGET_LIBC" = glibc ]; then
+	makedepends+=" libxcrypt-devel"
+fi
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel uid_wrapper"
+	checkdepends+=" cmocka"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 75b633eef8b1f44ad9a205f316b03666c45144dd Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 10:22:30 +0300
Subject: [PATCH 7/8] New package: resolv_wrapper-1.1.8

---
 .../resolv_wrapper-fix-for-cmocka-1.1.6.patch | 31 +++++++++++++++++++
 srcpkgs/resolv_wrapper/template               | 23 ++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100644 srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch
 create mode 100644 srcpkgs/resolv_wrapper/template

diff --git a/srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch b/srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch
new file mode 100644
index 00000000000000..5640be33053a8c
--- /dev/null
+++ b/srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch
@@ -0,0 +1,31 @@
+From f2e7f58025ecb4cf399494166abea01813b1d0f0 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Fri, 17 Feb 2023 17:51:27 +0100
+Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
+---
+ tests/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 1262bed..7f2f4ee 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ project(tests C)
+ 
++if (TARGET cmocka::cmocka)
++    set(CMOCKA_LIBRARY cmocka::cmocka)
++endif()
++
+ set(TORTURE_LIBRARY torture)
+ 
+ # A simple DNS server for testing
+-- 
+2.34.1
+
diff --git a/srcpkgs/resolv_wrapper/template b/srcpkgs/resolv_wrapper/template
new file mode 100644
index 00000000000000..4e1215c7b69867
--- /dev/null
+++ b/srcpkgs/resolv_wrapper/template
@@ -0,0 +1,23 @@
+# Template file for 'resolv_wrapper'
+pkgname=resolv_wrapper
+version=1.1.8
+revision=1
+archs="~*-musl" # missing res_ninit, res_nclose, etc
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Wrapper for DNS name resolving or DNS faking"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="https://cwrap.org/resolv_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=fbc30f77da3e12ecd4ef66ccf5ab77e0b744930ccd89062404082f928a8ec2e0
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel socket_wrapper"
+	checkdepends+=" cmocka"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 890c310a902a68376cf35cd30c7f75cd3b6309c5 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 13:06:38 +0300
Subject: [PATCH 8/8] samba: update to 4.20.1.

This also builds and packages the io_uring VFS and more importantly the
AD Domain Control part of Samba.
---
 common/shlibs                                 | 183 +++++++++++++-----
 srcpkgs/samba-dc                              |   1 +
 srcpkgs/samba/patches/fix-glibc-2.36.patch    |  59 ------
 srcpkgs/samba/patches/missing-headers.patch   |  52 -----
 srcpkgs/samba/patches/netdb-defines.patch     |  19 --
 .../patches/samba-bgqd-include-signal-h.patch |  14 ++
 srcpkgs/samba/template                        | 140 +++++++++-----
 7 files changed, 234 insertions(+), 234 deletions(-)
 create mode 120000 srcpkgs/samba-dc
 delete mode 100644 srcpkgs/samba/patches/fix-glibc-2.36.patch
 delete mode 100644 srcpkgs/samba/patches/missing-headers.patch
 delete mode 100644 srcpkgs/samba/patches/netdb-defines.patch
 create mode 100644 srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch

diff --git a/common/shlibs b/common/shlibs
index ff14234e60cdba..1d0b5f3bbb8d8b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4051,58 +4051,137 @@ libevemu.so.3 evemu-2.7.0_1
 libinih.so.0 inih-52_1
 libINIReader.so.0 inih-57_1
 libpcaudio.so.0 pcaudiolib-1.1_1
-libdcerpc-samr.so.0 samba-4.13.2_1
-libdcerpc-server-core.so.0 samba-4.13.2_1
-libnetapi.so.0 samba-4.13.2_1
-libnss_winbind.so.2 samba-4.13.2_1
-libnss_wins.so.2 samba-4.13.2_1
-libsamba-policy.so.0 samba-4.13.2_1
-libauth-unix-token-samba4.so samba-4.13.2_1
-libauth4-samba4.so samba-4.13.3_1
-libdcerpc-samba4.so samba-4.13.2_1
-libdsdb-module-samba4.so samba-4.13.2_1
-libgpext-samba4.so samba-4.13.2_1
-libnet-keytab-samba4.so samba-4.13.3_1
-libposix-eadb-samba4.so samba-4.13.2_1
-libprinting-migrate-samba4.so samba-4.13.2_1
-libsamba-net-samba4.so samba-4.13.2_1
-libsamba-python-samba4.so samba-4.13.3_1
-libshares-samba4.so samba-4.13.2_1
-libsmbd-base-samba4.so samba-4.13.2_1
-libsmbd-conn-samba4.so samba-4.13.2_1
-libsmbpasswordparser-samba4.so samba-4.13.3_1
-libxattr-tdb-samba4.so samba-4.13.2_1
-libdcerpc.so.0 samba-libs-4.13.2_1
-libdcerpc-binding.so.0 samba-libs-4.13.2_1
-libndr-krb5pac.so.0 samba-libs-4.13.2_1
-libndr-nbt.so.0 samba-libs-4.13.2_1
-libndr-standard.so.0 samba-libs-4.13.2_1
-libndr.so.1 samba-libs-4.13.2_1
-libsamba-credentials.so.1 samba-libs-4.13.2_1
-libsamba-errors.so.1 samba-libs-4.13.2_1
-libsamba-hostconfig.so.0 samba-libs-4.13.2_1
-libsamba-passdb.so.0 samba-libs-4.13.2_1
-libsamba-util.so.0 samba-libs-4.13.2_1
-libsamdb.so.0 samba-libs-4.13.2_1
-libsmbclient.so.0 samba-libs-4.13.2_1
-libsmbconf.so.0 samba-libs-4.13.2_1
-libsmbldap.so.2 samba-libs-4.13.2_1
-libwbclient.so.0 samba-libs-4.13.2_1
-libcli-ldap-samba4.so samba-libs-4.13.2_1
-libcliauth-samba4.so samba-libs-4.13.2_1
-libcluster-samba4.so samba-libs-4.13.3_1
-libcommon-auth-samba4.so samba-libs-4.13.2_1
-libdcerpc-samba-samba4.so samba-libs-4.13.2_1
-libflag-mapping-samba4.so samba-libs-4.13.3_1
-libgpo-samba4.so samba-libs-4.13.2_1
-libiov-buf-samba4.so samba-libs-4.13.3_1
-libndr-samba-samba4.so samba-libs-4.13.2_1
-libndr-samba4.so samba-libs-4.13.2_1
-libprinter-driver-samba4.so samba-libs-4.13.3_1
-libsmb-transport-samba4.so samba-libs-4.13.2_1
-libtdb-wrap-samba4.so samba-libs-4.13.3_1
-libutil-cmdline-samba4.so samba-libs-4.13.2_1
-libwinbind-client-samba4.so samba-libs-4.13.2_1
+libdcerpc.so.0 samba-libs-4.20.1_1
+libdcerpc-binding.so.0 samba-libs-4.20.1_1
+libdcerpc-samr.so.0 samba-libs-4.20.1_1
+libdcerpc-server.so.0 samba-libs-4.20.1_1
+libdcerpc-server-core.so.0 samba-libs-4.20.1_1
+libndr.so.4 samba-libs-4.20.1_1
+libndr-krb5pac.so.0 samba-libs-4.20.1_1
+libndr-nbt.so.0 samba-libs-4.20.1_1
+libndr-standard.so.0 samba-libs-4.20.1_1
+libnetapi.so.1 samba-libs-4.20.1_1
+libnss_winbind.so.2 samba-libs-4.20.1_1
+libnss_wins.so.2 samba-libs-4.20.1_1
+libsamba-credentials.so.1 samba-libs-4.20.1_1
+libsamba-errors.so.1 samba-libs-4.20.1_1
+libsamba-hostconfig.so.0 samba-libs-4.20.1_1
+libsamba-passdb.so.0 samba-libs-4.20.1_1
+libsamba-policy.so.0 samba-libs-4.20.1_1
+libsamba-util.so.0 samba-libs-4.20.1_1
+libsamdb.so.0 samba-libs-4.20.1_1
+libsmbclient.so.0 samba-libs-4.20.1_1
+libsmbconf.so.0 samba-libs-4.20.1_1
+libsmbldap.so.2 samba-libs-4.20.1_1
+libtevent-util.so.0 samba-libs-4.20.1_1
+libwbclient.so.0 samba-libs-4.20.1_1
+libCHARSET3-private-samba.so samba-libs-4.20.1_1
+libLIBWBCLIENT-OLD-private-samba.so samba-libs-4.20.1_1
+libMESSAGING-private-samba.so samba-libs-4.20.1_1
+libMESSAGING-SEND-private-samba.so samba-libs-4.20.1_1
+libREG-FULL-private-samba.so samba-libs-4.20.1_1
+libRPC-SERVER-LOOP-private-samba.so samba-libs-4.20.1_1
+libRPC-WORKER-private-samba.so samba-libs-4.20.1_1
+libad-claims-private-samba.so samba-libs-4.20.1_1
+libaddns-private-samba.so samba-libs-4.20.1_1
+libads-private-samba.so samba-libs-4.20.1_1
+libasn1util-private-samba.so samba-libs-4.20.1_1
+libauth-private-samba.so samba-libs-4.20.1_1
+libauth-unix-token-private-samba.so samba-libs-4.20.1_1
+libauth4-private-samba.so samba-libs-4.20.1_1
+libauthkrb5-private-samba.so samba-libs-4.20.1_1
+libauthn-policy-util-private-samba.so samba-libs-4.20.1_1
+libcli-cldap-private-samba.so samba-libs-4.20.1_1
+libcli-ldap-private-samba.so samba-libs-4.20.1_1
+libcli-ldap-common-private-samba.so samba-libs-4.20.1_1
+libcli-nbt-private-samba.so samba-libs-4.20.1_1
+libcli-smb-common-private-samba.so samba-libs-4.20.1_1
+libcli-spoolss-private-samba.so samba-libs-4.20.1_1
+libcliauth-private-samba.so samba-libs-4.20.1_1
+libclidns-private-samba.so samba-libs-4.20.1_1
+libcluster-private-samba.so samba-libs-4.20.1_1
+libcmdline-private-samba.so samba-libs-4.20.1_1
+libcmdline-contexts-private-samba.so samba-libs-4.20.1_1
+libcommon-auth-private-samba.so samba-libs-4.20.1_1
+libctdb-event-client-private-samba.so samba-libs-4.20.1_1
+libdb-glue-private-samba.so samba-libs-4.20.1_1
+libdbwrap-private-samba.so samba-libs-4.20.1_1
+libdcerpc-pkt-auth-private-samba.so samba-libs-4.20.1_1
+libdcerpc-samba-private-samba.so samba-libs-4.20.1_1
+libdcerpc-samba4-private-samba.so samba-libs-4.20.1_1
+libdfs-server-ad-private-samba.so samba-libs-4.20.1_1
+libdlz-bind9-for-torture-private-samba.so samba-libs-4.20.1_1
+libdnsserver-common-private-samba.so samba-libs-4.20.1_1
+libdsdb-garbage-collect-tombstones-private-samba.so samba-libs-4.20.1_1
+libdsdb-module-private-samba.so samba-libs-4.20.1_1
+libevents-private-samba.so samba-libs-4.20.1_1
+libflag-mapping-private-samba.so samba-libs-4.20.1_1
+libgenrand-private-samba.so samba-libs-4.20.1_1
+libgensec-private-samba.so samba-libs-4.20.1_1
+libgpext-private-samba.so samba-libs-4.20.1_1
+libgpo-private-samba.so samba-libs-4.20.1_1
+libgse-private-samba.so samba-libs-4.20.1_1
+libhttp-private-samba.so samba-libs-4.20.1_1
+libidmap-private-samba.so samba-libs-4.20.1_1
+libinterfaces-private-samba.so samba-libs-4.20.1_1
+libiov-buf-private-samba.so samba-libs-4.20.1_1
+libkrb5samba-private-samba.so samba-libs-4.20.1_1
+libldbsamba-private-samba.so samba-libs-4.20.1_1
+liblibcli-lsa3-private-samba.so samba-libs-4.20.1_1
+liblibcli-netlogon3-private-samba.so samba-libs-4.20.1_1
+liblibsmb-private-samba.so samba-libs-4.20.1_1
+libmessages-dgm-private-samba.so samba-libs-4.20.1_1
+libmessages-util-private-samba.so samba-libs-4.20.1_1
+libmscat-private-samba.so samba-libs-4.20.1_1
+libmsghdr-private-samba.so samba-libs-4.20.1_1
+libmsrpc3-private-samba.so samba-libs-4.20.1_1
+libndr-samba-private-samba.so samba-libs-4.20.1_1
+libndr-samba4-private-samba.so samba-libs-4.20.1_1
+libnet-keytab-private-samba.so samba-libs-4.20.1_1
+libnetif-private-samba.so samba-libs-4.20.1_1
+libnpa-tstream-private-samba.so samba-libs-4.20.1_1
+libnss-info-private-samba.so samba-libs-4.20.1_1
+libpac-private-samba.so samba-libs-4.20.1_1
+libposix-eadb-private-samba.so samba-libs-4.20.1_1
+libprinter-driver-private-samba.so samba-libs-4.20.1_1
+libprinting-migrate-private-samba.so samba-libs-4.20.1_1
+libprocess-model-private-samba.so samba-libs-4.20.1_1
+libregistry-private-samba.so samba-libs-4.20.1_1
+libreplace-private-samba.so samba-libs-4.20.1_1
+libsamba-cluster-support-private-samba.so samba-libs-4.20.1_1
+libsamba-debug-private-samba.so samba-libs-4.20.1_1
+libsamba-modules-private-samba.so samba-libs-4.20.1_1
+libsamba-net-private-samba.so samba-libs-4.20.1_1
+libsamba-python-private-samba.so samba-libs-4.20.1_1
+libsamba-security-private-samba.so samba-libs-4.20.1_1
+libsamba-sockets-private-samba.so samba-libs-4.20.1_1
+libsamba3-util-private-samba.so samba-libs-4.20.1_1
+libsamdb-common-private-samba.so samba-libs-4.20.1_1
+libscavenge-dns-records-private-samba.so samba-libs-4.20.1_1
+libsecrets3-private-samba.so samba-libs-4.20.1_1
+libserver-id-db-private-samba.so samba-libs-4.20.1_1
+libserver-role-private-samba.so samba-libs-4.20.1_1
+libservice-private-samba.so samba-libs-4.20.1_1
+libshares-private-samba.so samba-libs-4.20.1_1
+libsmb-transport-private-samba.so samba-libs-4.20.1_1
+libsmbclient-raw-private-samba.so samba-libs-4.20.1_1
+libsmbd-base-private-samba.so samba-libs-4.20.1_1
+libsmbd-shim-private-samba.so samba-libs-4.20.1_1
+libsmbldaphelper-private-samba.so samba-libs-4.20.1_1
+libsmbpasswdparser-private-samba.so samba-libs-4.20.1_1
+libsocket-blocking-private-samba.so samba-libs-4.20.1_1
+libstable-sort-private-samba.so samba-libs-4.20.1_1
+libsys-rw-private-samba.so samba-libs-4.20.1_1
+libtalloc-report-private-samba.so samba-libs-4.20.1_1
+libtalloc-report-printf-private-samba.so samba-libs-4.20.1_1
+libtdb-wrap-private-samba.so samba-libs-4.20.1_1
+libtime-basic-private-samba.so samba-libs-4.20.1_1
+libtorture-private-samba.so samba-libs-4.20.1_1
+libtrusts-util-private-samba.so samba-libs-4.20.1_1
+libutil-reg-private-samba.so samba-libs-4.20.1_1
+libutil-setid-private-samba.so samba-libs-4.20.1_1
+libutil-tdb-private-samba.so samba-libs-4.20.1_1
+libxattr-tdb-private-samba.so samba-libs-4.20.1_1
 libsixel.so.1 libsixel-1.8.6_1
 libpamtest.so.0 pam_wrapper-1.1.3_1
 libopenaptx.so.0 libopenaptx-0.2.0_1
diff --git a/srcpkgs/samba-dc b/srcpkgs/samba-dc
new file mode 120000
index 00000000000000..cba1f39180b3aa
--- /dev/null
+++ b/srcpkgs/samba-dc
@@ -0,0 +1 @@
+samba
\ No newline at end of file
diff --git a/srcpkgs/samba/patches/fix-glibc-2.36.patch b/srcpkgs/samba/patches/fix-glibc-2.36.patch
deleted file mode 100644
index beb84ce6a8ded2..00000000000000
--- a/srcpkgs/samba/patches/fix-glibc-2.36.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 766151bf5b7ef95ae4c8c98b8994e5c21c5bbec0 Mon Sep 17 00:00:00 2001
-From: Andreas Schneider <asn@samba.org>
-Date: Tue, 2 Aug 2022 07:55:46 +0200
-Subject: [PATCH] lib:replace: Only include <sys/mount.h> on non-Linux systems
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Details at:
-https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
-
-BUG: https://bugzilla.samba.org/show_bug.cgi?id=15132
-
-Signed-off-by: Andreas Schneider <asn@samba.org>
-Reviewed-by: Ralph Boehme <slow@samba.org>
-
-Autobuild-User(master): Ralph Böhme <slow@samba.org>
-Autobuild-Date(master): Tue Aug  2 11:05:14 UTC 2022 on sn-devel-184
----
- lib/replace/system/filesys.h | 4 +++-
- lib/replace/wscript          | 3 +++
- 2 files changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/lib/replace/system/filesys.h b/lib/replace/system/filesys.h
-index 034e5d5886c..bb9482c69af 100644
---- a/lib/replace/system/filesys.h
-+++ b/lib/replace/system/filesys.h
-@@ -36,7 +36,8 @@
- #include <sys/param.h>
- #endif
- 
--#ifdef HAVE_SYS_MOUNT_H
-+/* This include is required on UNIX (*BSD, AIX, ...) for statfs() */
-+#if !defined(LINUX) && defined(HAVE_SYS_MOUNT_H)
- #include <sys/mount.h>
- #endif
- 
-@@ -44,6 +45,7 @@
- #include <mntent.h>
- #endif
- 
-+/* This include is required on Linux for statfs() */
- #ifdef HAVE_SYS_VFS_H
- #include <sys/vfs.h>
- #endif
-diff --git a/lib/replace/wscript b/lib/replace/wscript
-index 4c774d9f0c3..dd9b19219a1 100644
---- a/lib/replace/wscript
-+++ b/lib/replace/wscript
-@@ -31,6 +31,9 @@ def configure(conf):
- 
-     conf.env.standalone_replace = conf.IN_LAUNCH_DIR()
- 
-+    if sys.platform.rfind('linux') > -1:
-+        conf.DEFINE('LINUX', '1')
-+
-     conf.DEFINE('BOOL_DEFINED', 1)
-     conf.DEFINE('HAVE_LIBREPLACE', 1)
-     conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
diff --git a/srcpkgs/samba/patches/missing-headers.patch b/srcpkgs/samba/patches/missing-headers.patch
deleted file mode 100644
index 820d7ecd903fbc..00000000000000
--- a/srcpkgs/samba/patches/missing-headers.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-diff --git lib/param/loadparm.h lib/param/loadparm.h
-index b5d79b9..3f4eae0 100644
---- a/lib/param/loadparm.h
-+++ b/lib/param/loadparm.h
-@@ -31,6 +31,7 @@
- #define _LOADPARM_H
- 
- #include <talloc.h>
-+#include <time.h>
- 
- struct parmlist_entry {
- 	struct parmlist_entry *prev, *next;
-diff --git source3/lib/system_smbd.c source3/lib/system_smbd.c
-index 3b1ac9c..4044d75 100644
---- a/source3/lib/system_smbd.c
-+++ b/source3/lib/system_smbd.c
-@@ -27,6 +27,8 @@
- #include "system/passwd.h"
- #include "nsswitch/winbind_client.h"
- #include "../lib/util/setid.h"
-+#include <grp.h>
-+#include <uuid/uuid.h>
- 
- #ifndef HAVE_GETGROUPLIST
- 
-diff --git source4/torture/local/nss_tests.c source4/torture/local/nss_tests.c
-index 2cd6122..0c84ec2 100644
---- a/source4/torture/local/nss_tests.c
-+++ b/source4/torture/local/nss_tests.c
-@@ -20,6 +20,8 @@
- */
- 
- #include "includes.h"
-+#include <grp.h>
-+#include <uuid/uuid.h>
- 
- #include "torture/torture.h"
- #include "torture/local/proto.h"
- 
-diff --git ctdb/tests/src/protocol_util_test.c ctdb/tests/src/protocol_util_test.c
-index edd2a34..48ce96e 100644
---- a/ctdb/tests/src/protocol_util_test.c
-+++ b/ctdb/tests/src/protocol_util_test.c
-@@ -20,6 +20,7 @@
- #include "replace.h"
- #include "system/network.h"
-
-+#include <unistd.h>
- #include <assert.h>
-
- #include "protocol/protocol_basic.c"
-
diff --git a/srcpkgs/samba/patches/netdb-defines.patch b/srcpkgs/samba/patches/netdb-defines.patch
deleted file mode 100644
index 15f79eebfb6ac1..00000000000000
--- a/srcpkgs/samba/patches/netdb-defines.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff --git nsswitch/wins.c nsswitch/wins.c
-index dccb6dd..bb24acb 100644
---- a/nsswitch/wins.c
-+++ b/nsswitch/wins.c
-@@ -39,6 +39,14 @@ static pthread_mutex_t wins_nss_mutex = PTHREAD_MUTEX_INITIALIZER;
- #define INADDRSZ 4
- #endif
- 
-+#ifndef NETDB_INTERNAL
-+#define NETDB_INTERNAL -1
-+#endif
-+
-+#ifndef NETDB_SUCCESS
-+#define NETDB_SUCCESS 0
-+#endif
-+
- NSS_STATUS _nss_wins_gethostbyname_r(const char *hostname,
- 				     struct hostent *he,
- 				     char *buffer,
diff --git a/srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch b/srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch
new file mode 100644
index 00000000000000..10dc1278cdc769
--- /dev/null
+++ b/srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch
@@ -0,0 +1,14 @@
+SIGTERM and SIGPIPE are used but undefined.
+diff --git a/source3/printing/samba-bgqd.c b/source3/printing/samba-bgqd.c
+index 8ac6ec5..09a5d12 100644
+--- a/source3/printing/samba-bgqd.c
++++ b/source3/printing/samba-bgqd.c
+@@ -40,6 +40,7 @@
+ #include "source3/lib/util_procid.h"
+ #include "source3/auth/proto.h"
+ #include "source3/printing/queue_process.h"
+ #include "source3/lib/substitute.h"
++#include <signal.h>
+ 
+ static void watch_handler(struct tevent_req *req)
+ {
diff --git a/srcpkgs/samba/template b/srcpkgs/samba/template
index 20af96624fdc2b..4c0f2dbdbf242c 100644
--- a/srcpkgs/samba/template
+++ b/srcpkgs/samba/template
@@ -1,69 +1,73 @@
 # Template file for 'samba'
 pkgname=samba
-version=4.14.12
-revision=5
+version=4.20.1
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
-_idmap_modules="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2"
-_pdb_modules="pdb_tdbsam,pdb_ldap,pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4"
-_auth_modules="auth_unix,auth_wbc,auth_server,auth_netlogind,autH_script,auth_samba4"
-configure_args="--enable-fhs --sbindir=/usr/bin
- --localstatedir=/var --sysconfdir=/etc --with-piddir=/run/samba
+_idmap_modules="idmap_ad,idmap_rid,idmap_ldap,idmap_hash,idmap_tdb2"
+_pdb_modules="pdb_tdbsam,pdb_ldap,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4"
+_auth_modules="auth_unix,auth_wbc,auth_server,auth_samba4,auth_skel"
+_vfs_modules="vfs_io_uring"
+configure_args="--enable-fhs --sysconfdir=/etc --localstatedir=/var
+ --sbindir=/usr/bin --with-privatelibdir=/usr/lib
+ --with-privatedir=/etc/samba/private --with-piddir=/run/samba
  --with-sockets-dir=/run/samba --with-lockdir=/run/lock/samba
- --with-privatedir=/etc/samba/private --with-pammodulesdir=/usr/lib/security
- --with-modulesdir=/usr/lib/samba --disable-rpath --disable-rpath-install
- --without-systemd --without-gettext --bundled-libraries=NONE
- --with-system-mitkrb5 --without-ad-dc --with-cluster-support
- --with-shared-modules=${_idmap_modules},${_pdb_modules},${_auth_modules}"
-hostmakedepends="pkg-config perl-Parse-Yapp rpcsvc-proto docbook2x
- libtasn1-tools tdb-python3 tevent-python3 talloc-python3 python3-setuptools"
+ --disable-rpath --disable-rpath-install --nopyc --nopyo
+ --without-gettext --without-systemd --without-gpgme
+ --with-cluster-support --with-system-mitkrb5 --with-experimental-mit-ad-dc
+ --bundled-libraries=NONE --builtin-libraries=NONE
+ --with-shared-modules=${_idmap_modules},${_pdb_modules},${_auth_modules},${_vfs_modules}"
+hostmakedepends="pkg-config perl-Parse-Yapp rpcsvc-proto docbook-xsl libxslt
+ libtasn1-tools tdb-python3 tevent-python3 talloc-python3 ldb-python3 flex
+ bison mit-krb5 python3-Markdown python3-dnspython"
 makedepends="python3-devel libtirpc-devel popt-devel e2fsprogs-devel
  mit-krb5-devel pam-devel acl-devel cups-devel avahi-libs-devel tdb-devel
  talloc-devel tevent-devel ldb-devel cmocka-devel gnutls-devel zlib-devel
- ncurses-devel libldap-devel libarchive-devel jansson-devel"
+ ncurses-devel libldap-devel libarchive-devel jansson-devel liburing-devel"
 short_desc="SMB/CIFS file, print, and login server for Unix"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.samba.org"
 distfiles="https://download.samba.org/pub/samba/stable/${pkgname}-${version}.tar.gz"
-checksum=155d9c2dfb06a18104422987590858bfe5e9783ebebe63882e7e7f07eaaa512d
+checksum=f93c3af5295340d08106c7c0dcfb85e4f85057dfd14587aa8817beb31aff88f7
 lib32disabled=yes
 conf_files="/etc/pam.d/samba /etc/samba/smb.conf"
 make_dirs="/etc/samba/private 0750 root root"
-subpackages="smbclient samba-ctdb samba-cups samba-devel samba-libs samba-python3"
+subpackages="smbclient samba-ctdb samba-cups samba-devel samba-libs
+ samba-python3 samba-dc"
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-	makedepends+=" musl-legacy-compat musl-nscd-devel"
+	makedepends+=" musl-legacy-compat musl-nscd-devel libexecinfo-devel"
 else
 	makedepends+=" glusterfs-devel"
 	subpackages+=" samba-glusterfs"
-fi
 
-# By default, samba wants to install a bunch of private "*-samba4.so" shared
-# libraries that leak into shlib_requires dependencies. Most of these can be
-# built into the public shared libraries, avoiding the mess of tracking shlibs
-# that shouldn't be exposed locally. For those that cannot be built in, make
-# sure to install them into /usr/lib so xbps-src picks them up.
-_privlibs="CHARSET3 MESSAGING_SEND MESSAGING LIBWBCLIENT_OLD addns ads \
- asn1util auth authkrb5 cmdline_contexts cmdline-credentials cli_cldap \
- cli-ldap-common cli-nbt cli_smb_common cli_spoolss clidns common-auth \
- ctdb-event-client dbwrap dcerpc-pkt-auth events genrand gensec gse http \
- interfaces krb5samba ldbsamba libcli_lsa3 libcli_netlogon3 libsmb \
- messages_dgm messages_util mscat msghdr msrpc3 netif npa_tstream popt_samba3 \
- popt_samba3_cmdline registry replace samba-cluster-support samba-debug \
- samba-modules samba-security samba-sockets samba3-util samdb-common secrets3 \
- server_id_db server-role smbclient-raw smbd_shim socket-blocking sys_rw \
- talloc_report_printf talloc_report tevent-util time-basic trusts_util \
- util_reg util_setid util_tdb"
-configure_args+=" --with-privatelibdir=/usr/lib --builtin-libraries=${_privlibs// /,}"
+	if [ "$XBPS_CHECK_PKGS" ]; then
+		configure_args+=" --enable-selftest"
+		hostmakedepends+=" python3-cryptography python3-iso8601
+		 python3-pyasn1"
+		makedepends+=" nss_wrapper pam_wrapper resolv_wrapper
+		  socket_wrapper uid_wrapper"
+	fi
+fi
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
+export PYTHONHASHSEED=1
 
 post_patch() {
 	# Look for properly named python support libraries
 	vsed -i third_party/waf/waflib/Tools/python.py \
-		-e "/env.pyext_PATTERN/s/dct\['SO'\]/'.so'/"
+		-e "s|env.pyext_PATTERN = .*$|env.pyext_PATTERN = '%s.so'|g"
+
+	# Fix for our `kdb` linking against the system `db` package which
+	# doesn't distribute a pkg-config file and the samba build scripts just
+	# can't handle that.
+	cat >>wscript_configure_system_mitkrb5 <<_EOF
+if ("db" in conf.env["LIB_KDB5"]
+      and not conf.check_cfg(package="db", mandatory=False)):
+    krb5_define_syslib(conf, "db", [])
+_EOF
 
 	# Fix log and spool locations in conf file
 	vsed -i examples/smb.conf.default \
@@ -90,6 +94,8 @@ post_install() {
 	vmkdir usr/lib/cups/backend
 	ln -fs /usr/bin/smbspool ${DESTDIR}/usr/lib/cups/backend/smb
 
+	vinstall packaging/printing/smbprint 744 usr/bin/
+
 	# Do not ship sudo rule that grants nopasswd privileges by default
 	rm -rf ${DESTDIR}/etc/sudoers.d
 
@@ -110,10 +116,9 @@ smbclient_package() {
 		local _t _tools
 
 		# These utilities have man pages in section 1
-		_tools="findsmb dbwrap_tool mdfind mvxattr nmblookup ntlm_auth
-		 oLschema2ldif regdiff regpatch regshell regtree rpcclient
-		 sharesec smbcacls smbclient smbcquotas smbget smbtar smbtree
-		 wbinfo"
+		_tools="dbwrap_tool mdsearch mvxattr nmblookup oLschema2ldif
+		regdiff regpatch regshell rpcclient sharesec smbcacls smbclient
+		smbcquotas smbget smbtar smbtree wspsearch"
 
 		for _t in ${_tools}; do
 			vmove usr/bin/${_t}
@@ -127,11 +132,9 @@ smbclient_package() {
 			vmove usr/share/man/man8/${_t}.8
 		done
 
-		# No man page for this one
+		# No man page for these
 		vmove usr/bin/dumpmscat
-
-		# Extra man page for smbget
-		vmove usr/share/man/man5/smbgetrc.5
+		vmove usr/bin/smbprint
 
 		vmove usr/libexec/samba/smbspool_krb5_wrapper
 		vmove usr/share/man/man8/smbspool_krb5_wrapper.8
@@ -171,19 +174,40 @@ samba-libs_package() {
 	replaces="libsmbclient>=0"
 	pkg_install() {
 		local _libs _privlibs _lib
-		_libs="dcerpc dcerpc-binding ndr-krb5pac ndr-nbt ndr-standard ndr
-		 samba-credentials samba-errors samba-hostconfig samba-passdb
-		 samba-util samdb smbclient smbconf smbldap wbclient"
-		_privlibs="cli-ldap cliauth cluster common-auth dcerpc-samba
-		 flag-mapping gpo iov-buf ndr-samba ndr printer-driver
-		 smb-transport tdb-wrap util-cmdline winbind-client"
+		_libs="dcerpc dcerpc-binding dcerpc-samr dcerpc-server
+		 dcerpc-server-core ndr ndr-krb5pac ndr-nbt ndr-standard netapi
+		 nss_winbind nss_wins samba-credentials samba-errors
+		 samba-hostconfig samba-passdb samba-policy samba-util samdb
+		 smbclient smbconf smbldap tevent-util wbclient"
+		_privlibs="CHARSET3 LIBWBCLIENT-OLD MESSAGING MESSAGING-SEND
+		 REG-FULL RPC-SERVER-LOOP RPC-WORKER ad-claims addns ads
+		 asn1util auth auth-unix-token auth4 authkrb5 authn-policy-util
+		 cli-cldap cli-ldap cli-ldap-common cli-nbt cli-smb-common
+		 cli-spoolss cliauth clidns cluster cmdline cmdline-contexts
+		 common-auth ctdb-event-client db-glue dbwrap dcerpc-pkt-auth
+		 dcerpc-samba dcerpc-samba4 dfs-server-ad dlz-bind9-for-torture
+		 dnsserver-common dsdb-garbage-collect-tombstones dsdb-module
+		 events flag-mapping genrand gensec gpext gpo gse http idmap
+		 interfaces iov-buf krb5samba ldbsamba libcli-lsa3
+		 libcli-netlogon3 libsmb messages-dgm messages-util mscat
+		 msghdr msrpc3 ndr-samba ndr-samba4 net-keytab netif
+		 npa-tstream nss-info pac posix-eadb printer-driver
+		 printing-migrate process-model registry replace
+		 samba-cluster-support samba-debug samba-modules samba-net
+		 samba-python samba-security samba-sockets samba3-util
+		 samdb-common scavenge-dns-records secrets3 server-id-db
+		 server-role service shares smb-transport smbclient-raw
+		 smbd-base smbd-shim smbldaphelper smbpasswdparser
+		 socket-blocking stable-sort sys-rw talloc-report
+		 talloc-report-printf tdb-wrap time-basic torture trusts-util
+		 util-reg util-setid util-tdb xattr-tdb"
 
 		for _lib in ${_libs}; do
 			vmove "usr/lib/lib${_lib}.so.*"
 		done
 
 		for _lib in ${_privlibs}; do
-			vmove "usr/lib/lib${_lib}-samba4.so"
+			vmove "usr/lib/lib${_lib}-private-samba.so"
 		done
 
 		vmove usr/share/man/man7/libsmbclient.7
@@ -209,6 +233,9 @@ samba-devel_package() {
 }
 
 samba-python3_package() {
+	depends="ldb-python3 talloc-python3 tdb-python3 tevent-python3
+	python3-cryptography python3-dnspython python3-Markdown
+	python3-requests"
 	short_desc+=" - Python3 bindings"
 	pkg_install() {
 		vmove ${py3_lib}
@@ -222,3 +249,12 @@ samba-glusterfs_package() {
 		vmove usr/share/man/man8/vfs_glusterfs.8
 	}
 }
+
+samba-dc_package() {
+	depends="samba-python3>=${version}_${revision}"
+	short_desc+=" - AD Domain Controller"
+	pkg_install() {
+		vmove "usr/bin/samba*"
+		vmove usr/share/samba
+	}
+}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PR PATCH] [Updated] samba: update to 4.20.1.
  2024-05-22 10:43 [PR PATCH] samba: update to 4.20.1 otommod
                   ` (3 preceding siblings ...)
  2024-05-23 14:04 ` otommod
@ 2024-05-23 14:12 ` otommod
  2024-05-26  2:47 ` abenson
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: otommod @ 2024-05-23 14:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2130 bytes --]

There is an updated pull request by otommod against master on the void-packages repository

https://github.com/otommod/void-packages samba-4.20.1
https://github.com/void-linux/void-packages/pull/50464

samba: update to 4.20.1.
I don't have much experience with packaging and none with `Void Linux` packaging in particular, especially with a big project like Samba, so I'm not sure this is production ready yet.

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
- I built this PR locally for these architectures:
  - x86_64
  - aarch64
  - aarch64-musl

#### Questions & notes
  - `samba-libs` has a ton of private libraries that I could not build as builtin this time. Should I add all of them to `common/shlibs`?
  - I packaged `{uid,socket,nss,resolv}_wrapper` since they are needed by the `samba` testsuite but they can also be bundled in... Do we really need them? They are not used by anything else (yet).  On the other hand, `pam_wrapper`, that is also needed, is already in the repository.
  - On a related note, I tried to build the aforementioned testsuite but it ended up with a `cmocka` related build failure (`LargestIntegralType` was not defined). It did build successfully when `cmocka` was build as a bundled library though.
  - Should we break the `samba` package up? Fedora/Debian have a ton of subpackages for it and even Alpine has a few more than us.

A patch file from https://github.com/void-linux/void-packages/pull/50464.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-samba-4.20.1-50464.patch --]
[-- Type: text/x-diff, Size: 45711 bytes --]

From d200d7137e0fe2a50a5fae1fa65b4b637a93c445 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Mon, 20 May 2024 15:51:28 +0300
Subject: [PATCH 1/8] tevent: update to 0.16.1.

---
 .../tevent/patches/fix-public-headers.patch   | 13 ----------
 srcpkgs/tevent/template                       | 25 +++++++++++++------
 2 files changed, 17 insertions(+), 21 deletions(-)
 delete mode 100644 srcpkgs/tevent/patches/fix-public-headers.patch

diff --git a/srcpkgs/tevent/patches/fix-public-headers.patch b/srcpkgs/tevent/patches/fix-public-headers.patch
deleted file mode 100644
index 1710226d4580c9..00000000000000
--- a/srcpkgs/tevent/patches/fix-public-headers.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-tevent.h needs sys/types.h for pid_t
-
---- a/tevent.h	2018-07-12 05:51:30.000000000 +0000
-+++ b/tevent.h	2018-07-19 10:13:15.360128807 +0000
-@@ -31,6 +31,7 @@
- #include <stdint.h>
- #include <talloc.h>
- #include <sys/time.h>
-+#include <sys/types.h>
- #include <stdbool.h>
- 
- struct tevent_context;
-
diff --git a/srcpkgs/tevent/template b/srcpkgs/tevent/template
index 7dadd564db0bf5..1a3f49d8bb8d0b 100644
--- a/srcpkgs/tevent/template
+++ b/srcpkgs/tevent/template
@@ -1,28 +1,37 @@
 # Template file for 'tevent'
 pkgname=tevent
-version=0.11.0
-revision=3
+version=0.16.1
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
 configure_args="--sysconfdir=/etc --localstatedir=/var
  --disable-rpath --disable-rpath-install --without-gettext
  --builtin-libraries=replace --bundled-libraries=NONE"
-hostmakedepends="pkg-config docbook2x python3-setuptools"
-makedepends="python3-devel talloc-devel libxslt gettext-devel cmocka-devel"
+hostmakedepends="pkg-config docbook-xsl libxslt"
+makedepends="python3-devel talloc-devel cmocka-devel"
 short_desc="Event system based on the talloc memory management library"
 maintainer="Yuusha Spacewolf <xyuusha@paranoici.org>"
 license="GPL-3.0-or-later"
 homepage="https://tevent.samba.org"
 distfiles="https://download.samba.org/pub/tevent/tevent-${version}.tar.gz"
-checksum=ee9a86c8e808aac2fe1e924eaa139ff7f0269d0e8e4fafa850ae5c7489bc82ba
+checksum=362971e0f32dc1905f6fe4736319c4b8348c22dc85aa6c3f690a28efe548029e
+
+if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
+	makedepends+=" libxcrypt-devel"
+fi
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
+export PYTHONHASHSEED=1
+
+do_check() {
+	${configure_script} test
+}
 
 post_patch() {
-	# Avoid Python shlib extension noise in libpytallic-util.so
-	vsed -e "/env.pyext_PATTERN/s/dct\['SO'\]/'.so'/" \
-		-i third_party/waf/waflib/Tools/python.py
+	# Look for properly named python support libraries
+	vsed -i third_party/waf/waflib/Tools/python.py \
+		-e "s|env.pyext_PATTERN = .*$|env.pyext_PATTERN = '%s.so'|"
 }
 
 tevent-python3_package() {

From b33ecfc10008f0f180ccf7f54c0b65518e17e014 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Mon, 20 May 2024 18:06:26 +0300
Subject: [PATCH 2/8] tdb: update to 1.4.10.

---
 srcpkgs/tdb/template | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/tdb/template b/srcpkgs/tdb/template
index 0134d2dcc2fb91..6d1c3039ed914f 100644
--- a/srcpkgs/tdb/template
+++ b/srcpkgs/tdb/template
@@ -1,21 +1,25 @@
 # Template file for 'tdb'
 pkgname=tdb
-version=1.4.9
-revision=2
+version=1.4.10
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
-configure_args="--prefix=/usr --libdir=/usr/lib --sysconfdir=/etc
- --localstatedir=/var --disable-rpath --disable-rpath-install
- --builtin-libraries=replace --bundled-libraries=NONE --without-gettext"
-hostmakedepends="pkg-config docbook2x"
-makedepends="python3-devel libxslt gettext-devel"
+configure_args="--sysconfdir=/etc --localstatedir=/var
+ --disable-rpath --disable-rpath-install --without-gettext
+ --builtin-libraries=replace --bundled-libraries=NONE"
+hostmakedepends="pkg-config docbook-xsl libxslt"
+makedepends="python3-devel"
 short_desc="Trivial Database, similar to GDBM but allows simultaneous commits"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="https://tdb.samba.org/"
 distfiles="https://download.samba.org/pub/tdb/tdb-${version}.tar.gz"
-checksum=0ac226073e3a2db8648da7af744cb95f50766a52feeb001d558b2b321b74a765
+checksum=02338e33c16c21c9e29571cef523e76b2b708636254f6f30c6cf195d48c62daf
+
+if [ "$XBPS_TARGET_LIBC" = glibc ]; then
+	makedepends+=" libxcrypt-devel"
+fi
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
 export PYTHONHASHSEED=1

From 953e05c68fd4d066e82c353f7213006aa2dc8d17 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Mon, 20 May 2024 18:20:57 +0300
Subject: [PATCH 3/8] ldb: update to 2.9.0.

---
 srcpkgs/ldb/patches/strtoull.patch | 89 ++++++++++++++++++++++++++++++
 srcpkgs/ldb/template               | 29 +++++-----
 2 files changed, 104 insertions(+), 14 deletions(-)
 create mode 100644 srcpkgs/ldb/patches/strtoull.patch

diff --git a/srcpkgs/ldb/patches/strtoull.patch b/srcpkgs/ldb/patches/strtoull.patch
new file mode 100644
index 00000000000000..2fcd928a3d143c
--- /dev/null
+++ b/srcpkgs/ldb/patches/strtoull.patch
@@ -0,0 +1,89 @@
+diff --git a/lib/replace/replace.c b/lib/replace/replace.c
+index 0652cb4..02b6ebf 100644
+--- a/lib/replace/replace.c
++++ b/lib/replace/replace.c
+@@ -559,41 +559,6 @@ long long int rep_strtoll(const char *str, char **endptr, int base)
+ #endif /* HAVE_STRTOLL */
+ 
+ 
+-#ifndef HAVE_STRTOULL
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
+-{
+-#ifdef HAVE_STRTOUQ
+-	return strtouq(str, endptr, base);
+-#elif defined(HAVE___STRTOULL) 
+-	return __strtoull(str, endptr, base);
+-#elif SIZEOF_LONG == SIZEOF_LONG_LONG
+-	return (unsigned long long int) strtoul(str, endptr, base);
+-#else
+-# error "You need a strtoull function"
+-#endif
+-}
+-#else
+-#ifdef HAVE_BSD_STRTOLL
+-#undef strtoull
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
+-{
+-	int saved_errno = errno;
+-	unsigned long long int nb = strtoull(str, endptr, base);
+-	/* With glibc EINVAL is only returned if base is not ok */
+-	if (errno == EINVAL) {
+-		if (base == 0 || (base >1 && base <37)) {
+-			/* Base was ok so it's because we were not
+-			 * able to make the conversion.
+-			 * Let's reset errno.
+-			 */
+-			errno = saved_errno;
+-		}
+-	}
+-	return nb;
+-}
+-#endif /* HAVE_BSD_STRTOLL */
+-#endif /* HAVE_STRTOULL */
+-
+ #ifndef HAVE_SETENV
+ int rep_setenv(const char *name, const char *value, int overwrite) 
+ {
+diff --git a/lib/replace/replace.h b/lib/replace/replace.h
+index a8910e2..854b1a7 100644
+--- a/lib/replace/replace.h
++++ b/lib/replace/replace.h
+@@ -394,16 +394,6 @@ long long int rep_strtoll(const char *str, char **endptr, int base);
+ #endif
+ #endif
+ 
+-#ifndef HAVE_STRTOULL
+-#define strtoull rep_strtoull
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base);
+-#else
+-#ifdef HAVE_BSD_STRTOLL /* yes, it's not HAVE_BSD_STRTOULL */
+-#define strtoull rep_strtoull
+-unsigned long long int rep_strtoull(const char *str, char **endptr, int base);
+-#endif
+-#endif
+-
+ #ifndef HAVE_FTRUNCATE
+ #define ftruncate rep_ftruncate
+ int rep_ftruncate(int,off_t);
+diff --git a/lib/replace/wscript b/lib/replace/wscript
+index 4c774d9..a1dc6d0 100644
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -411,7 +411,7 @@ def configure(conf):
+     conf.CHECK_FUNCS('initgroups pread pwrite strndup strcasestr strsep')
+     conf.CHECK_FUNCS('strtok_r mkdtemp dup2 dprintf vdprintf isatty chown lchown')
+     conf.CHECK_FUNCS('link readlink symlink realpath snprintf vsnprintf')
+-    conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen strtoull __strtoull')
++    conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen')
+     conf.CHECK_FUNCS('strtouq strtoll __strtoll strtoq memalign posix_memalign')
+     conf.CHECK_FUNCS('fmemopen')
+ 
+@@ -866,7 +866,7 @@ REPLACEMENT_FUNCTIONS = {
+                   'memmove', 'strdup', 'setlinebuf', 'vsyslog', 'strnlen',
+                   'strndup', 'waitpid', 'seteuid', 'setegid', 'chroot',
+                   'mkstemp', 'mkdtemp', 'pread', 'pwrite', 'strcasestr',
+-                  'strsep', 'strtok_r', 'strtoll', 'strtoull', 'setenv', 'unsetenv',
++                  'strsep', 'strtok_r', 'strtoll', 'setenv', 'unsetenv',
+                   'utime', 'utimes', 'dup2', 'chown', 'link', 'readlink',
+                   'symlink', 'lchown', 'realpath', 'memmem', 'vdprintf',
+                   'dprintf', 'get_current_dir_name', 'copy_file_range',
diff --git a/srcpkgs/ldb/template b/srcpkgs/ldb/template
index 964a2c33009da0..f3dcb95611ceb4 100644
--- a/srcpkgs/ldb/template
+++ b/srcpkgs/ldb/template
@@ -1,7 +1,7 @@
 # Template file for 'ldb'
 pkgname=ldb
-version=2.3.2
-revision=3
+version=2.9.0
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
@@ -9,28 +9,29 @@ configure_args="--sysconfdir=/etc --localstatedir=/var
  --disable-rpath --disable-rpath-install --without-gettext
  --builtin-libraries=replace --bundled-libraries=NONE
  --with-modulesdir=/usr/lib/ldb/modules"
-hostmakedepends="pkg-config docbook2x tdb-python3 tevent-python3 python3-setuptools"
-makedepends="python3-devel tdb-devel tevent-devel talloc-devel
- popt-devel lmdb-devel libxslt gettext-devel cmocka-devel"
+hostmakedepends="pkg-config docbook-xsl libxslt tdb-python3 tevent-python3"
+makedepends="python3-devel tdb-devel tevent-devel talloc-devel popt-devel
+ lmdb-devel cmocka-devel"
 checkdepends="cmocka-devel"
 short_desc="LDAP-like database from samba"
 maintainer="Yuusha Spacewolf <xyuusha@paranoici.org>"
 license="LGPL-3.0-or-later"
 homepage="https://www.samba.org/ldb/"
 distfiles="https://download.samba.org/pub/ldb/ldb-${version}.tar.gz"
-checksum=1416c949dc4326e41c0d8a5ecf8ef784f8c0b6e9d3dad8fa971e84ad56227603
-
-# workaround for cmocka's broken uintptr_t definition on musl
-if [ "$XBPS_TARGET_WORDSIZE" = "64" -a "$XBPS_TARGET_LIBC" = "musl" ]; then
-	CFLAGS+=" -D__WORDSIZE=64"
-fi
+checksum=105aaff71ad881a7faeb582fd416ae28221b6fde338fff82828065062c2507a5
+make_check=extended # testsuite takes a long time
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
+export PYTHONHASHSEED=1
 
 post_patch() {
-	# Avoid Python shlib extension noise in libpyldb-util.so
-	vsed -e "/env.pyext_PATTERN/s/dct\['SO'\]/'.so'/" \
-		-i third_party/waf/waflib/Tools/python.py
+	# Look for properly named python support libraries
+	vsed -i third_party/waf/waflib/Tools/python.py \
+		-e "s|env.pyext_PATTERN = .*$|env.pyext_PATTERN = '%s.so'|"
+}
+
+do_check() {
+	${configure_script} test ${makejobs}
 }
 
 ldb-python3_package() {

From 3fa890c670718b1a96f911a800416fccc2d57129 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 10:22:00 +0300
Subject: [PATCH 4/8] New package: uid_wrapper-1.3.0.

---
 .../uid_wrapper-fix-for-cmocka-1.1.6.patch    | 31 +++++++++++++++++++
 srcpkgs/uid_wrapper/template                  | 22 +++++++++++++
 2 files changed, 53 insertions(+)
 create mode 100644 srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch
 create mode 100644 srcpkgs/uid_wrapper/template

diff --git a/srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch b/srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch
new file mode 100644
index 00000000000000..c99c3ad6bce663
--- /dev/null
+++ b/srcpkgs/uid_wrapper/patches/uid_wrapper-fix-for-cmocka-1.1.6.patch
@@ -0,0 +1,31 @@
+From 850f24c6366abda30bfd77734b90330b8809d306 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Fri, 17 Feb 2023 17:51:27 +0100
+Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
+---
+ tests/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 635e86e..68e050e 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ project(tests C)
+ 
++if (TARGET cmocka::cmocka)
++    set(CMOCKA_LIBRARY cmocka::cmocka)
++endif()
++
+ add_library(uwrap_fake_socket_wrapper SHARED uwrap_fake_socket_wrapper.c)
+ target_compile_options(uwrap_fake_socket_wrapper
+                        PRIVATE
+-- 
+2.34.1
+
diff --git a/srcpkgs/uid_wrapper/template b/srcpkgs/uid_wrapper/template
new file mode 100644
index 00000000000000..24a90e93767069
--- /dev/null
+++ b/srcpkgs/uid_wrapper/template
@@ -0,0 +1,22 @@
+# Template file for 'uid_wrapper'
+pkgname=uid_wrapper
+version=1.3.0
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Testing tool to fake privilege separation"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="https://cwrap.org/uid_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=f7e7c1bde533530051931414724453e14e02adbb614824b6fe27cbb98654b762
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel"
+	checkdepends+=" cmocka"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 3279660419002213c5557ec0a10c0a4fc4fab683 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 11:09:08 +0300
Subject: [PATCH 5/8] New package: socket_wrapper-1.4.2

---
 srcpkgs/socket_wrapper/template | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/socket_wrapper/template

diff --git a/srcpkgs/socket_wrapper/template b/srcpkgs/socket_wrapper/template
new file mode 100644
index 00000000000000..45d462668c5c4f
--- /dev/null
+++ b/srcpkgs/socket_wrapper/template
@@ -0,0 +1,22 @@
+# Template file for 'socket_wrapper'
+pkgname=socket_wrapper
+version=1.4.2
+revision=1
+archs="~*-musl" # socket_wrapper redefines libc funcs, you can't do that on musl
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Library for passing all socket communications through unix sockets"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="http://cwrap.org/socket_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=0a08ec249dd9ffbb3b16d577b352d573561f57beeec3596182ac6ec8e46b9ab6
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 440aa36bfe59867bca88006b16284325f4e5aab6 Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 10:21:20 +0300
Subject: [PATCH 6/8] New package: nss_wrapper-1.1.15.

---
 .../nss_wrapper-fix-for-cmocka-1.1.6.patch    | 31 +++++++++++++++++++
 srcpkgs/nss_wrapper/template                  | 27 ++++++++++++++++
 2 files changed, 58 insertions(+)
 create mode 100644 srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch
 create mode 100644 srcpkgs/nss_wrapper/template

diff --git a/srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch b/srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch
new file mode 100644
index 00000000000000..ba2589be2d0834
--- /dev/null
+++ b/srcpkgs/nss_wrapper/patches/nss_wrapper-fix-for-cmocka-1.1.6.patch
@@ -0,0 +1,31 @@
+From 2c879a0ffa70cee33329291d7576ec971d420da2 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Fri, 17 Feb 2023 17:51:27 +0100
+Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
+---
+ tests/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 3b94076..733cc4e 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ project(tests C)
+ 
++if (TARGET cmocka::cmocka)
++    set(CMOCKA_LIBRARY cmocka::cmocka)
++endif()
++
+ set(TESTSUITE_LIBRARIES nss_utils ${NWRAP_REQUIRED_LIBRARIES} ${CMOCKA_LIBRARY})
+ string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
+ 
+-- 
+2.39.2
+
diff --git a/srcpkgs/nss_wrapper/template b/srcpkgs/nss_wrapper/template
new file mode 100644
index 00000000000000..94fa88b333cda9
--- /dev/null
+++ b/srcpkgs/nss_wrapper/template
@@ -0,0 +1,27 @@
+# Template file for 'nss_wrapper'
+pkgname=nss_wrapper
+version=1.1.15
+revision=1
+archs="~*-musl" # complains about the getXXent_r functions missing
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Wrapper for the user, group and hosts NSS API"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="http://cwrap.org/nss_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=36f874832a4f2158e04f69aa77e5515e16cf6e3bf81968d5dd8496db7d6906ad
+
+if [ "$XBPS_TARGET_LIBC" = glibc ]; then
+	makedepends+=" libxcrypt-devel"
+fi
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel uid_wrapper"
+	checkdepends+=" cmocka"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 75b633eef8b1f44ad9a205f316b03666c45144dd Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 10:22:30 +0300
Subject: [PATCH 7/8] New package: resolv_wrapper-1.1.8

---
 .../resolv_wrapper-fix-for-cmocka-1.1.6.patch | 31 +++++++++++++++++++
 srcpkgs/resolv_wrapper/template               | 23 ++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100644 srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch
 create mode 100644 srcpkgs/resolv_wrapper/template

diff --git a/srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch b/srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch
new file mode 100644
index 00000000000000..5640be33053a8c
--- /dev/null
+++ b/srcpkgs/resolv_wrapper/patches/resolv_wrapper-fix-for-cmocka-1.1.6.patch
@@ -0,0 +1,31 @@
+From f2e7f58025ecb4cf399494166abea01813b1d0f0 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@samba.org>
+Date: Fri, 17 Feb 2023 17:51:27 +0100
+Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Schneider <asn@samba.org>
+Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
+---
+ tests/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 1262bed..7f2f4ee 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ project(tests C)
+ 
++if (TARGET cmocka::cmocka)
++    set(CMOCKA_LIBRARY cmocka::cmocka)
++endif()
++
+ set(TORTURE_LIBRARY torture)
+ 
+ # A simple DNS server for testing
+-- 
+2.34.1
+
diff --git a/srcpkgs/resolv_wrapper/template b/srcpkgs/resolv_wrapper/template
new file mode 100644
index 00000000000000..4e1215c7b69867
--- /dev/null
+++ b/srcpkgs/resolv_wrapper/template
@@ -0,0 +1,23 @@
+# Template file for 'resolv_wrapper'
+pkgname=resolv_wrapper
+version=1.1.8
+revision=1
+archs="~*-musl" # missing res_ninit, res_nclose, etc
+build_style=cmake
+hostmakedepends="pkg-config"
+short_desc="Wrapper for DNS name resolving or DNS faking"
+maintainer="Otto Modinos <ottomodinos@gmail.com>"
+license="BSD-3-Clause"
+homepage="https://cwrap.org/resolv_wrapper.html"
+distfiles="https://download.samba.org/pub/cwrap/${pkgname}-${version}.tar.gz"
+checksum=fbc30f77da3e12ecd4ef66ccf5ab77e0b744930ccd89062404082f928a8ec2e0
+
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DUNIT_TESTING=ON"
+	makedepends+=" cmocka-devel socket_wrapper"
+	checkdepends+=" cmocka"
+fi
+
+post_install() {
+	vlicense LICENSE
+}

From 22938bfb20caad03f31b89e969ffae9a3176bffc Mon Sep 17 00:00:00 2001
From: Otto Modinos <ottomodinos@gmail.com>
Date: Wed, 22 May 2024 13:06:38 +0300
Subject: [PATCH 8/8] samba: update to 4.20.1.

This also builds and packages the io_uring VFS and more importantly the
AD Domain Control part of Samba.
---
 common/shlibs                                 | 183 +++++++++++++-----
 srcpkgs/samba-dc                              |   1 +
 srcpkgs/samba/patches/fix-glibc-2.36.patch    |  59 ------
 srcpkgs/samba/patches/missing-headers.patch   |  52 -----
 srcpkgs/samba/patches/netdb-defines.patch     |  19 --
 .../patches/samba-bgqd-include-signal-h.patch |  14 ++
 srcpkgs/samba/template                        | 140 +++++++++-----
 7 files changed, 234 insertions(+), 234 deletions(-)
 create mode 120000 srcpkgs/samba-dc
 delete mode 100644 srcpkgs/samba/patches/fix-glibc-2.36.patch
 delete mode 100644 srcpkgs/samba/patches/missing-headers.patch
 delete mode 100644 srcpkgs/samba/patches/netdb-defines.patch
 create mode 100644 srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch

diff --git a/common/shlibs b/common/shlibs
index ff14234e60cdba..1d0b5f3bbb8d8b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4051,58 +4051,137 @@ libevemu.so.3 evemu-2.7.0_1
 libinih.so.0 inih-52_1
 libINIReader.so.0 inih-57_1
 libpcaudio.so.0 pcaudiolib-1.1_1
-libdcerpc-samr.so.0 samba-4.13.2_1
-libdcerpc-server-core.so.0 samba-4.13.2_1
-libnetapi.so.0 samba-4.13.2_1
-libnss_winbind.so.2 samba-4.13.2_1
-libnss_wins.so.2 samba-4.13.2_1
-libsamba-policy.so.0 samba-4.13.2_1
-libauth-unix-token-samba4.so samba-4.13.2_1
-libauth4-samba4.so samba-4.13.3_1
-libdcerpc-samba4.so samba-4.13.2_1
-libdsdb-module-samba4.so samba-4.13.2_1
-libgpext-samba4.so samba-4.13.2_1
-libnet-keytab-samba4.so samba-4.13.3_1
-libposix-eadb-samba4.so samba-4.13.2_1
-libprinting-migrate-samba4.so samba-4.13.2_1
-libsamba-net-samba4.so samba-4.13.2_1
-libsamba-python-samba4.so samba-4.13.3_1
-libshares-samba4.so samba-4.13.2_1
-libsmbd-base-samba4.so samba-4.13.2_1
-libsmbd-conn-samba4.so samba-4.13.2_1
-libsmbpasswordparser-samba4.so samba-4.13.3_1
-libxattr-tdb-samba4.so samba-4.13.2_1
-libdcerpc.so.0 samba-libs-4.13.2_1
-libdcerpc-binding.so.0 samba-libs-4.13.2_1
-libndr-krb5pac.so.0 samba-libs-4.13.2_1
-libndr-nbt.so.0 samba-libs-4.13.2_1
-libndr-standard.so.0 samba-libs-4.13.2_1
-libndr.so.1 samba-libs-4.13.2_1
-libsamba-credentials.so.1 samba-libs-4.13.2_1
-libsamba-errors.so.1 samba-libs-4.13.2_1
-libsamba-hostconfig.so.0 samba-libs-4.13.2_1
-libsamba-passdb.so.0 samba-libs-4.13.2_1
-libsamba-util.so.0 samba-libs-4.13.2_1
-libsamdb.so.0 samba-libs-4.13.2_1
-libsmbclient.so.0 samba-libs-4.13.2_1
-libsmbconf.so.0 samba-libs-4.13.2_1
-libsmbldap.so.2 samba-libs-4.13.2_1
-libwbclient.so.0 samba-libs-4.13.2_1
-libcli-ldap-samba4.so samba-libs-4.13.2_1
-libcliauth-samba4.so samba-libs-4.13.2_1
-libcluster-samba4.so samba-libs-4.13.3_1
-libcommon-auth-samba4.so samba-libs-4.13.2_1
-libdcerpc-samba-samba4.so samba-libs-4.13.2_1
-libflag-mapping-samba4.so samba-libs-4.13.3_1
-libgpo-samba4.so samba-libs-4.13.2_1
-libiov-buf-samba4.so samba-libs-4.13.3_1
-libndr-samba-samba4.so samba-libs-4.13.2_1
-libndr-samba4.so samba-libs-4.13.2_1
-libprinter-driver-samba4.so samba-libs-4.13.3_1
-libsmb-transport-samba4.so samba-libs-4.13.2_1
-libtdb-wrap-samba4.so samba-libs-4.13.3_1
-libutil-cmdline-samba4.so samba-libs-4.13.2_1
-libwinbind-client-samba4.so samba-libs-4.13.2_1
+libdcerpc.so.0 samba-libs-4.20.1_1
+libdcerpc-binding.so.0 samba-libs-4.20.1_1
+libdcerpc-samr.so.0 samba-libs-4.20.1_1
+libdcerpc-server.so.0 samba-libs-4.20.1_1
+libdcerpc-server-core.so.0 samba-libs-4.20.1_1
+libndr.so.4 samba-libs-4.20.1_1
+libndr-krb5pac.so.0 samba-libs-4.20.1_1
+libndr-nbt.so.0 samba-libs-4.20.1_1
+libndr-standard.so.0 samba-libs-4.20.1_1
+libnetapi.so.1 samba-libs-4.20.1_1
+libnss_winbind.so.2 samba-libs-4.20.1_1
+libnss_wins.so.2 samba-libs-4.20.1_1
+libsamba-credentials.so.1 samba-libs-4.20.1_1
+libsamba-errors.so.1 samba-libs-4.20.1_1
+libsamba-hostconfig.so.0 samba-libs-4.20.1_1
+libsamba-passdb.so.0 samba-libs-4.20.1_1
+libsamba-policy.so.0 samba-libs-4.20.1_1
+libsamba-util.so.0 samba-libs-4.20.1_1
+libsamdb.so.0 samba-libs-4.20.1_1
+libsmbclient.so.0 samba-libs-4.20.1_1
+libsmbconf.so.0 samba-libs-4.20.1_1
+libsmbldap.so.2 samba-libs-4.20.1_1
+libtevent-util.so.0 samba-libs-4.20.1_1
+libwbclient.so.0 samba-libs-4.20.1_1
+libCHARSET3-private-samba.so samba-libs-4.20.1_1
+libLIBWBCLIENT-OLD-private-samba.so samba-libs-4.20.1_1
+libMESSAGING-private-samba.so samba-libs-4.20.1_1
+libMESSAGING-SEND-private-samba.so samba-libs-4.20.1_1
+libREG-FULL-private-samba.so samba-libs-4.20.1_1
+libRPC-SERVER-LOOP-private-samba.so samba-libs-4.20.1_1
+libRPC-WORKER-private-samba.so samba-libs-4.20.1_1
+libad-claims-private-samba.so samba-libs-4.20.1_1
+libaddns-private-samba.so samba-libs-4.20.1_1
+libads-private-samba.so samba-libs-4.20.1_1
+libasn1util-private-samba.so samba-libs-4.20.1_1
+libauth-private-samba.so samba-libs-4.20.1_1
+libauth-unix-token-private-samba.so samba-libs-4.20.1_1
+libauth4-private-samba.so samba-libs-4.20.1_1
+libauthkrb5-private-samba.so samba-libs-4.20.1_1
+libauthn-policy-util-private-samba.so samba-libs-4.20.1_1
+libcli-cldap-private-samba.so samba-libs-4.20.1_1
+libcli-ldap-private-samba.so samba-libs-4.20.1_1
+libcli-ldap-common-private-samba.so samba-libs-4.20.1_1
+libcli-nbt-private-samba.so samba-libs-4.20.1_1
+libcli-smb-common-private-samba.so samba-libs-4.20.1_1
+libcli-spoolss-private-samba.so samba-libs-4.20.1_1
+libcliauth-private-samba.so samba-libs-4.20.1_1
+libclidns-private-samba.so samba-libs-4.20.1_1
+libcluster-private-samba.so samba-libs-4.20.1_1
+libcmdline-private-samba.so samba-libs-4.20.1_1
+libcmdline-contexts-private-samba.so samba-libs-4.20.1_1
+libcommon-auth-private-samba.so samba-libs-4.20.1_1
+libctdb-event-client-private-samba.so samba-libs-4.20.1_1
+libdb-glue-private-samba.so samba-libs-4.20.1_1
+libdbwrap-private-samba.so samba-libs-4.20.1_1
+libdcerpc-pkt-auth-private-samba.so samba-libs-4.20.1_1
+libdcerpc-samba-private-samba.so samba-libs-4.20.1_1
+libdcerpc-samba4-private-samba.so samba-libs-4.20.1_1
+libdfs-server-ad-private-samba.so samba-libs-4.20.1_1
+libdlz-bind9-for-torture-private-samba.so samba-libs-4.20.1_1
+libdnsserver-common-private-samba.so samba-libs-4.20.1_1
+libdsdb-garbage-collect-tombstones-private-samba.so samba-libs-4.20.1_1
+libdsdb-module-private-samba.so samba-libs-4.20.1_1
+libevents-private-samba.so samba-libs-4.20.1_1
+libflag-mapping-private-samba.so samba-libs-4.20.1_1
+libgenrand-private-samba.so samba-libs-4.20.1_1
+libgensec-private-samba.so samba-libs-4.20.1_1
+libgpext-private-samba.so samba-libs-4.20.1_1
+libgpo-private-samba.so samba-libs-4.20.1_1
+libgse-private-samba.so samba-libs-4.20.1_1
+libhttp-private-samba.so samba-libs-4.20.1_1
+libidmap-private-samba.so samba-libs-4.20.1_1
+libinterfaces-private-samba.so samba-libs-4.20.1_1
+libiov-buf-private-samba.so samba-libs-4.20.1_1
+libkrb5samba-private-samba.so samba-libs-4.20.1_1
+libldbsamba-private-samba.so samba-libs-4.20.1_1
+liblibcli-lsa3-private-samba.so samba-libs-4.20.1_1
+liblibcli-netlogon3-private-samba.so samba-libs-4.20.1_1
+liblibsmb-private-samba.so samba-libs-4.20.1_1
+libmessages-dgm-private-samba.so samba-libs-4.20.1_1
+libmessages-util-private-samba.so samba-libs-4.20.1_1
+libmscat-private-samba.so samba-libs-4.20.1_1
+libmsghdr-private-samba.so samba-libs-4.20.1_1
+libmsrpc3-private-samba.so samba-libs-4.20.1_1
+libndr-samba-private-samba.so samba-libs-4.20.1_1
+libndr-samba4-private-samba.so samba-libs-4.20.1_1
+libnet-keytab-private-samba.so samba-libs-4.20.1_1
+libnetif-private-samba.so samba-libs-4.20.1_1
+libnpa-tstream-private-samba.so samba-libs-4.20.1_1
+libnss-info-private-samba.so samba-libs-4.20.1_1
+libpac-private-samba.so samba-libs-4.20.1_1
+libposix-eadb-private-samba.so samba-libs-4.20.1_1
+libprinter-driver-private-samba.so samba-libs-4.20.1_1
+libprinting-migrate-private-samba.so samba-libs-4.20.1_1
+libprocess-model-private-samba.so samba-libs-4.20.1_1
+libregistry-private-samba.so samba-libs-4.20.1_1
+libreplace-private-samba.so samba-libs-4.20.1_1
+libsamba-cluster-support-private-samba.so samba-libs-4.20.1_1
+libsamba-debug-private-samba.so samba-libs-4.20.1_1
+libsamba-modules-private-samba.so samba-libs-4.20.1_1
+libsamba-net-private-samba.so samba-libs-4.20.1_1
+libsamba-python-private-samba.so samba-libs-4.20.1_1
+libsamba-security-private-samba.so samba-libs-4.20.1_1
+libsamba-sockets-private-samba.so samba-libs-4.20.1_1
+libsamba3-util-private-samba.so samba-libs-4.20.1_1
+libsamdb-common-private-samba.so samba-libs-4.20.1_1
+libscavenge-dns-records-private-samba.so samba-libs-4.20.1_1
+libsecrets3-private-samba.so samba-libs-4.20.1_1
+libserver-id-db-private-samba.so samba-libs-4.20.1_1
+libserver-role-private-samba.so samba-libs-4.20.1_1
+libservice-private-samba.so samba-libs-4.20.1_1
+libshares-private-samba.so samba-libs-4.20.1_1
+libsmb-transport-private-samba.so samba-libs-4.20.1_1
+libsmbclient-raw-private-samba.so samba-libs-4.20.1_1
+libsmbd-base-private-samba.so samba-libs-4.20.1_1
+libsmbd-shim-private-samba.so samba-libs-4.20.1_1
+libsmbldaphelper-private-samba.so samba-libs-4.20.1_1
+libsmbpasswdparser-private-samba.so samba-libs-4.20.1_1
+libsocket-blocking-private-samba.so samba-libs-4.20.1_1
+libstable-sort-private-samba.so samba-libs-4.20.1_1
+libsys-rw-private-samba.so samba-libs-4.20.1_1
+libtalloc-report-private-samba.so samba-libs-4.20.1_1
+libtalloc-report-printf-private-samba.so samba-libs-4.20.1_1
+libtdb-wrap-private-samba.so samba-libs-4.20.1_1
+libtime-basic-private-samba.so samba-libs-4.20.1_1
+libtorture-private-samba.so samba-libs-4.20.1_1
+libtrusts-util-private-samba.so samba-libs-4.20.1_1
+libutil-reg-private-samba.so samba-libs-4.20.1_1
+libutil-setid-private-samba.so samba-libs-4.20.1_1
+libutil-tdb-private-samba.so samba-libs-4.20.1_1
+libxattr-tdb-private-samba.so samba-libs-4.20.1_1
 libsixel.so.1 libsixel-1.8.6_1
 libpamtest.so.0 pam_wrapper-1.1.3_1
 libopenaptx.so.0 libopenaptx-0.2.0_1
diff --git a/srcpkgs/samba-dc b/srcpkgs/samba-dc
new file mode 120000
index 00000000000000..cba1f39180b3aa
--- /dev/null
+++ b/srcpkgs/samba-dc
@@ -0,0 +1 @@
+samba
\ No newline at end of file
diff --git a/srcpkgs/samba/patches/fix-glibc-2.36.patch b/srcpkgs/samba/patches/fix-glibc-2.36.patch
deleted file mode 100644
index beb84ce6a8ded2..00000000000000
--- a/srcpkgs/samba/patches/fix-glibc-2.36.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 766151bf5b7ef95ae4c8c98b8994e5c21c5bbec0 Mon Sep 17 00:00:00 2001
-From: Andreas Schneider <asn@samba.org>
-Date: Tue, 2 Aug 2022 07:55:46 +0200
-Subject: [PATCH] lib:replace: Only include <sys/mount.h> on non-Linux systems
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Details at:
-https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
-
-BUG: https://bugzilla.samba.org/show_bug.cgi?id=15132
-
-Signed-off-by: Andreas Schneider <asn@samba.org>
-Reviewed-by: Ralph Boehme <slow@samba.org>
-
-Autobuild-User(master): Ralph Böhme <slow@samba.org>
-Autobuild-Date(master): Tue Aug  2 11:05:14 UTC 2022 on sn-devel-184
----
- lib/replace/system/filesys.h | 4 +++-
- lib/replace/wscript          | 3 +++
- 2 files changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/lib/replace/system/filesys.h b/lib/replace/system/filesys.h
-index 034e5d5886c..bb9482c69af 100644
---- a/lib/replace/system/filesys.h
-+++ b/lib/replace/system/filesys.h
-@@ -36,7 +36,8 @@
- #include <sys/param.h>
- #endif
- 
--#ifdef HAVE_SYS_MOUNT_H
-+/* This include is required on UNIX (*BSD, AIX, ...) for statfs() */
-+#if !defined(LINUX) && defined(HAVE_SYS_MOUNT_H)
- #include <sys/mount.h>
- #endif
- 
-@@ -44,6 +45,7 @@
- #include <mntent.h>
- #endif
- 
-+/* This include is required on Linux for statfs() */
- #ifdef HAVE_SYS_VFS_H
- #include <sys/vfs.h>
- #endif
-diff --git a/lib/replace/wscript b/lib/replace/wscript
-index 4c774d9f0c3..dd9b19219a1 100644
---- a/lib/replace/wscript
-+++ b/lib/replace/wscript
-@@ -31,6 +31,9 @@ def configure(conf):
- 
-     conf.env.standalone_replace = conf.IN_LAUNCH_DIR()
- 
-+    if sys.platform.rfind('linux') > -1:
-+        conf.DEFINE('LINUX', '1')
-+
-     conf.DEFINE('BOOL_DEFINED', 1)
-     conf.DEFINE('HAVE_LIBREPLACE', 1)
-     conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
diff --git a/srcpkgs/samba/patches/missing-headers.patch b/srcpkgs/samba/patches/missing-headers.patch
deleted file mode 100644
index 820d7ecd903fbc..00000000000000
--- a/srcpkgs/samba/patches/missing-headers.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-diff --git lib/param/loadparm.h lib/param/loadparm.h
-index b5d79b9..3f4eae0 100644
---- a/lib/param/loadparm.h
-+++ b/lib/param/loadparm.h
-@@ -31,6 +31,7 @@
- #define _LOADPARM_H
- 
- #include <talloc.h>
-+#include <time.h>
- 
- struct parmlist_entry {
- 	struct parmlist_entry *prev, *next;
-diff --git source3/lib/system_smbd.c source3/lib/system_smbd.c
-index 3b1ac9c..4044d75 100644
---- a/source3/lib/system_smbd.c
-+++ b/source3/lib/system_smbd.c
-@@ -27,6 +27,8 @@
- #include "system/passwd.h"
- #include "nsswitch/winbind_client.h"
- #include "../lib/util/setid.h"
-+#include <grp.h>
-+#include <uuid/uuid.h>
- 
- #ifndef HAVE_GETGROUPLIST
- 
-diff --git source4/torture/local/nss_tests.c source4/torture/local/nss_tests.c
-index 2cd6122..0c84ec2 100644
---- a/source4/torture/local/nss_tests.c
-+++ b/source4/torture/local/nss_tests.c
-@@ -20,6 +20,8 @@
- */
- 
- #include "includes.h"
-+#include <grp.h>
-+#include <uuid/uuid.h>
- 
- #include "torture/torture.h"
- #include "torture/local/proto.h"
- 
-diff --git ctdb/tests/src/protocol_util_test.c ctdb/tests/src/protocol_util_test.c
-index edd2a34..48ce96e 100644
---- a/ctdb/tests/src/protocol_util_test.c
-+++ b/ctdb/tests/src/protocol_util_test.c
-@@ -20,6 +20,7 @@
- #include "replace.h"
- #include "system/network.h"
-
-+#include <unistd.h>
- #include <assert.h>
-
- #include "protocol/protocol_basic.c"
-
diff --git a/srcpkgs/samba/patches/netdb-defines.patch b/srcpkgs/samba/patches/netdb-defines.patch
deleted file mode 100644
index 15f79eebfb6ac1..00000000000000
--- a/srcpkgs/samba/patches/netdb-defines.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff --git nsswitch/wins.c nsswitch/wins.c
-index dccb6dd..bb24acb 100644
---- a/nsswitch/wins.c
-+++ b/nsswitch/wins.c
-@@ -39,6 +39,14 @@ static pthread_mutex_t wins_nss_mutex = PTHREAD_MUTEX_INITIALIZER;
- #define INADDRSZ 4
- #endif
- 
-+#ifndef NETDB_INTERNAL
-+#define NETDB_INTERNAL -1
-+#endif
-+
-+#ifndef NETDB_SUCCESS
-+#define NETDB_SUCCESS 0
-+#endif
-+
- NSS_STATUS _nss_wins_gethostbyname_r(const char *hostname,
- 				     struct hostent *he,
- 				     char *buffer,
diff --git a/srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch b/srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch
new file mode 100644
index 00000000000000..10dc1278cdc769
--- /dev/null
+++ b/srcpkgs/samba/patches/samba-bgqd-include-signal-h.patch
@@ -0,0 +1,14 @@
+SIGTERM and SIGPIPE are used but undefined.
+diff --git a/source3/printing/samba-bgqd.c b/source3/printing/samba-bgqd.c
+index 8ac6ec5..09a5d12 100644
+--- a/source3/printing/samba-bgqd.c
++++ b/source3/printing/samba-bgqd.c
+@@ -40,6 +40,7 @@
+ #include "source3/lib/util_procid.h"
+ #include "source3/auth/proto.h"
+ #include "source3/printing/queue_process.h"
+ #include "source3/lib/substitute.h"
++#include <signal.h>
+ 
+ static void watch_handler(struct tevent_req *req)
+ {
diff --git a/srcpkgs/samba/template b/srcpkgs/samba/template
index 20af96624fdc2b..2d37047927312b 100644
--- a/srcpkgs/samba/template
+++ b/srcpkgs/samba/template
@@ -1,69 +1,73 @@
 # Template file for 'samba'
 pkgname=samba
-version=4.14.12
-revision=5
+version=4.20.1
+revision=1
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
-_idmap_modules="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2"
-_pdb_modules="pdb_tdbsam,pdb_ldap,pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4"
-_auth_modules="auth_unix,auth_wbc,auth_server,auth_netlogind,autH_script,auth_samba4"
-configure_args="--enable-fhs --sbindir=/usr/bin
- --localstatedir=/var --sysconfdir=/etc --with-piddir=/run/samba
+_idmap_modules="idmap_ad,idmap_rid,idmap_ldap,idmap_hash,idmap_tdb2"
+_pdb_modules="pdb_tdbsam,pdb_ldap,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4"
+_auth_modules="auth_unix,auth_wbc,auth_server,auth_samba4,auth_skel"
+_vfs_modules="vfs_io_uring"
+configure_args="--enable-fhs --sysconfdir=/etc --localstatedir=/var
+ --sbindir=/usr/bin --with-privatelibdir=/usr/lib
+ --with-privatedir=/etc/samba/private --with-piddir=/run/samba
  --with-sockets-dir=/run/samba --with-lockdir=/run/lock/samba
- --with-privatedir=/etc/samba/private --with-pammodulesdir=/usr/lib/security
- --with-modulesdir=/usr/lib/samba --disable-rpath --disable-rpath-install
- --without-systemd --without-gettext --bundled-libraries=NONE
- --with-system-mitkrb5 --without-ad-dc --with-cluster-support
- --with-shared-modules=${_idmap_modules},${_pdb_modules},${_auth_modules}"
-hostmakedepends="pkg-config perl-Parse-Yapp rpcsvc-proto docbook2x
- libtasn1-tools tdb-python3 tevent-python3 talloc-python3 python3-setuptools"
+ --disable-rpath --disable-rpath-install --nopyc --nopyo
+ --without-gettext --without-systemd --without-gpgme
+ --with-cluster-support --with-system-mitkrb5 --with-experimental-mit-ad-dc
+ --bundled-libraries=NONE --builtin-libraries=NONE
+ --with-shared-modules=${_idmap_modules},${_pdb_modules},${_auth_modules},${_vfs_modules}"
+hostmakedepends="pkg-config perl-Parse-Yapp rpcsvc-proto docbook-xsl libxslt
+ libtasn1-tools tdb-python3 tevent-python3 talloc-python3 ldb-python3 flex
+ bison mit-krb5 python3-Markdown python3-dnspython"
 makedepends="python3-devel libtirpc-devel popt-devel e2fsprogs-devel
  mit-krb5-devel pam-devel acl-devel cups-devel avahi-libs-devel tdb-devel
  talloc-devel tevent-devel ldb-devel cmocka-devel gnutls-devel zlib-devel
- ncurses-devel libldap-devel libarchive-devel jansson-devel"
+ ncurses-devel libldap-devel libarchive-devel jansson-devel liburing-devel"
 short_desc="SMB/CIFS file, print, and login server for Unix"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.samba.org"
 distfiles="https://download.samba.org/pub/samba/stable/${pkgname}-${version}.tar.gz"
-checksum=155d9c2dfb06a18104422987590858bfe5e9783ebebe63882e7e7f07eaaa512d
+checksum=f93c3af5295340d08106c7c0dcfb85e4f85057dfd14587aa8817beb31aff88f7
 lib32disabled=yes
 conf_files="/etc/pam.d/samba /etc/samba/smb.conf"
 make_dirs="/etc/samba/private 0750 root root"
-subpackages="smbclient samba-ctdb samba-cups samba-devel samba-libs samba-python3"
+subpackages="smbclient samba-ctdb samba-cups samba-devel samba-libs
+ samba-python3 samba-dc"
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-	makedepends+=" musl-legacy-compat musl-nscd-devel"
+	makedepends+=" musl-legacy-compat musl-nscd-devel libexecinfo-devel"
 else
 	makedepends+=" glusterfs-devel"
 	subpackages+=" samba-glusterfs"
-fi
 
-# By default, samba wants to install a bunch of private "*-samba4.so" shared
-# libraries that leak into shlib_requires dependencies. Most of these can be
-# built into the public shared libraries, avoiding the mess of tracking shlibs
-# that shouldn't be exposed locally. For those that cannot be built in, make
-# sure to install them into /usr/lib so xbps-src picks them up.
-_privlibs="CHARSET3 MESSAGING_SEND MESSAGING LIBWBCLIENT_OLD addns ads \
- asn1util auth authkrb5 cmdline_contexts cmdline-credentials cli_cldap \
- cli-ldap-common cli-nbt cli_smb_common cli_spoolss clidns common-auth \
- ctdb-event-client dbwrap dcerpc-pkt-auth events genrand gensec gse http \
- interfaces krb5samba ldbsamba libcli_lsa3 libcli_netlogon3 libsmb \
- messages_dgm messages_util mscat msghdr msrpc3 netif npa_tstream popt_samba3 \
- popt_samba3_cmdline registry replace samba-cluster-support samba-debug \
- samba-modules samba-security samba-sockets samba3-util samdb-common secrets3 \
- server_id_db server-role smbclient-raw smbd_shim socket-blocking sys_rw \
- talloc_report_printf talloc_report tevent-util time-basic trusts_util \
- util_reg util_setid util_tdb"
-configure_args+=" --with-privatelibdir=/usr/lib --builtin-libraries=${_privlibs// /,}"
+	if [ "$XBPS_CHECK_PKGS" ]; then
+		configure_args+=" --enable-selftest"
+		hostmakedepends+=" python3-cryptography python3-iso8601
+		 python3-pyasn1"
+		makedepends+=" nss_wrapper pam_wrapper resolv_wrapper
+		  socket_wrapper uid_wrapper"
+	fi
+fi
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
+export PYTHONHASHSEED=1
 
 post_patch() {
 	# Look for properly named python support libraries
 	vsed -i third_party/waf/waflib/Tools/python.py \
-		-e "/env.pyext_PATTERN/s/dct\['SO'\]/'.so'/"
+		-e "s|env.pyext_PATTERN = .*$|env.pyext_PATTERN = '%s.so'|g"
+
+	# Fix for our `kdb` linking against the system `db` package which
+	# doesn't distribute a pkg-config file and the samba build scripts just
+	# can't handle that.
+	cat >>wscript_configure_system_mitkrb5 <<_EOF
+if ("db" in conf.env["LIB_KDB5"]
+      and not conf.check_cfg(package="db", mandatory=False)):
+    krb5_define_syslib(conf, "db", [])
+_EOF
 
 	# Fix log and spool locations in conf file
 	vsed -i examples/smb.conf.default \
@@ -90,6 +94,8 @@ post_install() {
 	vmkdir usr/lib/cups/backend
 	ln -fs /usr/bin/smbspool ${DESTDIR}/usr/lib/cups/backend/smb
 
+	vinstall packaging/printing/smbprint 744 usr/bin/
+
 	# Do not ship sudo rule that grants nopasswd privileges by default
 	rm -rf ${DESTDIR}/etc/sudoers.d
 
@@ -110,10 +116,9 @@ smbclient_package() {
 		local _t _tools
 
 		# These utilities have man pages in section 1
-		_tools="findsmb dbwrap_tool mdfind mvxattr nmblookup ntlm_auth
-		 oLschema2ldif regdiff regpatch regshell regtree rpcclient
-		 sharesec smbcacls smbclient smbcquotas smbget smbtar smbtree
-		 wbinfo"
+		_tools="dbwrap_tool mdsearch mvxattr nmblookup oLschema2ldif
+		regdiff regpatch regshell rpcclient sharesec smbcacls smbclient
+		smbcquotas smbget smbtar smbtree wspsearch"
 
 		for _t in ${_tools}; do
 			vmove usr/bin/${_t}
@@ -127,11 +132,9 @@ smbclient_package() {
 			vmove usr/share/man/man8/${_t}.8
 		done
 
-		# No man page for this one
+		# No man page for these
 		vmove usr/bin/dumpmscat
-
-		# Extra man page for smbget
-		vmove usr/share/man/man5/smbgetrc.5
+		vmove usr/bin/smbprint
 
 		vmove usr/libexec/samba/smbspool_krb5_wrapper
 		vmove usr/share/man/man8/smbspool_krb5_wrapper.8
@@ -171,19 +174,40 @@ samba-libs_package() {
 	replaces="libsmbclient>=0"
 	pkg_install() {
 		local _libs _privlibs _lib
-		_libs="dcerpc dcerpc-binding ndr-krb5pac ndr-nbt ndr-standard ndr
-		 samba-credentials samba-errors samba-hostconfig samba-passdb
-		 samba-util samdb smbclient smbconf smbldap wbclient"
-		_privlibs="cli-ldap cliauth cluster common-auth dcerpc-samba
-		 flag-mapping gpo iov-buf ndr-samba ndr printer-driver
-		 smb-transport tdb-wrap util-cmdline winbind-client"
+		_libs="dcerpc dcerpc-binding dcerpc-samr dcerpc-server
+		 dcerpc-server-core ndr ndr-krb5pac ndr-nbt ndr-standard netapi
+		 nss_winbind nss_wins samba-credentials samba-errors
+		 samba-hostconfig samba-passdb samba-policy samba-util samdb
+		 smbclient smbconf smbldap tevent-util wbclient"
+		_privlibs="CHARSET3 LIBWBCLIENT-OLD MESSAGING MESSAGING-SEND
+		 REG-FULL RPC-SERVER-LOOP RPC-WORKER ad-claims addns ads
+		 asn1util auth auth-unix-token auth4 authkrb5 authn-policy-util
+		 cli-cldap cli-ldap cli-ldap-common cli-nbt cli-smb-common
+		 cli-spoolss cliauth clidns cluster cmdline cmdline-contexts
+		 common-auth ctdb-event-client db-glue dbwrap dcerpc-pkt-auth
+		 dcerpc-samba dcerpc-samba4 dfs-server-ad dlz-bind9-for-torture
+		 dnsserver-common dsdb-garbage-collect-tombstones dsdb-module
+		 events flag-mapping genrand gensec gpext gpo gse http idmap
+		 interfaces iov-buf krb5samba ldbsamba libcli-lsa3
+		 libcli-netlogon3 libsmb messages-dgm messages-util mscat
+		 msghdr msrpc3 ndr-samba ndr-samba4 net-keytab netif
+		 npa-tstream nss-info pac posix-eadb printer-driver
+		 printing-migrate process-model registry replace
+		 samba-cluster-support samba-debug samba-modules samba-net
+		 samba-python samba-security samba-sockets samba3-util
+		 samdb-common scavenge-dns-records secrets3 server-id-db
+		 server-role service shares smb-transport smbclient-raw
+		 smbd-base smbd-shim smbldaphelper smbpasswdparser
+		 socket-blocking stable-sort sys-rw talloc-report
+		 talloc-report-printf tdb-wrap time-basic torture trusts-util
+		 util-reg util-setid util-tdb xattr-tdb"
 
 		for _lib in ${_libs}; do
 			vmove "usr/lib/lib${_lib}.so.*"
 		done
 
 		for _lib in ${_privlibs}; do
-			vmove "usr/lib/lib${_lib}-samba4.so"
+			vmove "usr/lib/lib${_lib}-private-samba.so"
 		done
 
 		vmove usr/share/man/man7/libsmbclient.7
@@ -209,6 +233,9 @@ samba-devel_package() {
 }
 
 samba-python3_package() {
+	depends="ldb-python3 talloc-python3 tdb-python3 tevent-python3
+	 python3-cryptography python3-dnspython python3-Markdown
+	 python3-requests"
 	short_desc+=" - Python3 bindings"
 	pkg_install() {
 		vmove ${py3_lib}
@@ -222,3 +249,12 @@ samba-glusterfs_package() {
 		vmove usr/share/man/man8/vfs_glusterfs.8
 	}
 }
+
+samba-dc_package() {
+	depends="samba-python3>=${version}_${revision}"
+	short_desc+=" - AD Domain Controller"
+	pkg_install() {
+		vmove "usr/bin/samba*"
+		vmove usr/share/samba
+	}
+}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: samba: update to 4.20.1.
  2024-05-22 10:43 [PR PATCH] samba: update to 4.20.1 otommod
                   ` (4 preceding siblings ...)
  2024-05-23 14:12 ` otommod
@ 2024-05-26  2:47 ` abenson
  2024-05-26  3:48 ` [PR PATCH] [Merged]: " abenson
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: abenson @ 2024-05-26  2:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 164 bytes --]

New comment by abenson on void-packages repository

https://github.com/void-linux/void-packages/pull/50464#issuecomment-2132036164

Comment:
Fix the `xlint` error.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PR PATCH] [Merged]: samba: update to 4.20.1.
  2024-05-22 10:43 [PR PATCH] samba: update to 4.20.1 otommod
                   ` (5 preceding siblings ...)
  2024-05-26  2:47 ` abenson
@ 2024-05-26  3:48 ` abenson
  2024-05-26  3:49 ` abenson
  2024-05-26  3:49 ` abenson
  8 siblings, 0 replies; 10+ messages in thread
From: abenson @ 2024-05-26  3:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1997 bytes --]

There's a merged pull request on the void-packages repository

samba: update to 4.20.1.
https://github.com/void-linux/void-packages/pull/50464

Description:
I don't have much experience with packaging and none with `Void Linux` packaging in particular, especially with a big project like Samba, so I'm not sure this is production ready yet.

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
- I built this PR locally for these architectures:
  - x86_64
  - aarch64
  - aarch64-musl

#### Questions & notes
  - `samba-libs` has a ton of private libraries that I could not build as builtin this time. Should I add all of them to `common/shlibs`? **EDIT** I did add them all
  - I packaged `{uid,socket,nss,resolv}_wrapper` since they are needed by the `samba` testsuite but they can also be bundled in... Do we really need them? They are not used by anything else (yet).  On the other hand, `pam_wrapper`, that is also needed, is already in the repository.
  - On a related note, I tried to build the aforementioned testsuite but it ended up with a `cmocka` related build failure (`LargestIntegralType` was not defined). It did build successfully when `cmocka` was build as a bundled library though.
  - Should we break the `samba` package up? Fedora/Debian have a ton of subpackages for it and even Alpine has a few more than us.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: samba: update to 4.20.1.
  2024-05-22 10:43 [PR PATCH] samba: update to 4.20.1 otommod
                   ` (6 preceding siblings ...)
  2024-05-26  3:48 ` [PR PATCH] [Merged]: " abenson
@ 2024-05-26  3:49 ` abenson
  2024-05-26  3:49 ` abenson
  8 siblings, 0 replies; 10+ messages in thread
From: abenson @ 2024-05-26  3:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 253 bytes --]

New comment by abenson on void-packages repository

https://github.com/void-linux/void-packages/pull/50464#issuecomment-2132051770

Comment:
Nevermind, I disagree with xlint's error. j

I'm also sorry to inform you that you're now the `samba` person.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: samba: update to 4.20.1.
  2024-05-22 10:43 [PR PATCH] samba: update to 4.20.1 otommod
                   ` (7 preceding siblings ...)
  2024-05-26  3:49 ` abenson
@ 2024-05-26  3:49 ` abenson
  8 siblings, 0 replies; 10+ messages in thread
From: abenson @ 2024-05-26  3:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 251 bytes --]

New comment by abenson on void-packages repository

https://github.com/void-linux/void-packages/pull/50464#issuecomment-2132051770

Comment:
Nevermind, I disagree with xlint's error.

I'm also sorry to inform you that you're now the `samba` person.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-05-26  3:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-22 10:43 [PR PATCH] samba: update to 4.20.1 otommod
2024-05-23  8:15 ` [PR PATCH] [Updated] " otommod
2024-05-23  8:17 ` otommod
2024-05-23 14:02 ` [PR PATCH] [Updated] " otommod
2024-05-23 14:04 ` otommod
2024-05-23 14:12 ` otommod
2024-05-26  2:47 ` abenson
2024-05-26  3:48 ` [PR PATCH] [Merged]: " abenson
2024-05-26  3:49 ` abenson
2024-05-26  3:49 ` abenson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).