summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net-fs/samba/files/4.4/samba4.confd38
-rw-r--r--net-fs/samba/files/4.4/samba4.initd-r156
-rw-r--r--net-fs/samba/files/named.conf.dlz.patch15
-rw-r--r--net-fs/samba/files/nmbd.service12
-rw-r--r--net-fs/samba/files/samba-3.4.2-lib.tevent.python.mk6
-rw-r--r--net-fs/samba/files/samba-4.0.19-automagic_aio_fix.patch57
-rw-r--r--net-fs/samba/files/samba-4.1.14-libsystemd.patch51
-rw-r--r--net-fs/samba/files/samba-4.1.14-named.conf.dlz.patch15
-rw-r--r--net-fs/samba/files/samba-4.2.3-heimdal_compilefix.patch22
-rw-r--r--net-fs/samba/files/samba-4.2.7-pam.patch36
-rw-r--r--net-fs/samba/files/samba-4.4.0-pam.patch29
-rw-r--r--net-fs/samba/files/samba.conf2
-rw-r--r--net-fs/samba/files/samba.service10
-rw-r--r--net-fs/samba/files/smbd.service12
-rw-r--r--net-fs/samba/files/smbd.socket9
-rw-r--r--net-fs/samba/files/smbd_at.service7
-rw-r--r--net-fs/samba/files/winbindd.service12
-rw-r--r--net-fs/samba/metadata.xml31
-rw-r--r--net-fs/samba/samba-scm.ebuild235
-rw-r--r--sys-libs/tdb/metadata.xml12
-rw-r--r--sys-libs/tdb/tdb-scm.ebuild66
21 files changed, 733 insertions, 0 deletions
diff --git a/net-fs/samba/files/4.4/samba4.confd b/net-fs/samba/files/4.4/samba4.confd
new file mode 100644
index 0000000..58b2c78
--- /dev/null
+++ b/net-fs/samba/files/4.4/samba4.confd
@@ -0,0 +1,38 @@
+# Add "winbind" to the daemon_list if you also want winbind to start.
+# Replace "smbd nmbd" by "samba4" if you want the active directory domain controller part or the ntvfs
+# file server part or the rpc proxy to start.
+# Note that samba4 controls 'smbd' by itself, thus it can't be started manually. You can, however,
+# tweak the behaviour of a samba4-controlled smbd by modifying your '/etc/samba/smb.conf' file
+# accordingly.
+daemon_list="smbd nmbd"
+
+#----------------------------------------------------------------------------
+# Daemons calls: <daemon_name>_<command_option>
+#----------------------------------------------------------------------------
+my_service_name="samba"
+my_service_PRE="unset TMP TMPDIR"
+my_service_POST=""
+
+#----------------------------------------------------------------------------
+# Daemons calls: <daemon_name>_<command_option>
+#----------------------------------------------------------------------------
+smbd_start_options="-D"
+smbd_start="start-stop-daemon --start --exec /usr/sbin/smbd -- ${smbd_start_options}"
+smbd_stop="start-stop-daemon --stop --exec /usr/sbin/smbd"
+smbd_reload="killall -HUP smbd"
+
+nmbd_start_options="-D"
+nmbd_start="start-stop-daemon --start --exec /usr/sbin/nmbd -- ${nmbd_start_options}"
+nmbd_stop="start-stop-daemon --stop --exec /usr/sbin/nmbd"
+nmbd_reload="killall -HUP nmbd"
+
+samba4_start_options=""
+samba4_start="start-stop-daemon --start --exec /usr/sbin/samba -- ${samba4_start_options}"
+samba4_stop="start-stop-daemon --stop --exec /usr/sbin/samba"
+samba4_reload="killall -HUP samba"
+
+winbind_start_options=""
+winbind_start="start-stop-daemon --start --exec /usr/sbin/winbindd -- ${winbind_start_options}"
+winbind_stop="start-stop-daemon --stop --exec /usr/sbin/winbindd"
+winbind_reload="killall -HUP winbindd"
+
diff --git a/net-fs/samba/files/4.4/samba4.initd-r1 b/net-fs/samba/files/4.4/samba4.initd-r1
new file mode 100644
index 0000000..bf162ad
--- /dev/null
+++ b/net-fs/samba/files/4.4/samba4.initd-r1
@@ -0,0 +1,56 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+extra_started_commands="reload"
+piddir="/run/samba"
+
+depend() {
+ after slapd
+ need net
+ use cupsd
+}
+
+DAEMONNAME="${SVCNAME##samba.}"
+[ "${DAEMONNAME}" != "samba" ] && daemon_list=${DAEMONNAME}
+
+signal_do() {
+ local signal="$1"
+ [ -z "${signal}" ] && return 0
+
+ local result=0 last_result=0 daemon= cmd_exec=
+ for daemon in ${daemon_list} ; do
+ eval cmd_exec=\$${daemon}_${signal}
+ if [ -n "${cmd_exec}" ]; then
+ ebegin "${my_service_name} -> ${signal}: ${daemon}"
+ #echo ${cmd} '->' ${!cmd}
+ ${cmd_exec} > /dev/null
+ last_result=$?
+ eend ${last_result}
+ fi
+ result=$(( ${result} + ${last_result} ))
+ done
+ return ${result}
+}
+
+start() {
+ ${my_service_PRE}
+ [ -d "${piddir}" ] || mkdir -p "${piddir}"
+ signal_do start && return 0
+
+ eerror "Error: starting services (see system logs)"
+ signal_do stop
+ return 1
+}
+stop() {
+ ${my_service_PRE}
+ if signal_do stop ; then
+ ${my_service_POST}
+ return 0
+ fi
+}
+reload() {
+ ${my_service_PRE}
+ signal_do reload
+}
diff --git a/net-fs/samba/files/named.conf.dlz.patch b/net-fs/samba/files/named.conf.dlz.patch
new file mode 100644
index 0000000..ad8486c
--- /dev/null
+++ b/net-fs/samba/files/named.conf.dlz.patch
@@ -0,0 +1,15 @@
+diff --git a/source4/setup/named.conf.dlz b/source4/setup/named.conf.dlz
+index be20a57..d86f766 100644
+--- a/source4/setup/named.conf.dlz
++++ b/source4/setup/named.conf.dlz
+@@ -11,9 +11,9 @@
+ #
+ dlz "AD DNS Zone" {
+ # For BIND 9.8.0
+- database "dlopen ${MODULESDIR}/bind9/dlz_bind9.so";
++ # database "dlopen ${MODULESDIR}/bind9/dlz_bind9.so";
+
+ # For BIND 9.9.0
+- # database "dlopen ${MODULESDIR}/bind9/dlz_bind9_9.so";
++ database "dlopen ${MODULESDIR}/bind9/dlz_bind9_9.so";
+ };
diff --git a/net-fs/samba/files/nmbd.service b/net-fs/samba/files/nmbd.service
new file mode 100644
index 0000000..44b4ffb
--- /dev/null
+++ b/net-fs/samba/files/nmbd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Samba NetBIOS name server
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/samba/nmbd.pid
+ExecStart=/usr/sbin/nmbd -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-fs/samba/files/samba-3.4.2-lib.tevent.python.mk b/net-fs/samba/files/samba-3.4.2-lib.tevent.python.mk
new file mode 100644
index 0000000..3a03755
--- /dev/null
+++ b/net-fs/samba/files/samba-3.4.2-lib.tevent.python.mk
@@ -0,0 +1,6 @@
+[PYTHON::pytevent]
+LIBRARY_REALNAME = tevent.$(SHLIBEXT)
+PRIVATE_DEPENDENCIES = LIBTEVENT PYTALLOC LIBSAMBA-UTIL LIBREPLACE
+
+pytevent_OBJ_FILES = $(libteventsrcdir)/pytevent.o
+
diff --git a/net-fs/samba/files/samba-4.0.19-automagic_aio_fix.patch b/net-fs/samba/files/samba-4.0.19-automagic_aio_fix.patch
new file mode 100644
index 0000000..ec351db
--- /dev/null
+++ b/net-fs/samba/files/samba-4.0.19-automagic_aio_fix.patch
@@ -0,0 +1,57 @@
+https://bugzilla.samba.org/show_bug.cgi?id=10370
+
+--- samba-4.0.19/source3/wscript
++++ samba-4.0.19/source3/wscript
+@@ -507,9 +507,10 @@
+ else:
+ conf.DEFINE('HAVE_NO_AIO', '1')
+
+- if host_os.rfind('linux') > -1:
+- conf.CHECK_FUNCS_IN('io_submit', 'aio')
+- conf.CHECK_CODE('''
++ if Options.options.with_aio_support != False:
++ if host_os.rfind('linux') > -1:
++ conf.CHECK_FUNCS_IN('io_submit', 'aio')
++ conf.CHECK_CODE('''
+ struct io_event ioev;
+ struct iocb *ioc;
+ io_context_t ctx;
+@@ -526,11 +527,11 @@
+ io_getevents(ctx, 1, 1, &ioev, &ts);
+ ''',
+ 'HAVE_LINUX_KERNEL_AIO',
+- msg='Checking for linux kernel asynchronous io support',
+- headers='unistd.h stdlib.h sys/types.h fcntl.h sys/eventfd.h libaio.h',
+- lib='aio')
++ msg='Checking for linux kernel asynchronous io support',
++ headers='unistd.h stdlib.h sys/types.h fcntl.h sys/eventfd.h libaio.h',
++ lib='aio')
+
+- conf.CHECK_CODE('''
++ conf.CHECK_CODE('''
+ struct msghdr msg;
+ union {
+ struct cmsghdr cm;
+@@ -540,17 +541,17 @@
+ msg.msg_controllen = sizeof(control_un.control);
+ ''',
+ 'HAVE_MSGHDR_MSG_CONTROL',
+- msg='Checking if we can use msg_control for passing file descriptors',
+- headers='sys/types.h stdlib.h stddef.h sys/socket.h sys/un.h')
+- conf.CHECK_CODE('''
++ msg='Checking if we can use msg_control for passing file descriptors',
++ headers='sys/types.h stdlib.h stddef.h sys/socket.h sys/un.h')
++ conf.CHECK_CODE('''
+ struct msghdr msg;
+ int fd;
+ msg.msg_acctrights = (caddr_t) &fd;
+ msg.msg_acctrightslen = sizeof(fd);
+ ''',
+ 'HAVE_MSGHDR_MSG_ACCTRIGHTS',
+- msg='Checking if we can use msg_acctrights for passing file descriptors',
+- headers='sys/types.h stdlib.h stddef.h sys/socket.h sys/un.h')
++ msg='Checking if we can use msg_acctrights for passing file descriptors',
++ headers='sys/types.h stdlib.h stddef.h sys/socket.h sys/un.h')
+
+ if Options.options.with_winbind:
+ conf.env.build_winbind = True
diff --git a/net-fs/samba/files/samba-4.1.14-libsystemd.patch b/net-fs/samba/files/samba-4.1.14-libsystemd.patch
new file mode 100644
index 0000000..94b30c0
--- /dev/null
+++ b/net-fs/samba/files/samba-4.1.14-libsystemd.patch
@@ -0,0 +1,51 @@
+From 0f9b06ade820ce165015526220569db81e00150b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 3 Jan 2015 18:59:48 +0100
+Subject: [PATCH] Support libsystemd, renamed from libsystemd-daemon
+
+---
+ lib/util/wscript_build | 2 +-
+ wscript | 4 ++++
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/lib/util/wscript_build b/lib/util/wscript_build
+index f161f96..6b6b511 100755
+--- a/lib/util/wscript_build
++++ b/lib/util/wscript_build
+@@ -10,7 +10,7 @@ bld.SAMBA_LIBRARY('samba-util',
+ server_id.c dprintf.c parmlist.c bitmap.c pidfile.c
+ tevent_debug.c util_process.c memcache.c''',
+ deps='DYNCONFIG',
+- public_deps='talloc tevent execinfo uid_wrapper pthread LIBCRYPTO charset util_setid systemd-daemon',
++ public_deps='talloc tevent execinfo uid_wrapper pthread LIBCRYPTO charset util_setid systemd systemd-daemon',
+ public_headers='debug.h attr.h byteorder.h data_blob.h memory.h safe_string.h time.h talloc_stack.h xfile.h dlinklist.h samba_util.h string_wrappers.h',
+ header_path= [ ('dlinklist.h samba_util.h', '.'), ('*', 'util') ],
+ local_include=False,
+diff --git a/wscript b/wscript
+index f389f90..3c4fa21 100644
+--- a/wscript
++++ b/wscript
+@@ -183,9 +183,12 @@ def configure(conf):
+ conf.env['ENABLE_PIE'] = True
+
+ if Options.options.enable_systemd != False:
++ conf.check_cfg(package='libsystemd', args='--cflags --libs',
++ msg='Checking for libsystemd', uselib_store="SYSTEMD")
+ conf.check_cfg(package='libsystemd-daemon', args='--cflags --libs',
+ msg='Checking for libsystemd-daemon', uselib_store="SYSTEMD-DAEMON")
+ conf.CHECK_HEADERS('systemd/sd-daemon.h', lib='systemd-daemon')
++ conf.CHECK_LIB('systemd', shlib=True)
+ conf.CHECK_LIB('systemd-daemon', shlib=True)
+
+ if conf.CONFIG_SET('HAVE_SYSTEMD_SD_DAEMON_H'):
+@@ -193,6 +196,7 @@ def configure(conf):
+ conf.env['ENABLE_SYSTEMD'] = True
+ else:
+ conf.SET_TARGET_TYPE('systemd-daemon', 'EMPTY')
++ conf.SET_TARGET_TYPE('systemd', 'EMPTY')
+ conf.undefine('HAVE_SYSTEMD')
+
+ conf.SAMBA_CONFIG_H('include/config.h')
+--
+2.2.1
+
diff --git a/net-fs/samba/files/samba-4.1.14-named.conf.dlz.patch b/net-fs/samba/files/samba-4.1.14-named.conf.dlz.patch
new file mode 100644
index 0000000..9f1ebb8
--- /dev/null
+++ b/net-fs/samba/files/samba-4.1.14-named.conf.dlz.patch
@@ -0,0 +1,15 @@
+--- samba-4.1.14/source4/setup/named.conf.dlz
++++ samba-4.1.14/source4/setup/named.conf.dlz
+@@ -11,10 +11,10 @@
+ #
+ dlz "AD DNS Zone" {
+ # For BIND 9.8.x
+- database "dlopen ${MODULESDIR}/bind9/dlz_bind9.so";
++ # database "dlopen ${MODULESDIR}/bind9/dlz_bind9.so";
+
+ # For BIND 9.9.x
+- # database "dlopen ${MODULESDIR}/bind9/dlz_bind9_9.so";
++ database "dlopen ${MODULESDIR}/bind9/dlz_bind9_9.so";
+
+ # For BIND 9.10.x
+ # database "dlopen ${MODULESDIR}/bind9/dlz_bind9_10.so";
diff --git a/net-fs/samba/files/samba-4.2.3-heimdal_compilefix.patch b/net-fs/samba/files/samba-4.2.3-heimdal_compilefix.patch
new file mode 100644
index 0000000..c6f5007
--- /dev/null
+++ b/net-fs/samba/files/samba-4.2.3-heimdal_compilefix.patch
@@ -0,0 +1,22 @@
+https://bugs.gentoo.org/542638
+
+From: Stephan Wolf <stephan@letzte-bankreihe.de>
+
+Samba uses the build in implementation of heimdal from year 2011.
+The ebuild uses the portage version of heimdal.
+I got it fixed to patch samba kdc_init function.
+
+--- samba-4.2.3/source4/kdc/kdc.c
++++ samba-4.2.3/source4/kdc/kdc.c
+@@ -967,9 +967,9 @@
+ * The old behavior in the _kdc_get_preferred_key()
+ * function is use_strongest_server_key=TRUE.
+ */
+- kdc->config->as_use_strongest_session_key = false;
++ kdc->config->tgt_use_strongest_session_key = false;
+ kdc->config->preauth_use_strongest_session_key = false;
+- kdc->config->tgs_use_strongest_session_key = false;
++ kdc->config->svc_use_strongest_session_key = false;
+ kdc->config->use_strongest_server_key = true;
+
+ /* Register hdb-samba4 hooks for use as a keytab */
diff --git a/net-fs/samba/files/samba-4.2.7-pam.patch b/net-fs/samba/files/samba-4.2.7-pam.patch
new file mode 100644
index 0000000..22b393e
--- /dev/null
+++ b/net-fs/samba/files/samba-4.2.7-pam.patch
@@ -0,0 +1,36 @@
+--- samba-4.2.7/source3/wscript
++++ samba-4.2.7/source3/wscript
+@@ -853,11 +853,11 @@
+ if not conf.CHECK_FUNCS_IN('iconv_open', 'iconv', headers='iconv.h'):
+ conf.env.with_iconv = False
+ if conf.env.with_iconv:
+ conf.DEFINE('HAVE_ICONV', 1)
+
+- if Options.options.with_pam:
++ if Options.options.with_pam != False:
+ use_pam=True
+ conf.CHECK_HEADERS('security/pam_appl.h pam/pam_appl.h')
+ if not conf.CONFIG_SET('HAVE_SECURITY_PAM_APPL_H') and not conf.CONFIG_SET('HAVE_PAM_PAM_APPL_H'):
+ Logs.warn("--with-pam=yes but pam_appl.h not found")
+ use_pam=False
+@@ -926,10 +926,20 @@
+ msg="Checking whether PAM_RADIO_TYPE is available");
+ if use_pam:
+ conf.DEFINE('WITH_PAM', 1)
+ conf.DEFINE('WITH_PAM_MODULES', 1)
+
++ else:
++ Logs.warn("PAM disabled")
++ use_pam=False
++ conf.undefine('WITH_PAM')
++ conf.undefine('WITH_PAM_MODULES')
++ conf.undefine('HAVE_SECURITY_PAM_APPL_H')
++ conf.undefine('PAM_RHOST')
++ conf.undefine('PAM_TTY')
++ conf.undefine('HAVE_PAM_PAM_APPL_H')
++
+ if Options.options.with_pam_smbpass:
+ conf.env.with_pam_smbpass = True
+
+ seteuid = False
+
diff --git a/net-fs/samba/files/samba-4.4.0-pam.patch b/net-fs/samba/files/samba-4.4.0-pam.patch
new file mode 100644
index 0000000..4516013
--- /dev/null
+++ b/net-fs/samba/files/samba-4.4.0-pam.patch
@@ -0,0 +1,29 @@
+--- samba-4.4.0rc2/source3/wscript
++++ samba-4.4.0rc2/source3/wscript
+@@ -870,7 +870,7 @@
+ if conf.env.with_iconv:
+ conf.DEFINE('HAVE_ICONV', 1)
+
+- if Options.options.with_pam:
++ if Options.options.with_pam != False:
+ use_pam=True
+ conf.CHECK_HEADERS('security/pam_appl.h pam/pam_appl.h')
+ if not conf.CONFIG_SET('HAVE_SECURITY_PAM_APPL_H') and not conf.CONFIG_SET('HAVE_PAM_PAM_APPL_H'):
+@@ -943,6 +943,17 @@
+ conf.DEFINE('WITH_PAM', 1)
+ conf.DEFINE('WITH_PAM_MODULES', 1)
+
++ else:
++ Logs.warn("PAM disabled")
++ use_pam=False
++ conf.undefine('WITH_PAM')
++ conf.undefine('WITH_PAM_MODULES')
++ conf.undefine('HAVE_SECURITY_PAM_APPL_H')
++ conf.undefine('PAM_RHOST')
++ conf.undefine('PAM_TTY')
++ conf.undefine('HAVE_PAM_PAM_APPL_H')
++
++
+ seteuid = False
+
+ #
diff --git a/net-fs/samba/files/samba.conf b/net-fs/samba/files/samba.conf
new file mode 100644
index 0000000..e0a6f32
--- /dev/null
+++ b/net-fs/samba/files/samba.conf
@@ -0,0 +1,2 @@
+D /run/samba 0755 root root
+D /run/lock/samba 0755 root root
diff --git a/net-fs/samba/files/samba.service b/net-fs/samba/files/samba.service
new file mode 100644
index 0000000..8214ff8
--- /dev/null
+++ b/net-fs/samba/files/samba.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Samba AD server
+After=network.target winbindd.service
+Conflicts=nmbd.service smbd.service
+
+[Service]
+ExecStart=/usr/sbin/samba --interactive
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-fs/samba/files/smbd.service b/net-fs/samba/files/smbd.service
new file mode 100644
index 0000000..5c006a4
--- /dev/null
+++ b/net-fs/samba/files/smbd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Samba SMB/CIFS server
+After=network.target nmbd.service winbindd.service
+
+[Service]
+Type=forking
+PIDFile=/var/run/samba/smbd.pid
+ExecStart=/usr/sbin/smbd -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-fs/samba/files/smbd.socket b/net-fs/samba/files/smbd.socket
new file mode 100644
index 0000000..833bf43
--- /dev/null
+++ b/net-fs/samba/files/smbd.socket
@@ -0,0 +1,9 @@
+[Unit]
+Description=Samba SMB/CIFS server socket
+
+[Socket]
+ListenStream=445
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/net-fs/samba/files/smbd_at.service b/net-fs/samba/files/smbd_at.service
new file mode 100644
index 0000000..e1f71be
--- /dev/null
+++ b/net-fs/samba/files/smbd_at.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Samba SMB/CIFS server instance
+
+[Service]
+ExecStart=/usr/sbin/smbd -F
+ExecReload=/bin/kill -HUP $MAINPID
+StandardInput=socket
diff --git a/net-fs/samba/files/winbindd.service b/net-fs/samba/files/winbindd.service
new file mode 100644
index 0000000..67a778f
--- /dev/null
+++ b/net-fs/samba/files/winbindd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Samba Winbind daemon
+After=network.target nmbd.service
+
+[Service]
+Type=forking
+PIDFile=/var/run/samba/winbindd.pid
+ExecStart=/usr/sbin/winbindd -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-fs/samba/metadata.xml b/net-fs/samba/metadata.xml
new file mode 100644
index 0000000..b367f4d
--- /dev/null
+++ b/net-fs/samba/metadata.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>samba@gentoo.org</email>
+ <name>Samba Team</name>
+ </maintainer>
+ <longdescription>
+ Samba is an Open Source/Free Software suite that provides seamless file and print services to SMB/CIFS clients. Integration with various accounting and antivirus backends. License: GNU General Public License.
+ </longdescription>
+ <use>
+ <flag name="addc">Enable Active Directory Domain Controller support</flag>
+ <flag name="ads">Enable Active Directory support</flag>
+ <flag name="swat">Enables support for swat configuration gui</flag>
+ <flag name="winbind">Enables support for the winbind auth daemon</flag>
+ <flag name="client">Enables the client part</flag>
+ <flag name="server">Enables the server part</flag>
+ <flag name="netapi">Enable building of netapi bits</flag>
+ <flag name="addns">Enable AD DNS integration</flag>
+ <flag name="aio">Enable asynchronous IO support</flag>
+ <flag name="cluster">Enable support for clustering</flag>
+ <flag name="dmapi">Enable support for DMAPI. This currently works only in combination with XFS.</flag>
+ <flag name="ldb">Enable the ldb tools</flag>
+ <flag name="quota">Enables support for user quotas</flag>
+ <flag name="smbclient">Enable smbclient tool</flag>
+ <flag name="smbsharemodes">Enable special smb share modes (?) </flag>
+ <flag name="system-mitkrb5">Use <pkg>app-crypt/mit-krb5</pkg> instead of
+ <pkg>app-crypt/heimdal</pkg>.</flag>
+ <flag name="iprint">Enabling iPrint technology by Novell</flag>
+ </use>
+</pkgmetadata>
diff --git a/net-fs/samba/samba-scm.ebuild b/net-fs/samba/samba-scm.ebuild
new file mode 100644
index 0000000..7ec849c
--- /dev/null
+++ b/net-fs/samba/samba-scm.ebuild
@@ -0,0 +1,235 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='threads(+),xml(+)'
+
+inherit python-single-r1 waf-utils multilib-minimal linux-info systemd eutils git-r3
+
+
+SRC_PATH="stable"
+
+SRC_URI="https://dev.gentoo.org/~polynomial-c/samba-disable-python-patches-4.5.0_rc1.tar.xz"
+
+EGIT_REPO_URI="git://git.samba.org/samba.git"
+
+KEYWORDS=""
+
+DESCRIPTION="Samba Suite Version 4"
+HOMEPAGE="http://www.samba.org/"
+LICENSE="GPL-3"
+
+SLOT="0"
+
+IUSE="acl addc addns ads avahi client cluster cups dmapi fam gnutls iprint
+ldap pam quota selinux syslog +system-mitkrb5 systemd test winbind"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/samba-4.0/policy.h
+ /usr/include/samba-4.0/dcerpc_server.h
+ /usr/include/samba-4.0/ctdb.h
+ /usr/include/samba-4.0/ctdb_client.h
+ /usr/include/samba-4.0/ctdb_protocol.h
+ /usr/include/samba-4.0/ctdb_private.h
+ /usr/include/samba-4.0/ctdb_typesafe_cb.h
+ /usr/include/samba-4.0/ctdb_version.h
+)
+
+# sys-apps/attr is an automagic dependency (see bug #489748)
+CDEPEND="${PYTHON_DEPS}
+ >=app-arch/libarchive-3.1.2[${MULTILIB_USEDEP}]
+ dev-lang/perl:=
+ dev-libs/libbsd[${MULTILIB_USEDEP}]
+ dev-libs/iniparser:0
+ dev-libs/popt[${MULTILIB_USEDEP}]
+ sys-libs/readline:=
+ virtual/libiconv
+ dev-python/subunit[${PYTHON_USEDEP},${MULTILIB_USEDEP}]
+ sys-apps/attr[${MULTILIB_USEDEP}]
+ sys-libs/libcap
+ >=sys-libs/ldb-1.1.27[${MULTILIB_USEDEP}]
+ sys-libs/ncurses:0=[${MULTILIB_USEDEP}]
+ >=sys-libs/talloc-2.1.8[python,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
+ =sys-libs/tdb-scm[python,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
+ >=sys-libs/tevent-0.9.29[${MULTILIB_USEDEP}]
+ sys-libs/zlib[${MULTILIB_USEDEP}]
+ pam? ( virtual/pam )
+ acl? ( virtual/acl )
+ addns? ( net-dns/bind-tools[gssapi] )
+ cluster? ( !dev-db/ctdb )
+ cups? ( net-print/cups )
+ dmapi? ( sys-apps/dmapi )
+ fam? ( virtual/fam )
+ gnutls? ( dev-libs/libgcrypt:0
+ >=net-libs/gnutls-1.4.0 )
+ ldap? ( net-nds/openldap[${MULTILIB_USEDEP}] )
+ system-mitkrb5? ( app-crypt/mit-krb5[${MULTILIB_USEDEP}] )
+ !system-mitkrb5? ( >=app-crypt/heimdal-1.5[-ssl,${MULTILIB_USEDEP}] )
+ systemd? ( sys-apps/systemd:0= )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ client? ( net-fs/cifs-utils[ads?] )
+ selinux? ( sec-policy/selinux-samba )
+ !dev-perl/Parse-Yapp
+"
+
+REQUIRED_USE="addc? ( gnutls !system-mitkrb5 )
+ ads? ( acl gnutls ldap )
+ ${PYTHON_REQUIRED_USE}"
+
+
+PATCHES=(
+ "${FILESDIR}/${PN}-4.4.0-pam.patch"
+)
+
+#CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+CONFDIR="${FILESDIR}/4.4"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+SHAREDMODS=""
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ if use cluster ; then
+ SHAREDMODS="${SHAREDMODS}idmap_rid,idmap_tdb2,idmap_ad"
+ fi
+}
+src_unpack()
+{
+ git-r3_src_unpack
+ default
+}
+
+src_prepare() {
+ default
+
+ # install the patches from tarball(s)
+ eapply "${WORKDIR}/patches/"
+
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local myconf=()
+ myconf=(
+ --enable-fhs
+ --sysconfdir="${EPREFIX}/etc"
+ --localstatedir="${EPREFIX}/var"
+ --with-modulesdir="${EPREFIX}/usr/$(get_libdir)/samba"
+ --with-piddir="${EPREFIX}/run/${PN}"
+ --bundled-libraries=NONE
+ --builtin-libraries=NONE
+ --disable-rpath
+ --disable-rpath-install
+ --nopyc
+ --nopyo
+ )
+ if multilib_is_native_abi ; then
+ myconf+=(
+ $(use_with acl acl-support)
+ $(usex addc '' '--without-ad-dc')
+ $(use_with addns dnsupdate)
+ $(use_with ads)
+ $(usex ads '--with-shared-modules=idmap_ad' '')
+ $(use_enable avahi)
+ $(use_with cluster cluster-support)
+ $(use_enable cups)
+ $(use_with dmapi)
+ $(use_with fam)
+ $(use_enable gnutls)
+ $(use_enable iprint)
+ $(use_with ldap)
+ $(use_with pam)
+ $(usex pam "--with-pammodulesdir=${EPREFIX}/$(get_libdir)/security" '')
+ $(use_with quota quotas)
+ $(use_with syslog)
+ $(use_with systemd)
+ $(usex system-mitkrb5 '--with-system-mitkrb5' '')
+ $(use_with winbind)
+ $(usex test '--enable-selftest' '')
+ --with-shared-modules=${SHAREDMODS}
+ )
+ else
+ myconf+=(
+ --without-acl-support
+ --without-ad-dc
+ --without-dnsupdate
+ --without-ads
+ --disable-avahi
+ --without-cluster-support
+ --disable-cups
+ --without-dmapi
+ --without-fam
+ --disable-gnutls
+ --disable-iprint
+ $(use_with ldap)
+ --without-pam
+ --without-quotas
+ --without-syslog
+ --without-systemd
+ $(usex system-mitkrb5 '--with-system-mitkrb5' '')
+ --without-winbind
+ --disable-python
+ )
+ fi
+
+ CPPFLAGS="-I${SYSROOT}${EPREFIX}/usr/include/et ${CPPFLAGS}" \
+ waf-utils_src_configure ${myconf[@]}
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+
+ # Make all .so files executable
+ find "${D}" -type f -name "*.so" -exec chmod +x {} +
+
+ if multilib_is_native_abi; then
+ # install ldap schema for server (bug #491002)
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins examples/LDAP/samba.schema
+ fi
+
+ # create symlink for cups (bug #552310)
+ if use cups ; then
+ dosym /usr/bin/smbspool /usr/libexec/cups/backend/smb
+ fi
+
+ # install example config file
+ insinto /etc/samba
+ doins examples/smb.conf.default
+
+ # Install init script and conf.d file
+ newinitd "${CONFDIR}/samba4.initd-r1" samba
+ newconfd "${CONFDIR}/samba4.confd" samba
+
+ systemd_dotmpfilesd "${FILESDIR}"/samba.conf
+ systemd_dounit "${FILESDIR}"/nmbd.service
+ systemd_dounit "${FILESDIR}"/smbd.{service,socket}
+ systemd_newunit "${FILESDIR}"/smbd_at.service 'smbd@.service'
+ systemd_dounit "${FILESDIR}"/winbindd.service
+ systemd_dounit "${FILESDIR}"/samba.service
+ fi
+}
+
+multilib_src_test() {
+ if multilib_is_native_abi ; then
+ "${WAF_BINARY}" test || die "test failed"
+ fi
+}
+
+pkg_postinst() {
+ ewarn "Be aware the this release contains the best of all of Samba's"
+ ewarn "technology parts, both a file server (that you can reasonably expect"
+ ewarn "to upgrade existing Samba 3.x releases to) and the AD domain"
+ ewarn "controller work previously known as 'samba4'."
+
+ elog "For further information and migration steps make sure to read "
+ elog "http://samba.org/samba/history/${P}.html "
+ elog "http://samba.org/samba/history/${PN}-4.2.0.html and"
+ elog "http://wiki.samba.org/index.php/Samba4/HOWTO "
+}
diff --git a/sys-libs/tdb/metadata.xml b/sys-libs/tdb/metadata.xml
new file mode 100644
index 0000000..f0c4a5f
--- /dev/null
+++ b/sys-libs/tdb/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+<maintainer type="project">
+ <email>samba@gentoo.org</email>
+ <name>Samba</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/tdb/tdb-scm.ebuild b/sys-libs/tdb/tdb-scm.ebuild
new file mode 100644
index 0000000..6156378
--- /dev/null
+++ b/sys-libs/tdb/tdb-scm.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit waf-utils multilib-minimal python-single-r1 git-r3
+
+DESCRIPTION="A simple database API"
+HOMEPAGE="http://tdb.samba.org/"
+SRC_URI=""
+
+EGIT_REPO_URI="git://git.samba.org/samba.git"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS=""
+IUSE="python"
+
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+DEPEND="
+ ${RDEPEND}
+ ${PYTHON_DEPS}
+ app-text/docbook-xml-dtd:4.2"
+
+S="${S}/lib/tdb"
+WAF_BINARY="${S}/../../buildtools/bin/waf"
+WAF="${S}/../../buildtools/bin/waf"
+
+src_prepare() {
+ default
+ python_fix_shebang .
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local extra_opts=()
+ if ! multilib_is_native_abi || ! use python; then
+ extra_opts+=( --disable-python )
+ fi
+
+ waf-utils_src_configure \
+ "${extra_opts[@]}"
+}
+
+multilib_src_compile() {
+ # need to avoid parallel building, this looks like the sanest way with waf-utils/multiprocessing eclasses
+ unset MAKEOPTS
+ waf-utils_src_compile
+}
+
+multilib_src_test() {
+ # the default src_test runs 'make test' and 'make check', letting
+ # the tests fail occasionally (reason: unknown)
+ emake check
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+}