1 ################################################################################
5 ################################################################################
8 SAMBA4_SITE = http://ftp.samba.org/pub/samba
9 SAMBA4_SOURCE = samba-$(SAMBA4_VERSION).tar.gz
10 SAMBA4_INSTALL_STAGING = YES
11 SAMBA4_LICENSE = GPLv3+
12 SAMBA4_LICENSE_FILES = COPYING
13 SAMBA4_DEPENDENCIES = host-e2fsprogs host-heimdal e2fsprogs popt python zlib \
14 $(if $(BR2_PACKAGE_LIBCAP),libcap) \
15 $(if $(BR2_PACKAGE_READLINE),readline)
17 ifeq ($(BR2_PACKAGE_ACL),y)
18 SAMBA4_CONF_OPTS += --with-acl-support
19 SAMBA4_DEPENDENCIES += acl
21 SAMBA4_CONF_OPTS += --without-acl-support
24 ifeq ($(BR2_PACKAGE_CUPS),y)
25 SAMBA4_CONF_ENV += CUPS_CONFIG="$(STAGING_DIR)/usr/bin/cups-config"
26 SAMBA4_CONF_OPTS += --enable-cups
27 SAMBA4_DEPENDENCIES += cups
29 SAMBA4_CONF_OPTS += --disable-cups
32 ifeq ($(BR2_PACKAGE_LIBAIO),y)
33 SAMBA4_CONF_OPTS += --with-aio-support
34 SAMBA4_DEPENDENCIES += libaio
36 SAMBA4_CONF_OPTS += --without-aio-support
39 ifeq ($(BR2_PACKAGE_DBUS)$(BR2_PACKAGE_AVAHI_DAEMON),yy)
40 SAMBA4_CONF_OPTS += --enable-avahi
41 SAMBA4_DEPENDENCIES += avahi
43 SAMBA4_CONF_OPTS += --disable-avahi
46 ifeq ($(BR2_PACKAGE_GAMIN),y)
47 SAMBA4_CONF_OPTS += --with-fam
48 SAMBA4_DEPENDENCIES += gamin
50 SAMBA4_CONF_OPTS += --without-fam
53 ifeq ($(BR2_PACKAGE_GETTEXT),y)
54 SAMBA4_CONF_OPTS += --with-gettext=$(STAGING_DIR)/usr
55 SAMBA4_DEPENDENCIES += gettext
57 SAMBA4_CONF_OPTS += --without-gettext
60 ifeq ($(BR2_PACKAGE_GNUTLS),y)
61 SAMBA4_CONF_OPTS += --enable-gnutls
62 SAMBA4_DEPENDENCIES += gnutls
64 SAMBA4_CONF_OPTS += --disable-gnutls
67 ifeq ($(BR2_PACKAGE_NCURSES_TARGET_FORM)$(BR2_PACKAGE_NCURSES_TARGET_MENU)$(BR2_PACKAGE_NCURSES_TARGET_PANEL),yyy)
68 SAMBA4_CONF_ENV += NCURSES_CONFIG="$(STAGING_DIR)/usr/bin/$(NCURSES_CONFIG_SCRIPTS)"
69 SAMBA4_DEPENDENCIES += ncurses
71 SAMBA4_CONF_OPTS += --without-regedit
74 # The ctdb tests (cluster) need bash and take up some space
75 # They're normally intended for debugging so remove them
76 define SAMBA4_REMOVE_CTDB_TESTS
77 rm -rf $(TARGET_DIR)/usr/lib/ctdb-tests
78 rm -rf $(TARGET_DIR)/usr/share/ctdb-tests
79 rm -f $(TARGET_DIR)/usr/bin/ctdb_run_*tests
81 SAMBA4_POST_INSTALL_TARGET_HOOKS += SAMBA4_REMOVE_CTDB_TESTS
83 define SAMBA4_CONFIGURE_CMDS
84 cp package/samba4/samba4-cache.txt $(@D)/cache.txt;
85 echo 'Checking uname machine type: $(BR2_ARCH)' >>$(@D)/cache.txt;
87 PYTHON_CONFIG="$(STAGING_DIR)/usr/bin/python-config" \
90 $(TARGET_CONFIGURE_OPTS) \
92 ./buildtools/bin/waf configure \
95 --localstatedir=/var \
96 --with-libiconv=$(STAGING_DIR)/usr \
99 --cross-answers=$(@D)/cache.txt \
102 --disable-rpath-install \
106 --disable-glusterfs \
107 --with-cluster-support \
108 --bundled-libraries='!asn1_compile,!compile_et' \
109 $(SAMBA4_CONF_OPTS) \
113 define SAMBA4_BUILD_CMDS
114 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
117 define SAMBA4_INSTALL_STAGING_CMDS
118 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
121 define SAMBA4_INSTALL_TARGET_CMDS
122 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
125 # Samba just installs .py files so the purge causes problems with some tools
126 ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y)
127 define SAMBA4_BUILD_PYC_FILES
128 PYTHONPATH="$(PYTHON_PATH)" \
129 $(HOST_DIR)/usr/bin/python -c "import compileall; \
130 compileall.compile_dir('$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages/samba')"
132 SAMBA4_POST_INSTALL_TARGET_HOOKS += SAMBA4_BUILD_PYC_FILES
135 ifeq ($(BR2_PACKAGE_SAMBA4_AD_DC),)
136 SAMBA4_CONF_OPTS += --without-ad-dc
139 ifeq ($(BR2_PACKAGE_SAMBA4_ADS),y)
140 SAMBA4_CONF_OPTS += --with-ads --with-ldap --with-shared-modules=idmap_ad
141 SAMBA4_DEPENDENCIES += openldap
143 SAMBA4_CONF_OPTS += --without-ads --without-ldap
146 ifeq ($(BR2_PACKAGE_SAMBA4_SMBTORTURE),)
147 define SAMBA4_REMOVE_SMBTORTURE
148 rm -f $(TARGET_DIR)/usr/bin/smbtorture
150 SAMBA4_POST_INSTALL_TARGET_HOOKS += SAMBA4_REMOVE_SMBTORTURE
153 define SAMBA4_INSTALL_INIT_SYSV
154 $(INSTALL) -m 0755 -D package/samba4/S91smb \
155 $(TARGET_DIR)/etc/init.d/S91smb
158 $(eval $(generic-package))