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