2014-03-02 13:42:18 +01:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# samba4
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2020-07-02 07:35:56 +02:00
|
|
|
SAMBA4_VERSION = 4.11.10
|
2017-01-30 20:02:22 +01:00
|
|
|
SAMBA4_SITE = https://download.samba.org/pub/samba/stable
|
2014-03-02 13:42:18 +01:00
|
|
|
SAMBA4_SOURCE = samba-$(SAMBA4_VERSION).tar.gz
|
2015-03-06 13:50:29 +01:00
|
|
|
SAMBA4_INSTALL_STAGING = YES
|
2017-03-30 15:43:33 +02:00
|
|
|
SAMBA4_LICENSE = GPL-3.0+
|
2014-03-02 13:42:18 +01:00
|
|
|
SAMBA4_LICENSE_FILES = COPYING
|
2016-03-16 15:34:40 +01:00
|
|
|
SAMBA4_DEPENDENCIES = \
|
2020-03-08 12:18:12 +01:00
|
|
|
host-e2fsprogs host-heimdal host-nfs-utils host-python3 \
|
2019-11-06 19:42:37 +01:00
|
|
|
cmocka e2fsprogs gnutls popt zlib \
|
2016-03-23 20:24:31 +01:00
|
|
|
$(if $(BR2_PACKAGE_LIBAIO),libaio) \
|
2014-03-03 12:44:12 +01:00
|
|
|
$(if $(BR2_PACKAGE_LIBCAP),libcap) \
|
2017-07-04 12:35:08 +02:00
|
|
|
$(if $(BR2_PACKAGE_READLINE),readline) \
|
|
|
|
$(TARGET_NLS_DEPENDENCIES)
|
2017-07-23 15:36:18 +02:00
|
|
|
SAMBA4_CFLAGS = $(TARGET_CFLAGS)
|
2019-04-21 23:45:13 +02:00
|
|
|
SAMBA4_LDFLAGS = $(TARGET_LDFLAGS) $(TARGET_NLS_LIBS)
|
2017-07-23 15:36:18 +02:00
|
|
|
SAMBA4_CONF_ENV = \
|
|
|
|
CFLAGS="$(SAMBA4_CFLAGS)" \
|
2019-06-10 10:56:56 +02:00
|
|
|
LDFLAGS="$(SAMBA4_LDFLAGS)" \
|
2019-08-13 23:43:48 +02:00
|
|
|
XSLTPROC=false \
|
|
|
|
WAF_NO_PREFORK=1
|
2017-07-23 15:36:18 +02:00
|
|
|
|
2020-03-08 12:18:12 +01:00
|
|
|
SAMBA4_PYTHON = PYTHON="$(HOST_DIR)/bin/python3"
|
2019-07-22 18:12:13 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_PYTHON3),y)
|
2020-03-08 12:18:12 +01:00
|
|
|
SAMBA4_PYTHON += PYTHON_CONFIG="$(STAGING_DIR)/usr/bin/python3-config"
|
|
|
|
SAMBA4_DEPENDENCIES += python3
|
2019-07-22 18:12:13 +02:00
|
|
|
else
|
2019-12-15 18:36:29 +01:00
|
|
|
SAMBA4_CONF_OPTS += --disable-python
|
2019-07-22 18:12:13 +02:00
|
|
|
endif
|
|
|
|
|
2017-07-23 15:36:18 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
|
|
|
|
SAMBA4_CFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags libtirpc`
|
|
|
|
SAMBA4_LDFLAGS += `$(PKG_CONFIG_HOST_BINARY) --libs libtirpc`
|
|
|
|
SAMBA4_DEPENDENCIES += libtirpc host-pkgconf
|
|
|
|
endif
|
2014-03-02 13:42:18 +01:00
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_ACL),y)
|
2015-03-06 10:30:09 +01:00
|
|
|
SAMBA4_CONF_OPTS += --with-acl-support
|
|
|
|
SAMBA4_DEPENDENCIES += acl
|
2014-03-02 13:42:18 +01:00
|
|
|
else
|
2015-03-06 10:30:09 +01:00
|
|
|
SAMBA4_CONF_OPTS += --without-acl-support
|
2014-03-02 13:42:18 +01:00
|
|
|
endif
|
|
|
|
|
2014-07-31 17:21:18 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_CUPS),y)
|
2015-03-06 10:30:09 +01:00
|
|
|
SAMBA4_CONF_ENV += CUPS_CONFIG="$(STAGING_DIR)/usr/bin/cups-config"
|
|
|
|
SAMBA4_CONF_OPTS += --enable-cups
|
|
|
|
SAMBA4_DEPENDENCIES += cups
|
2014-07-31 17:21:18 +02:00
|
|
|
else
|
2015-03-06 10:30:09 +01:00
|
|
|
SAMBA4_CONF_OPTS += --disable-cups
|
2014-07-31 17:21:18 +02:00
|
|
|
endif
|
|
|
|
|
2017-07-23 15:36:19 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_DBUS),y)
|
|
|
|
SAMBA4_DEPENDENCIES += dbus
|
|
|
|
endif
|
|
|
|
|
2014-03-02 13:42:18 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_DBUS)$(BR2_PACKAGE_AVAHI_DAEMON),yy)
|
2015-03-06 10:30:09 +01:00
|
|
|
SAMBA4_CONF_OPTS += --enable-avahi
|
|
|
|
SAMBA4_DEPENDENCIES += avahi
|
2014-03-02 13:42:18 +01:00
|
|
|
else
|
2015-03-06 10:30:09 +01:00
|
|
|
SAMBA4_CONF_OPTS += --disable-avahi
|
2014-03-02 13:42:18 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_GAMIN),y)
|
2015-03-06 10:30:09 +01:00
|
|
|
SAMBA4_CONF_OPTS += --with-fam
|
|
|
|
SAMBA4_DEPENDENCIES += gamin
|
2014-03-02 13:42:18 +01:00
|
|
|
else
|
2015-03-06 10:30:09 +01:00
|
|
|
SAMBA4_CONF_OPTS += --without-fam
|
2014-03-02 13:42:18 +01:00
|
|
|
endif
|
|
|
|
|
2018-09-15 20:16:30 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_LIBARCHIVE),y)
|
|
|
|
SAMBA4_CONF_OPTS += --with-libarchive
|
|
|
|
SAMBA4_DEPENDENCIES += libarchive
|
|
|
|
else
|
|
|
|
SAMBA4_CONF_OPTS += --without-libarchive
|
|
|
|
endif
|
|
|
|
|
ncurses: remove BR2_PACKAGE_NCURSES_TARGET_{FORM, MENU, PANEL} options
The ncurses sub-options BR2_PACKAGE_NCURSES_TARGET_{FORM,MENU,PANEL}
are currently very badly broken: they only control whether the
libform, libmenu and libpanel libraries are installed in
$(TARGET_DIR), but do absolutely nothing about their installation in
$(STAGING_DIR).
This means that when one of those options is disabled, the
corresponding library is indeed not installed in the target, but is
available in staging. It can therefore be detected by the configure
script of another package and used... even though the library will not
be in the target, causing a runtime failure.
Internally, ncurses.mk uses the "make install" logic of ncurses for
the staging installation, but uses a completely hand-written logic for
the target installation, which is the reason for this
desynchronization between what's installed in staging and target.
When BR2_PACKAGE_NCURSES_WCHAR=y, this also causes some build
failures. Indeed, when BR2_PACKAGE_NCURSES_WCHAR=y, Buildroot creates
some symbolic links lib<foo>.so -> lib<foo>w.so in staging and target,
but only for the lib<foo> that have been enabled by
BR2_PACKAGE_NCURSES_TARGET_{FORM,MENU,PANEL}. Due to this, a package
that for example needed the libmenu library but forgot to select
BR2_PACKAGE_NCURSES_TARGET_MENU was:
- Building fine with BR2_PACKAGE_NCURSES_WCHAR disabled (because
libmenu.so exists in staging), but would fail to run at runtime
because libmenu.so is not in the target.
- Fail to build with BR2_PACKAGE_NCURSES_WCHAR=y because only
libmenuw.so exists, and not the libmenu.so symbolic link.
Since those libraries are small (43K for libform, 21K for libmenu and
8.2K for libpanel), this commit takes the very simple approach of
removing those options, and installing the libraries
unconditionally. It therefore uses the "make install" logic for both
the staging *and* target installation.
In detail, this commit:
- Removes the NCURSES_PROGS variable, not needed since
--without-progs already allows to disable the build and
installation of programs.
- Removes the NCURSES_LIBS-y variable, and replaces it with a single
unconditional assignement to NCURSES_LIBS, only used to create the
lib<foo>w.so -> lib<foo>.so symbolic links when wchar support is
enabled.
- Removes NCURSES_INSTALL_TARGET_CMDS and the functions it was
calling: NCURSES_INSTALL_TARGET_LIBS and
NCURSES_INSTALL_TARGET_PROGS.
- Adds a NCURSES_TARGET_SYMLINK_RESET hook to create the reset ->
tset symbolic link, as was done before.
- Adds a NCURSES_TARGET_CLEANUP_TERMINFO to cleanup the terminfo
files in the target, so that we stay in the same situation in terms
of installed terminfo files.
- Removes the BR2_PACKAGE_NCURSES_TARGET_{FORM,MENU,PANEL} options
from the Config.in files: both their definition and usage.
- Simplifies all the symlink dance for lib<foo> -> lib<foo>w, because
as Yann E. Morin suggested, this dance is only needed in staging, not
in the target. Once binaries have been built, they refer to the
SONAME of the library, which is the lib<foo>w variant (for shared
linking). For static linking and .pc files, it's obvious that we
don't care about them on the target. Therefore the
NCURSES_LINK_LIBS_STATIC, NCURSES_LINK_LIBS_SHARED and
NCURSES_LINK_PC functions no longer take any argument: they always
apply to STAGING_DIR only. NCURSES_LINK_TARGET_LIBS is removed.
It is worth mentioning that adding Config.in.legacy support is *NOT*
necessary. Indeed:
- If they were disabled before this patch, having them in
Config.in.legacy would not trigger the legacy warning.
- If they were enabled before this patch, then the behavior is
unchanged: all libraries are now unconditionally installed. So
there is no point in warning the user.
We double-checked the installed size of a filesystem containing just
ncurses before and after this patch, and the only folder that has its
size changed is /usr/lib, growing from 852 KB to 932 KB in the wchar
enabled case. That's a 80 KB system size increase.
This commit fixes the sngrep build failure and potentially numerous
runtime issues with ncurses.
Fixes:
http://autobuild.buildroot.net/results/7b5db21a6c568e6c6c8fe2b5d5a2f5ca24df510c/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-23 19:08:45 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_NCURSES),y)
|
2015-03-06 11:42:48 +01:00
|
|
|
SAMBA4_CONF_ENV += NCURSES_CONFIG="$(STAGING_DIR)/usr/bin/$(NCURSES_CONFIG_SCRIPTS)"
|
2015-03-06 10:30:09 +01:00
|
|
|
SAMBA4_DEPENDENCIES += ncurses
|
2014-03-02 13:42:18 +01:00
|
|
|
else
|
2015-03-06 10:30:09 +01:00
|
|
|
SAMBA4_CONF_OPTS += --without-regedit
|
2014-03-02 13:42:18 +01:00
|
|
|
endif
|
|
|
|
|
2015-03-05 21:44:09 +01:00
|
|
|
# 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
|
|
|
|
|
2014-03-02 13:42:18 +01:00
|
|
|
define SAMBA4_CONFIGURE_CMDS
|
2017-11-29 03:55:24 +01:00
|
|
|
$(INSTALL) -m 0644 package/samba4/samba4-cache.txt $(@D)/cache.txt;
|
2014-04-23 02:07:58 +02:00
|
|
|
echo 'Checking uname machine type: $(BR2_ARCH)' >>$(@D)/cache.txt;
|
2014-03-02 13:42:18 +01:00
|
|
|
(cd $(@D); \
|
2019-07-22 18:12:13 +02:00
|
|
|
$(SAMBA4_PYTHON) \
|
2014-03-02 13:42:18 +01:00
|
|
|
python_LDFLAGS="" \
|
|
|
|
python_LIBDIR="" \
|
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2014-07-31 17:21:18 +02:00
|
|
|
$(SAMBA4_CONF_ENV) \
|
2014-03-02 13:42:18 +01:00
|
|
|
./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 \
|
2018-09-15 20:16:30 +02:00
|
|
|
--without-gpgme \
|
|
|
|
--without-ldb-lmdb \
|
2014-03-02 13:42:18 +01:00
|
|
|
--disable-glusterfs \
|
2015-03-05 21:44:09 +01:00
|
|
|
--with-cluster-support \
|
2014-05-09 14:31:37 +02:00
|
|
|
--bundled-libraries='!asn1_compile,!compile_et' \
|
2014-09-27 21:32:44 +02:00
|
|
|
$(SAMBA4_CONF_OPTS) \
|
2014-03-02 13:42:18 +01:00
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define SAMBA4_BUILD_CMDS
|
2019-07-22 18:12:13 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(SAMBA4_PYTHON) $(MAKE) -C $(@D)
|
2014-03-02 13:42:18 +01:00
|
|
|
endef
|
|
|
|
|
2015-03-06 13:50:29 +01:00
|
|
|
define SAMBA4_INSTALL_STAGING_CMDS
|
2019-07-22 18:12:13 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(SAMBA4_PYTHON) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
|
2015-03-06 13:50:29 +01:00
|
|
|
endef
|
|
|
|
|
2014-03-02 13:42:18 +01:00
|
|
|
define SAMBA4_INSTALL_TARGET_CMDS
|
2019-07-22 18:12:13 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(SAMBA4_PYTHON) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
|
2014-03-02 13:42:18 +01:00
|
|
|
endef
|
|
|
|
|
2018-09-15 20:16:30 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_SAMBA4_AD_DC),y)
|
|
|
|
SAMBA4_DEPENDENCIES += jansson
|
|
|
|
else
|
2019-07-22 18:12:13 +02:00
|
|
|
SAMBA4_CONF_OPTS += --without-ad-dc --without-json
|
2015-03-05 21:44:09 +01:00
|
|
|
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
|
|
|
|
|
2014-03-02 13:42:18 +01:00
|
|
|
define SAMBA4_INSTALL_INIT_SYSV
|
|
|
|
$(INSTALL) -m 0755 -D package/samba4/S91smb \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S91smb
|
|
|
|
endef
|
|
|
|
|
2018-11-24 21:12:41 +01:00
|
|
|
ifeq ($(BR2_INIT_SYSTEMD),y)
|
|
|
|
SAMBA4_CONF_OPTS += --systemd-install-services
|
|
|
|
SAMBA4_DEPENDENCIES += systemd
|
|
|
|
endif
|
|
|
|
|
2015-05-23 12:14:42 +02:00
|
|
|
define SAMBA4_INSTALL_INIT_SYSTEMD
|
2016-05-16 13:52:30 +02:00
|
|
|
$(INSTALL) -D -m 644 $(@D)/packaging/systemd/samba.conf.tmp \
|
2016-07-02 18:21:31 +02:00
|
|
|
$(TARGET_DIR)/usr/lib/tmpfiles.d/samba.conf
|
|
|
|
printf "d /var/log/samba 755 root root\n" >>$(TARGET_DIR)/usr/lib/tmpfiles.d/samba.conf
|
2015-05-23 12:14:42 +02:00
|
|
|
endef
|
|
|
|
|
2014-03-02 13:42:18 +01:00
|
|
|
$(eval $(generic-package))
|