Move all to deprecated folder.

This commit is contained in:
2016-11-16 21:57:57 +01:00
parent 01738a7684
commit 05de7d6c04
9777 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
Disable libbsd support, samba4 uses a global config.h for its own
codebase and that of heimdal (when building with builtin).
This causes redefinition conflicts for link(2) when both standard unistd.h
and bsd/unistd.h get included.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
diff -Nura samba-4.2.0rc1.orig/lib/replace/wscript samba-4.2.0rc1/lib/replace/wscript
--- samba-4.2.0rc1.orig/lib/replace/wscript 2014-10-01 06:17:32.000000000 -0300
+++ samba-4.2.0rc1/lib/replace/wscript 2014-10-01 07:21:13.559498987 -0300
@@ -282,15 +282,6 @@
conf.CHECK_FUNCS('strtouq strtoll __strtoll strtoq memalign posix_memalign')
conf.CHECK_FUNCS('prctl')
- # libbsd on some platforms provides strlcpy and strlcat
- if not conf.CHECK_FUNCS('strlcpy strlcat'):
- conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
- checklibc=True)
- if not conf.CHECK_FUNCS('getpeereid'):
- conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
- if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
- conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
-
conf.CHECK_CODE('''
struct ucred cred;
socklen_t cred_len;

View File

@@ -0,0 +1,56 @@
From e4ef92852023f4e2f192d3c47220dc75930a615c Mon Sep 17 00:00:00 2001
From: Gustavo Zacarias <gustavo@zacarias.com.ar>
Date: Fri, 11 Sep 2015 16:41:31 -0300
Subject: [PATCH] build: improve stack protector check
Testing a toolchain for proper -fstack-protector must go beyond ensuring
the compiler and linker accept the option.
If the test C program does nothing with the stack then guards aren't
inserted and/or are optimized away giving the false impression that it
works when in fact the libc might not support it.
Update the check to a program that uses the stack, hence making a link
fail if proper support isn't available, for example in non-ssp enabled
uclibc toolchains like this:
test.c:(.text.startup+0x64): undefined reference to `__stack_chk_fail'
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
buildtools/wafsamba/samba_autoconf.py | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index c5f132c..ef34b00 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -657,9 +657,23 @@ def SAMBA_CONFIG_H(conf, path=None):
if not IN_LAUNCH_DIR(conf):
return
- if conf.CHECK_CFLAGS(['-fstack-protector']) and conf.CHECK_LDFLAGS(['-fstack-protector']):
- conf.ADD_CFLAGS('-fstack-protector')
- conf.ADD_LDFLAGS('-fstack-protector')
+ # we need to build real code that can't be optimized away to test
+ if conf.check(fragment='''
+ #include <stdio.h>
+
+ int main(void)
+ {
+ char t[100000];
+ while (fgets(t, sizeof(t), stdin));
+ return 0;
+ }
+ ''',
+ execute=0,
+ ccflags='-fstack-protector',
+ ldflags='-fstack-protector',
+ msg='Checking if toolchain accepts -fstack-protector'):
+ conf.ADD_CFLAGS('-fstack-protector')
+ conf.ADD_LDFLAGS('-fstack-protector')
if Options.options.debug:
conf.ADD_CFLAGS('-g', testflags=True)
--
2.4.6

View File

@@ -0,0 +1,49 @@
comment "samba4 needs a toolchain w/ RPC, wchar, dynamic library, threads"
depends on BR2_TOOLCHAIN_HAS_SYNC_4
depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_NATIVE_RPC \
|| BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_USE_MMU
config BR2_PACKAGE_SAMBA4
bool "samba4"
depends on !BR2_PACKAGE_SAMBA
depends on BR2_USE_MMU # fork()
depends on BR2_USE_WCHAR # e2fsprogs
depends on BR2_TOOLCHAIN_HAS_NATIVE_RPC
depends on BR2_TOOLCHAIN_HAS_THREADS # python -> libffi
depends on !BR2_STATIC_LIBS # python
depends on !BR2_nios2 # binary too large, relocations don't fit
depends on BR2_TOOLCHAIN_HAS_SYNC_4
select BR2_PACKAGE_E2FSPROGS
select BR2_PACKAGE_POPT
select BR2_PACKAGE_PYTHON
select BR2_PACKAGE_ZLIB
help
Provides secure, stable and fast file and print services
for all clients using the SMB/CIFS protocol, such as all
versions of DOS, Windows, OS/2, Linux and many others.
http://www.samba.org/
if BR2_PACKAGE_SAMBA4
config BR2_PACKAGE_SAMBA4_AD_DC
bool "AD DC"
select BR2_PACKAGE_GNUTLS
help
Enable Active Directory Domain Controller functionality.
config BR2_PACKAGE_SAMBA4_ADS
bool "ADS"
select BR2_PACKAGE_OPENLDAP
help
Enable Active Directory member Server functionality.
config BR2_PACKAGE_SAMBA4_SMBTORTURE
bool "smbtorture"
help
Install the smbtorture test suite.
It's normally used for validation and stress testing.
Approximately +5 MB of stripped uncompressed target space.
endif

View File

@@ -0,0 +1,56 @@
#!/bin/sh
[ -f /etc/samba/smb.conf ] || exit 0
mkdir -p /var/log/samba
start() {
printf "Starting SMB services: "
smbd -D
[ $? = 0 ] && echo "OK" || echo "FAIL"
printf "Starting NMB services: "
nmbd -D
[ $? = 0 ] && echo "OK" || echo "FAIL"
}
stop() {
printf "Shutting down SMB services: "
kill -9 `pidof smbd`
[ $? = 0 ] && echo "OK" || echo "FAIL"
printf "Shutting down NMB services: "
kill -9 `pidof nmbd`
[ $? = 0 ] && echo "OK" || echo "FAIL"
}
restart() {
stop
start
}
reload() {
printf "Reloading smb.conf file: "
kill -HUP `pidof smbd`
[ $? = 0 ] && echo "OK" || echo "FAIL"
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac
exit $?

View File

@@ -0,0 +1,38 @@
Checking simple C program: OK
rpath library support: OK
-Wl,--version-script support: OK
Checking getconf LFS_CFLAGS: NO
Checking for large file support without additional flags: OK
Checking for -D_LARGE_FILES: OK
Checking correct behavior of strtoll: NO
Checking for working strptime: OK
Checking for C99 vsnprintf: OK
Checking for HAVE_SHARED_MMAP: OK
Checking for HAVE_MREMAP: OK
Checking for HAVE_INCOHERENT_MMAP: NO
Checking for HAVE_SECURE_MKSTEMP: OK
Checking for HAVE_IFACE_GETIFADDRS: OK
Checking for kernel change notify support: OK
Checking for Linux kernel oplocks: OK
Checking for kernel share modes: OK
Checking if can we convert from CP850 to UCS-2LE: OK
Checking if can we convert from UTF-8 to UCS-2LE: OK
Checking whether we can use Linux thread-specific credentials with 32-bit system calls: OK
Checking whether we can use Linux thread-specific credentials: OK
Checking whether setreuid is available: OK
Checking whether setresuid is available: OK
Checking whether seteuid is available: OK
Checking whether fcntl locking is available: OK
Checking for the maximum value of the 'time_t' type: OK
Checking whether the realpath function allows a NULL argument: OK
Checking whether POSIX capabilities are available: OK
Checking for ftruncate extend: OK
vfs_fileid checking for statfs() and struct statfs.f_fsid: OK
getcwd takes a NULL argument: OK
Checking uname sysname type: "Linux"
Checking uname release type: "3.0.0"
Checking uname version type: "#1 Tue Nov 1 12:34:56 UTC 2013"
Checking value of NSIG: "65"
Checking value of _NSIG: "65"
Checking value of SIGRTMAX: "64"
Checking value of SIGRTMIN: "34"

View File

@@ -0,0 +1,2 @@
# Locally calculated after checking pgp signature
sha256 5d0eb52e842832af922f7d57716eacff23192906ec3bdf6727e18ca24f1419d9 samba-4.3.4.tar.gz

View File

@@ -0,0 +1,175 @@
################################################################################
#
# samba4
#
################################################################################
SAMBA4_VERSION = 4.3.4
SAMBA4_SITE = http://ftp.samba.org/pub/samba/stable
SAMBA4_SOURCE = samba-$(SAMBA4_VERSION).tar.gz
SAMBA4_INSTALL_STAGING = YES
SAMBA4_LICENSE = GPLv3+
SAMBA4_LICENSE_FILES = COPYING
SAMBA4_DEPENDENCIES = host-e2fsprogs host-heimdal e2fsprogs popt python zlib \
$(if $(BR2_PACKAGE_LIBBSD),libbsd) \
$(if $(BR2_PACKAGE_LIBCAP),libcap) \
$(if $(BR2_PACKAGE_READLINE),readline)
ifeq ($(BR2_PACKAGE_ACL),y)
SAMBA4_CONF_OPTS += --with-acl-support
SAMBA4_DEPENDENCIES += acl
else
SAMBA4_CONF_OPTS += --without-acl-support
endif
ifeq ($(BR2_PACKAGE_CUPS),y)
SAMBA4_CONF_ENV += CUPS_CONFIG="$(STAGING_DIR)/usr/bin/cups-config"
SAMBA4_CONF_OPTS += --enable-cups
SAMBA4_DEPENDENCIES += cups
else
SAMBA4_CONF_OPTS += --disable-cups
endif
ifeq ($(BR2_PACKAGE_LIBAIO),y)
SAMBA4_CONF_OPTS += --with-aio-support
SAMBA4_DEPENDENCIES += libaio
else
SAMBA4_CONF_OPTS += --without-aio-support
endif
ifeq ($(BR2_PACKAGE_DBUS)$(BR2_PACKAGE_AVAHI_DAEMON),yy)
SAMBA4_CONF_OPTS += --enable-avahi
SAMBA4_DEPENDENCIES += avahi
else
SAMBA4_CONF_OPTS += --disable-avahi
endif
ifeq ($(BR2_PACKAGE_GAMIN),y)
SAMBA4_CONF_OPTS += --with-fam
SAMBA4_DEPENDENCIES += gamin
else
SAMBA4_CONF_OPTS += --without-fam
endif
ifeq ($(BR2_PACKAGE_GETTEXT),y)
SAMBA4_CONF_OPTS += --with-gettext=$(STAGING_DIR)/usr
SAMBA4_DEPENDENCIES += gettext
else
SAMBA4_CONF_OPTS += --without-gettext
endif
ifeq ($(BR2_PACKAGE_GNUTLS),y)
SAMBA4_CONF_OPTS += --enable-gnutls
SAMBA4_DEPENDENCIES += gnutls
else
SAMBA4_CONF_OPTS += --disable-gnutls
endif
ifeq ($(BR2_PACKAGE_NCURSES_TARGET_FORM)$(BR2_PACKAGE_NCURSES_TARGET_MENU)$(BR2_PACKAGE_NCURSES_TARGET_PANEL),yyy)
SAMBA4_CONF_ENV += NCURSES_CONFIG="$(STAGING_DIR)/usr/bin/$(NCURSES_CONFIG_SCRIPTS)"
SAMBA4_DEPENDENCIES += ncurses
else
SAMBA4_CONF_OPTS += --without-regedit
endif
# The ctdb tests (cluster) need bash and take up some space
# They're normally intended for debugging so remove them
define SAMBA4_REMOVE_CTDB_TESTS
rm -rf $(TARGET_DIR)/usr/lib/ctdb-tests
rm -rf $(TARGET_DIR)/usr/share/ctdb-tests
rm -f $(TARGET_DIR)/usr/bin/ctdb_run_*tests
endef
SAMBA4_POST_INSTALL_TARGET_HOOKS += SAMBA4_REMOVE_CTDB_TESTS
define SAMBA4_CONFIGURE_CMDS
cp package/samba4/samba4-cache.txt $(@D)/cache.txt;
echo 'Checking uname machine type: $(BR2_ARCH)' >>$(@D)/cache.txt;
(cd $(@D); \
PYTHON_CONFIG="$(STAGING_DIR)/usr/bin/python-config" \
python_LDFLAGS="" \
python_LIBDIR="" \
$(TARGET_CONFIGURE_OPTS) \
$(SAMBA4_CONF_ENV) \
./buildtools/bin/waf configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--with-libiconv=$(STAGING_DIR)/usr \
--enable-fhs \
--cross-compile \
--cross-answers=$(@D)/cache.txt \
--hostcc=gcc \
--disable-rpath \
--disable-rpath-install \
--disable-iprint \
--without-pam \
--without-dmapi \
--disable-glusterfs \
--with-cluster-support \
--bundled-libraries='!asn1_compile,!compile_et' \
$(SAMBA4_CONF_OPTS) \
)
endef
define SAMBA4_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
endef
define SAMBA4_INSTALL_STAGING_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
endef
define SAMBA4_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
endef
# Samba just installs .py files so the purge causes problems with some tools
ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y)
define SAMBA4_BUILD_PYC_FILES
PYTHONPATH="$(PYTHON_PATH)" \
$(HOST_DIR)/usr/bin/python -c "import compileall; \
compileall.compile_dir('$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages/samba')"
endef
SAMBA4_POST_INSTALL_TARGET_HOOKS += SAMBA4_BUILD_PYC_FILES
endif
ifeq ($(BR2_PACKAGE_SAMBA4_AD_DC),)
SAMBA4_CONF_OPTS += --without-ad-dc
endif
ifeq ($(BR2_PACKAGE_SAMBA4_ADS),y)
SAMBA4_CONF_OPTS += --with-ads --with-ldap --with-shared-modules=idmap_ad
SAMBA4_DEPENDENCIES += openldap
else
SAMBA4_CONF_OPTS += --without-ads --without-ldap
endif
ifeq ($(BR2_PACKAGE_SAMBA4_SMBTORTURE),)
define SAMBA4_REMOVE_SMBTORTURE
rm -f $(TARGET_DIR)/usr/bin/smbtorture
endef
SAMBA4_POST_INSTALL_TARGET_HOOKS += SAMBA4_REMOVE_SMBTORTURE
endif
define SAMBA4_INSTALL_INIT_SYSV
$(INSTALL) -m 0755 -D package/samba4/S91smb \
$(TARGET_DIR)/etc/init.d/S91smb
endef
define SAMBA4_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 $(@D)/packaging/systemd/nmb.service \
$(TARGET_DIR)/usr/lib/systemd/system/nmb.service
$(INSTALL) -D -m 644 $(@D)/packaging/systemd/smb.service \
$(TARGET_DIR)/usr/lib/systemd/system/smb.service
$(INSTALL) -D -m 644 $(@D)/packaging/systemd/winbind.service \
$(TARGET_DIR)/usr/lib/systemd/system/winbind.service
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
ln -sf ../../../../usr/lib/systemd/system/nmb.service \
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nmb.service
ln -sf ../../../../usr/lib/systemd/system/smb.service \
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/smb.service
ln -sf ../../../../usr/lib/systemd/system/winbind.service \
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/winbind.service
endef
$(eval $(generic-package))