net-fs/samba: Adding still missing files
authorKristian Fiskerstrand <kf@sumptuouscapital.com>
Sat, 24 Jan 2015 17:08:33 +0000 (18:08 +0100)
committerKristian Fiskerstrand <kf@sumptuouscapital.com>
Sat, 24 Jan 2015 17:08:33 +0000 (18:08 +0100)
net-fs/samba/files/named.conf.dlz.patch [new file with mode: 0644]
net-fs/samba/files/nmbd.service [new file with mode: 0644]
net-fs/samba/files/samba-4.0.19-automagic_aio_fix.patch [new file with mode: 0644]
net-fs/samba/files/samba-4.1.14-libsystemd.patch [new file with mode: 0644]
net-fs/samba/files/samba-4.1.14-named.conf.dlz.patch [new file with mode: 0644]
net-fs/samba/files/samba.conf [new file with mode: 0644]
net-fs/samba/files/samba.service [new file with mode: 0644]
net-fs/samba/files/smbd.service [new file with mode: 0644]
net-fs/samba/files/smbd.socket [new file with mode: 0644]
net-fs/samba/files/smbd_at.service [new file with mode: 0644]
net-fs/samba/files/winbindd.service [new file with mode: 0644]

diff --git a/net-fs/samba/files/named.conf.dlz.patch b/net-fs/samba/files/named.conf.dlz.patch
new file mode 100644 (file)
index 0000000..ad8486c
--- /dev/null
@@ -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 (file)
index 0000000..44b4ffb
--- /dev/null
@@ -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-4.0.19-automagic_aio_fix.patch b/net-fs/samba/files/samba-4.0.19-automagic_aio_fix.patch
new file mode 100644 (file)
index 0000000..ec351db
--- /dev/null
@@ -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 (file)
index 0000000..94b30c0
--- /dev/null
@@ -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 (file)
index 0000000..9f1ebb8
--- /dev/null
@@ -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.conf b/net-fs/samba/files/samba.conf
new file mode 100644 (file)
index 0000000..fce6812
--- /dev/null
@@ -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 (file)
index 0000000..8214ff8
--- /dev/null
@@ -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 (file)
index 0000000..5c006a4
--- /dev/null
@@ -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 (file)
index 0000000..833bf43
--- /dev/null
@@ -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 (file)
index 0000000..e1f71be
--- /dev/null
@@ -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 (file)
index 0000000..67a778f
--- /dev/null
@@ -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