summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity/samba/samba_4.8.11.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-connectivity/samba/samba_4.8.11.bb')
-rw-r--r--meta-networking/recipes-connectivity/samba/samba_4.8.11.bb323
1 files changed, 323 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/samba/samba_4.8.11.bb b/meta-networking/recipes-connectivity/samba/samba_4.8.11.bb
new file mode 100644
index 000000000..8b29d9bad
--- /dev/null
+++ b/meta-networking/recipes-connectivity/samba/samba_4.8.11.bb
@@ -0,0 +1,323 @@
1HOMEPAGE = "https://www.samba.org/"
2SECTION = "console/network"
3
4LICENSE = "GPL-3.0+ & LGPL-3.0+ & GPL-2.0+"
5LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
6 file://${COREBASE}/meta/files/common-licenses/LGPL-3.0;md5=bfccfe952269fff2b407dd11f2f3083b \
7 file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 "
8
9SAMBA_MIRROR = "http://samba.org/samba/ftp"
10MIRRORS += "\
11${SAMBA_MIRROR} http://mirror.internode.on.net/pub/samba \n \
12${SAMBA_MIRROR} http://www.mirrorservice.org/sites/ftp.samba.org \n \
13"
14
15SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \
16 file://smb.conf \
17 file://16-do-not-check-xsltproc-manpages.patch \
18 file://20-do-not-import-target-module-while-cross-compile.patch \
19 file://21-add-config-option-without-valgrind.patch \
20 file://netdb_defines.patch \
21 file://glibc_only.patch \
22 file://iconv-4.7.0.patch \
23 file://dnsserver-4.7.0.patch \
24 file://smb_conf-4.7.0.patch \
25 file://volatiles.03_samba \
26 "
27SRC_URI_append_libc-musl = " \
28 file://samba-pam.patch \
29 file://samba-4.3.9-remove-getpwent_r.patch \
30 file://cmocka-uintptr_t.patch \
31 "
32
33SRC_URI[md5sum] = "de61611075e97ea98140a42d9189d9a5"
34SRC_URI[sha256sum] = "d294a8d7455d7d252d7bafc9c474855ea6e0ebe559c3babcd303a5c24e58710a"
35
36UPSTREAM_CHECK_REGEX = "samba\-(?P<pver>4\.8(\.\d+)+).tar.gz"
37
38inherit systemd waf-samba cpan-base perlnative update-rc.d
39# remove default added RDEPENDS on perl
40RDEPENDS_${PN}_remove = "perl"
41
42DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libbsd libaio libpam"
43
44inherit distro_features_check
45REQUIRED_DISTRO_FEATURES = "pam"
46
47DEPENDS_append_libc-musl = " libtirpc"
48CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
49LDFLAGS_append_libc-musl = " -ltirpc"
50
51INITSCRIPT_NAME = "samba"
52INITSCRIPT_PARAMS = "start 20 3 5 . stop 20 0 1 6 ."
53
54SYSTEMD_PACKAGES = "${PN}-base ${PN}-ad-dc winbind"
55SYSTEMD_SERVICE_${PN}-base = "nmb.service smb.service"
56SYSTEMD_SERVICE_${PN}-ad-dc = "${@bb.utils.contains('PACKAGECONFIG', 'ad-dc', 'samba.service', '', d)}"
57SYSTEMD_SERVICE_winbind = "winbind.service"
58
59# There are prerequisite settings to enable ad-dc, so disable the service by default.
60# Reference:
61# https://wiki.samba.org/index.php/Setting_up_Samba_as_an_Active_Directory_Domain_Controller
62SYSTEMD_AUTO_ENABLE_${PN}-ad-dc = "disable"
63
64# Use krb5. Build active domain controller.
65#
66PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd zeroconf', d)} \
67 acl ad-dc cups gnutls ldap mitkrb5 \
68"
69
70RDEPENDS_${PN}-ctdb-tests += "bash util-linux-getopt"
71
72PACKAGECONFIG[acl] = "--with-acl-support,--without-acl-support,acl"
73PACKAGECONFIG[fam] = "--with-fam,--without-fam,gamin"
74PACKAGECONFIG[cups] = "--enable-cups,--disable-cups,cups"
75PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
76PACKAGECONFIG[sasl] = ",,cyrus-sasl"
77PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd"
78PACKAGECONFIG[dmapi] = "--with-dmapi,--without-dmapi,dmapi"
79PACKAGECONFIG[zeroconf] = "--enable-avahi,--disable-avahi,avahi"
80PACKAGECONFIG[valgrind] = ",--without-valgrind,valgrind,"
81PACKAGECONFIG[lttng] = "--with-lttng, --without-lttng,lttng-ust"
82PACKAGECONFIG[archive] = "--with-libarchive, --without-libarchive, libarchive"
83
84# Building the AD (Active Directory) DC (Domain Controller) requires GnuTLS,
85# And ad-dc doesn't work with mitkrb5 for versions prior to 4.7.0 according to:
86# http://samba.2283325.n4.nabble.com/samba-4-6-6-Unknown-dependency-kdc-in-service-kdc-objlist-td4722096.html
87# So the working combination is:
88# 1) ad-dc: enable, gnutls: enable, mitkrb5: disable
89# 2) ad-dc: disable, gnutls: enable/disable, mitkrb5: enable
90#
91# We are now at 4.7.0, so take the above with a grain of salt. We do not need to know where
92# krb5kdc is unless ad-dc is enabled, but we tell configure anyhow.
93#
94PACKAGECONFIG[ad-dc] = "--with-experimental-mit-ad-dc,--without-ad-dc,,"
95PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls,"
96PACKAGECONFIG[mitkrb5] = "--with-system-mitkrb5 --with-system-mitkdc=/usr/sbin/krb5kdc,,krb5,"
97
98SAMBA4_IDMAP_MODULES="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2"
99SAMBA4_PDB_MODULES="pdb_tdbsam,${@bb.utils.contains('PACKAGECONFIG', 'ldap', 'pdb_ldap,', '', d)}pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4"
100SAMBA4_AUTH_MODULES="auth_unix,auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4"
101SAMBA4_MODULES="${SAMBA4_IDMAP_MODULES},${SAMBA4_PDB_MODULES},${SAMBA4_AUTH_MODULES}"
102
103# These libraries are supposed to replace others supplied by packages, but decorate the names of
104# .so files so there will not be a conflict. This is not done consistantly, so be very careful
105# when adding to this list.
106#
107SAMBA4_LIBS="heimdal,cmocka,ldb,pyldb-util,NONE"
108
109# interim packages: As long as ldb/pyldb-util are in SAMBA4_LIBS we need to pack
110# bundled libraries in seperate packages. Otherwise they are auto-packed in
111# package 'samba' which RDEPENDS on lots of packages not wanted e.g autostarting
112# nmbd/smbd daemons
113# Once 'ldb,pyldb-util' are removed from SAMBA4_LIBS the bundled packages can
114# be removed again.
115PACKAGES =+ "${PN}-bundled-ldb ${PN}-bundled-pyldb-util"
116FILES_${PN}-bundled-ldb = "${libdir}/samba/libldb${SOLIBS}"
117FILES_${PN}-bundled-pyldb-util = "${libdir}/samba/libpyldb-util${SOLIBS}"
118
119EXTRA_OECONF += "--enable-fhs \
120 --with-piddir=/run \
121 --with-sockets-dir=/run/samba \
122 --with-modulesdir=${libdir}/samba \
123 --with-lockdir=${localstatedir}/lib/samba \
124 --with-cachedir=${localstatedir}/lib/samba \
125 --disable-rpath-install \
126 --with-shared-modules=${SAMBA4_MODULES} \
127 --bundled-libraries=${SAMBA4_LIBS} \
128 ${@oe.utils.conditional('TARGET_ARCH', 'x86_64', '', '--disable-glusterfs', d)} \
129 --with-cluster-support \
130 --with-profiling-data \
131 --with-libiconv=${STAGING_DIR_HOST}${prefix} \
132 --with-pam --with-pammodulesdir=${base_libdir}/security \
133 "
134
135LDFLAGS += "-Wl,-z,relro,-z,now ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}"
136
137do_install_append() {
138 for section in 1 5 7; do
139 install -d ${D}${mandir}/man$section
140 install -m 0644 ctdb/doc/*.$section ${D}${mandir}/man$section
141 done
142 for section in 1 5 7 8; do
143 install -d ${D}${mandir}/man$section
144 install -m 0644 docs/manpages/*.$section ${D}${mandir}/man$section
145 done
146
147 install -d ${D}${systemd_system_unitdir}
148 install -m 0644 ${S}/bin/default/packaging/systemd/*.service ${D}${systemd_system_unitdir}/
149 sed -e 's,\(ExecReload=\).*\(/kill\),\1${base_bindir}\2,' \
150 -e 's,/etc/sysconfig/samba,${sysconfdir}/default/samba,' \
151 -i ${D}${systemd_system_unitdir}/*.service
152
153 if [ "${@bb.utils.contains('PACKAGECONFIG', 'ad-dc', 'yes', 'no', d)}" = "no" ]; then
154 rm -f ${D}${systemd_system_unitdir}/samba.service
155 fi
156
157 install -d ${D}${sysconfdir}/tmpfiles.d
158 install -m644 packaging/systemd/samba.conf.tmp ${D}${sysconfdir}/tmpfiles.d/samba.conf
159 echo "d ${localstatedir}/log/samba 0755 root root -" \
160 >> ${D}${sysconfdir}/tmpfiles.d/samba.conf
161 install -d ${D}${sysconfdir}/init.d
162 install -m 0755 packaging/sysv/samba.init ${D}${sysconfdir}/init.d/samba
163 sed -e 's,/opt/samba/bin,${sbindir},g' \
164 -e 's,/opt/samba/smb.conf,${sysconfdir}/samba/smb.conf,g' \
165 -e 's,/opt/samba/log,${localstatedir}/log/samba,g' \
166 -e 's,/etc/init.d/samba.server,${sysconfdir}/init.d/samba,g' \
167 -e 's,/usr/bin,${base_bindir},g' \
168 -i ${D}${sysconfdir}/init.d/samba
169
170 install -d ${D}${sysconfdir}/samba
171 echo "127.0.0.1 localhost" > ${D}${sysconfdir}/samba/lmhosts
172 install -m644 ${WORKDIR}/smb.conf ${D}${sysconfdir}/samba/smb.conf
173 install -D -m 644 ${WORKDIR}/volatiles.03_samba ${D}${sysconfdir}/default/volatiles/03_samba
174
175 install -d ${D}${sysconfdir}/default
176 install -m644 packaging/systemd/samba.sysconfig ${D}${sysconfdir}/default/samba
177
178 # install ctdb config file and test cases
179 install -D -m 0644 ${S}/ctdb/tests/onnode/nodes ${D}${sysconfdir}/ctdb/nodes
180 # the items are from ctdb/tests/run_tests.sh
181 for d in onnode takeover tool eventscripts cunit simple complex; do
182 testdir=${D}${datadir}/ctdb-tests/$d
183 install -d $testdir
184 cp ${S}/ctdb/tests/$d/*.sh $testdir
185 cp -r ${S}/ctdb/tests/$d/scripts ${S}/ctdb/tests/$d/stubs $testdir || true
186 done
187
188 # fix file-rdeps qa warning
189 if [ -f ${D}${bindir}/onnode ]; then
190 sed -i 's:\(#!/bin/\)bash:\1sh:' ${D}${bindir}/onnode
191 fi
192
193 chmod 0750 ${D}${sysconfdir}/sudoers.d
194 rm -rf ${D}/run ${D}${localstatedir}/run ${D}${localstatedir}/log
195}
196
197PACKAGES =+ "${PN}-python ${PN}-pidl \
198 ${PN}-dsdb-modules ${PN}-testsuite registry-tools \
199 winbind \
200 ${PN}-common ${PN}-base ${PN}-ad-dc ${PN}-ctdb-tests \
201 smbclient ${PN}-client ${PN}-server ${PN}-test"
202
203python samba_populate_packages() {
204 def module_hook(file, pkg, pattern, format, basename):
205 pn = d.getVar('PN')
206 d.appendVar('RRECOMMENDS_%s-base' % pn, ' %s' % pkg)
207
208 mlprefix = d.getVar('MLPREFIX') or ''
209 pam_libdir = d.expand('${base_libdir}/security')
210 pam_pkgname = mlprefix + 'pam-plugin%s'
211 do_split_packages(d, pam_libdir, '^pam_(.*)\.so$', pam_pkgname, 'PAM plugin for %s', extra_depends='', prepend=True)
212
213 libdir = d.getVar('libdir')
214 do_split_packages(d, libdir, '^lib(.*)\.so\..*$', 'lib%s', 'Samba %s library', extra_depends='${PN}-common', prepend=True, allow_links=True)
215 pkglibdir = '%s/samba' % libdir
216 do_split_packages(d, pkglibdir, '^lib(.*)\.so$', 'lib%s', 'Samba %s library', extra_depends='${PN}-common', prepend=True)
217 moduledir = '%s/samba/auth' % libdir
218 do_split_packages(d, moduledir, '^(.*)\.so$', 'samba-auth-%s', 'Samba %s authentication backend', hook=module_hook, extra_depends='', prepend=True)
219 moduledir = '%s/samba/pdb' % libdir
220 do_split_packages(d, moduledir, '^(.*)\.so$', 'samba-pdb-%s', 'Samba %s password backend', hook=module_hook, extra_depends='', prepend=True)
221}
222
223PACKAGESPLITFUNCS_prepend = "samba_populate_packages "
224PACKAGES_DYNAMIC = "samba-auth-.* samba-pdb-.*"
225
226RDEPENDS_${PN} += "${PN}-base ${PN}-python ${PN}-dsdb-modules"
227RDEPENDS_${PN}-python += "pytalloc python-tdb"
228
229FILES_${PN}-base = "${sbindir}/nmbd \
230 ${sbindir}/smbd \
231 ${sysconfdir}/init.d \
232 ${systemd_system_unitdir}/nmb.service \
233 ${systemd_system_unitdir}/smb.service"
234
235FILES_${PN}-ad-dc = "${sbindir}/samba \
236 ${systemd_system_unitdir}/samba.service \
237 ${libdir}/krb5/plugins/kdb/samba.so \
238"
239RDEPENDS_${PN}-ad-dc = "krb5-kdc"
240
241FILES_${PN}-ctdb-tests = "${bindir}/ctdb_run_tests \
242 ${bindir}/ctdb_run_cluster_tests \
243 ${sysconfdir}/ctdb/nodes \
244 ${datadir}/ctdb-tests \
245 ${datadir}/ctdb/tests \
246 ${localstatedir}/lib/ctdb \
247 "
248
249FILES_${BPN}-common = "${sysconfdir}/default \
250 ${sysconfdir}/samba \
251 ${sysconfdir}/tmpfiles.d \
252 ${localstatedir}/lib/samba \
253 ${localstatedir}/spool/samba \
254"
255
256FILES_${PN} += "${libdir}/vfs/*.so \
257 ${libdir}/charset/*.so \
258 ${libdir}/*.dat \
259 ${libdir}/auth/*.so \
260"
261
262FILES_${PN}-dsdb-modules = "${libdir}/samba/ldb"
263
264FILES_${PN}-testsuite = "${bindir}/gentest \
265 ${bindir}/locktest \
266 ${bindir}/masktest \
267 ${bindir}/ndrdump \
268 ${bindir}/smbtorture"
269
270FILES_registry-tools = "${bindir}/regdiff \
271 ${bindir}/regpatch \
272 ${bindir}/regshell \
273 ${bindir}/regtree"
274
275FILES_winbind = "${sbindir}/winbindd \
276 ${bindir}/wbinfo \
277 ${bindir}/ntlm_auth \
278 ${libdir}/samba/idmap \
279 ${libdir}/samba/nss_info \
280 ${libdir}/winbind_krb5_locator.so \
281 ${libdir}/winbind-krb5-localauth.so \
282 ${sysconfdir}/init.d/winbind \
283 ${systemd_system_unitdir}/winbind.service"
284
285FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
286
287FILES_smbclient = "${bindir}/cifsdd \
288 ${bindir}/rpcclient \
289 ${bindir}/smbcacls \
290 ${bindir}/smbclient \
291 ${bindir}/smbcquotas \
292 ${bindir}/smbget \
293 ${bindir}/smbspool \
294 ${bindir}/smbtar \
295 ${bindir}/smbtree \
296 ${libdir}/samba/smbspool_krb5_wrapper"
297
298RDEPENDS_${PN}-pidl_append = " perl"
299FILES_${PN}-pidl = "${bindir}/pidl ${datadir}/perl5/Parse"
300
301RDEPENDS_${PN}-client = "\
302 smbclient \
303 winbind \
304 registry-tools \
305 ${PN}-pidl \
306 "
307
308ALLOW_EMPTY_${PN}-client = "1"
309
310RDEPENDS_${PN}-server = "\
311 ${PN} \
312 winbind \
313 registry-tools \
314 "
315
316ALLOW_EMPTY_${PN}-server = "1"
317
318RDEPENDS_${PN}-test = "\
319 ${PN}-ctdb-tests \
320 ${PN}-testsuite \
321 "
322
323ALLOW_EMPTY_${PN}-test = "1"