summaryrefslogtreecommitdiffstats
path: root/source/n/samba
diff options
context:
space:
mode:
Diffstat (limited to 'source/n/samba')
-rw-r--r--source/n/samba/doinst.sh33
-rw-r--r--source/n/samba/rc.samba3
-rwxr-xr-xsource/n/samba/samba.SlackBuild60
-rw-r--r--source/n/samba/samba.install.talloc.tevent.tdb.diff102
4 files changed, 149 insertions, 49 deletions
diff --git a/source/n/samba/doinst.sh b/source/n/samba/doinst.sh
index eb2b0b58c..ff09d3161 100644
--- a/source/n/samba/doinst.sh
+++ b/source/n/samba/doinst.sh
@@ -10,8 +10,33 @@ config() {
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
-config etc/rc.d/rc.samba.new
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname ${NEW})/$(basename ${NEW} .new)"
+ if [ -e ${OLD} ]; then
+ cp -a ${OLD} ${NEW}.incoming
+ cat ${NEW} > ${NEW}.incoming
+ mv ${NEW}.incoming ${NEW}
+ fi
+ config ${NEW}
+}
+
config etc/samba/lmhosts.new
-# This won't be needed. The point here is to preserve the permissions of the existing
-# file, if there is one. I don't see major new development happening in rc.samba... ;-)
-rm -f etc/rc.d/rc.samba.new
+preserve_perms etc/rc.d/rc.samba.new
+
+# Commented out 2014-09-15 just in case we do need to change this.
+## This won't be needed. The point here is to preserve the permissions of the existing
+## file, if there is one. I don't see major new development happening in rc.samba... ;-)
+#rm -f etc/rc.d/rc.samba.new
+
+# Since /etc/samba/private/ has moved to /var/lib/samba/private, migrate any
+# important files if possible:
+if [ -d etc/samba/private -a -d var/lib/samba/private ]; then
+ for file in etc/samba/private/* ; do
+ if [ -r "$file" -a ! -r "var/lib/samba/private/$(basename $file)" ]; then
+ mv "$file" var/lib/samba/private
+ fi
+ done
+ # Might as well try to eliminate this directory, since it should be empty:
+ rmdir etc/samba/private 1> /dev/null 2> /dev/null
+fi
diff --git a/source/n/samba/rc.samba b/source/n/samba/rc.samba
index 2a28f3e52..5b98b879c 100644
--- a/source/n/samba/rc.samba
+++ b/source/n/samba/rc.samba
@@ -10,10 +10,13 @@
samba_start() {
if [ -x /usr/sbin/smbd -a -x /usr/sbin/nmbd -a -r /etc/samba/smb.conf ]; then
+ mkdir -p /var/run/samba
echo "Starting Samba: /usr/sbin/smbd -D"
/usr/sbin/smbd -D
echo " /usr/sbin/nmbd -D"
/usr/sbin/nmbd -D
+ elif [ ! -r /etc/samba/smb.conf ]; then
+ echo "ERROR: cannot start Samba since /etc/samba/smb.conf does not exist"
fi
}
diff --git a/source/n/samba/samba.SlackBuild b/source/n/samba/samba.SlackBuild
index 2257abb82..a7406724d 100755
--- a/source/n/samba/samba.SlackBuild
+++ b/source/n/samba/samba.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009, 2010, 2012, 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2008, 2009, 2010, 2012, 2013, 2015, 2016 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -24,7 +24,7 @@
VERSION=${VERSION:-$(echo samba-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
if [ -e $CWD/machine.conf ]; then
. $CWD/machine.conf ]
@@ -34,15 +34,15 @@ else
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) export ARCH=i486 ;;
+ i?86) export ARCH=i586 ;;
arm*) export ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) export ARCH=$( uname -m ) ;;
esac
fi
# Set CFLAGS/CXXFLAGS and LIBDIRSUFFIX:
- if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
@@ -81,6 +81,9 @@ rm -rf samba-$VERSION
tar xvf $CWD/samba-$VERSION.tar.xz || exit 1
cd samba-$VERSION || exit 1
+# Patch to install talloc/tevent/tdb libraries and includes:
+zcat $CWD/samba.install.talloc.tevent.tdb.diff.gz | patch -p1 --verbose || exit 1
+
if [ ! -d source3/lib/cmdline ]; then
( cd source3/lib
mkdir cmdline
@@ -113,7 +116,7 @@ CFLAGS="$SLKCFLAGS" \
--sysconfdir=/etc \
--with-configdir=/etc/samba \
--with-piddir=/var/run \
- --with-privatedir=/etc/samba/private \
+ --with-privatedir=/var/lib/samba/private \
--with-privatelibdir=/usr/lib${LIBDIRSUFFIX} \
--with-modulesdir=/usr/lib${LIBDIRSUFFIX} \
--with-lockdir=/var/cache/samba \
@@ -134,56 +137,23 @@ CFLAGS="$SLKCFLAGS" \
#--builtin-libraries=replace,ccan \
#--bundled-libraries=heimdal \
-# -j options don't seem to work...
+# -j options don't seem to work... [Yes they do! At least try to use -j below...]
JOBS=6
MAXJOBS=6
export JOBS MAXJOBS
-make || exit 1
+make -j $MAXJOBS || make || exit 1
mkdir -p \
$PKG/usr/doc/samba-$VERSION \
$PKG/var/spool/samba \
$PKG/var/log/samba \
- $PKG/etc/samba/private \
+ $PKG/var/lib/samba/private \
$PKG/var/cache/samba
-chmod 700 $PKG/etc/samba/private
+chmod 700 $PKG/var/lib/samba/private
chmod 1777 $PKG/var/spool/samba
make install DESTDIR=$PKG || exit 1
-# Install pkgconfig files:
-mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig
-if [ ! -r $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/talloc.pc ]; then
- cat $CWD/talloc.pc | sed -e "s/\/lib/\/lib${LIBDIRSUFFIX}/" > $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/talloc.pc
-fi
-if [ ! -r $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/pytalloc-util.pc ]; then
- cat $CWD/pytalloc-util.pc | sed -e "s/\/lib/\/lib${LIBDIRSUFFIX}/" > $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/pytalloc-util.pc
-fi
-
-# Install talloc.h:
-if [ ! -r $PKG/usr/include/talloc.h ]; then
- cp -a lib/talloc/talloc.h $PKG/usr/include
- chown root:root $PKG/usr/include/talloc.h
- chmod 644 $PKG/usr/include/talloc.h
-fi
-
-# Make symlink for pytalloc.h in /usr/include:
-if [ ! -r $PKG/usr/include/pytalloc.h ]; then
- if [ -r $PKG/usr/include/samba-4.0/pytalloc.h ]; then
- ( cd $PKG/usr/include ; ln -sf samba-4.0/pytalloc.h . )
- fi
-fi
-
-# Make symlink for libtalloc.so:
-if [ ! -r $PKG/usr/lib${LIBDIRSUFFIX}/libtalloc.so -a -r $PKG/usr/lib${LIBDIRSUFFIX}/libtalloc.so.? ]; then
- ( cd $PKG/usr/lib${LIBDIRSUFFIX} ; ln -sf libtalloc.so.? libtalloc.so )
-fi
-
-# Make symlink for libpytalloc-util.so:
-if [ ! -r $PKG/usr/lib${LIBDIRSUFFIX}/libpytalloc-util.so -a -r $PKG/usr/lib${LIBDIRSUFFIX}/libpytalloc-util.so.? ]; then
- ( cd $PKG/usr/lib${LIBDIRSUFFIX} ; ln -sf libpytalloc-util.so.? libpytalloc-util.so )
-fi
-
# Install the smbprint script:
install -m0744 packaging/printing/smbprint $PKG/usr/bin/smbprint
@@ -236,9 +206,9 @@ cat << EOF
*** Be sure the package contains:
-drwx------ 2 root root 1024 Mar 12 13:21 /etc/samba/private
drwxr-xr-x 2 root root 4096 May 3 15:46 /var/cache/samba/
-drwxr-xr-x 2 root root 48 Aug 29 13:06 /var/log/samba/
+drwx------ 2 root root 1024 Mar 12 13:21 /var/lib/samba/private
+drwxr-xr-x 2 root root 48 Aug 29 13:06 /var/log/samba/
drwxrwxrwt 2 root root 1024 Mar 12 13:21 /var/spool/samba/
EOF
diff --git a/source/n/samba/samba.install.talloc.tevent.tdb.diff b/source/n/samba/samba.install.talloc.tevent.tdb.diff
new file mode 100644
index 000000000..9410f2b71
--- /dev/null
+++ b/source/n/samba/samba.install.talloc.tevent.tdb.diff
@@ -0,0 +1,102 @@
+--- ./lib/tevent/wscript.orig 2016-03-08 05:07:45.000000000 -0600
++++ ./lib/tevent/wscript 2016-04-11 12:45:14.299532166 -0500
+@@ -92,11 +92,8 @@
+ if bld.CONFIG_SET('HAVE_SOLARIS_PORTS'):
+ SRC += ' tevent_port.c'
+
+- if bld.env.standalone_tevent:
+- bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
+- private_library = False
+- else:
+- private_library = True
++ bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
++ private_library = False
+
+ if not bld.CONFIG_SET('USING_SYSTEM_TEVENT'):
+ bld.SAMBA_LIBRARY('tevent',
+--- ./lib/tdb/wscript.orig 2016-01-26 05:45:46.000000000 -0600
++++ ./lib/tdb/wscript 2016-04-11 12:45:14.301532166 -0500
+@@ -117,11 +117,8 @@
+
+ COMMON_SRC = bld.SUBDIR('common', COMMON_FILES)
+
+- if bld.env.standalone_tdb:
+- bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
+- private_library = False
+- else:
+- private_library = True
++ bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
++ private_library = False
+
+ if not bld.CONFIG_SET('USING_SYSTEM_TDB'):
+
+--- ./lib/talloc/wscript.orig 2016-04-11 12:45:14.295532166 -0500
++++ ./lib/talloc/wscript 2016-04-11 12:45:26.761531768 -0500
+@@ -77,41 +77,39 @@
+ def build(bld):
+ bld.RECURSE('lib/replace')
+
+- if bld.env.standalone_talloc:
+- bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
+- bld.env.TALLOC_VERSION = VERSION
+- private_library = False
+-
+- # should we also install the symlink to libtalloc1.so here?
+- bld.SAMBA_LIBRARY('talloc-compat1-%s' % (VERSION),
+- 'compat/talloc_compat1.c',
+- public_deps='talloc',
+- soname='libtalloc.so.1',
+- pc_files=[],
+- public_headers=[],
+- enabled=bld.env.TALLOC_COMPAT1)
+-
+- testsuite_deps = 'talloc'
+- if bld.CONFIG_SET('HAVE_PTHREAD'):
+- testsuite_deps += ' pthread'
+-
+- bld.SAMBA_BINARY('talloc_testsuite',
+- 'testsuite_main.c testsuite.c',
+- testsuite_deps,
+- install=False)
+-
+- bld.SAMBA_BINARY('talloc_test_magic_differs_helper',
+- 'test_magic_differs_helper.c',
+- 'talloc', install=False)
++ bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
++ bld.env.TALLOC_VERSION = VERSION
++ private_library = False
++
++ # should we also install the symlink to libtalloc1.so here?
++ bld.SAMBA_LIBRARY('talloc-compat1-%s' % (VERSION),
++ 'compat/talloc_compat1.c',
++ public_deps='talloc',
++ soname='libtalloc.so.1',
++ pc_files=[],
++ public_headers=[],
++ enabled=bld.env.TALLOC_COMPAT1)
++
++ testsuite_deps = 'talloc'
++ if bld.CONFIG_SET('HAVE_PTHREAD'):
++ testsuite_deps += ' pthread'
++
++ bld.SAMBA_BINARY('talloc_testsuite',
++ 'testsuite_main.c testsuite.c',
++ testsuite_deps,
++ install=False)
++
++ bld.SAMBA_BINARY('talloc_test_magic_differs_helper',
++ 'test_magic_differs_helper.c',
++ 'talloc', install=False)
+
+- else:
+- private_library = True
+
+ if not bld.CONFIG_SET('USING_SYSTEM_TALLOC'):
+
+ bld.SAMBA_LIBRARY('talloc',
+ 'talloc.c',
+ deps='replace',
++ includes='.',
+ abi_directory='ABI',
+ abi_match='talloc* _talloc*',
+ hide_symbols=True,