summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-fs/samba
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-fs/samba')
-rw-r--r--net-fs/samba/Manifest8
-rw-r--r--net-fs/samba/files/3.5/lmhosts2
-rw-r--r--net-fs/samba/files/3.5/nsswitch.conf-winbind17
-rw-r--r--net-fs/samba/files/3.5/nsswitch.conf-wins17
-rw-r--r--net-fs/samba/files/3.5/samba-3.5.6-kerberos-dummy.patch30
-rw-r--r--net-fs/samba/files/3.5/samba-3.5.8-uclib-build.patch58
-rw-r--r--net-fs/samba/files/3.5/samba.confd28
-rw-r--r--net-fs/samba/files/3.5/samba.initd59
-rw-r--r--net-fs/samba/files/3.5/samba.pam8
-rw-r--r--net-fs/samba/files/3.5/smb.conf.default271
-rw-r--r--net-fs/samba/files/3.5/smb.conf.default.patch86
-rw-r--r--net-fs/samba/files/3.5/smbusers7
-rw-r--r--net-fs/samba/files/3.5/swat.xinetd17
-rw-r--r--net-fs/samba/files/3.5/system-auth-winbind.pam18
-rw-r--r--net-fs/samba/files/3.6/lmhosts2
-rw-r--r--net-fs/samba/files/3.6/samba.confd28
-rw-r--r--net-fs/samba/files/3.6/samba.initd60
-rw-r--r--net-fs/samba/files/3.6/samba.pam8
-rw-r--r--net-fs/samba/files/3.6/smb.conf.default.patch68
-rw-r--r--net-fs/samba/files/3.6/smbusers7
-rw-r--r--net-fs/samba/files/3.6/swat.xinetd17
-rw-r--r--net-fs/samba/files/3.6/system-auth-winbind.pam18
-rw-r--r--net-fs/samba/files/4.0/com_err.patch35
-rw-r--r--net-fs/samba/files/4.0/samba4.confd38
-rw-r--r--net-fs/samba/files/4.0/samba4.initd-r156
-rw-r--r--net-fs/samba/files/4.1/com_err.patch35
-rw-r--r--net-fs/samba/files/4.1/samba4.confd38
-rw-r--r--net-fs/samba/files/4.1/samba4.initd-r156
-rw-r--r--net-fs/samba/files/4.2/samba4.confd38
-rw-r--r--net-fs/samba/files/4.2/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.conf1
-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.xml30
-rw-r--r--net-fs/samba/samba-3.5.21.ebuild453
-rw-r--r--net-fs/samba/samba-3.5.22.ebuild453
-rw-r--r--net-fs/samba/samba-3.6.25.ebuild483
-rw-r--r--net-fs/samba/samba-4.0.26.ebuild181
-rw-r--r--net-fs/samba/samba-4.1.18.ebuild176
-rw-r--r--net-fs/samba/samba-4.1.19.ebuild176
-rw-r--r--net-fs/samba/samba-4.2.3.ebuild182
51 files changed, 3549 insertions, 0 deletions
diff --git a/net-fs/samba/Manifest b/net-fs/samba/Manifest
new file mode 100644
index 000000000000..5b09dc41587d
--- /dev/null
+++ b/net-fs/samba/Manifest
@@ -0,0 +1,8 @@
+DIST samba-3.5.21.tar.gz 35377315 SHA256 fd9a66056b1ba9496762394efff41fcaa0e58f2e50e71910e6d202b8a59a1c10 SHA512 e6d52530094b2f8284f8536f97411c3944a83e9f1a808836acdca19fe4aee3cc47e136cc2a2eab96ba89526fe289ec1a3d22fb836bd261bf7c8ddfbccd1cf975 WHIRLPOOL a476ea24841cfdec0f640880e0362173a3f6b957afd2d2448f7b4a8b7c927ef558fd22e7fe20b05bd8aecf1169d8e488b87830a99ddfddcbc8be0c9a414966ad
+DIST samba-3.5.22.tar.gz 35385144 SHA256 b4c98f77f5634478da109063334acd9b6ad7bcb38151a5b1cac6dc5feb6679dc SHA512 0e1b4816d921ca82f0426a254cf103066634cc54e28d707a62da951118413f7f5ca5f87d60688cab802a58b0af87f797fbbe12f4e1284d5d7f545a98aba97616 WHIRLPOOL 6e59655dd7a537f0c7c889c43ddf5afb8060706e1ec79b3835698181c5c7478059f91c93eefbde50b03e0154a686eda35eabf807bb7ae01dd2b9b39648a009ae
+DIST samba-3.6.25.tar.gz 34121828 SHA256 8f2c8a7f2bd89b0dfd228ed917815852f7c625b2bc0936304ac3ed63aaf83751 SHA512 25a5c56dae4517e82e196b59fa301b661ec75db57effbb0ede35fb23b018f78cdea6513e8760966caf58abc43335fcebda77fe5bf5bb9d4b27fd3ca6e5a3b626 WHIRLPOOL 68c4a335b3912bf3c6baecae337b1131127515191052366ca9a04ec6d919f2fb69c912aefb087e2578134f3a9bde7b496ea880f2197a8dbf8221058dd1e8444d
+DIST samba-4.0.26.tar.gz 22155521 SHA256 ce2441992c6d18950d752edb2d1274b3f7e056b2e2e8516fc42e408e4a25894a SHA512 0df6f5961b2b6af1a4356540299acae52473f9d4342762d1556c859a36a63a7b8706c94f835581e96ecbf47a2d7fb09b67f93aa3869812215e9661dda7ee1906 WHIRLPOOL fda98da46719e6f4cefa58aef56f4d75120c4386b5e398e9b2ac3aa693255a6bce9606b1bf5646708d96e4f3c8982586501ccdae7c11f223b629ab128d33ae59
+DIST samba-4.1.18.tar.gz 19550894 SHA256 5bd302355c82195271de41d4f1e0c6353bde652a23886940b310b7734256f156 SHA512 1798fc23bfa282f4e0cc047e8da6fc553f4e56a19ec1f82877a7381b7ba2d97b4687de0d499a094e725e420303e2e07038a63b9cc463f97131b91c29c0919dec WHIRLPOOL fce4c07255c882c742429a91b6faeeb079a4c85a227b803c6e2e6b7531402746f57d02099bf5104c8c7db0190ff9ca9cc69797bf30000412aecbe90906a66100
+DIST samba-4.1.19.tar.gz 19558250 SHA256 62f23dffacd4faf8ac557f9cf01a1595e39db0bbdd959c4c1890f46155c9f936 SHA512 116f022cfd55506028a14363e084080eeb93257d216958c70991b11f4f8f01195e7174371edcdd2c72cadcb7544c0b0b979d638a7a37600d7bbd0610020f028e WHIRLPOOL dd672fc7cb659f8a80177b6d19187e2557847e802db9b3cd5fd2b708dc78b9a31c675cac80afd3a36789d562a8582155c7ffcbad26b810b621cda08b0395e6c9
+DIST samba-4.2.3.tar.gz 20721283 SHA256 b6dfa5ae4818d891ee2fcff04a5912f4a4fb2394b4f5e66a2a15b428da094c7c SHA512 33fd4deb3a9bb6ee7656fb716116f2ff3c65303ce7c13bdf2c4c618ce67e61f1d1fa77c7c29504e4bb4d6c5a094dcc54dc41999864e52ebd521d89a93666383a WHIRLPOOL 0684eae6fa815f3af99646721fd414e57e26966cc30b8c0e12bd8a1e651ac7984855521044b83becfd2beb70c5820d49d3dd1e702bb78109b34ec188b0e43191
+DIST smb_traffic_analyzer_v2.diff.bz2 12226 SHA256 1bae7eafbe8ac2382313d5ab9d43d73ba64b63a714f0f588516952d476fb868d SHA512 aa0e457a0dd282e61e6dfcd5705c29b319832dca9711b1b5baf8373e2f079991399c3537c050219ccb861a93f86353ebff677a5c625d2e3f1f3a13ee5c4087d0 WHIRLPOOL 85ee72a360f67ebe71be5cd400ecd635280a0d7c64ebb8b94656a5ef1a94f74a987de86408af00ce1b81cc8363b1b3cf14726860d29b72ee610d4bab73d6b139
diff --git a/net-fs/samba/files/3.5/lmhosts b/net-fs/samba/files/3.5/lmhosts
new file mode 100644
index 000000000000..fe7b466eb16a
--- /dev/null
+++ b/net-fs/samba/files/3.5/lmhosts
@@ -0,0 +1,2 @@
+# $Id$
+127.0.0.1 localhost
diff --git a/net-fs/samba/files/3.5/nsswitch.conf-winbind b/net-fs/samba/files/3.5/nsswitch.conf-winbind
new file mode 100644
index 000000000000..32d9b98b8505
--- /dev/null
+++ b/net-fs/samba/files/3.5/nsswitch.conf-winbind
@@ -0,0 +1,17 @@
+# $Id$
+passwd: files winbind
+group: files winbind
+
+hosts: files dns
+networks: files dns
+
+services: db files
+protocols: db files
+rpc: db files
+ethers: db files
+netmasks: files
+netgroup: files
+bootparams: files
+
+automount: files
+aliases: files
diff --git a/net-fs/samba/files/3.5/nsswitch.conf-wins b/net-fs/samba/files/3.5/nsswitch.conf-wins
new file mode 100644
index 000000000000..44c01aed9557
--- /dev/null
+++ b/net-fs/samba/files/3.5/nsswitch.conf-wins
@@ -0,0 +1,17 @@
+# $Id$
+passwd: files
+group: files
+
+hosts: files dns wins
+networks: files dns
+
+services: db files
+protocols: db files
+rpc: db files
+ethers: db files
+netmasks: files
+netgroup: files
+bootparams: files
+
+automount: files
+aliases: files
diff --git a/net-fs/samba/files/3.5/samba-3.5.6-kerberos-dummy.patch b/net-fs/samba/files/3.5/samba-3.5.6-kerberos-dummy.patch
new file mode 100644
index 000000000000..ef76afff7ef6
--- /dev/null
+++ b/net-fs/samba/files/3.5/samba-3.5.6-kerberos-dummy.patch
@@ -0,0 +1,30 @@
+diff -NrU5 samba-3.5.6.original/source3/include/krb5_protos.h samba-3.5.6/source3/include/krb5_protos.h
+--- samba-3.5.6.original/source3/include/krb5_protos.h 2010-10-07 10:41:16.000000000 -0600
++++ samba-3.5.6/source3/include/krb5_protos.h 2010-12-23 11:01:09.000000000 -0600
+@@ -86,15 +86,10 @@
+ const char *name,
+ krb5_principal *principal);
+ bool smb_krb5_principal_compare_any_realm(krb5_context context,
+ krb5_const_principal princ1,
+ krb5_const_principal princ2);
+-int cli_krb5_get_ticket(const char *principal, time_t time_offset,
+- DATA_BLOB *ticket, DATA_BLOB *session_key_krb5,
+- uint32 extra_ap_opts, const char *ccname,
+- time_t *tgs_expire,
+- const char *impersonate_princ_s);
+ krb5_error_code smb_krb5_renew_ticket(const char *ccache_string, const char *client_string, const char *service_string, time_t *expire_time);
+ krb5_error_code kpasswd_err_to_krb5_err(krb5_error_code res_code);
+ krb5_error_code smb_krb5_gen_netbios_krb5_address(smb_krb5_addresses **kerb_addr);
+ krb5_error_code smb_krb5_free_addresses(krb5_context context, smb_krb5_addresses *addr);
+ NTSTATUS krb5_to_nt_status(krb5_error_code kerberos_error);
+@@ -144,5 +139,10 @@
+ krb5_creds **creds_p);
+ char *smb_krb5_principal_get_realm(krb5_context context,
+ krb5_principal principal);
+ #endif /* HAVE_KRB5 */
+
++int cli_krb5_get_ticket(const char *principal, time_t time_offset,
++ DATA_BLOB *ticket, DATA_BLOB *session_key_krb5,
++ uint32 extra_ap_opts, const char *ccname,
++ time_t *tgs_expire,
++ const char *impersonate_princ_s);
diff --git a/net-fs/samba/files/3.5/samba-3.5.8-uclib-build.patch b/net-fs/samba/files/3.5/samba-3.5.8-uclib-build.patch
new file mode 100644
index 000000000000..905b06a5db16
--- /dev/null
+++ b/net-fs/samba/files/3.5/samba-3.5.8-uclib-build.patch
@@ -0,0 +1,58 @@
+From a5bfd634ecd0e81eb92b065da311ee4cf6f08757 Mon Sep 17 00:00:00 2001
+From: Jeff Layton <jlayton@samba.org>
+Date: Mon, 5 Jul 2010 08:39:45 -0400
+Subject: [PATCH] mount.cifs: switch to using _PATH_MNTTAB and paths.h
+
+The code currently uses fstab.h and _PATH_FSTAB, but uClibc apparently
+doesn't have that header. It does have paths.h and _PATH_MNTTAB however
+and so does glibc, so use that instead.
+
+Reported-by: Armin Kuster <linux@kama-aina.net>
+Signed-off-by: Jeff Layton <jlayton@samba.org>
+---
+diff -NrU5 samba-3.5.8.original/client/mount.cifs.c samba-3.5.8/client/mount.cifs.c
+--- samba-3.5.8.original/client/mount.cifs.c 2011-03-06 12:48:05.000000000 -0600
++++ samba-3.5.8/client/mount.cifs.c 2011-05-04 08:51:42.000000000 -0600
+@@ -37,11 +37,11 @@
+ #include <netdb.h>
+ #include <string.h>
+ #include <mntent.h>
+ #include <fcntl.h>
+ #include <limits.h>
+-#include <fstab.h>
++#include <paths.h>
+ #include "mount.h"
+
+ #define MOUNT_CIFS_VERSION_MAJOR "1"
+ #define MOUNT_CIFS_VERSION_MINOR "14"
+
+@@ -261,14 +261,14 @@
+ {
+ FILE *fstab;
+ struct mntent *mnt;
+
+ /* make sure this mount is listed in /etc/fstab */
+- fstab = setmntent(_PATH_FSTAB, "r");
++ fstab = setmntent(_PATH_MNTTAB, "r");
+ if (!fstab) {
+ fprintf(stderr, "Couldn't open %s for reading!\n",
+- _PATH_FSTAB);
++ _PATH_MNTTAB);
+ return EX_FILEIO;
+ }
+
+ while((mnt = getmntent(fstab))) {
+ if (!strcmp(mountpoint, mnt->mnt_dir))
+@@ -277,11 +277,11 @@
+ endmntent(fstab);
+
+ if (mnt == NULL || strcmp(mnt->mnt_fsname, devname)) {
+ fprintf(stderr, "%s: permission denied: no match for "
+ "%s found in %s\n", progname, mountpoint,
+- _PATH_FSTAB);
++ _PATH_MNTTAB);
+ return EX_USAGE;
+ }
+
+ /*
+ * 'mount' munges the options from fstab before passing them
diff --git a/net-fs/samba/files/3.5/samba.confd b/net-fs/samba/files/3.5/samba.confd
new file mode 100644
index 000000000000..1b329dae6b18
--- /dev/null
+++ b/net-fs/samba/files/3.5/samba.confd
@@ -0,0 +1,28 @@
+#add "winbind" to the daemon_list if you also want winbind to start
+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"
+
+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/3.5/samba.initd b/net-fs/samba/files/3.5/samba.initd
new file mode 100644
index 000000000000..0e1802f31f77
--- /dev/null
+++ b/net-fs/samba/files/3.5/samba.initd
@@ -0,0 +1,59 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+extra_started_commands="reload"
+
+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}
+}
+
+mkdir_sambadirs() {
+ [ -d /var/run/samba ] || mkdir -p /var/run/samba
+}
+
+start() {
+ ${my_service_PRE}
+ mkdir_sambadirs
+ 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/3.5/samba.pam b/net-fs/samba/files/3.5/samba.pam
new file mode 100644
index 000000000000..91beadd478a4
--- /dev/null
+++ b/net-fs/samba/files/3.5/samba.pam
@@ -0,0 +1,8 @@
+#%PAM-1.0
+# * pam_smbpass.so authenticates against the smbpasswd file
+# * changed Redhat's 'pam_stack' with 'include' for *BSD compatibility
+# (Diego "Flameeyes" Petteno'): enable with pam>=0.78 only
+auth required pam_smbpass.so nodelay
+account include system-auth
+session include system-auth
+password required pam_smbpass.so nodelay smbconf=/etc/samba/smb.conf
diff --git a/net-fs/samba/files/3.5/smb.conf.default b/net-fs/samba/files/3.5/smb.conf.default
new file mode 100644
index 000000000000..4c9a4a6d529f
--- /dev/null
+++ b/net-fs/samba/files/3.5/smb.conf.default
@@ -0,0 +1,271 @@
+# This is the main Samba configuration file. You should read the
+# smb.conf(5) manual page in order to understand the options listed
+# here. Samba has a huge number of configurable options (perhaps too
+# many!) most of which are not shown in this example
+#
+# For a step to step guide on installing, configuring and using samba,
+# read the Samba-HOWTO-Collection. This may be obtained from:
+# http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
+#
+# Many working examples of smb.conf files can be found in the
+# Samba-Guide which is generated daily and can be downloaded from:
+# http://www.samba.org/samba/docs/Samba-Guide.pdf
+#
+# Any line which starts with a ; (semi-colon) or a # (hash)
+# is a comment and is ignored. In this example we will use a #
+# for commentry and a ; for parts of the config file that you
+# may wish to enable
+#
+# NOTE: Whenever you modify this file you should run the command "testparm"
+# to check that you have not made any basic syntactic errors.
+#
+#======================= Global Settings =====================================
+[global]
+
+# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
+ workgroup = MYGROUP
+
+# server string is the equivalent of the NT Description field
+ server string = Samba Server
+
+# Security mode. Defines in which mode Samba will operate. Possible
+# values are share, user, server, domain and ads. Most people will want
+# user level security. See the Samba-HOWTO-Collection for details.
+ security = user
+
+# This option is important for security. It allows you to restrict
+# connections to machines which are on your local network. The
+# following example restricts access to two C class networks and
+# the "loopback" interface. For more examples of the syntax see
+# the smb.conf man page
+; hosts allow = 192.168.1. 192.168.2. 127.
+
+# If you want to automatically load your printer list rather
+# than setting them up individually then you'll need this
+ load printers = yes
+
+# you may wish to override the location of the printcap file
+; printcap name = /etc/printcap
+
+# on SystemV system setting printcap name to lpstat should allow
+# you to automatically obtain a printer list from the SystemV spool
+# system
+; printcap name = lpstat
+
+# It should not be necessary to specify the print system type unless
+# it is non-standard. Currently supported print systems include:
+# bsd, cups, sysv, plp, lprng, aix, hpux, qnx
+; printing = cups
+
+# Uncomment this if you want a guest account, you must add this to /etc/passwd
+# otherwise the user "nobody" is used
+; guest account = pcguest
+
+# this tells Samba to use a separate log file for each machine
+# that connects
+ log file = /var/log/samba/log.%m
+
+# Put a capping on the size of the log files (in Kb).
+ max log size = 50
+
+# Use password server option only with security = server
+# The argument list may include:
+# password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
+# or to auto-locate the domain controller/s
+# password server = *
+; password server = <NT-Server-Name>
+
+# Use the realm option only with security = ads
+# Specifies the Active Directory realm the host is part of
+; realm = MY_REALM
+
+# Backend to store user information in. New installations should
+# use either tdbsam or ldapsam. smbpasswd is available for backwards
+# compatibility. tdbsam requires no further configuration.
+; passdb backend = tdbsam
+
+# Using the following line enables you to customise your configuration
+# on a per machine basis. The %m gets replaced with the netbios name
+# of the machine that is connecting.
+# Note: Consider carefully the location in the configuration file of
+# this line. The included file is read at that point.
+; include = /etc/samba/smb.conf.%m
+
+# Configure Samba to use multiple interfaces
+# If you have multiple network interfaces then you must list them
+# here. See the man page for details.
+; interfaces = 192.168.12.2/24 192.168.13.2/24
+
+# Browser Control Options:
+# set local master to no if you don't want Samba to become a master
+# browser on your network. Otherwise the normal election rules apply
+; local master = no
+
+# OS Level determines the precedence of this server in master browser
+# elections. The default value should be reasonable
+; os level = 33
+
+# Domain Master specifies Samba to be the Domain Master Browser. This
+# allows Samba to collate browse lists between subnets. Don't use this
+# if you already have a Windows NT domain controller doing this job
+; domain master = yes
+
+# Preferred Master causes Samba to force a local browser election on startup
+# and gives it a slightly higher chance of winning the election
+; preferred master = yes
+
+# Enable this if you want Samba to be a domain logon server for
+# Windows95 workstations.
+; domain logons = yes
+
+# if you enable domain logons then you may want a per-machine or
+# per user logon script
+# run a specific logon batch file per workstation (machine)
+; logon script = %m.bat
+# run a specific logon batch file per username
+; logon script = %U.bat
+
+# Where to store roving profiles (only for Win95 and WinNT)
+# %L substitutes for this servers netbios name, %U is username
+# You must uncomment the [Profiles] share below
+; logon path = \\%L\Profiles\%U
+
+# Windows Internet Name Serving Support Section:
+# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
+; wins support = yes
+
+# WINS Server - Tells the NMBD components of Samba to be a WINS Client
+# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
+; wins server = w.x.y.z
+
+# WINS Proxy - Tells Samba to answer name resolution queries on
+# behalf of a non WINS capable client, for this to work there must be
+# at least one WINS Server on the network. The default is NO.
+; wins proxy = yes
+
+# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
+# via DNS nslookups. The default is NO.
+ dns proxy = no
+
+# These scripts are used on a domain controller or stand-alone
+# machine to add or delete corresponding unix accounts
+; add user script = /usr/sbin/useradd %u
+; add group script = /usr/sbin/groupadd %g
+; add machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u
+; delete user script = /usr/sbin/userdel %u
+; delete user from group script = /usr/sbin/deluser %u %g
+; delete group script = /usr/sbin/groupdel %g
+
+
+#============================ Share Definitions ==============================
+[homes]
+ comment = Home Directories
+ browseable = no
+ writable = yes
+
+# Un-comment the following and create the netlogon directory for Domain Logons
+; [netlogon]
+; comment = Network Logon Service
+; path = /var/lib/samba/netlogon
+; guest ok = yes
+; writable = no
+; share modes = no
+
+
+# Un-comment the following to provide a specific roving profile share
+# the default is to use the user's home directory
+;[Profiles]
+; path = /var/lib/samba/profiles
+; browseable = no
+; guest ok = yes
+
+
+# NOTE: If you have a BSD-style print system there is no need to
+# specifically define each individual printer
+[printers]
+ comment = All Printers
+ path = /var/spool/samba
+ browseable = no
+# Set public = yes to allow user 'guest account' to print
+ guest ok = no
+ writable = no
+ printable = yes
+
+# This one is useful for people to share files
+;[tmp]
+; comment = Temporary file space
+; path = /tmp
+; read only = no
+; public = yes
+
+# A publicly accessible directory, but read only, except for people in
+# the "staff" group
+;[public]
+; comment = Public Stuff
+; path = /home/samba
+; public = yes
+; writable = yes
+; printable = no
+; write list = @staff
+
+# Other examples.
+#
+# A private printer, usable only by fred. Spool data will be placed in fred's
+# home directory. Note that fred must have write access to the spool directory,
+# wherever it is.
+;[fredsprn]
+; comment = Fred's Printer
+; valid users = fred
+; path = /homes/fred
+; printer = freds_printer
+; public = no
+; writable = no
+; printable = yes
+
+# A private directory, usable only by fred. Note that fred requires write
+# access to the directory.
+;[fredsdir]
+; comment = Fred's Service
+; path = /usr/somewhere/private
+; valid users = fred
+; public = no
+; writable = yes
+; printable = no
+
+# a service which has a different directory for each machine that connects
+# this allows you to tailor configurations to incoming machines. You could
+# also use the %U option to tailor it by user name.
+# The %m gets replaced with the machine name that is connecting.
+;[pchome]
+; comment = PC Directories
+; path = /usr/pc/%m
+; public = no
+; writable = yes
+
+# A publicly accessible directory, read/write to all users. Note that all files
+# created in the directory by users will be owned by the default user, so
+# any user with access can delete any other user's files. Obviously this
+# directory must be writable by the default user. Another user could of course
+# be specified, in which case all files would be owned by that user instead.
+;[public]
+; path = /usr/somewhere/else/public
+; public = yes
+; only guest = yes
+; writable = yes
+; printable = no
+
+# The following two entries demonstrate how to share a directory so that two
+# users can place files there that will be owned by the specific users. In this
+# setup, the directory should be writable by both users and should have the
+# sticky bit set on it to prevent abuse. Obviously this could be extended to
+# as many users as required.
+;[myshare]
+; comment = Mary's and Fred's stuff
+; path = /usr/somewhere/shared
+; valid users = mary fred
+; public = no
+; writable = yes
+; printable = no
+; create mask = 0765
+
+
diff --git a/net-fs/samba/files/3.5/smb.conf.default.patch b/net-fs/samba/files/3.5/smb.conf.default.patch
new file mode 100644
index 000000000000..e9d62db164f4
--- /dev/null
+++ b/net-fs/samba/files/3.5/smb.conf.default.patch
@@ -0,0 +1,86 @@
+--- samba-3.5.9/examples/smb.conf.default 2011-06-14 05:17:28.000000000 -0600
++++ /etc/samba/smb.conf.default 2011-06-29 10:12:13.000000000 -0600
+@@ -61,11 +61,11 @@
+ # otherwise the user "nobody" is used
+ ; guest account = pcguest
+
+ # this tells Samba to use a separate log file for each machine
+ # that connects
+- log file = /usr/local/samba/var/log.%m
++ log file = /var/log/samba/log.%m
+
+ # Put a capping on the size of the log files (in Kb).
+ max log size = 50
+
+ # Use password server option only with security = server
+@@ -79,19 +79,22 @@
+ # Specifies the Active Directory realm the host is part of
+ ; realm = MY_REALM
+
+ # Backend to store user information in. New installations should
+ # use either tdbsam or ldapsam. smbpasswd is available for backwards
+-# compatibility. tdbsam requires no further configuration.
++# compatibility. tdbsam requires no further configuration. If you're
++# migrating from < samba 3.4, you'll have to convert your old user
++# passwords to the new backend with the command:
++# pdbedit -i smbpasswd:/var/lib/samba/private/smbpasswd -e
+ ; passdb backend = tdbsam
+
+ # Using the following line enables you to customise your configuration
+ # on a per machine basis. The %m gets replaced with the netbios name
+ # of the machine that is connecting.
+ # Note: Consider carefully the location in the configuration file of
+ # this line. The included file is read at that point.
+-; include = /usr/local/samba/lib/smb.conf.%m
++; include = /etc/samba/smb.conf.%m
+
+ # Configure Samba to use multiple interfaces
+ # If you have multiple network interfaces then you must list them
+ # here. See the man page for details.
+ ; interfaces = 192.168.12.2/24 192.168.13.2/24
+@@ -164,29 +167,29 @@
+ writable = yes
+
+ # Un-comment the following and create the netlogon directory for Domain Logons
+ ; [netlogon]
+ ; comment = Network Logon Service
+-; path = /usr/local/samba/lib/netlogon
++; path = /var/lib/samba/netlogon
+ ; guest ok = yes
+ ; writable = no
+ ; share modes = no
+
+
+ # Un-comment the following to provide a specific roving profile share
+ # the default is to use the user's home directory
+ ;[Profiles]
+-; path = /usr/local/samba/profiles
++; path = /var/lib/samba/profiles
+ ; browseable = no
+ ; guest ok = yes
+
+
+ # NOTE: If you have a BSD-style print system there is no need to
+ # specifically define each individual printer
+ [printers]
+ comment = All Printers
+- path = /usr/spool/samba
++ path = /var/spool/samba
+ browseable = no
+ # Set public = yes to allow user 'guest account' to print
+ guest ok = no
+ writable = no
+ printable = yes
+@@ -202,11 +205,11 @@
+ # the "staff" group
+ ;[public]
+ ; comment = Public Stuff
+ ; path = /home/samba
+ ; public = yes
+-; writable = no
++; writable = yes
+ ; printable = no
+ ; write list = @staff
+
+ # Other examples.
+ #
diff --git a/net-fs/samba/files/3.5/smbusers b/net-fs/samba/files/3.5/smbusers
new file mode 100644
index 000000000000..7acb6dc817af
--- /dev/null
+++ b/net-fs/samba/files/3.5/smbusers
@@ -0,0 +1,7 @@
+# $Id$
+
+# Syntax:
+# Unix_name = SMB_name1 SMB_name2 ...
+
+root = Administrator admin
+nobody = guest pcguest smbguest
diff --git a/net-fs/samba/files/3.5/swat.xinetd b/net-fs/samba/files/3.5/swat.xinetd
new file mode 100644
index 000000000000..45e977df11aa
--- /dev/null
+++ b/net-fs/samba/files/3.5/swat.xinetd
@@ -0,0 +1,17 @@
+# default: off
+# description: SWAT is the Samba Web Admin Tool. Use swat \
+# to configure your Samba server. To use SWAT, \
+# connect to port 901 with your favorite web browser.
+# $Id$
+
+service swat
+{
+ port = 901
+ socket_type = stream
+ wait = no
+ only_from = localhost
+ user = root
+ server = /usr/sbin/swat
+ log_on_failure += USERID
+ disable = yes
+}
diff --git a/net-fs/samba/files/3.5/system-auth-winbind.pam b/net-fs/samba/files/3.5/system-auth-winbind.pam
new file mode 100644
index 000000000000..8d6746b7aeb6
--- /dev/null
+++ b/net-fs/samba/files/3.5/system-auth-winbind.pam
@@ -0,0 +1,18 @@
+#%PAM-1.0
+# $Id$
+
+auth required pam_env.so
+auth sufficient pam_winbind.so
+auth sufficient pam_unix.so likeauth nullok use_first_pass
+auth required pam_deny.so
+
+account sufficient pam_winbind.so
+account required pam_unix.so
+
+password required pam_cracklib.so retry=3
+password sufficient pam_unix.so nullok use_authtok md5 shadow
+password required pam_deny.so
+
+session required pam_mkhomedir.so skel=/etc/skel/ umask=0022
+session required pam_limits.so
+session required pam_unix.so
diff --git a/net-fs/samba/files/3.6/lmhosts b/net-fs/samba/files/3.6/lmhosts
new file mode 100644
index 000000000000..fe7b466eb16a
--- /dev/null
+++ b/net-fs/samba/files/3.6/lmhosts
@@ -0,0 +1,2 @@
+# $Id$
+127.0.0.1 localhost
diff --git a/net-fs/samba/files/3.6/samba.confd b/net-fs/samba/files/3.6/samba.confd
new file mode 100644
index 000000000000..1b329dae6b18
--- /dev/null
+++ b/net-fs/samba/files/3.6/samba.confd
@@ -0,0 +1,28 @@
+#add "winbind" to the daemon_list if you also want winbind to start
+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"
+
+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/3.6/samba.initd b/net-fs/samba/files/3.6/samba.initd
new file mode 100644
index 000000000000..1ebd2e72b926
--- /dev/null
+++ b/net-fs/samba/files/3.6/samba.initd
@@ -0,0 +1,60 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+extra_started_commands="reload"
+piddir="/var/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}
+}
+
+mkdir_sambadirs() {
+ [ -d "${piddir}" ] || mkdir -p ${piddir}
+}
+
+start() {
+ ${my_service_PRE}
+ mkdir_sambadirs
+ 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/3.6/samba.pam b/net-fs/samba/files/3.6/samba.pam
new file mode 100644
index 000000000000..91beadd478a4
--- /dev/null
+++ b/net-fs/samba/files/3.6/samba.pam
@@ -0,0 +1,8 @@
+#%PAM-1.0
+# * pam_smbpass.so authenticates against the smbpasswd file
+# * changed Redhat's 'pam_stack' with 'include' for *BSD compatibility
+# (Diego "Flameeyes" Petteno'): enable with pam>=0.78 only
+auth required pam_smbpass.so nodelay
+account include system-auth
+session include system-auth
+password required pam_smbpass.so nodelay smbconf=/etc/samba/smb.conf
diff --git a/net-fs/samba/files/3.6/smb.conf.default.patch b/net-fs/samba/files/3.6/smb.conf.default.patch
new file mode 100644
index 000000000000..c2a9a72cedad
--- /dev/null
+++ b/net-fs/samba/files/3.6/smb.conf.default.patch
@@ -0,0 +1,68 @@
+--- samba-3.6.0rc2/examples/smb.conf.default~ 2011-06-07 19:13:47.000000000 +0100
++++ samba-3.6.0rc2/examples/smb.conf.default 2011-06-30 16:12:42.388102480 +0100
+@@ -63,7 +63,7 @@
+
+ # this tells Samba to use a separate log file for each machine
+ # that connects
+- log file = /usr/local/samba/var/log.%m
++ log file = /var/log/samba/log.%m
+
+ # Put a capping on the size of the log files (in Kb).
+ max log size = 50
+@@ -81,7 +81,10 @@
+
+ # Backend to store user information in. New installations should
+ # use either tdbsam or ldapsam. smbpasswd is available for backwards
+-# compatibility. tdbsam requires no further configuration.
++# compatibility. tdbsam requires no further configuration. If you're
++# migrating from < samba 3.4, you'll have to convert your old user
++# passwords to the new backend with the command:
++# pdbedit -i smbpasswd:/var/lib/samba/private/smbpasswd -e
+ ; passdb backend = tdbsam
+
+ # Using the following line enables you to customise your configuration
+@@ -89,7 +92,7 @@
+ # of the machine that is connecting.
+ # Note: Consider carefully the location in the configuration file of
+ # this line. The included file is read at that point.
+-; include = /usr/local/samba/lib/smb.conf.%m
++; include = /etc/samba/smb.conf.%m
+
+ # Configure Samba to use multiple interfaces
+ # If you have multiple network interfaces then you must list them
+@@ -166,7 +169,7 @@
+ # Un-comment the following and create the netlogon directory for Domain Logons
+ ; [netlogon]
+ ; comment = Network Logon Service
+-; path = /usr/local/samba/lib/netlogon
++; path = /var/lib/samba/netlogon
+ ; guest ok = yes
+ ; writable = no
+ ; share modes = no
+@@ -175,7 +178,7 @@
+ # Un-comment the following to provide a specific roving profile share
+ # the default is to use the user's home directory
+ ;[Profiles]
+-; path = /usr/local/samba/profiles
++; path = /var/lib/samba/profiles
+ ; browseable = no
+ ; guest ok = yes
+
+@@ -184,7 +187,7 @@
+ # specifically define each individual printer
+ [printers]
+ comment = All Printers
+- path = /usr/spool/samba
++ path = /var/spool/samba
+ browseable = no
+ # Set public = yes to allow user 'guest account' to print
+ guest ok = no
+@@ -204,7 +207,7 @@
+ ; comment = Public Stuff
+ ; path = /home/samba
+ ; public = yes
+-; writable = no
++; writable = yes
+ ; printable = no
+ ; write list = @staff
+
diff --git a/net-fs/samba/files/3.6/smbusers b/net-fs/samba/files/3.6/smbusers
new file mode 100644
index 000000000000..7acb6dc817af
--- /dev/null
+++ b/net-fs/samba/files/3.6/smbusers
@@ -0,0 +1,7 @@
+# $Id$
+
+# Syntax:
+# Unix_name = SMB_name1 SMB_name2 ...
+
+root = Administrator admin
+nobody = guest pcguest smbguest
diff --git a/net-fs/samba/files/3.6/swat.xinetd b/net-fs/samba/files/3.6/swat.xinetd
new file mode 100644
index 000000000000..45e977df11aa
--- /dev/null
+++ b/net-fs/samba/files/3.6/swat.xinetd
@@ -0,0 +1,17 @@
+# default: off
+# description: SWAT is the Samba Web Admin Tool. Use swat \
+# to configure your Samba server. To use SWAT, \
+# connect to port 901 with your favorite web browser.
+# $Id$
+
+service swat
+{
+ port = 901
+ socket_type = stream
+ wait = no
+ only_from = localhost
+ user = root
+ server = /usr/sbin/swat
+ log_on_failure += USERID
+ disable = yes
+}
diff --git a/net-fs/samba/files/3.6/system-auth-winbind.pam b/net-fs/samba/files/3.6/system-auth-winbind.pam
new file mode 100644
index 000000000000..8d6746b7aeb6
--- /dev/null
+++ b/net-fs/samba/files/3.6/system-auth-winbind.pam
@@ -0,0 +1,18 @@
+#%PAM-1.0
+# $Id$
+
+auth required pam_env.so
+auth sufficient pam_winbind.so
+auth sufficient pam_unix.so likeauth nullok use_first_pass
+auth required pam_deny.so
+
+account sufficient pam_winbind.so
+account required pam_unix.so
+
+password required pam_cracklib.so retry=3
+password sufficient pam_unix.so nullok use_authtok md5 shadow
+password required pam_deny.so
+
+session required pam_mkhomedir.so skel=/etc/skel/ umask=0022
+session required pam_limits.so
+session required pam_unix.so
diff --git a/net-fs/samba/files/4.0/com_err.patch b/net-fs/samba/files/4.0/com_err.patch
new file mode 100644
index 000000000000..2c9ad88f01d7
--- /dev/null
+++ b/net-fs/samba/files/4.0/com_err.patch
@@ -0,0 +1,35 @@
+From 2f34bfbc1941127d17a7a91c6598d6a6c35620e2 Mon Sep 17 00:00:00 2001
+From: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
+Date: Thu, 6 Oct 2011 00:19:01 +0200
+Subject: [PATCH] Add missing com_err dependencies
+
+---
+ auth/kerberos/wscript_build | 2 +-
+ nsswitch/wscript_build | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/auth/kerberos/wscript_build b/auth/kerberos/wscript_build
+index 1070770..2421b16 100644
+--- a/auth/kerberos/wscript_build
++++ b/auth/kerberos/wscript_build
+@@ -1,3 +1,3 @@
+ bld.SAMBA_SUBSYSTEM('KRB5_PAC',
+ source='gssapi_pac.c kerberos_pac.c',
+- deps='gssapi_krb5 krb5 ndr-krb5pac')
++ deps='gssapi_krb5 krb5 ndr-krb5pac com_err')
+diff --git a/nsswitch/wscript_build b/nsswitch/wscript_build
+index 298da06..4e353d3 100644
+--- a/nsswitch/wscript_build
++++ b/nsswitch/wscript_build
+@@ -33,7 +33,7 @@ if bld.CONFIG_SET('WITH_PAM_MODULES') and bld.CONFIG_SET('HAVE_PAM_START'):
+ if bld.CONFIG_SET('HAVE_KRB5_LOCATE_PLUGIN_H'):
+ bld.SAMBA_LIBRARY('winbind_krb5_locator',
+ source='winbind_krb5_locator.c',
+- deps='wbclient krb5',
++ deps='wbclient krb5 com_err',
+ realname='winbind_krb5_locator.so')
+
+ bld.SAMBA_SUBSYSTEM('WB_REQTRANS',
+--
+1.7.3.4
+
diff --git a/net-fs/samba/files/4.0/samba4.confd b/net-fs/samba/files/4.0/samba4.confd
new file mode 100644
index 000000000000..58b2c7827bdf
--- /dev/null
+++ b/net-fs/samba/files/4.0/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.0/samba4.initd-r1 b/net-fs/samba/files/4.0/samba4.initd-r1
new file mode 100644
index 000000000000..012e19edc92c
--- /dev/null
+++ b/net-fs/samba/files/4.0/samba4.initd-r1
@@ -0,0 +1,56 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+extra_started_commands="reload"
+piddir="/var/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/4.1/com_err.patch b/net-fs/samba/files/4.1/com_err.patch
new file mode 100644
index 000000000000..2c9ad88f01d7
--- /dev/null
+++ b/net-fs/samba/files/4.1/com_err.patch
@@ -0,0 +1,35 @@
+From 2f34bfbc1941127d17a7a91c6598d6a6c35620e2 Mon Sep 17 00:00:00 2001
+From: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
+Date: Thu, 6 Oct 2011 00:19:01 +0200
+Subject: [PATCH] Add missing com_err dependencies
+
+---
+ auth/kerberos/wscript_build | 2 +-
+ nsswitch/wscript_build | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/auth/kerberos/wscript_build b/auth/kerberos/wscript_build
+index 1070770..2421b16 100644
+--- a/auth/kerberos/wscript_build
++++ b/auth/kerberos/wscript_build
+@@ -1,3 +1,3 @@
+ bld.SAMBA_SUBSYSTEM('KRB5_PAC',
+ source='gssapi_pac.c kerberos_pac.c',
+- deps='gssapi_krb5 krb5 ndr-krb5pac')
++ deps='gssapi_krb5 krb5 ndr-krb5pac com_err')
+diff --git a/nsswitch/wscript_build b/nsswitch/wscript_build
+index 298da06..4e353d3 100644
+--- a/nsswitch/wscript_build
++++ b/nsswitch/wscript_build
+@@ -33,7 +33,7 @@ if bld.CONFIG_SET('WITH_PAM_MODULES') and bld.CONFIG_SET('HAVE_PAM_START'):
+ if bld.CONFIG_SET('HAVE_KRB5_LOCATE_PLUGIN_H'):
+ bld.SAMBA_LIBRARY('winbind_krb5_locator',
+ source='winbind_krb5_locator.c',
+- deps='wbclient krb5',
++ deps='wbclient krb5 com_err',
+ realname='winbind_krb5_locator.so')
+
+ bld.SAMBA_SUBSYSTEM('WB_REQTRANS',
+--
+1.7.3.4
+
diff --git a/net-fs/samba/files/4.1/samba4.confd b/net-fs/samba/files/4.1/samba4.confd
new file mode 100644
index 000000000000..58b2c7827bdf
--- /dev/null
+++ b/net-fs/samba/files/4.1/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.1/samba4.initd-r1 b/net-fs/samba/files/4.1/samba4.initd-r1
new file mode 100644
index 000000000000..012e19edc92c
--- /dev/null
+++ b/net-fs/samba/files/4.1/samba4.initd-r1
@@ -0,0 +1,56 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+extra_started_commands="reload"
+piddir="/var/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/4.2/samba4.confd b/net-fs/samba/files/4.2/samba4.confd
new file mode 100644
index 000000000000..58b2c7827bdf
--- /dev/null
+++ b/net-fs/samba/files/4.2/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.2/samba4.initd-r1 b/net-fs/samba/files/4.2/samba4.initd-r1
new file mode 100644
index 000000000000..ff42552e5d43
--- /dev/null
+++ b/net-fs/samba/files/4.2/samba4.initd-r1
@@ -0,0 +1,56 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+extra_started_commands="reload"
+piddir="/var/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 000000000000..ad8486ce1c67
--- /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 000000000000..44b4ffba1f7f
--- /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 000000000000..3a0375580bea
--- /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 000000000000..ec351db7a2d0
--- /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 000000000000..94b30c00e162
--- /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 000000000000..9f1ebb819906
--- /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 000000000000..c6f50073317a
--- /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.conf b/net-fs/samba/files/samba.conf
new file mode 100644
index 000000000000..fce6812e6393
--- /dev/null
+++ b/net-fs/samba/files/samba.conf
@@ -0,0 +1 @@
+D /var/run/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 000000000000..8214ff863182
--- /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 000000000000..5c006a44edb6
--- /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 000000000000..833bf438832f
--- /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 000000000000..e1f71be3f7fa
--- /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 000000000000..67a778fc76c7
--- /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 000000000000..d0c82d3de21f
--- /dev/null
+++ b/net-fs/samba/metadata.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>samba</herd>
+<maintainer>
+ <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="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="smbtav2">Enable Samba Traffic Analyzer version 2 </flag>
+ <flag name="iprint">Enabling iPrint technology by Novell</flag>
+</use>
+</pkgmetadata>
diff --git a/net-fs/samba/samba-3.5.21.ebuild b/net-fs/samba/samba-3.5.21.ebuild
new file mode 100644
index 000000000000..fcf0c9598296
--- /dev/null
+++ b/net-fs/samba/samba-3.5.21.ebuild
@@ -0,0 +1,453 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit pam versionator multilib eutils flag-o-matic
+
+MY_PV=${PV/_/}
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Library bits of the samba network filesystem"
+HOMEPAGE="http://www.samba.org/"
+SRC_URI="mirror://samba/stable/${P}.tar.gz
+ http://dev.gentoo.org/~dagger/files/smb_traffic_analyzer_v2.diff.bz2"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
+IUSE="acl addns ads +aio avahi caps +client cluster debug doc examples fam
+ ldap ldb +netapi pam quota +readline selinux +server +smbclient smbsharemodes smbtav2
+ swat syslog winbind"
+
+DEPEND="dev-libs/popt
+ !net-fs/samba-client
+ !net-fs/samba-libs
+ !net-fs/samba-server
+ !net-fs/cifs-utils
+ sys-libs/talloc
+ sys-libs/tdb
+ virtual/libiconv
+ ads? ( virtual/krb5 sys-fs/e2fsprogs
+ client? ( sys-apps/keyutils ) )
+ avahi? ( net-dns/avahi[dbus] )
+ caps? ( sys-libs/libcap )
+ client? ( !net-fs/mount-cifs
+ dev-libs/iniparser )
+ cluster? ( >=dev-db/ctdb-1.0.114_p1 )
+ fam? ( virtual/fam )
+ ldap? ( net-nds/openldap )
+ pam? ( virtual/pam
+ winbind? ( dev-libs/iniparser )
+ )
+ readline? ( >=sys-libs/readline-5.2 )
+ selinux? ( sec-policy/selinux-samba )
+ syslog? ( virtual/logger )"
+
+RDEPEND="${DEPEND}"
+
+# Disable tests since we don't want to build that much here
+RESTRICT="test"
+
+SBINPROGS=""
+BINPROGS=""
+KRBPLUGIN=""
+PLUGINEXT=".so"
+SHAREDMODS=""
+
+S="${WORKDIR}/${MY_P}/source3"
+
+# TODO:
+# - enable iPrint on Prefix/OSX and Darwin?
+# - selftest-prefix? selftest?
+# - AFS?
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+REQUIRED_USE="
+ ads? ( ldap )
+ swat? ( server )
+"
+
+pkg_setup() {
+ if use server ; then
+ SBINPROGS="${SBINPROGS} bin/smbd bin/nmbd"
+ BINPROGS="${BINPROGS} bin/testparm bin/smbstatus bin/smbcontrol bin/pdbedit
+ bin/profiles bin/sharesec bin/eventlogadm"
+
+ use smbtav2 && BINPROGS="${BINPROGS} bin/smbta-util"
+ use swat && SBINPROGS="${SBINPROGS} bin/swat"
+ use winbind && SBINPROGS="${SBINPROGS} bin/winbindd"
+ use ads && use winbind && KRBPLUGIN="${KRBPLUGIN} bin/winbind_krb5_locator"
+ fi
+
+ if use client ; then
+ BINPROGS="${BINPROGS} bin/smbclient bin/net bin/smbget bin/smbtree
+ bin/nmblookup bin/smbpasswd bin/rpcclient bin/smbcacls bin/smbcquotas
+ bin/ntlm_auth"
+
+ use ads && SBINPROGS="${SBINPROGS} bin/cifs.upcall"
+ fi
+
+ use ldb && BINPROGS="${BINPROGS} bin/ldbedit bin/ldbsearch bin/ldbadd bin/ldbdel bin/ldbmodify bin/ldbrename";
+
+ if use winbind ; then
+ BINPROGS="${BINPROGS} bin/wbinfo"
+ SHAREDMODS="${SHAREDMODS}idmap_rid,idmap_hash"
+ use ads && SHAREDMODS="${SHAREDMODS},idmap_ad"
+ use ldap && SHAREDMODS="${SHAREDMODS},idmap_ldap,idmap_adex"
+ fi
+
+ if use winbind &&
+ [[ $(tc-getCC)$ == *gcc* ]] &&
+ [[ $(gcc-major-version)$(gcc-minor-version) -lt 43 ]]
+ then
+ eerror "It is a known issue that ${P} will not build with "
+ eerror "winbind use flag enabled when using gcc < 4.3 ."
+ eerror "Please use at least the latest stable gcc version."
+ die "Using sys-devel/gcc < 4.3 with winbind use flag."
+ fi
+}
+
+src_prepare() {
+ cp "${FILESDIR}/samba-3.4.2-lib.tevent.python.mk" "../lib/tevent/python.mk"
+
+ # ensure that winbind has correct ldflags (QA notice)
+ sed -i \
+ -e 's|LDSHFLAGS="|LDSHFLAGS="\\${LDFLAGS} |g' \
+ configure || die "sed failed"
+
+ epatch "${CONFDIR}"/${PN}-3.5.6-kerberos-dummy.patch
+ use smbtav2 && cd "${WORKDIR}/${P}" && epatch "${WORKDIR}"/smb_traffic_analyzer_v2.diff
+ cd "${WORKDIR}/${MY_P}" && epatch "${CONFDIR}"/${PN}-3.5.8-uclib-build.patch
+ epatch "${CONFDIR}"/smb.conf.default.patch
+}
+
+src_configure() {
+ local myconf
+
+ # Filter out -fPIE
+ [[ ${CHOST} == *-*bsd* ]] && myconf+=" --disable-pie"
+
+ #Allowing alpha/s390/sh to build
+ if use alpha || use s390 || use sh; then
+ replace-flags -O? -O1
+ fi
+
+ # Upstream refuses to make this configurable
+ use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no
+
+ # use_with doesn't accept 2 USE-flags
+ if use client && use ads ; then
+ myconf+=" --with-cifsupcall"
+ else
+ myconf+=" --without-cifsupcall"
+ fi
+
+ if use client && use kernel_linux ; then
+ myconf+=" --with-cifsmount --with-cifsumount"
+ else
+ myconf+=" --without-cifsmount --without-cifsumount"
+ fi
+
+ #bug #399141 wrap newer iniparser version
+ has_version ">=dev-libs/iniparser-3.0.0" && \
+ export CPPFLAGS+=" -Diniparser_getstr\(d,i\)=iniparser_getstring\(d,i,NULL\)"
+
+ # Notes:
+ # - automount is only needed in conjunction with NIS and we don't have that
+ # anymore => LDAP?
+ # - --without-dce-dfs and --without-nisplus-home can't be passed to configure but are disabled by default
+ econf ${myconf} \
+ --with-piddir=/var/run/samba \
+ --sysconfdir=/etc/samba \
+ --localstatedir=/var \
+ $(use_enable debug developer) \
+ --enable-largefile \
+ --enable-socket-wrapper \
+ --enable-nss-wrapper \
+ $(use_enable swat) \
+ --disable-cups \
+ --disable-iprint \
+ $(use_enable fam) \
+ --enable-shared-libs \
+ --disable-dnssd \
+ $(use_enable avahi) \
+ --with-fhs \
+ --with-privatedir=/var/lib/samba/private \
+ --with-rootsbindir=/var/cache/samba \
+ --with-lockdir=/var/cache/samba \
+ --with-swatdir=/usr/share/doc/${PF}/swat \
+ --with-configdir=/etc/samba \
+ --with-logfilebase=/var/log/samba \
+ --with-pammodulesdir=$(getpam_mod_dir) \
+ --without-afs \
+ --without-fake-kaserver \
+ --without-vfs-afsacl \
+ $(use_with ldap) \
+ $(use_with ads) \
+ $(use_with ads krb5 /usr) \
+ $(use_with ads dnsupdate) \
+ --without-automount \
+ $(use_with pam) \
+ $(use_with pam pam_smbpass) \
+ $(use_with syslog) \
+ $(use_with quota quotas) \
+ $(use_with quota sys-quotas) \
+ --without-utmp \
+ --without-lib{talloc,tdb} \
+ $(use_with netapi libnetapi) \
+ $(use_with smbclient libsmbclient) \
+ $(use_with smbsharemodes libsmbsharemodes) \
+ $(use_with addns libaddns) \
+ $(use_with cluster ctdb /usr) \
+ $(use_with cluster cluster-support) \
+ $(use_with acl acl-support) \
+ $(use_with aio aio-support) \
+ --with-sendfile-support \
+ $(use_with winbind) \
+ --with-shared-modules=${SHAREDMODS} \
+ --without-included-popt \
+ --without-included-iniparser
+}
+
+src_compile() {
+ # compile libs
+ if use addns ; then
+ einfo "make addns library"
+ emake libaddns
+ fi
+ if use netapi ; then
+ einfo "make netapi library"
+ emake libnetapi
+ fi
+ if use smbclient ; then
+ einfo "make smbclient library"
+ emake libsmbclient
+ fi
+ if use smbsharemodes ; then
+ einfo "make smbsharemodes library"
+ emake libsmbsharemodes
+ fi
+
+ # compile modules
+ emake modules
+
+ # compile pam moudles
+ if use pam ; then
+ einfo "make pam modules"
+ emake pam_modules
+ fi
+
+ # compile winbind nss modules
+ if use winbind ; then
+ einfo "make nss modules"
+ emake nss_modules
+ fi
+
+ # compile utilities
+ if [ -n "${BINPROGS}" ] ; then
+ einfo "make binprogs"
+ emake ${BINPROGS}
+ fi
+ if [ -n "${SBINPROGS}" ] ; then
+ einfo "make sbinprogs"
+ emake ${SBINPROGS}
+ fi
+
+ if [ -n "${KRBPLUGIN}" ] ; then
+ einfo "make krbplugin"
+ emake ${KRBPLUGIN}${PLUGINEXT}
+ fi
+
+ if use client && use kernel_linux; then
+ einfo "make {,u}mount.cifs"
+ emake bin/{,u}mount.cifs
+ fi
+}
+
+src_install() {
+ # install libs
+ if use addns ; then
+ einfo "install addns library"
+ emake installlibaddns DESTDIR="${D}"
+ fi
+ if use netapi ; then
+ einfo "install netapi library"
+ emake installlibnetapi DESTDIR="${D}"
+ fi
+ if use smbclient ; then
+ einfo "install smbclient library"
+ emake installlibsmbclient DESTDIR="${D}"
+ fi
+ if use smbsharemodes ; then
+ einfo "install smbsharemodes library"
+ emake installlibsmbsharemodes DESTDIR="${D}"
+ fi
+
+ # install modules
+ emake installmodules DESTDIR="${D}"
+
+ if use pam ; then
+ einfo "install pam modules"
+ emake installpammodules DESTDIR="${D}"
+
+ if use winbind ; then
+ newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind
+ doman ../docs/manpages/pam_winbind.8
+ # bug #376853
+ insinto /etc/security
+ doins ../examples/pam_winbind/pam_winbind.conf || die
+ fi
+
+ newpamd "${CONFDIR}/samba.pam" samba
+ dodoc pam_smbpass/README
+ fi
+
+ # Nsswitch extensions. Make link for wins and winbind resolvers
+ if use winbind ; then
+ einfo "install libwbclient"
+ emake installlibwbclient DESTDIR="${D}"
+ dolib.so ../nsswitch/libnss_wins.so
+ dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2
+ dolib.so ../nsswitch/libnss_winbind.so
+ dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2
+ einfo "install libwbclient related manpages"
+ doman ../docs/manpages/idmap_rid.8
+ doman ../docs/manpages/idmap_hash.8
+ if use ldap ; then
+ doman ../docs/manpages/idmap_adex.8
+ doman ../docs/manpages/idmap_ldap.8
+ fi
+ if use ads ; then
+ doman ../docs/manpages/idmap_ad.8
+ fi
+ fi
+
+ # install binaries
+ insinto /usr
+ for prog in ${SBINPROGS} ; do
+ dosbin ${prog}
+ doman ../docs/manpages/${prog/bin\/}*
+ done
+
+ for prog in ${BINPROGS} ; do
+ dobin ${prog}
+ doman ../docs/manpages/${prog/bin\/}*
+ done
+
+ # install krbplugin
+ if [ -n "${KRBPLUGIN}" ] ; then
+ if has_version app-crypt/mit-krb5 ; then
+ insinto /usr/$(get_libdir)/krb5/plugins/libkrb5
+ doins ${KRBPLUGIN}${PLUGINEXT}
+ elif has_version app-crypt/heimdal ; then
+ insinto /usr/$(get_libdir)/plugin/krb5
+ doins ${KRBPLUGIN}${PLUGINEXT}
+ fi
+ insinto /usr
+ for prog in ${KRBPLUGIN} ; do
+ doman ../docs/manpages/${prog/bin\/}*
+ done
+ fi
+
+ # install server components
+ if use server ; then
+ doman ../docs/manpages/vfs* ../docs/manpages/samba.7
+
+ diropts -m0700
+ keepdir /var/lib/samba/private
+
+ diropts -m1777
+ keepdir /var/spool/samba
+
+ diropts -m0755
+ keepdir /var/{cache,log}/samba
+ keepdir /var/lib/samba/{netlogon,profiles}
+ keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR}
+ keepdir /usr/$(get_libdir)/samba/{auth,pdb,rpc,idmap,nss_info,gpext}
+
+ newconfd "${CONFDIR}/samba.confd" samba
+ newinitd "${CONFDIR}/samba.initd" samba
+
+ insinto /etc/samba
+ doins "${CONFDIR}"/{smbusers,lmhosts}
+
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins ../examples/LDAP/samba.schema
+ fi
+
+ if use swat ; then
+ insinto /etc/xinetd.d
+ newins "${CONFDIR}/swat.xinetd" swat
+ script/installswat.sh "${D}" "${ROOT}/usr/share/doc/${PF}/swat" "${S}"
+ fi
+
+ dodoc ../MAINTAINERS ../README* ../Roadmap ../WHATSNEW.txt ../docs/THANKS
+ fi
+
+ # install client files ({u,}mount.cifs into /)
+ if use client && use kernel_linux ; then
+ into /
+ dosbin bin/{u,}mount.cifs
+ doman ../docs/manpages/{u,}mount.cifs.8
+ fi
+
+ # install misc files
+ insinto /etc/samba
+ doins ../examples/smb.conf.default
+ doman ../docs/manpages/smb.conf.5
+
+ insinto /usr/"$(get_libdir)"/samba
+ doins ../codepages/{valid.dat,upcase.dat,lowcase.dat}
+
+ # install docs
+ if use doc ; then
+ dohtml -r ../docs/htmldocs/*
+ dodoc ../docs/*.pdf
+ fi
+
+ # install examples
+ if use examples ; then
+ insinto /usr/share/doc/${PF}/examples
+
+ if use smbclient ; then
+ doins -r ../examples/libsmbclient
+ fi
+
+ if use winbind ; then
+ doins -r ../examples/pam_winbind ../examples/nss
+ fi
+
+ if use server ; then
+ cd ../examples
+ doins -r auth autofs dce-dfs LDAP logon misc pdb \
+ perfcounter printer-accounting printing scripts tridge \
+ validchars VFS
+ fi
+ fi
+
+ # Remove empty installation directories
+ rmdir --ignore-fail-on-non-empty \
+ "${D}/usr/$(get_libdir)/samba" \
+ "${D}/usr"/{sbin,bin} \
+ "${D}/usr/share"/{man,locale,} \
+ "${D}/var"/{run,lib/samba/private,lib/samba,lib,cache/samba,cache,} \
+ # || die "tried to remove non-empty dirs, this seems like a bug in the ebuild"
+}
+
+pkg_postinst() {
+ elog "The default value of 'wide links' has been changed to 'no' in samba 3.5"
+ elog "to avoid an insecure default configuration"
+ elog "('wide links = yes' and 'unix extensions = yes'). For more details,"
+ elog "please see http://www.samba.org/samba/news/symlink_attack.html ."
+ elog ""
+ elog "An EXPERIMENTAL implementation of the SMB2 protocol has been added."
+ elog "SMB2 can be enabled by setting 'max protocol = smb2'. SMB2 is a new "
+ elog "implementation of the SMB protocol used by Windows Vista and higher"
+ elog ""
+ elog "For further information make sure to read the release notes at"
+ elog "http://samba.org/samba/history/${P}.html and "
+ elog "http://samba.org/samba/history/${PN}-3.5.0.html"
+}
diff --git a/net-fs/samba/samba-3.5.22.ebuild b/net-fs/samba/samba-3.5.22.ebuild
new file mode 100644
index 000000000000..18f5cf437538
--- /dev/null
+++ b/net-fs/samba/samba-3.5.22.ebuild
@@ -0,0 +1,453 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit pam versionator multilib eutils flag-o-matic
+
+MY_PV=${PV/_/}
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Library bits of the samba network filesystem"
+HOMEPAGE="http://www.samba.org/"
+SRC_URI="mirror://samba/stable/${P}.tar.gz
+ http://dev.gentoo.org/~dagger/files/smb_traffic_analyzer_v2.diff.bz2"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ~ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd"
+IUSE="acl addns ads +aio avahi caps +client cluster debug doc examples fam
+ ldap ldb +netapi pam quota +readline selinux +server +smbclient smbsharemodes smbtav2
+ swat syslog winbind"
+
+DEPEND="dev-libs/popt
+ !net-fs/samba-client
+ !net-fs/samba-libs
+ !net-fs/samba-server
+ !net-fs/cifs-utils
+ sys-libs/talloc
+ sys-libs/tdb
+ virtual/libiconv
+ ads? ( virtual/krb5 sys-fs/e2fsprogs
+ client? ( sys-apps/keyutils ) )
+ avahi? ( net-dns/avahi[dbus] )
+ caps? ( sys-libs/libcap )
+ client? ( !net-fs/mount-cifs
+ dev-libs/iniparser )
+ cluster? ( >=dev-db/ctdb-1.0.114_p1 )
+ fam? ( virtual/fam )
+ ldap? ( net-nds/openldap )
+ pam? ( virtual/pam
+ winbind? ( dev-libs/iniparser )
+ )
+ readline? ( >=sys-libs/readline-5.2 )
+ selinux? ( sec-policy/selinux-samba )
+ syslog? ( virtual/logger )"
+
+RDEPEND="${DEPEND}"
+
+# Disable tests since we don't want to build that much here
+RESTRICT="test"
+
+SBINPROGS=""
+BINPROGS=""
+KRBPLUGIN=""
+PLUGINEXT=".so"
+SHAREDMODS=""
+
+S="${WORKDIR}/${MY_P}/source3"
+
+# TODO:
+# - enable iPrint on Prefix/OSX and Darwin?
+# - selftest-prefix? selftest?
+# - AFS?
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+REQUIRED_USE="
+ ads? ( ldap )
+ swat? ( server )
+"
+
+pkg_setup() {
+ if use server ; then
+ SBINPROGS="${SBINPROGS} bin/smbd bin/nmbd"
+ BINPROGS="${BINPROGS} bin/testparm bin/smbstatus bin/smbcontrol bin/pdbedit
+ bin/profiles bin/sharesec bin/eventlogadm"
+
+ use smbtav2 && BINPROGS="${BINPROGS} bin/smbta-util"
+ use swat && SBINPROGS="${SBINPROGS} bin/swat"
+ use winbind && SBINPROGS="${SBINPROGS} bin/winbindd"
+ use ads && use winbind && KRBPLUGIN="${KRBPLUGIN} bin/winbind_krb5_locator"
+ fi
+
+ if use client ; then
+ BINPROGS="${BINPROGS} bin/smbclient bin/net bin/smbget bin/smbtree
+ bin/nmblookup bin/smbpasswd bin/rpcclient bin/smbcacls bin/smbcquotas
+ bin/ntlm_auth"
+
+ use ads && SBINPROGS="${SBINPROGS} bin/cifs.upcall"
+ fi
+
+ use ldb && BINPROGS="${BINPROGS} bin/ldbedit bin/ldbsearch bin/ldbadd bin/ldbdel bin/ldbmodify bin/ldbrename";
+
+ if use winbind ; then
+ BINPROGS="${BINPROGS} bin/wbinfo"
+ SHAREDMODS="${SHAREDMODS}idmap_rid,idmap_hash"
+ use ads && SHAREDMODS="${SHAREDMODS},idmap_ad"
+ use ldap && SHAREDMODS="${SHAREDMODS},idmap_ldap,idmap_adex"
+ fi
+
+ if use winbind &&
+ [[ $(tc-getCC)$ == *gcc* ]] &&
+ [[ $(gcc-major-version)$(gcc-minor-version) -lt 43 ]]
+ then
+ eerror "It is a known issue that ${P} will not build with "
+ eerror "winbind use flag enabled when using gcc < 4.3 ."
+ eerror "Please use at least the latest stable gcc version."
+ die "Using sys-devel/gcc < 4.3 with winbind use flag."
+ fi
+}
+
+src_prepare() {
+ cp "${FILESDIR}/samba-3.4.2-lib.tevent.python.mk" "../lib/tevent/python.mk"
+
+ # ensure that winbind has correct ldflags (QA notice)
+ sed -i \
+ -e 's|LDSHFLAGS="|LDSHFLAGS="\\${LDFLAGS} |g' \
+ configure || die "sed failed"
+
+ epatch "${CONFDIR}"/${PN}-3.5.6-kerberos-dummy.patch
+ use smbtav2 && cd "${WORKDIR}/${P}" && epatch "${WORKDIR}"/smb_traffic_analyzer_v2.diff
+ cd "${WORKDIR}/${MY_P}" && epatch "${CONFDIR}"/${PN}-3.5.8-uclib-build.patch
+ epatch "${CONFDIR}"/smb.conf.default.patch
+}
+
+src_configure() {
+ local myconf
+
+ # Filter out -fPIE
+ [[ ${CHOST} == *-*bsd* ]] && myconf+=" --disable-pie"
+
+ #Allowing alpha/s390/sh to build
+ if use alpha || use s390 || use sh; then
+ replace-flags -O? -O1
+ fi
+
+ # Upstream refuses to make this configurable
+ use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no
+
+ # use_with doesn't accept 2 USE-flags
+ if use client && use ads ; then
+ myconf+=" --with-cifsupcall"
+ else
+ myconf+=" --without-cifsupcall"
+ fi
+
+ if use client && use kernel_linux ; then
+ myconf+=" --with-cifsmount --with-cifsumount"
+ else
+ myconf+=" --without-cifsmount --without-cifsumount"
+ fi
+
+ #bug #399141 wrap newer iniparser version
+ has_version ">=dev-libs/iniparser-3.0.0" && \
+ export CPPFLAGS+=" -Diniparser_getstr\(d,i\)=iniparser_getstring\(d,i,NULL\)"
+
+ # Notes:
+ # - automount is only needed in conjunction with NIS and we don't have that
+ # anymore => LDAP?
+ # - --without-dce-dfs and --without-nisplus-home can't be passed to configure but are disabled by default
+ econf ${myconf} \
+ --with-piddir=/var/run/samba \
+ --sysconfdir=/etc/samba \
+ --localstatedir=/var \
+ $(use_enable debug developer) \
+ --enable-largefile \
+ --enable-socket-wrapper \
+ --enable-nss-wrapper \
+ $(use_enable swat) \
+ --disable-cups \
+ --disable-iprint \
+ $(use_enable fam) \
+ --enable-shared-libs \
+ --disable-dnssd \
+ $(use_enable avahi) \
+ --with-fhs \
+ --with-privatedir=/var/lib/samba/private \
+ --with-rootsbindir=/var/cache/samba \
+ --with-lockdir=/var/cache/samba \
+ --with-swatdir=/usr/share/doc/${PF}/swat \
+ --with-configdir=/etc/samba \
+ --with-logfilebase=/var/log/samba \
+ --with-pammodulesdir=$(getpam_mod_dir) \
+ --without-afs \
+ --without-fake-kaserver \
+ --without-vfs-afsacl \
+ $(use_with ldap) \
+ $(use_with ads) \
+ $(use_with ads krb5 /usr) \
+ $(use_with ads dnsupdate) \
+ --without-automount \
+ $(use_with pam) \
+ $(use_with pam pam_smbpass) \
+ $(use_with syslog) \
+ $(use_with quota quotas) \
+ $(use_with quota sys-quotas) \
+ --without-utmp \
+ --without-lib{talloc,tdb} \
+ $(use_with netapi libnetapi) \
+ $(use_with smbclient libsmbclient) \
+ $(use_with smbsharemodes libsmbsharemodes) \
+ $(use_with addns libaddns) \
+ $(use_with cluster ctdb /usr) \
+ $(use_with cluster cluster-support) \
+ $(use_with acl acl-support) \
+ $(use_with aio aio-support) \
+ --with-sendfile-support \
+ $(use_with winbind) \
+ --with-shared-modules=${SHAREDMODS} \
+ --without-included-popt \
+ --without-included-iniparser
+}
+
+src_compile() {
+ # compile libs
+ if use addns ; then
+ einfo "make addns library"
+ emake libaddns
+ fi
+ if use netapi ; then
+ einfo "make netapi library"
+ emake libnetapi
+ fi
+ if use smbclient ; then
+ einfo "make smbclient library"
+ emake libsmbclient
+ fi
+ if use smbsharemodes ; then
+ einfo "make smbsharemodes library"
+ emake libsmbsharemodes
+ fi
+
+ # compile modules
+ emake modules
+
+ # compile pam moudles
+ if use pam ; then
+ einfo "make pam modules"
+ emake pam_modules
+ fi
+
+ # compile winbind nss modules
+ if use winbind ; then
+ einfo "make nss modules"
+ emake nss_modules
+ fi
+
+ # compile utilities
+ if [ -n "${BINPROGS}" ] ; then
+ einfo "make binprogs"
+ emake ${BINPROGS}
+ fi
+ if [ -n "${SBINPROGS}" ] ; then
+ einfo "make sbinprogs"
+ emake ${SBINPROGS}
+ fi
+
+ if [ -n "${KRBPLUGIN}" ] ; then
+ einfo "make krbplugin"
+ emake ${KRBPLUGIN}${PLUGINEXT}
+ fi
+
+ if use client && use kernel_linux; then
+ einfo "make {,u}mount.cifs"
+ emake bin/{,u}mount.cifs
+ fi
+}
+
+src_install() {
+ # install libs
+ if use addns ; then
+ einfo "install addns library"
+ emake installlibaddns DESTDIR="${D}"
+ fi
+ if use netapi ; then
+ einfo "install netapi library"
+ emake installlibnetapi DESTDIR="${D}"
+ fi
+ if use smbclient ; then
+ einfo "install smbclient library"
+ emake installlibsmbclient DESTDIR="${D}"
+ fi
+ if use smbsharemodes ; then
+ einfo "install smbsharemodes library"
+ emake installlibsmbsharemodes DESTDIR="${D}"
+ fi
+
+ # install modules
+ emake installmodules DESTDIR="${D}"
+
+ if use pam ; then
+ einfo "install pam modules"
+ emake installpammodules DESTDIR="${D}"
+
+ if use winbind ; then
+ newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind
+ doman ../docs/manpages/pam_winbind.8
+ # bug #376853
+ insinto /etc/security
+ doins ../examples/pam_winbind/pam_winbind.conf || die
+ fi
+
+ newpamd "${CONFDIR}/samba.pam" samba
+ dodoc pam_smbpass/README
+ fi
+
+ # Nsswitch extensions. Make link for wins and winbind resolvers
+ if use winbind ; then
+ einfo "install libwbclient"
+ emake installlibwbclient DESTDIR="${D}"
+ dolib.so ../nsswitch/libnss_wins.so
+ dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2
+ dolib.so ../nsswitch/libnss_winbind.so
+ dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2
+ einfo "install libwbclient related manpages"
+ doman ../docs/manpages/idmap_rid.8
+ doman ../docs/manpages/idmap_hash.8
+ if use ldap ; then
+ doman ../docs/manpages/idmap_adex.8
+ doman ../docs/manpages/idmap_ldap.8
+ fi
+ if use ads ; then
+ doman ../docs/manpages/idmap_ad.8
+ fi
+ fi
+
+ # install binaries
+ insinto /usr
+ for prog in ${SBINPROGS} ; do
+ dosbin ${prog}
+ doman ../docs/manpages/${prog/bin\/}*
+ done
+
+ for prog in ${BINPROGS} ; do
+ dobin ${prog}
+ doman ../docs/manpages/${prog/bin\/}*
+ done
+
+ # install krbplugin
+ if [ -n "${KRBPLUGIN}" ] ; then
+ if has_version app-crypt/mit-krb5 ; then
+ insinto /usr/$(get_libdir)/krb5/plugins/libkrb5
+ doins ${KRBPLUGIN}${PLUGINEXT}
+ elif has_version app-crypt/heimdal ; then
+ insinto /usr/$(get_libdir)/plugin/krb5
+ doins ${KRBPLUGIN}${PLUGINEXT}
+ fi
+ insinto /usr
+ for prog in ${KRBPLUGIN} ; do
+ doman ../docs/manpages/${prog/bin\/}*
+ done
+ fi
+
+ # install server components
+ if use server ; then
+ doman ../docs/manpages/vfs* ../docs/manpages/samba.7
+
+ diropts -m0700
+ keepdir /var/lib/samba/private
+
+ diropts -m1777
+ keepdir /var/spool/samba
+
+ diropts -m0755
+ keepdir /var/{cache,log}/samba
+ keepdir /var/lib/samba/{netlogon,profiles}
+ keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR}
+ keepdir /usr/$(get_libdir)/samba/{auth,pdb,rpc,idmap,nss_info,gpext}
+
+ newconfd "${CONFDIR}/samba.confd" samba
+ newinitd "${CONFDIR}/samba.initd" samba
+
+ insinto /etc/samba
+ doins "${CONFDIR}"/{smbusers,lmhosts}
+
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins ../examples/LDAP/samba.schema
+ fi
+
+ if use swat ; then
+ insinto /etc/xinetd.d
+ newins "${CONFDIR}/swat.xinetd" swat
+ script/installswat.sh "${D}" "${ROOT}/usr/share/doc/${PF}/swat" "${S}"
+ fi
+
+ dodoc ../MAINTAINERS ../README* ../Roadmap ../WHATSNEW.txt ../docs/THANKS
+ fi
+
+ # install client files ({u,}mount.cifs into /)
+ if use client && use kernel_linux ; then
+ into /
+ dosbin bin/{u,}mount.cifs
+ doman ../docs/manpages/{u,}mount.cifs.8
+ fi
+
+ # install misc files
+ insinto /etc/samba
+ doins ../examples/smb.conf.default
+ doman ../docs/manpages/smb.conf.5
+
+ insinto /usr/"$(get_libdir)"/samba
+ doins ../codepages/{valid.dat,upcase.dat,lowcase.dat}
+
+ # install docs
+ if use doc ; then
+ dohtml -r ../docs/htmldocs/*
+ dodoc ../docs/*.pdf
+ fi
+
+ # install examples
+ if use examples ; then
+ insinto /usr/share/doc/${PF}/examples
+
+ if use smbclient ; then
+ doins -r ../examples/libsmbclient
+ fi
+
+ if use winbind ; then
+ doins -r ../examples/pam_winbind ../examples/nss
+ fi
+
+ if use server ; then
+ cd ../examples
+ doins -r auth autofs dce-dfs LDAP logon misc pdb \
+ perfcounter printer-accounting printing scripts tridge \
+ validchars VFS
+ fi
+ fi
+
+ # Remove empty installation directories
+ rmdir --ignore-fail-on-non-empty \
+ "${D}/usr/$(get_libdir)/samba" \
+ "${D}/usr"/{sbin,bin} \
+ "${D}/usr/share"/{man,locale,} \
+ "${D}/var"/{run,lib/samba/private,lib/samba,lib,cache/samba,cache,} \
+ # || die "tried to remove non-empty dirs, this seems like a bug in the ebuild"
+}
+
+pkg_postinst() {
+ elog "The default value of 'wide links' has been changed to 'no' in samba 3.5"
+ elog "to avoid an insecure default configuration"
+ elog "('wide links = yes' and 'unix extensions = yes'). For more details,"
+ elog "please see http://www.samba.org/samba/news/symlink_attack.html ."
+ elog ""
+ elog "An EXPERIMENTAL implementation of the SMB2 protocol has been added."
+ elog "SMB2 can be enabled by setting 'max protocol = smb2'. SMB2 is a new "
+ elog "implementation of the SMB protocol used by Windows Vista and higher"
+ elog ""
+ elog "For further information make sure to read the release notes at"
+ elog "http://samba.org/samba/history/${P}.html and "
+ elog "http://samba.org/samba/history/${PN}-3.5.0.html"
+}
diff --git a/net-fs/samba/samba-3.6.25.ebuild b/net-fs/samba/samba-3.6.25.ebuild
new file mode 100644
index 000000000000..5536c514acfe
--- /dev/null
+++ b/net-fs/samba/samba-3.6.25.ebuild
@@ -0,0 +1,483 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit pam versionator multilib multilib-minimal eutils flag-o-matic systemd
+
+MY_PV=${PV/_/}
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Library bits of the samba network filesystem"
+HOMEPAGE="http://www.samba.org/"
+SRC_URI="mirror://samba/stable/${MY_P}.tar.gz"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
+IUSE="acl addns ads +aio avahi caps +client cluster cups debug dmapi doc examples fam
+ ldap ldb +netapi pam quota +readline selinux +server +smbclient smbsharemodes
+ swat syslog +winbind"
+
+DEPEND="dev-libs/popt
+ >=sys-libs/talloc-2.0.8-r1[${MULTILIB_USEDEP}]
+ >=sys-libs/tdb-1.2.13[${MULTILIB_USEDEP}]
+ >=sys-libs/tevent-0.9.19[${MULTILIB_USEDEP}]
+ >=virtual/libiconv-0-r1[${MULTILIB_USEDEP}]
+ ads? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] sys-fs/e2fsprogs
+ client? ( sys-apps/keyutils ) )
+ avahi? ( net-dns/avahi[dbus] )
+ caps? ( >=sys-libs/libcap-2.22-r2[${MULTILIB_USEDEP}] )
+ client? ( !net-fs/mount-cifs
+ >=dev-libs/iniparser-3.1-r1[${MULTILIB_USEDEP}] )
+ cluster? ( >=dev-db/ctdb-1.13 )
+ cups? ( net-print/cups )
+ debug? ( dev-libs/dmalloc )
+ dmapi? ( sys-apps/dmapi )
+ fam? ( >=virtual/fam-0-r1[${MULTILIB_USEDEP}] )
+ ldap? ( >=net-nds/openldap-2.4.38-r1[${MULTILIB_USEDEP}] )
+ ldb? ( sys-libs/ldb )
+ pam? ( >=virtual/pam-0-r1[${MULTILIB_USEDEP}]
+ winbind? ( >=dev-libs/iniparser-3.1-r1[${MULTILIB_USEDEP}] )
+ )
+ readline? ( >=sys-libs/readline-5.2:= )
+ syslog? ( virtual/logger )"
+
+RDEPEND="${DEPEND}
+ kernel_linux? ( ads? ( net-fs/cifs-utils[ads] )
+ client? ( net-fs/cifs-utils ) )
+ selinux? ( sec-policy/selinux-samba )
+"
+
+# Disable tests since we don't want to build that much here
+RESTRICT="test"
+
+SBINPROGS=""
+BINPROGS=""
+KRBPLUGIN=""
+PLUGINEXT=".so"
+SHAREDMODS=""
+
+S=${WORKDIR}/${MY_P}
+
+# TODO:
+# - enable iPrint on Prefix/OSX and Darwin?
+# - selftest-prefix? selftest?
+# - AFS?
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+REQUIRED_USE="
+ ads? ( ldap )
+ swat? ( server )
+"
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if use winbind &&
+ [[ $(tc-getCC)$ == *gcc* ]] &&
+ [[ $(gcc-major-version)$(gcc-minor-version) -lt 43 ]]
+ then
+ eerror "It is a known issue that ${P} will not build with "
+ eerror "winbind use flag enabled when using gcc < 4.3 ."
+ eerror "Please use at least the latest stable gcc version."
+ die "Using sys-devel/gcc < 4.3 with winbind use flag."
+ fi
+ fi
+}
+
+pkg_setup() {
+ if use server ; then
+ SBINPROGS="${SBINPROGS} bin/smbd bin/nmbd"
+ BINPROGS="${BINPROGS} bin/testparm bin/smbstatus bin/smbcontrol bin/pdbedit
+ bin/profiles bin/sharesec bin/eventlogadm bin/smbta-util
+ $(usex client "" "bin/smbclient")"
+
+ use swat && SBINPROGS="${SBINPROGS} bin/swat"
+ use winbind && SBINPROGS="${SBINPROGS} bin/winbindd"
+ use ads && use winbind && KRBPLUGIN="${KRBPLUGIN} bin/winbind_krb5_locator"
+ fi
+
+ if use client ; then
+ BINPROGS="${BINPROGS} bin/smbclient bin/net bin/smbget bin/smbtree
+ bin/nmblookup bin/smbpasswd bin/rpcclient bin/smbcacls bin/smbcquotas
+ bin/ntlm_auth"
+
+ fi
+
+ use cups && BINPROGS="${BINPROGS} bin/smbspool"
+# use ldb && BINPROGS="${BINPROGS} bin/ldbedit bin/ldbsearch bin/ldbadd bin/ldbdel bin/ldbmodify bin/ldbrename";
+
+ if use winbind ; then
+ BINPROGS="${BINPROGS} bin/wbinfo"
+ SHAREDMODS="${SHAREDMODS}idmap_rid,idmap_hash"
+ use ads && SHAREDMODS="${SHAREDMODS},idmap_ad"
+ use cluster && SHAREDMODS="${SHAREDMODS},idmap_tdb2"
+ use ldap && SHAREDMODS="${SHAREDMODS},idmap_ldap,idmap_adex"
+ fi
+}
+
+src_prepare() {
+ cp "${FILESDIR}/samba-3.4.2-lib.tevent.python.mk" "lib/tevent/python.mk"
+
+ # ensure that winbind has correct ldflags (QA notice)
+ sed -i \
+ -e 's|LDSHFLAGS="|LDSHFLAGS="\\${LDFLAGS} |g' \
+ source3/configure || die "sed failed"
+ epatch "${CONFDIR}"/smb.conf.default.patch
+
+ #bug #399141 wrap newer iniparser version
+ has_version ">=dev-libs/iniparser-3.0.0" && \
+ append-cppflags "-Diniparser_getstr\(d,i\)=iniparser_getstring\(d,i,NULL\)"
+
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local myconf=()
+
+ # we can't alter S since build system writes to '../' and therefore
+ # we need to duplicate the whole structure
+ cd source3 || die
+
+ # Filter out -fPIE
+ [[ ${CHOST} == *-*bsd* ]] && myconf+=( --disable-pie )
+
+ #Allowing alpha/s390/sh to build
+ if use alpha || [[ ${ABI} == s390 ]] || use sh ; then
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+ replace-flags -O? -O1
+ fi
+
+ # http://wiki.samba.org/index.php/CTDB_Setup
+ use cluster && myconf+=( --disable-pie )
+
+ # Upstream refuses to make this configurable
+ myconf+=( ac_cv_header_sys_capability_h=$(usex caps) )
+
+ # Notes:
+ # - automount is only needed in conjunction with NIS and we don't have that
+ # anymore => LDAP?
+ # - --without-dce-dfs and --without-nisplus-home can't be passed to configure but are disabled by default
+ econf "${myconf[@]}" \
+ --with-piddir="${EPREFIX}"/var/run/samba \
+ --sysconfdir="${EPREFIX}"/etc/samba \
+ --localstatedir="${EPREFIX}"/var \
+ $(multilib_native_use_enable debug developer) \
+ --enable-largefile \
+ --enable-socket-wrapper \
+ --enable-nss-wrapper \
+ $(multilib_native_use_enable swat) \
+ $(multilib_native_use_enable debug dmalloc) \
+ $(multilib_native_use_enable cups) \
+ --disable-iprint \
+ $(use_enable fam) \
+ --enable-shared-libs \
+ --disable-dnssd \
+ $(multilib_native_use_enable avahi) \
+ --with-fhs \
+ --with-privatedir="${EPREFIX}"/var/lib/samba/private \
+ --with-rootsbindir="${EPREFIX}"/var/cache/samba \
+ --with-lockdir="${EPREFIX}"/var/cache/samba \
+ --with-swatdir="${EPREFIX}"/usr/share/doc/${PF}/swat \
+ --with-configdir="${EPREFIX}"/etc/samba \
+ --with-logfilebase="${EPREFIX}"/var/log/samba \
+ --with-pammodulesdir=$(getpam_mod_dir) \
+ $(multilib_native_use_with dmapi) \
+ --without-afs \
+ --without-fake-kaserver \
+ --without-vfs-afsacl \
+ $(use_with ldap) \
+ $(use_with ads) \
+ $(use_with ads krb5 "${EPREFIX}"/usr) \
+ $(use_with ads dnsupdate) \
+ --without-automount \
+ $(use_with pam) \
+ $(use_with pam pam_smbpass) \
+ $(use_with syslog) \
+ $(use_with quota quotas) \
+ $(use_with quota sys-quotas) \
+ --without-utmp \
+ --without-lib{talloc,tdb} \
+ $(use_with netapi libnetapi) \
+ $(use_with smbclient libsmbclient) \
+ $(use_with smbsharemodes libsmbsharemodes) \
+ $(use_with addns libaddns) \
+ $(use_with cluster ctdb "${EPREFIX}"/usr) \
+ $(use_with cluster cluster-support) \
+ $(multilib_native_use_with acl acl-support) \
+ $(use_with aio aio-support) \
+ --with-sendfile-support \
+ $(use_with winbind) \
+ --with-shared-modules=${SHAREDMODS} \
+ --without-included-popt \
+ --without-included-iniparser
+}
+
+multilib_src_compile() {
+ cd source3 || die
+
+ # compile libs
+ if use addns ; then
+ einfo "make addns library"
+ emake libaddns
+ fi
+ if use netapi ; then
+ einfo "make netapi library"
+ emake libnetapi
+ fi
+ if use smbclient ; then
+ einfo "make smbclient library"
+ emake libsmbclient
+ fi
+ if use smbsharemodes ; then
+ einfo "make smbsharemodes library"
+ emake libsmbsharemodes
+ fi
+
+ # compile modules
+ emake modules
+
+ # compile pam moudles
+ if use pam ; then
+ einfo "make pam modules"
+ emake pam_modules
+ fi
+
+ # compile winbind nss modules
+ if use winbind ; then
+ einfo "make nss modules"
+ emake nss_modules
+ fi
+
+ # compile utilities
+ if multilib_is_native_abi; then
+ if [ -n "${BINPROGS}" ] ; then
+ einfo "make binprogs"
+ emake ${BINPROGS}
+ fi
+ if [ -n "${SBINPROGS}" ] ; then
+ einfo "make sbinprogs"
+ emake ${SBINPROGS}
+ fi
+ fi
+
+ if [ -n "${KRBPLUGIN}" ] ; then
+ einfo "make krbplugin"
+ emake ${KRBPLUGIN}${PLUGINEXT}
+ fi
+}
+
+multilib_src_install() {
+ cd source3 || die
+
+ # pkgconfig files installation needed, bug #464818
+ local pkgconfigdir=/usr/$(get_libdir)/pkgconfig
+
+ # install libs
+ if use addns ; then
+ einfo "install addns library"
+ emake installlibaddns DESTDIR="${D}"
+ fi
+ if use netapi ; then
+ einfo "install netapi library"
+ emake installlibnetapi DESTDIR="${D}"
+ insinto $pkgconfigdir
+ doins pkgconfig/netapi.pc
+ fi
+ if use smbclient ; then
+ einfo "install smbclient library"
+ emake installlibsmbclient DESTDIR="${D}"
+ insinto $pkgconfigdir
+ doins pkgconfig/smbclient.pc
+ fi
+ if use smbsharemodes ; then
+ einfo "install smbsharemodes library"
+ emake installlibsmbsharemodes DESTDIR="${D}"
+ insinto $pkgconfigdir
+ doins pkgconfig/smbsharemodes.pc
+ fi
+
+ # install modules
+ emake installmodules DESTDIR="${D}"
+
+ if use pam ; then
+ einfo "install pam modules"
+ emake installpammodules DESTDIR="${D}"
+
+ if use winbind ; then
+ newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind
+ doman ../docs/manpages/pam_winbind.8
+ # bug #376853
+ insinto /etc/security
+ doins ../examples/pam_winbind/pam_winbind.conf || die
+ fi
+
+ newpamd "${CONFDIR}/samba.pam" samba
+ dodoc pam_smbpass/README
+ fi
+
+ # Nsswitch extensions. Make link for wins and winbind resolvers
+ if use winbind ; then
+ einfo "install libwbclient"
+ emake installlibwbclient DESTDIR="${D}"
+ dolib.so ../nsswitch/libnss_wins.so
+ dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2
+ dolib.so ../nsswitch/libnss_winbind.so
+ dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2
+ insinto $pkgconfigdir
+ doins pkgconfig/wbclient.pc
+ einfo "install libwbclient related manpages"
+ doman ../docs/manpages/idmap_rid.8
+ doman ../docs/manpages/idmap_hash.8
+ if use ldap ; then
+ doman ../docs/manpages/idmap_adex.8
+ doman ../docs/manpages/idmap_ldap.8
+ fi
+ if use ads ; then
+ doman ../docs/manpages/idmap_ad.8
+ fi
+ fi
+
+ # install binaries
+ if multilib_is_native_abi; then
+ insinto /usr
+ for prog in ${SBINPROGS} ; do
+ dosbin ${prog}
+ doman ../docs/manpages/${prog/bin\/}*
+ done
+
+ for prog in ${BINPROGS} ; do
+ dobin ${prog}
+ doman ../docs/manpages/${prog/bin\/}*
+ done
+
+ # install scripts
+ if use client ; then
+ dobin script/findsmb
+ doman ../docs/manpages/findsmb.1
+ fi
+ fi
+
+ # install krbplugin
+ if [ -n "${KRBPLUGIN}" ] ; then
+ if has_version app-crypt/mit-krb5 ; then
+ insinto /usr/$(get_libdir)/krb5/plugins/libkrb5
+ doins ${KRBPLUGIN}${PLUGINEXT}
+ elif has_version app-crypt/heimdal ; then
+ insinto /usr/$(get_libdir)/plugin/krb5
+ doins ${KRBPLUGIN}${PLUGINEXT}
+ fi
+ insinto /usr
+ for prog in ${KRBPLUGIN} ; do
+ doman ../docs/manpages/${prog/bin\/}*
+ done
+ fi
+}
+
+multilib_src_install_all() {
+ # install server components
+ if use server ; then
+ doman docs/manpages/vfs* docs/manpages/samba.7
+
+ diropts -m0700
+ keepdir /var/lib/samba/private
+
+ diropts -m1777
+ keepdir /var/spool/samba
+
+ diropts -m0755
+ keepdir /var/{cache,log}/samba
+ keepdir /var/lib/samba/{netlogon,profiles}
+ keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR}
+ keepdir /usr/$(get_libdir)/samba/{auth,pdb,rpc,idmap,nss_info,gpext}
+
+ newconfd "${CONFDIR}/samba.confd" samba
+ newinitd "${CONFDIR}/samba.initd" samba
+
+ insinto /etc/samba
+ doins "${CONFDIR}"/{smbusers,lmhosts}
+
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins examples/LDAP/samba.schema
+ fi
+
+ if use swat ; then
+ insinto /etc/xinetd.d
+ newins "${CONFDIR}/swat.xinetd" swat
+ script/installswat.sh "${ED}" "${EROOT}/usr/share/doc/${PF}/swat" "${S}"
+ fi
+
+ dodoc MAINTAINERS.txt README* Roadmap WHATSNEW.txt docs/THANKS
+ fi
+
+ # install the spooler to cups
+ if use cups ; then
+ dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb
+ fi
+
+ # install misc files
+ insinto /etc/samba
+ doins examples/smb.conf.default
+ doman docs/manpages/smb.conf.5
+
+ insinto /usr/"$(get_libdir)"/samba
+ doins codepages/{valid.dat,upcase.dat,lowcase.dat}
+
+ # install docs
+ if use doc ; then
+ dohtml -r docs/htmldocs/.
+ dodoc docs/*.pdf
+ fi
+
+ # install examples
+ if use examples ; then
+ insinto /usr/share/doc/${PF}/examples
+
+ if use smbclient ; then
+ doins -r examples/libsmbclient
+ fi
+
+ if use winbind ; then
+ doins -r examples/pam_winbind examples/nss
+ fi
+
+ if use server ; then
+ cd examples || die
+ doins -r auth autofs dce-dfs LDAP logon misc pdb \
+ perfcounter printer-accounting printing scripts tridge \
+ validchars VFS
+ fi
+ fi
+
+ # Remove empty installation directories
+ rmdir --ignore-fail-on-non-empty \
+ "${ED}/usr/$(get_libdir)/samba" \
+ "${ED}/usr"/{sbin,bin} \
+ "${ED}/usr/share"/{man,locale,} \
+ "${ED}/var"/{run,lib/samba/private,lib/samba,lib,cache/samba,cache,} \
+ # || die "tried to remove non-empty dirs, this seems like a bug in the ebuild"
+
+ 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
+}
+
+pkg_postinst() {
+ elog "Samba 3.6 has adopted a number of improved security defaults that"
+ elog "will impact on existing users of Samba."
+ elog " client ntlmv2 auth = yes"
+ elog " client use spnego principal = no"
+ elog " send spnego principal = no"
+ elog ""
+ elog "SMB2 protocol support in 3.6.0 is fully functional and can be "
+ elog "enabled by setting 'max protocol = smb2'. SMB2 is a new "
+ elog "implementation of the SMB protocol used by Windows Vista and higher"
+ elog ""
+ elog "For further information make sure to read the release notes at"
+ elog "http://samba.org/samba/history/${P}.html and "
+ elog "http://samba.org/samba/history/${PN}-3.6.0.html"
+}
diff --git a/net-fs/samba/samba-4.0.26.ebuild b/net-fs/samba/samba-4.0.26.ebuild
new file mode 100644
index 000000000000..889c20e6a981
--- /dev/null
+++ b/net-fs/samba/samba-4.0.26.ebuild
@@ -0,0 +1,181 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='threads(+)'
+
+inherit python-single-r1 waf-utils multilib linux-info systemd eutils
+
+MY_PV="${PV/_rc/rc}"
+MY_P="${PN}-${MY_PV}"
+
+if [ "${PV}" = "4.9999" ]; then
+ EGIT_REPO_URI="git://git.samba.org/samba.git"
+ KEYWORDS=""
+ inherit git-2
+else
+ SRC_URI="mirror://samba/stable/${MY_P}.tar.gz"
+ KEYWORDS="~amd64 ~hppa ~x86"
+fi
+
+DESCRIPTION="Samba Suite Version 4"
+HOMEPAGE="http://www.samba.org/"
+LICENSE="GPL-3"
+
+SLOT="0"
+
+IUSE="acl addns ads aio avahi client cluster cups dmapi fam gnutls iprint
+ldap quota selinux swat syslog test winbind"
+
+# sys-apps/attr is an automagic dependency (see bug #489748)
+# sys-libs/pam is an automagic dependency (see bug #489770)
+CDEPEND="${PYTHON_DEPS}
+ >=app-crypt/heimdal-1.5[-ssl]
+ dev-libs/iniparser
+ dev-libs/popt
+ sys-libs/readline:=
+ virtual/libiconv
+ dev-python/subunit[${PYTHON_USEDEP}]
+ sys-apps/attr
+ sys-libs/libcap
+ >=sys-libs/ldb-1.1.16
+ >=sys-libs/tdb-1.2.11[python,${PYTHON_USEDEP}]
+ >=sys-libs/talloc-2.0.8[python,${PYTHON_USEDEP}]
+ >=sys-libs/tevent-0.9.18
+ sys-libs/zlib
+ virtual/pam
+ acl? ( virtual/acl )
+ addns? ( net-dns/bind-tools[gssapi] )
+ aio? ( dev-libs/libaio )
+ cluster? ( >=dev-db/ctdb-1.0.114_p1 )
+ 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 )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ client? ( net-fs/cifs-utils[ads?] )
+ selinux? ( sec-policy/selinux-samba )
+"
+
+REQUIRED_USE="ads? ( acl ldap )
+ ${PYTHON_REQUIRED_USE}"
+
+RESTRICT="mirror"
+
+S="${WORKDIR}/${MY_P}"
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+# sys-apps/dmapi is an automagic dependency (see bug #474492)
+PATCHES=(
+ "${FILESDIR}/named.conf.dlz.patch"
+ "${FILESDIR}/${PN}-4.0.19-automagic_aio_fix.patch"
+)
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ if use aio; then
+ if ! linux_config_exists || ! linux_chkconfig_present AIO; then
+ ewarn "You must enable AIO support in your kernel config, "
+ ewarn "to be able to support asynchronous I/O. "
+ ewarn "You can find it at"
+ ewarn
+ ewarn "General Support"
+ ewarn " Enable AIO support "
+ ewarn
+ ewarn "and recompile your kernel..."
+ fi
+ fi
+}
+
+src_configure() {
+ local myconf=''
+ use "cluster" && myconf+=" --with-ctdb-dir=/usr"
+ use "test" && myconf+=" --enable-selftest"
+ myconf="${myconf} \
+ --enable-fhs \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --with-modulesdir=/usr/$(get_libdir)/samba \
+ --with-pammodulesdir=/$(get_libdir)/security \
+ --with-piddir=/var/run/${PN} \
+ --disable-rpath \
+ --disable-rpath-install \
+ --nopyc \
+ --nopyo \
+ --disable-ntdb \
+ --bundled-libraries=NONE \
+ --builtin-libraries=NONE \
+ $(use_with addns dnsupdate) \
+ $(use_with acl acl-support) \
+ $(use_with ads) \
+ $(use_with aio aio-support) \
+ $(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) \
+ --with-pam \
+ --with-pam_smbpass \
+ $(use_with quota quotas) \
+ $(use_with syslog) \
+ $(use_with swat) \
+ $(use_with winbind)
+ "
+ use "ads" && myconf+=" --with-shared-modules=idmap_ad"
+
+ CPPFLAGS="-I${SYSROOT}/usr/include/et ${CPPFLAGS}" \
+ waf-utils_src_configure ${myconf}
+}
+
+src_install() {
+ waf-utils_src_install
+
+ # install ldap schema for server (bug #491002)
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins examples/LDAP/samba.schema
+ fi
+
+ # Make all .so files executable
+ find "${D}" -type f -name "*.so" -exec chmod +x {} +
+
+ # 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
+}
+
+src_test() {
+ "${WAF_BINARY}" test || die "test failed"
+}
+
+pkg_postinst() {
+ elog "This is is the first stable release of Samba 4.0"
+
+ 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.0.0.html and"
+ elog "http://wiki.samba.org/index.php/Samba4/HOWTO "
+}
diff --git a/net-fs/samba/samba-4.1.18.ebuild b/net-fs/samba/samba-4.1.18.ebuild
new file mode 100644
index 000000000000..b79e86102977
--- /dev/null
+++ b/net-fs/samba/samba-4.1.18.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='threads(+)'
+
+inherit python-single-r1 waf-utils multilib linux-info systemd base
+
+MY_PV="${PV/_rc/rc}"
+MY_P="${PN}-${MY_PV}"
+
+SRC_URI="mirror://samba/stable/${MY_P}.tar.gz"
+KEYWORDS="~amd64 ~arm64 ~hppa ~x86"
+
+DESCRIPTION="Samba Suite Version 4"
+HOMEPAGE="http://www.samba.org/"
+LICENSE="GPL-3"
+
+SLOT="0"
+
+IUSE="acl addns ads aio avahi client cluster cups dmapi fam gnutls iprint
+ldap quota selinux syslog systemd test winbind"
+
+# sys-apps/attr is an automagic dependency (see bug #489748)
+# sys-libs/pam is an automagic dependency (see bug #489770)
+CDEPEND="${PYTHON_DEPS}
+ >=app-crypt/heimdal-1.5[-ssl,-threads]
+ dev-libs/iniparser
+ dev-libs/popt
+ sys-libs/readline:=
+ virtual/libiconv
+ dev-python/subunit[${PYTHON_USEDEP}]
+ sys-apps/attr
+ sys-libs/libcap
+ >=sys-libs/ntdb-1.0[python,${PYTHON_USEDEP}]
+ >=sys-libs/ldb-1.1.17
+ >=sys-libs/tdb-1.2.12[python,${PYTHON_USEDEP}]
+ >=sys-libs/talloc-2.1.2[python,${PYTHON_USEDEP}]
+ >=sys-libs/tevent-0.9.18
+ sys-libs/zlib
+ virtual/pam
+ acl? ( virtual/acl )
+ addns? ( net-dns/bind-tools[gssapi] )
+ aio? ( dev-libs/libaio )
+ cluster? ( >=dev-db/ctdb-1.0.114_p1 )
+ 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 )
+ systemd? ( sys-apps/systemd:0= )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ client? ( net-fs/cifs-utils[ads?] )
+ selinux? ( sec-policy/selinux-samba )
+"
+
+REQUIRED_USE="ads? ( acl ldap )
+ ${PYTHON_REQUIRED_USE}"
+
+RESTRICT="mirror"
+
+S="${WORKDIR}/${MY_P}"
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-4.1.14-named.conf.dlz.patch"
+ "${FILESDIR}/${PN}-4.0.19-automagic_aio_fix.patch"
+ # support libsystemd (instead of libsystemd-daemon), bug #526362
+ "${FILESDIR}/${PN}-4.1.14-libsystemd.patch"
+)
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ if use aio; then
+ if ! linux_config_exists || ! linux_chkconfig_present AIO; then
+ ewarn "You must enable AIO support in your kernel config, "
+ ewarn "to be able to support asynchronous I/O. "
+ ewarn "You can find it at"
+ ewarn
+ ewarn "General Support"
+ ewarn " Enable AIO support "
+ ewarn
+ ewarn "and recompile your kernel..."
+ fi
+ fi
+}
+
+src_configure() {
+ local myconf=''
+ use "cluster" && myconf+=" --with-ctdb-dir=/usr"
+ use "test" && myconf+=" --enable-selftest"
+ myconf="${myconf} \
+ --enable-fhs \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --with-modulesdir=/usr/$(get_libdir)/samba \
+ --with-pammodulesdir=/$(get_libdir)/security \
+ --with-piddir=/var/run/${PN} \
+ --disable-rpath \
+ --disable-rpath-install \
+ --nopyc \
+ --nopyo \
+ --bundled-libraries=NONE \
+ --builtin-libraries=NONE \
+ $(use_with addns dnsupdate) \
+ $(use_with acl acl-support) \
+ $(use_with ads) \
+ $(use_with aio aio-support) \
+ $(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) \
+ --with-pam \
+ --with-pam_smbpass \
+ $(use_with quota quotas) \
+ $(use_with syslog) \
+ $(use_with systemd) \
+ $(use_with winbind)
+ "
+ use "ads" && myconf+=" --with-shared-modules=idmap_ad"
+
+ CPPFLAGS="-I${SYSROOT}/usr/include/et ${CPPFLAGS}" \
+ waf-utils_src_configure ${myconf}
+}
+
+src_install() {
+ waf-utils_src_install
+
+ # install ldap schema for server (bug #491002)
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins examples/LDAP/samba.schema
+ fi
+
+ # Make all .so files executable
+ find "${D}" -type f -name "*.so" -exec chmod +x {} +
+
+ # 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
+}
+
+src_test() {
+ "${WAF_BINARY}" test || die "test failed"
+}
+
+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.0.0.html and"
+ elog "http://wiki.samba.org/index.php/Samba4/HOWTO "
+}
diff --git a/net-fs/samba/samba-4.1.19.ebuild b/net-fs/samba/samba-4.1.19.ebuild
new file mode 100644
index 000000000000..b79e86102977
--- /dev/null
+++ b/net-fs/samba/samba-4.1.19.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='threads(+)'
+
+inherit python-single-r1 waf-utils multilib linux-info systemd base
+
+MY_PV="${PV/_rc/rc}"
+MY_P="${PN}-${MY_PV}"
+
+SRC_URI="mirror://samba/stable/${MY_P}.tar.gz"
+KEYWORDS="~amd64 ~arm64 ~hppa ~x86"
+
+DESCRIPTION="Samba Suite Version 4"
+HOMEPAGE="http://www.samba.org/"
+LICENSE="GPL-3"
+
+SLOT="0"
+
+IUSE="acl addns ads aio avahi client cluster cups dmapi fam gnutls iprint
+ldap quota selinux syslog systemd test winbind"
+
+# sys-apps/attr is an automagic dependency (see bug #489748)
+# sys-libs/pam is an automagic dependency (see bug #489770)
+CDEPEND="${PYTHON_DEPS}
+ >=app-crypt/heimdal-1.5[-ssl,-threads]
+ dev-libs/iniparser
+ dev-libs/popt
+ sys-libs/readline:=
+ virtual/libiconv
+ dev-python/subunit[${PYTHON_USEDEP}]
+ sys-apps/attr
+ sys-libs/libcap
+ >=sys-libs/ntdb-1.0[python,${PYTHON_USEDEP}]
+ >=sys-libs/ldb-1.1.17
+ >=sys-libs/tdb-1.2.12[python,${PYTHON_USEDEP}]
+ >=sys-libs/talloc-2.1.2[python,${PYTHON_USEDEP}]
+ >=sys-libs/tevent-0.9.18
+ sys-libs/zlib
+ virtual/pam
+ acl? ( virtual/acl )
+ addns? ( net-dns/bind-tools[gssapi] )
+ aio? ( dev-libs/libaio )
+ cluster? ( >=dev-db/ctdb-1.0.114_p1 )
+ 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 )
+ systemd? ( sys-apps/systemd:0= )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ client? ( net-fs/cifs-utils[ads?] )
+ selinux? ( sec-policy/selinux-samba )
+"
+
+REQUIRED_USE="ads? ( acl ldap )
+ ${PYTHON_REQUIRED_USE}"
+
+RESTRICT="mirror"
+
+S="${WORKDIR}/${MY_P}"
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-4.1.14-named.conf.dlz.patch"
+ "${FILESDIR}/${PN}-4.0.19-automagic_aio_fix.patch"
+ # support libsystemd (instead of libsystemd-daemon), bug #526362
+ "${FILESDIR}/${PN}-4.1.14-libsystemd.patch"
+)
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ if use aio; then
+ if ! linux_config_exists || ! linux_chkconfig_present AIO; then
+ ewarn "You must enable AIO support in your kernel config, "
+ ewarn "to be able to support asynchronous I/O. "
+ ewarn "You can find it at"
+ ewarn
+ ewarn "General Support"
+ ewarn " Enable AIO support "
+ ewarn
+ ewarn "and recompile your kernel..."
+ fi
+ fi
+}
+
+src_configure() {
+ local myconf=''
+ use "cluster" && myconf+=" --with-ctdb-dir=/usr"
+ use "test" && myconf+=" --enable-selftest"
+ myconf="${myconf} \
+ --enable-fhs \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --with-modulesdir=/usr/$(get_libdir)/samba \
+ --with-pammodulesdir=/$(get_libdir)/security \
+ --with-piddir=/var/run/${PN} \
+ --disable-rpath \
+ --disable-rpath-install \
+ --nopyc \
+ --nopyo \
+ --bundled-libraries=NONE \
+ --builtin-libraries=NONE \
+ $(use_with addns dnsupdate) \
+ $(use_with acl acl-support) \
+ $(use_with ads) \
+ $(use_with aio aio-support) \
+ $(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) \
+ --with-pam \
+ --with-pam_smbpass \
+ $(use_with quota quotas) \
+ $(use_with syslog) \
+ $(use_with systemd) \
+ $(use_with winbind)
+ "
+ use "ads" && myconf+=" --with-shared-modules=idmap_ad"
+
+ CPPFLAGS="-I${SYSROOT}/usr/include/et ${CPPFLAGS}" \
+ waf-utils_src_configure ${myconf}
+}
+
+src_install() {
+ waf-utils_src_install
+
+ # install ldap schema for server (bug #491002)
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins examples/LDAP/samba.schema
+ fi
+
+ # Make all .so files executable
+ find "${D}" -type f -name "*.so" -exec chmod +x {} +
+
+ # 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
+}
+
+src_test() {
+ "${WAF_BINARY}" test || die "test failed"
+}
+
+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.0.0.html and"
+ elog "http://wiki.samba.org/index.php/Samba4/HOWTO "
+}
diff --git a/net-fs/samba/samba-4.2.3.ebuild b/net-fs/samba/samba-4.2.3.ebuild
new file mode 100644
index 000000000000..de4d61db5c15
--- /dev/null
+++ b/net-fs/samba/samba-4.2.3.ebuild
@@ -0,0 +1,182 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='threads(+)'
+
+inherit python-single-r1 waf-utils multilib linux-info systemd eutils
+
+MY_PV="${PV/_rc/rc}"
+MY_P="${PN}-${MY_PV}"
+
+SRC_PATH="stable"
+[[ ${PV} = *_rc* ]] && SRC_PATH="rc"
+
+SRC_URI="mirror://samba/${SRC_PATH}/${MY_P}.tar.gz"
+KEYWORDS="~amd64 ~hppa ~x86"
+[[ ${PV} = *_rc* ]] && KEYWORDS=""
+
+DESCRIPTION="Samba Suite Version 4"
+HOMEPAGE="http://www.samba.org/"
+LICENSE="GPL-3"
+
+SLOT="0"
+
+IUSE="acl addns ads aio avahi client cluster cups dmapi fam gnutls iprint
+ldap quota selinux syslog systemd test winbind"
+
+# sys-apps/attr is an automagic dependency (see bug #489748)
+# sys-libs/pam is an automagic dependency (see bug #489770)
+CDEPEND="${PYTHON_DEPS}
+ >=app-crypt/heimdal-1.5[-ssl]
+ dev-libs/iniparser
+ dev-libs/popt
+ sys-libs/readline:=
+ virtual/libiconv
+ dev-python/subunit[${PYTHON_USEDEP}]
+ >=net-libs/socket_wrapper-1.1.2
+ sys-apps/attr
+ sys-libs/libcap
+ >=sys-libs/ldb-1.1.20
+ >=sys-libs/nss_wrapper-1.0.2
+ >=sys-libs/ntdb-1.0[python,${PYTHON_USEDEP}]
+ >=sys-libs/talloc-2.1.2[python,${PYTHON_USEDEP}]
+ >=sys-libs/tdb-1.3.6[python,${PYTHON_USEDEP}]
+ >=sys-libs/tevent-0.9.25
+ >=sys-libs/uid_wrapper-1.0.1
+ sys-libs/zlib
+ virtual/pam
+ acl? ( virtual/acl )
+ addns? ( net-dns/bind-tools[gssapi] )
+ aio? ( dev-libs/libaio )
+ cluster? ( >=dev-db/ctdb-1.0.114_p1 )
+ 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 )
+ systemd? ( sys-apps/systemd:0= )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ client? ( net-fs/cifs-utils[ads?] )
+ selinux? ( sec-policy/selinux-samba )
+"
+
+REQUIRED_USE="ads? ( acl gnutls ldap )
+ ${PYTHON_REQUIRED_USE}"
+
+RESTRICT="mirror"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=( "${FILESDIR}/${PN}-4.2.3-heimdal_compilefix.patch" )
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ if use aio; then
+ if ! linux_config_exists || ! linux_chkconfig_present AIO; then
+ ewarn "You must enable AIO support in your kernel config, "
+ ewarn "to be able to support asynchronous I/O. "
+ ewarn "You can find it at"
+ ewarn
+ ewarn "General Support"
+ ewarn " Enable AIO support "
+ ewarn
+ ewarn "and recompile your kernel..."
+ fi
+ fi
+}
+
+src_prepare() {
+ epatch ${PATCHES[@]}
+}
+
+src_configure() {
+ local myconf=''
+ use "cluster" && myconf+=" --with-ctdb-dir=/usr"
+ use "test" && myconf+=" --enable-selftest"
+ myconf="${myconf} \
+ --enable-fhs \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --with-modulesdir=/usr/$(get_libdir)/samba \
+ --with-pammodulesdir=/$(get_libdir)/security \
+ --with-piddir=/var/run/${PN} \
+ --disable-rpath \
+ --disable-rpath-install \
+ --nopyc \
+ --nopyo \
+ --bundled-libraries=NONE \
+ --builtin-libraries=NONE \
+ $(use_with addns dnsupdate) \
+ $(use_with acl acl-support) \
+ $(use_with ads) \
+ $(use_with aio aio-support) \
+ $(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) \
+ --with-pam \
+ --with-pam_smbpass \
+ $(use_with quota quotas) \
+ $(use_with syslog) \
+ $(use_with systemd) \
+ $(use_with winbind)
+ "
+ use "ads" && myconf+=" --with-shared-modules=idmap_ad"
+
+ CPPFLAGS="-I${SYSROOT}/usr/include/et ${CPPFLAGS}" \
+ waf-utils_src_configure ${myconf}
+}
+
+src_install() {
+ waf-utils_src_install
+
+ # install ldap schema for server (bug #491002)
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins examples/LDAP/samba.schema
+ fi
+
+ # Make all .so files executable
+ find "${D}" -type f -name "*.so" -exec chmod +x {} +
+
+ # 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
+}
+
+src_test() {
+ "${WAF_BINARY}" test || die "test failed"
+}
+
+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.0.0.html and"
+ elog "http://wiki.samba.org/index.php/Samba4/HOWTO "
+}