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