diff options
Diffstat (limited to 'rules')
-rw-r--r-- | rules/samba.in | 118 | ||||
-rw-r--r-- | rules/samba.make | 239 |
2 files changed, 143 insertions, 214 deletions
diff --git a/rules/samba.in b/rules/samba.in index d71b9ab8a..ec5423661 100644 --- a/rules/samba.in +++ b/rules/samba.in @@ -3,14 +3,22 @@ menuconfig SAMBA tristate prompt "samba " + select HOST_SYSTEM_PERL + select LIBC_CRYPT + select LIBC_DL select LIBC_NSL select LIBC_RESOLV - select LIBC_DL - select LIBC_CRYPT if SAMBA_SERVER select GCCLIBS_GCC_S - select READLINE + select ACL + select BUSYBOX_START_STOP_DAEMON if SAMBA_STARTSCRIPT + select CUPS if SAMBA_CUPS + select KRB5 + select LIBBSD + select LIBCAP select LIBPOPT - select BUSYBOX_START_STOP_DAEMON if SAMBA_STARTSCRIPT + select READLINE + select SYSTEMD if SAMBA_SYSTEMD_UNIT + select ZLIB help Samba is an Open Source/Free Software suite that has, since 1992, provided file and print services to all manner of @@ -20,85 +28,10 @@ menuconfig SAMBA See http://www.samba.org for details. -# Optional Features: -# --enable-static=PKGS build static libraries default=no -# --enable-shared=PKGS build shared libraries default=yes -# --enable-pie Turn on pie support if available (default=yes) -# --enable-debug Turn on compiler debugging information (default=no) -# --enable-socket-wrapper Turn on socket wrapper library (default=no) -# --enable-developer Turn on developer warnings and debugging (default=no) -# --enable-krb5developer Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no) -# --enable-dmalloc Enable heap debugging default=no - - -# --enable-iprint Turn on iPrint support (default=yes if cups is yes) -# -# Optional Packages: -# --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] -# --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) -# --with-fhs Use FHS-compliant paths (default=no) -# --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private) -# --with-rootsbindir=DIR Which directory to use for root sbin ($ac_default_prefix/sbin) -# --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks) -# --with-piddir=DIR Where to put pid files ($ac_default_prefix/var/locks) -# --with-swatdir=DIR Where to put SWAT files ($ac_default_prefix/swat) -# --with-configdir=DIR Where to put configuration files ($libdir) -# --with-logfilebase=DIR Where to put log files ($VARDIR) -# --with-libdir=DIR Where to put libdir ($libdir) -# --with-pammodulesdir=DIR Which directory to use for PAM modules ($ac_default_prefix/$libdir/security) -# --with-mandir=DIR Where to put man pages ($mandir) -# --with-cfenc=HEADERDIR Use internal CoreFoundation encoding API -# for optimization (Mac OS X/Darwin only) -# --with-selftest-prefix=DIR The prefix where make test will be runned ($selftest_prefix) -# --with-smbtorture4-path=PATH The path to a samba4 smbtorture for make test (none) -# --with-profiling-data Include gathering source code profile information (default=no) -# --with-readline=DIR Look for readline include/libs in DIR (default=auto) -# --with-smbwrapper Include SMB wrapper support (default=no) -# --with-afs Include AFS clear-text auth support (default=no) -# --with-fake-kaserver Include AFS fake-kaserver support (default=no) -# --with-vfs-afsacl Include AFS to NT ACL mapping module (default=no) -# --with-dce-dfs Include DCE/DFS clear-text auth support (default=no) -# --with-ldap LDAP support (default yes) -# --with-ads Active Directory support (default auto) -# --with-krb5=base-dir Locate Kerberos 5 support (default=/usr) -# --with-automount Include automount support (default=no) -# --with-smbmount Include smbmount (Linux only) support (default=no) -# --with-cifsmount Include mount.cifs and umount.cifs (Linux only) support (default=yes) -# --with-pam Include PAM support (default=no) -# --with-pam_smbpass Build PAM module for authenticating against passdb backends (default=no) -# --with-nisplus-home Include NISPLUS_HOME support (default=no) -# --with-syslog Include experimental SYSLOG support (default=no) -# --with-quotas Include disk-quota support (default=no) -# --with-sys-quotas Include lib/sysquotas.c support (default=auto) -# --with-utmp Include utmp accounting (default, if supported by OS) -# --with-libmsrpc Build the libmsrpc shared library (default=yes if shared libs supported) -# --with-libsmbclient Build the libsmbclient shared library (default=yes if shared libs supported) -# --with-libsmbsharemodes Build the libsmbsharemodes shared library (default=yes if shared libs supported) -# --with-spinlocks Use spin locks instead of fcntl locks (default=no) -# --with-cluster-support Enable cluster extensions (default=no) -# --with-acl-support Include ACL support (default=no) -# --with-aio-support Include asynchronous io support (default=no) -# --with-sendfile-support Check for sendfile support (default=yes) -# --with-winbind Build winbind (default, if supported by OS) -# --with-included-popt use bundled popt library, not from system -# --with-included-iniparser use bundled iniparser library, not from system -# --with-python=PYTHONNAME build Python libraries -# --with-static-modules=MODULES Comma-seperated list of names of modules to statically link in -# --with-shared-modules=MODULES Comma-seperated list of names of modules to build shared - if SAMBA config SAMBA_COMMON bool - default y - prompt "Samba common files" - help - Install common samba files. - -config SAMBA_SMB_CONF - bool - default y - prompt "install /etc/samba/smb.conf" config SAMBA_SERVER bool @@ -108,19 +41,6 @@ config SAMBA_SERVER Installs samba server. ATTENTION: You need rw access to your rootfs before starting the samba server! -if SAMBA_SERVER - -config SAMBA_SECRETS_USER - bool - prompt "User defined smb password Database" - help - This will install the /etc/samba/secrets.tdb from - projectroot/etc/samba/secrets.tdb. If you wish to run samba - in user security level and use you own userdatabase. You will - have to enable this. If you say n here. The samba server will - generates his own secrets.tdb after initialisation. -endif - config SAMBA_CLIENT bool select SAMBA_COMMON @@ -135,16 +55,8 @@ config SAMBA_LIBCLIENT help Installs the libsmbclient shared library. -config SAMBA_SMBFS - bool - select SAMBA_COMMON - prompt "Samba file system" - help - Enables the system to mount windows share via SMB protocol - config SAMBA_CUPS bool - depends on BROKEN prompt "cups support" help Turn on CUPS support @@ -155,4 +67,10 @@ config SAMBA_STARTSCRIPT depends on SAMBA_SERVER prompt "install /etc/init.d/samba" +config SAMBA_SYSTEMD_UNIT + bool + default y + depends on SAMBA_SERVER && INITMETHOD_SYSTEMD + prompt "install systemd unit files" + endif diff --git a/rules/samba.make b/rules/samba.make index efe40a1f9..cfa869495 100644 --- a/rules/samba.make +++ b/rules/samba.make @@ -17,106 +17,119 @@ PACKAGES-$(PTXCONF_SAMBA) += samba # # Paths and names # -SAMBA_VERSION := 3.0.37 -SAMBA_MD5 := 11ed2bfef4090bd5736b194b43f67289 +SAMBA_VERSION := 4.9.4 +SAMBA_MD5 := 5e94705ae741bc6e4c893cea7b5de0d5 SAMBA := samba-$(SAMBA_VERSION) SAMBA_SUFFIX := tar.gz +SAMBA_URL := https://download.samba.org/pub/samba/stable/$(SAMBA).$(SAMBA_SUFFIX) SAMBA_SOURCE := $(SRCDIR)/$(SAMBA).$(SAMBA_SUFFIX) SAMBA_DIR := $(BUILDDIR)/$(SAMBA) -SAMBA_LICENSE := GPL-2.0-only - -SAMBA_URL := \ - http://www.samba.org/samba/ftp/stable/$(SAMBA).$(SAMBA_SUFFIX) \ - http://www.samba.org/samba/ftp/old-versions/$(SAMBA).$(SAMBA_SUFFIX) +SAMBA_LICENSE := GPL-3.0-or-later AND LGPL-3.0-or-later +# cross-compile runtime checks. Initial file generated with +# --cross-execute=$(PTXDIST_SYSROOT_CROSS)/bin/qemu-cross +SAMBA_CONFIG := $(shell ptxd_get_alternative config/samba cross-answers && echo $$ptxd_reply) # ---------------------------------------------------------------------------- # Prepare # ---------------------------------------------------------------------------- -SAMBA_PATH := PATH=$(CROSS_PATH) -SAMBA_ENV := \ - $(CROSS_ENV) \ - CFLAGS=-O2 \ - libreplace_cv_READDIR_NEEDED=no \ - samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no \ - samba_cv_HAVE_BROKEN_GETGROUPS=no \ - samba_cv_HAVE_C99_VSNPRINTF=yes \ - samba_cv_HAVE_DEVICE_MAJOR_FN=yes \ - samba_cv_HAVE_DEVICE_MINOR_FN=yes \ - samba_cv_HAVE_FCNTL_LOCK=yes \ - samba_cv_HAVE_FTRUNCATE_EXTEND=yes \ - samba_cv_HAVE_GETTIMEOFDAY_TZ=yes \ - samba_cv_HAVE_IFACE_AIX=no \ - samba_cv_HAVE_IFACE_IFCONF=yes \ - samba_cv_HAVE_IFACE_IFREQ=yes \ - samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes \ - samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes \ - samba_cv_HAVE_KERNEL_SHARE_MODES=yes \ - samba_cv_HAVE_MAKEDEV=yes \ - samba_cv_HAVE_MMAP=yes \ - samba_cv_HAVE_NATIVE_ICONV=yes \ - samba_cv_HAVE_SECURE_MKSTEMP=yes \ - samba_cv_HAVE_STRUCT_FLOCK64=yes \ - samba_cv_HAVE_TRUNCATED_SALT=no \ - samba_cv_HAVE_WORKING_AF_LOCAL=yes \ - samba_cv_LINUX_LFS_SUPPORT=yes \ - samba_cv_REALPATH_TAKES_NULL=yes \ - samba_cv_REPLACE_INET_NTOA=no \ - samba_cv_USE_SETRESUID=yes \ - samba_cv_USE_SETREUID=yes \ - samba_cv_have_longlong=yes \ - samba_cv_have_setresgid=yes \ - samba_cv_have_setresuid=yes - # # autoconf # -SAMBA_AUTOCONF := \ - $(CROSS_AUTOCONF_USR) \ - --disable-pie \ - --libdir=/usr/lib/samba \ - --sysconfdir=/etc \ - --with-configdir=/etc/samba \ - --with-libdir=/usr/lib \ - --with-libsmbclient \ - --with-lockdir=/var/lock \ - --with-logfilebase=/var/log \ - --with-piddir=/var/run \ - --with-privatedir=/etc/samba \ - --with-readline \ - --with-syslog \ +SAMBA_CONF_TOOL := NO +SAMBA_CONF_OPT := \ + --nocache \ + --without-json-audit \ + --without-gettext \ + --disable-python \ + --without-gpgme \ + --without-winbind \ --without-ads \ - --without-automount \ - --without-included-popt \ - --without-krb5 \ --without-ldap \ + --$(call ptx/endis,PTXCONF_SAMBA_CUPS)-cups \ + --disable-iprint \ --without-pam \ - --without-utmp \ - --without-winbind - -ifdef PTXCONF_SAMBA_CUPS -SAMBA_AUTOCONF += --enable-cups -else -SAMBA_AUTOCONF += --disable-cups -endif - -ifdef PTXCONF_SAMBA_SMBFS -SAMBA_AUTOCONF += --with-smbmount -endif - -ifdef PTXCONF_ICONV -SAMBA_AUTOCONF += --with-libiconv=$(SYSROOT)/usr -else -SAMBA_AUTOCONF += --without-libiconv -endif + --with-quotas \ + --with-sendfile-support \ + --with-utmp \ + --disable-avahi \ + --$(call ptx/wwo, PTXCONF_ICONV)-iconv \ + --with-acl-support \ + --with-dnsupdate \ + --with-syslog \ + --without-automount \ + --without-dmapi \ + --without-fam \ + --without-profiling-data \ + --without-libarchive \ + --without-cluster-support \ + --without-regedit \ + --without-fake-kaserver \ + --disable-glusterfs \ + --disable-cephfs \ + --disable-spotlight \ + --with-systemd \ + --without-lttng \ + --accel-aes=$(call ptx/ifdef,PTXCONF_ARCH_X86_64,intelaesni,none) \ + --enable-pthreadpool \ + --with-system-mitkrb5 \ + --without-ad-dc \ + --without-ntvfs-fileserver \ + $(CROSS_AUTOCONF_SYSROOT_USR) \ + --bundled-libraries=NONE,cmocka,tdb,talloc,tevent,ldb \ + --disable-rpath \ + --disable-rpath-install \ + --enable-auto-reconfigure \ + --cross-compile \ + --cross-execute=/does/not/exist/and/triggers/exceptions \ + --cross-answers=$(SAMBA_DIR)/cross-answers \ + --hostcc=$(HOSTCC) \ + --enable-fhs \ + --with-piddir=/run/samba \ + --with-lockdir=/var/lib/samba/lock \ + --systemd-install-services \ + --with-systemddir=/usr/lib/systemd/system + +$(STATEDIR)/samba.prepare: + @$(call targetinfo) + @UNAME_M=$(PTXCONF_ARCH_STRING) \ + UNAME_R=$(KERNEL_VERSION) \ + UNAME_V=$(if $(KERNEL_HEADER_VERSION),$(KERNEL_HEADER_VERSION),$(KERNEL_VERSION)) \ + HAS_64BIT=$(call ptx/ifdef,PTXCONF_ARCH_LP64,OK,NO) \ + ptxd_replace_magic $(SAMBA_CONFIG) > $(SAMBA_DIR)/cross-answers + @$(call world/execute, SAMBA, $(SYSTEMPYTHON) ./buildtools/bin/waf configure $(SAMBA_CONF_OPT)) + @$(call touch) -SAMBA_SUBDIR := source -SAMBA_MAKE_PAR := NO +SAMBA_COMPILE_ENV := \ + PTXDIST_ICECC= # ---------------------------------------------------------------------------- # Target-Install # ---------------------------------------------------------------------------- +SAMBA_COMMON_LIBS := \ + libdcerpc \ + libdcerpc-binding \ + libndr-krb5pac \ + libndr-nbt \ + libndr-standard \ + libndr \ + libnetapi \ + libsamba-credentials \ + libsamba-errors \ + libsamba-hostconfig \ + libsamba-passdb \ + libsamba-util \ + libsamdb \ + libsmbconf \ + libtevent-util \ + libwbclient \ + samba/libldb \ + samba/libtalloc \ + samba/libtdb \ + samba/libtevent + + $(STATEDIR)/samba.targetinstall: @$(call targetinfo) @@ -126,9 +139,15 @@ $(STATEDIR)/samba.targetinstall: @$(call install_fixup, samba,AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>") @$(call install_fixup, samba,DESCRIPTION,missing) - @$(call install_copy, samba, 0, 0, 0755, /etc/samba) + @$(call install_alternative_tree, samba, 0, 0, /etc/samba) ifdef PTXCONF_SAMBA_COMMON + @$(call install_glob, samba, 0, 0, -, \ + /usr/lib/samba,*-samba4.so) + + @$(foreach lib, $(SAMBA_COMMON_LIBS), \ + $(call install_lib, samba, 0, 0, 0644, $(lib))$(ptx/nl)) + @$(call install_copy, samba, 0, 0, 0755, -, \ /usr/bin/nmblookup) @$(call install_copy, samba, 0, 0, 0755, -, \ @@ -137,12 +156,6 @@ ifdef PTXCONF_SAMBA_COMMON /usr/bin/smbpasswd) @$(call install_copy, samba, 0, 0, 0755, -, \ /usr/bin/testparm) - @$(call install_copy, samba, 0, 0, 0644, -, \ - /usr/lib/lowcase.dat) - @$(call install_copy, samba, 0, 0, 0644, -, \ - /usr/lib/upcase.dat) - @$(call install_copy, samba, 0, 0, 0644, -, \ - /usr/lib/valid.dat) endif ifdef PTXCONF_SAMBA_SERVER @@ -158,16 +171,27 @@ ifdef PTXCONF_SAMBA_SERVER /usr/bin/smbstatus) @$(call install_copy, samba, 0, 0, 0755, -, \ /usr/bin/tdbbackup) + @$(call install_copy, samba, 0, 0, 0755, /var/cache/samba) + @$(call install_copy, samba, 0, 0, 0755, /var/lib/samba) + @$(call install_alternative, samba, 0, 0, 0644, \ + /usr/lib/tmpfiles.d/samba.conf) endif -ifdef PTXCONF_SAMBA_SMB_CONF - @$(call install_alternative, samba, 0, 0, 0644, \ - /etc/samba/smb.conf) +ifdef PTXCONF_SAMBA_CLIENT + @$(call install_copy, samba, 0, 0, 0755, -, \ + /usr/bin/smbcacls) + @$(call install_copy, samba, 0, 0, 0755, -, \ + /usr/bin/smbcquotas) + @$(call install_copy, samba, 0, 0, 0755, -, \ + /usr/bin/smbtree) + @$(call install_copy, samba, 0, 0, 0755, -, \ + /usr/bin/smbclient) + @$(call install_copy, samba, 0, 0, 0755, -, \ + /usr/bin/rpcclient) endif -ifdef PTXCONF_SAMBA_SECRETS_USER - @$(call install_alternative, samba, 0, 0, 0600, \ - /etc/samba/secrets.tdb) +ifdef PTXCONF_SAMBA_LIBCLIENT + @$(call install_lib, samba, 0, 0, 0644, libsmbclient) endif # # @@ -185,29 +209,16 @@ endif endif endif -ifdef PTXCONF_SAMBA_CLIENT - @$(call install_copy, samba, 0, 0, 0755, -, \ - /usr/bin/smbcacls) - @$(call install_copy, samba, 0, 0, 0755, -, \ - /usr/bin/smbcquotas) - @$(call install_copy, samba, 0, 0, 0755, -, \ - /usr/bin/smbtree) - @$(call install_copy, samba, 0, 0, 0755, -, \ - /usr/bin/smbclient) - @$(call install_copy, samba, 0, 0, 0755, -, \ - /usr/bin/rpcclient) -endif - -ifdef PTXCONF_SAMBA_LIBCLIENT - @$(call install_copy, samba, 0, 0, 0644, -, \ - /usr/lib/libsmbclient.so) -endif +ifdef PTXCONF_SAMBA_SYSTEMD_UNIT + @$(call install_alternative, samba, 0, 0, 0644, \ + /usr/lib/systemd/system/smb.service) + @$(call install_link, samba, ../smb.service, \ + /usr/lib/systemd/system/multi-user.target.wants/smb.service) -ifdef PTXCONF_SAMBA_SMBFS - @$(call install_copy, samba, 0, 0, 0755, -, \ - /usr/bin/smbmount) - @$(call install_copy, samba, 0, 0, 0755, -, \ - /usr/bin/smbumount) + @$(call install_alternative, samba, 0, 0, 0644, \ + /usr/lib/systemd/system/nmb.service) + @$(call install_link, samba, ../nmb.service, \ + /usr/lib/systemd/system/multi-user.target.wants/nmb.service) endif @$(call install_finish, samba) |