From 8281a16572e71986868d9dc11cd381a9a98c99cf Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jackpot51@gmail.com>
Date: Fri, 12 Jan 2024 15:16:49 -0700
Subject: [PATCH] Make progress on samba

---
 recipes/wip/samba/answers.txt |  4 ++++
 recipes/wip/samba/recipe.toml | 33 ++++++++++++++++++++++++++-------
 2 files changed, 30 insertions(+), 7 deletions(-)
 create mode 100644 recipes/wip/samba/answers.txt

diff --git a/recipes/wip/samba/answers.txt b/recipes/wip/samba/answers.txt
new file mode 100644
index 000000000..f9dc37fb6
--- /dev/null
+++ b/recipes/wip/samba/answers.txt
@@ -0,0 +1,4 @@
+Checking for HAVE_LITTLE_ENDIAN - runtime: OK
+Checking for large file support without additional flags: OK
+Checking for HAVE_SECURE_MKSTEMP: OK
+Checking for HAVE_MREMAP: OK
diff --git a/recipes/wip/samba/recipe.toml b/recipes/wip/samba/recipe.toml
index b2cd6168d..b4cc087bd 100644
--- a/recipes/wip/samba/recipe.toml
+++ b/recipes/wip/samba/recipe.toml
@@ -1,11 +1,30 @@
-#TODO probably wrong tarball
-# filesystem support - https://wiki.samba.org/index.php/File_System_Support
+#TODO: needs gnutls3 to compile
 [source]
-tar = "https://download.samba.org/pub/samba/samba-4.19.3.tar.gz"
+git = "https://gitlab.redox-os.org/redox-os/samba.git"
+upstream = "https://github.com/samba-team/samba.git"
+
 [build]
-template = "configure"
+template = "custom"
 dependencies = [
-    "gnutls",
-    "zlib",
-    "kerberos5",
+    "gnutls3"
 ]
+script = """
+rsync -av --delete --exclude .git "${COOKBOOK_SOURCE}/" ./
+cp -v "${COOKBOOK_RECIPE}/answers.txt" answers.txt
+
+COOKBOOK_CONFIGURE_FLAGS=(
+    --builtin-libraries=ALL
+    --cross-compile
+    --cross-answers=answers.txt
+    --disable-python
+    --disable-rpath
+    --enable-fhs
+    --host="${TARGET}"
+    --localstatedir=/var
+    --prefix=/usr
+    --sysconfdir=/etc
+    --with-static-modules=ALL
+    --without-ad-dc
+)
+cookbook_configure
+"""
-- 
GitLab