samba4: bump to version 4.5.4
[buildroot-gz.git] / package / samba4 / samba4.mk
blob7eacf8a0858e0d253e3a14db349ce13d6470cfd2
1 ################################################################################
3 # samba4
5 ################################################################################
7 SAMBA4_VERSION = 4.5.4
8 SAMBA4_SITE = http://ftp.samba.org/pub/samba/stable
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 = \
14 host-e2fsprogs host-heimdal host-python \
15 e2fsprogs popt python zlib \
16 $(if $(BR2_PACKAGE_LIBAIO),libaio) \
17 $(if $(BR2_PACKAGE_LIBCAP),libcap) \
18 $(if $(BR2_PACKAGE_READLINE),readline)
20 ifeq ($(BR2_PACKAGE_ACL),y)
21 SAMBA4_CONF_OPTS += --with-acl-support
22 SAMBA4_DEPENDENCIES += acl
23 else
24 SAMBA4_CONF_OPTS += --without-acl-support
25 endif
27 ifeq ($(BR2_PACKAGE_CUPS),y)
28 SAMBA4_CONF_ENV += CUPS_CONFIG="$(STAGING_DIR)/usr/bin/cups-config"
29 SAMBA4_CONF_OPTS += --enable-cups
30 SAMBA4_DEPENDENCIES += cups
31 else
32 SAMBA4_CONF_OPTS += --disable-cups
33 endif
35 ifeq ($(BR2_PACKAGE_DBUS)$(BR2_PACKAGE_AVAHI_DAEMON),yy)
36 SAMBA4_CONF_OPTS += --enable-avahi
37 SAMBA4_DEPENDENCIES += avahi
38 else
39 SAMBA4_CONF_OPTS += --disable-avahi
40 endif
42 ifeq ($(BR2_PACKAGE_GAMIN),y)
43 SAMBA4_CONF_OPTS += --with-fam
44 SAMBA4_DEPENDENCIES += gamin
45 else
46 SAMBA4_CONF_OPTS += --without-fam
47 endif
49 ifeq ($(BR2_PACKAGE_GETTEXT),y)
50 SAMBA4_DEPENDENCIES += gettext
51 else
52 SAMBA4_CONF_OPTS += --without-gettext
53 endif
55 ifeq ($(BR2_PACKAGE_GNUTLS),y)
56 SAMBA4_CONF_OPTS += --enable-gnutls
57 SAMBA4_DEPENDENCIES += gnutls
58 else
59 SAMBA4_CONF_OPTS += --disable-gnutls
60 endif
62 ifeq ($(BR2_PACKAGE_NCURSES_TARGET_FORM)$(BR2_PACKAGE_NCURSES_TARGET_MENU)$(BR2_PACKAGE_NCURSES_TARGET_PANEL),yyy)
63 SAMBA4_CONF_ENV += NCURSES_CONFIG="$(STAGING_DIR)/usr/bin/$(NCURSES_CONFIG_SCRIPTS)"
64 SAMBA4_DEPENDENCIES += ncurses
65 else
66 SAMBA4_CONF_OPTS += --without-regedit
67 endif
69 # The ctdb tests (cluster) need bash and take up some space
70 # They're normally intended for debugging so remove them
71 define SAMBA4_REMOVE_CTDB_TESTS
72 rm -rf $(TARGET_DIR)/usr/lib/ctdb-tests
73 rm -rf $(TARGET_DIR)/usr/share/ctdb-tests
74 rm -f $(TARGET_DIR)/usr/bin/ctdb_run_*tests
75 endef
76 SAMBA4_POST_INSTALL_TARGET_HOOKS += SAMBA4_REMOVE_CTDB_TESTS
78 define SAMBA4_CONFIGURE_CMDS
79 cp package/samba4/samba4-cache.txt $(@D)/cache.txt;
80 echo 'Checking uname machine type: $(BR2_ARCH)' >>$(@D)/cache.txt;
81 (cd $(@D); \
82 PYTHON_CONFIG="$(STAGING_DIR)/usr/bin/python-config" \
83 python_LDFLAGS="" \
84 python_LIBDIR="" \
85 $(TARGET_CONFIGURE_OPTS) \
86 $(SAMBA4_CONF_ENV) \
87 ./buildtools/bin/waf configure \
88 --prefix=/usr \
89 --sysconfdir=/etc \
90 --localstatedir=/var \
91 --with-libiconv=$(STAGING_DIR)/usr \
92 --enable-fhs \
93 --cross-compile \
94 --cross-answers=$(@D)/cache.txt \
95 --hostcc=gcc \
96 --disable-rpath \
97 --disable-rpath-install \
98 --disable-iprint \
99 --without-pam \
100 --without-dmapi \
101 --disable-glusterfs \
102 --with-cluster-support \
103 --bundled-libraries='!asn1_compile,!compile_et' \
104 $(SAMBA4_CONF_OPTS) \
106 endef
108 define SAMBA4_BUILD_CMDS
109 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
110 endef
112 define SAMBA4_INSTALL_STAGING_CMDS
113 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
114 endef
116 define SAMBA4_INSTALL_TARGET_CMDS
117 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
118 endef
120 ifeq ($(BR2_PACKAGE_SAMBA4_AD_DC),)
121 SAMBA4_CONF_OPTS += --without-ad-dc
122 endif
124 ifeq ($(BR2_PACKAGE_SAMBA4_ADS),y)
125 SAMBA4_CONF_OPTS += --with-ads --with-ldap --with-shared-modules=idmap_ad
126 SAMBA4_DEPENDENCIES += openldap
127 else
128 SAMBA4_CONF_OPTS += --without-ads --without-ldap
129 endif
131 ifeq ($(BR2_PACKAGE_SAMBA4_SMBTORTURE),)
132 define SAMBA4_REMOVE_SMBTORTURE
133 rm -f $(TARGET_DIR)/usr/bin/smbtorture
134 endef
135 SAMBA4_POST_INSTALL_TARGET_HOOKS += SAMBA4_REMOVE_SMBTORTURE
136 endif
138 define SAMBA4_INSTALL_INIT_SYSV
139 $(INSTALL) -m 0755 -D package/samba4/S91smb \
140 $(TARGET_DIR)/etc/init.d/S91smb
141 endef
143 define SAMBA4_INSTALL_INIT_SYSTEMD
144 $(INSTALL) -D -m 644 $(@D)/packaging/systemd/nmb.service \
145 $(TARGET_DIR)/usr/lib/systemd/system/nmb.service
146 $(INSTALL) -D -m 644 $(@D)/packaging/systemd/smb.service \
147 $(TARGET_DIR)/usr/lib/systemd/system/smb.service
148 $(INSTALL) -D -m 644 $(@D)/packaging/systemd/winbind.service \
149 $(TARGET_DIR)/usr/lib/systemd/system/winbind.service
150 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
151 ln -sf ../../../../usr/lib/systemd/system/nmb.service \
152 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nmb.service
153 ln -sf ../../../../usr/lib/systemd/system/smb.service \
154 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/smb.service
155 ln -sf ../../../../usr/lib/systemd/system/winbind.service \
156 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/winbind.service
157 $(INSTALL) -D -m 644 $(@D)/packaging/systemd/samba.conf.tmp \
158 $(TARGET_DIR)/usr/lib/tmpfiles.d/samba.conf
159 printf "d /var/log/samba 755 root root\n" >>$(TARGET_DIR)/usr/lib/tmpfiles.d/samba.conf
160 endef
162 $(eval $(generic-package))