The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / samba4 / samba4.mk
1 ################################################################################
2 #
3 # samba4
4 #
5 ################################################################################
6
7 SAMBA4_VERSION = 4.2.1
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)
16
17 ifeq ($(BR2_PACKAGE_ACL),y)
18 SAMBA4_CONF_OPTS += --with-acl-support
19 SAMBA4_DEPENDENCIES += acl
20 else
21 SAMBA4_CONF_OPTS += --without-acl-support
22 endif
23
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
28 else
29 SAMBA4_CONF_OPTS += --disable-cups
30 endif
31
32 ifeq ($(BR2_PACKAGE_LIBAIO),y)
33 SAMBA4_CONF_OPTS += --with-aio-support
34 SAMBA4_DEPENDENCIES += libaio
35 else
36 SAMBA4_CONF_OPTS += --without-aio-support
37 endif
38
39 ifeq ($(BR2_PACKAGE_DBUS)$(BR2_PACKAGE_AVAHI_DAEMON),yy)
40 SAMBA4_CONF_OPTS += --enable-avahi
41 SAMBA4_DEPENDENCIES += avahi
42 else
43 SAMBA4_CONF_OPTS += --disable-avahi
44 endif
45
46 ifeq ($(BR2_PACKAGE_GAMIN),y)
47 SAMBA4_CONF_OPTS += --with-fam
48 SAMBA4_DEPENDENCIES += gamin
49 else
50 SAMBA4_CONF_OPTS += --without-fam
51 endif
52
53 ifeq ($(BR2_PACKAGE_GETTEXT),y)
54 SAMBA4_CONF_OPTS += --with-gettext=$(STAGING_DIR)/usr
55 SAMBA4_DEPENDENCIES += gettext
56 else
57 SAMBA4_CONF_OPTS += --without-gettext
58 endif
59
60 ifeq ($(BR2_PACKAGE_GNUTLS),y)
61 SAMBA4_CONF_OPTS += --enable-gnutls
62 SAMBA4_DEPENDENCIES += gnutls
63 else
64 SAMBA4_CONF_OPTS += --disable-gnutls
65 endif
66
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
70 else
71 SAMBA4_CONF_OPTS += --without-regedit
72 endif
73
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
80 endef
81 SAMBA4_POST_INSTALL_TARGET_HOOKS += SAMBA4_REMOVE_CTDB_TESTS
82
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;
86         (cd $(@D); \
87                 PYTHON_CONFIG="$(STAGING_DIR)/usr/bin/python-config" \
88                 python_LDFLAGS="" \
89                 python_LIBDIR="" \
90                 $(TARGET_CONFIGURE_OPTS) \
91                 $(SAMBA4_CONF_ENV) \
92                 ./buildtools/bin/waf configure \
93                         --prefix=/usr \
94                         --sysconfdir=/etc \
95                         --localstatedir=/var \
96                         --with-libiconv=$(STAGING_DIR)/usr \
97                         --enable-fhs \
98                         --cross-compile \
99                         --cross-answers=$(@D)/cache.txt \
100                         --hostcc=gcc \
101                         --disable-rpath \
102                         --disable-rpath-install \
103                         --disable-iprint \
104                         --without-pam \
105                         --without-dmapi \
106                         --disable-glusterfs \
107                         --with-cluster-support \
108                         --bundled-libraries='!asn1_compile,!compile_et' \
109                         $(SAMBA4_CONF_OPTS) \
110         )
111 endef
112
113 define SAMBA4_BUILD_CMDS
114         $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
115 endef
116
117 define SAMBA4_INSTALL_STAGING_CMDS
118         $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
119 endef
120
121 define SAMBA4_INSTALL_TARGET_CMDS
122         $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
123 endef
124
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')"
131 endef
132 SAMBA4_POST_INSTALL_TARGET_HOOKS += SAMBA4_BUILD_PYC_FILES
133 endif
134
135 ifeq ($(BR2_PACKAGE_SAMBA4_AD_DC),)
136 SAMBA4_CONF_OPTS += --without-ad-dc
137 endif
138
139 ifeq ($(BR2_PACKAGE_SAMBA4_ADS),y)
140 SAMBA4_CONF_OPTS += --with-ads --with-ldap --with-shared-modules=idmap_ad
141 SAMBA4_DEPENDENCIES += openldap
142 else
143 SAMBA4_CONF_OPTS += --without-ads --without-ldap
144 endif
145
146 ifeq ($(BR2_PACKAGE_SAMBA4_SMBTORTURE),)
147 define SAMBA4_REMOVE_SMBTORTURE
148         rm -f $(TARGET_DIR)/usr/bin/smbtorture
149 endef
150 SAMBA4_POST_INSTALL_TARGET_HOOKS += SAMBA4_REMOVE_SMBTORTURE
151 endif
152
153 define SAMBA4_INSTALL_INIT_SYSV
154         $(INSTALL) -m 0755 -D package/samba4/S91smb \
155                 $(TARGET_DIR)/etc/init.d/S91smb
156 endef
157
158 $(eval $(generic-package))