Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-fs/samba/, net-fs/samba/files/
Date: Tue, 09 Apr 2019 06:05:50
Message-Id: 1554789934.fa902078740e4df285dd222d95352b6cebeb7fc5.polynomial-c@gentoo
1 commit: fa902078740e4df285dd222d95352b6cebeb7fc5
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 9 05:32:07 2019 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 9 06:05:34 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa902078
7
8 net-fs/samba: Bump to versions 4.9.6 and 4.10.2
9
10 apply patch to v4.10.2 fixing builds with USE="-gnutls"
11
12 Bug: https://bugs.gentoo.org/675694
13 Package-Manager: Portage-2.3.62, Repoman-2.3.12
14 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
15
16 net-fs/samba/Manifest | 2 +
17 .../samba-4.10.0-disable_gnutls_build_fix.patch | 32 +++
18 net-fs/samba/samba-4.10.2.ebuild | 307 +++++++++++++++++++++
19 net-fs/samba/samba-4.9.6.ebuild | 305 ++++++++++++++++++++
20 4 files changed, 646 insertions(+)
21
22 diff --git a/net-fs/samba/Manifest b/net-fs/samba/Manifest
23 index 8337a39063d..9f412a59f1e 100644
24 --- a/net-fs/samba/Manifest
25 +++ b/net-fs/samba/Manifest
26 @@ -1,5 +1,6 @@
27 DIST samba-4.10.0.tar.gz 18270804 BLAKE2B 53faf392aa4d09412f3d525410e290385f796dd7ef16e48d403ce8ff0466150312992c7459adee21ebf4c217c67a77d244b69f706dae16245058670a2ccd2087 SHA512 e82a8ec78cea666a653bddab066eaa22382f5b016b38f7618492e39f470d6f4c3ddd6dc21e9f0e9fde73ab98c4dd3da1a3823fd457f085ac14c36070b447ac90
28 DIST samba-4.10.1.tar.gz 18280677 BLAKE2B e14142d51e35d0745d21832825af59216032df5316db4adb39044e3121911ac06bc3d7070c9a03f7fdda03e18f537293e9e3a4c4a78bd1c3c93244d23171ca39 SHA512 cfd86999d2eacb7700f03a25112211f4c79f64685d758744f690046728b5f5d66e4699d6cc9dc3e1ae108eb630ed18d9f62791ca101daabcebafa3cca2b3d838
29 +DIST samba-4.10.2.tar.gz 18280710 BLAKE2B f15b117d1159dfa6cd279c5011629d688fcfba94a2ca8184a827d0787a31f76a38f46b355454b916f2e62c0a88109b86664f6bb16fc0e23d0f61d09908e587cd SHA512 3d146ea12567ebb02a7babcad779b82339ffbfb19f6f2be5cac33eb18af2c9b546dc1cd910072a5c9e152ba9c4a632ed6870c48a8f6ad9d04304b130f240a4bf
30 DIST samba-4.5.11-disable-python-patches.tar.xz 6292 BLAKE2B c2a32a1059a02bc1c87ce5f604cbc5878c654b8f693c8486b5ba63b37513444915a7b6389fe82b7e31ab2f9577dd8462eddba60b4f4f756b4ed1145ce7bd90ae SHA512 f0e3076e3e1ecaae3f06b3ef30efc81719fb3f63a1041dcbdae4b62ca4cf693732f9eb16f047d046d4930136fed82194e82b455ea888e12cf845b3e6a122d57d
31 DIST samba-4.5.16.tar.gz 21024396 BLAKE2B e737559fb748044076608fa233700eb54c7e1c56bc234763f062b6341a179cc78a4a8cdf9f3d6f4d7f3cf8a79f846852ddd5cc753a468c3adb3a0451e1809ed9 SHA512 de8a41013cfb5ef3adcb290efd97a78a5de876d90ad05764d631f14e663a1849bb53e4ac394b46c906f1109be5748fee9316407a659c57007d36851ae8adcd7f
32 DIST samba-4.7.12.tar.gz 16923189 BLAKE2B 98ea5e535482a4cdfeb4f9ad70bc8c40bb6d5a8920ce9bc6dda84f20698245c3c5d472a5f79984efc81f9c32d1d1e72b1fcdffb137e3a27634f4c521a1d46a48 SHA512 951dfc0ea7130da9d9aa3069ca276e630d67171a1995dba368459e0cdf00337d0f6271827bffec694371010614a1a7ce2349840ddedd0231315f6a56dce2fcac
33 @@ -7,3 +8,4 @@ DIST samba-4.8.6.tar.gz 17723841 BLAKE2B 38da52e14b4417f26462eef2226c4498e54d2c2
34 DIST samba-4.8.9.tar.gz 17750151 BLAKE2B 09f350be7f262889708c1b8f779c0e003cc292e0de2afb19f35ec12d43c4c5874151e984699218a563a11eb24b13f1af33607d2accfe699fb0b5f6bdb1b9b367 SHA512 733eb769e21fc563d4deef17c54de025d05ceec85f8b16513bbeefdb3cb99c3611027e049014d3c29cb6463ce2660be92c97f8b5f741a6b67424c8f329a88ea4
35 DIST samba-4.9.4.tar.gz 18053738 BLAKE2B 337444e55fc8a8864e3960609719087e64e7d14faaf150c510b9011f67ffdc8a9bd6533c60be938e742db8a2e5401a065e7d14fae0480ee7a996a1f71ef0448d SHA512 ecd9937caa12d409b9b4cf34982b1670346fa64c7ecd111b390e296771476e13eb7b868997bfe489f36b7bdc5c9fc3af42cd5ad276e9d85aaedfa8ac4cfc0617
36 DIST samba-4.9.5.tar.gz 18065757 BLAKE2B 541b2534cdfb94a155aee629645bb4f1cbe429c6cb4f3170973807c4c5d2728013137eb65e478da763169315e0fc720f5dc54a70f7f9dcce4e2d5b69271a82cd SHA512 0ce49721dcd1b16148448bdf516c42f8fdeb3cb48e7fa8113fac508f8585251ead23d5b679f99eb7925e7a6fbedc2da75d339946b0cecb15698f3ea0cb542750
37 +DIST samba-4.9.6.tar.gz 18068196 BLAKE2B 03a04abb430abc4b7ba6fc5ade8690c215948d24fe1044d79c2dd1f8242b6708f0618045e37ad73114413dcef70bcf45de15f358a0e012cecfea045b9ab9165c SHA512 462774e60f0165aa445821795c373ab6845ac2790578a68e84c0c82f761ddf29bf5186106a95f394e24b8ef7393d7abe003f95e72f5c5892bbf992f58e350531
38
39 diff --git a/net-fs/samba/files/samba-4.10.0-disable_gnutls_build_fix.patch b/net-fs/samba/files/samba-4.10.0-disable_gnutls_build_fix.patch
40 new file mode 100644
41 index 00000000000..12b2df3a597
42 --- /dev/null
43 +++ b/net-fs/samba/files/samba-4.10.0-disable_gnutls_build_fix.patch
44 @@ -0,0 +1,32 @@
45 +From 41eeabcb0175659aebf6d480c43fb64310f37d9c Mon Sep 17 00:00:00 2001
46 +From: Andrew Bartlett <abartlet@×××××.org>
47 +Date: Wed, 20 Mar 2019 13:57:50 +1300
48 +Subject: [PATCH] build: Allow build when --disable-gnutls is set
49 +
50 +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13844
51 +
52 +Signed-off-by: Andrew Bartlett <abartlet@×××××.org>
53 +---
54 + lib/mscat/wscript | 6 +++++-
55 + 1 file changed, 5 insertions(+), 1 deletion(-)
56 +
57 +diff --git a/lib/mscat/wscript b/lib/mscat/wscript
58 +index 7ca9ef567ee..4d1f752a3c1 100644
59 +--- a/lib/mscat/wscript
60 ++++ b/lib/mscat/wscript
61 +@@ -12,7 +12,11 @@ def configure(conf):
62 + if not conf.find_program('asn1Parser', var='ASN1PARSER'):
63 + Logs.warn('WARNING: ans1Parser hasn\'t been found! Please install it (e.g. libtasn1-bin)')
64 +
65 +- conf.CHECK_FUNCS_IN('gnutls_pkcs7_get_embedded_data_oid', 'gnutls')
66 ++ # GnuTLS is currently able to be disabled
67 ++ if conf.env.enable_gnutls:
68 ++ conf.CHECK_FUNCS_IN('gnutls_pkcs7_get_embedded_data_oid', 'gnutls')
69 ++ else:
70 ++ Logs.warn('WARNING: gnutls disabled so dumpmscat will not be built')
71 +
72 + def build(bld):
73 + if (bld.CONFIG_SET('HAVE_LIBTASN1') and
74 +--
75 +2.11.0
76 +
77
78 diff --git a/net-fs/samba/samba-4.10.2.ebuild b/net-fs/samba/samba-4.10.2.ebuild
79 new file mode 100644
80 index 00000000000..4a4d425c969
81 --- /dev/null
82 +++ b/net-fs/samba/samba-4.10.2.ebuild
83 @@ -0,0 +1,307 @@
84 +# Copyright 1999-2019 Gentoo Authors
85 +# Distributed under the terms of the GNU General Public License v2
86 +
87 +EAPI=6
88 +PYTHON_COMPAT=( python3_{4,5,6,7} )
89 +PYTHON_REQ_USE='threads(+),xml(+)'
90 +
91 +inherit python-single-r1 waf-utils multilib-minimal linux-info systemd pam
92 +
93 +MY_PV="${PV/_rc/rc}"
94 +MY_P="${PN}-${MY_PV}"
95 +
96 +SRC_PATH="stable"
97 +[[ ${PV} = *_rc* ]] && SRC_PATH="rc"
98 +
99 +SRC_URI="mirror://samba/${SRC_PATH}/${MY_P}.tar.gz"
100 +[[ ${PV} = *_rc* ]] || \
101 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
102 +
103 +DESCRIPTION="Samba Suite Version 4"
104 +HOMEPAGE="https://www.samba.org/"
105 +LICENSE="GPL-3"
106 +
107 +SLOT="0"
108 +
109 +IUSE="acl addc addns ads ceph client cluster cups debug dmapi fam gnutls gpg iprint json ldap
110 +pam python quota selinux syslog system-heimdal +system-mitkrb5 systemd test winbind zeroconf"
111 +
112 +MULTILIB_WRAPPED_HEADERS=(
113 + /usr/include/samba-4.0/policy.h
114 + /usr/include/samba-4.0/dcerpc_server.h
115 + /usr/include/samba-4.0/ctdb.h
116 + /usr/include/samba-4.0/ctdb_client.h
117 + /usr/include/samba-4.0/ctdb_protocol.h
118 + /usr/include/samba-4.0/ctdb_private.h
119 + /usr/include/samba-4.0/ctdb_typesafe_cb.h
120 + /usr/include/samba-4.0/ctdb_version.h
121 +)
122 +
123 +# sys-apps/attr is an automagic dependency (see bug #489748)
124 +CDEPEND="
125 + >=app-arch/libarchive-3.1.2[${MULTILIB_USEDEP}]
126 + dev-lang/perl:=
127 + dev-libs/libaio[${MULTILIB_USEDEP}]
128 + dev-libs/libbsd[${MULTILIB_USEDEP}]
129 + dev-libs/iniparser:0
130 + dev-libs/popt[${MULTILIB_USEDEP}]
131 + dev-python/subunit[${PYTHON_USEDEP},${MULTILIB_USEDEP}]
132 + >=dev-util/cmocka-1.1.1[${MULTILIB_USEDEP}]
133 + net-libs/libnsl:=[${MULTILIB_USEDEP}]
134 + sys-apps/attr[${MULTILIB_USEDEP}]
135 + >=sys-libs/ldb-1.5.4[ldap(+)?,python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
136 + <sys-libs/ldb-1.6.0[ldap(+)?,python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
137 + sys-libs/libcap
138 + sys-libs/ncurses:0=[${MULTILIB_USEDEP}]
139 + sys-libs/readline:0=
140 + >=sys-libs/talloc-2.1.16[python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
141 + >=sys-libs/tdb-1.3.18[python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
142 + >=sys-libs/tevent-0.9.39[python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
143 + sys-libs/zlib[${MULTILIB_USEDEP}]
144 + virtual/libiconv
145 + pam? ( virtual/pam )
146 + acl? ( virtual/acl )
147 + addns? (
148 + net-dns/bind-tools[gssapi]
149 + dev-python/dnspython:=[${PYTHON_USEDEP}]
150 + )
151 + ceph? ( sys-cluster/ceph )
152 + cluster? (
153 + net-libs/rpcsvc-proto
154 + !dev-db/ctdb
155 + )
156 + cups? ( net-print/cups )
157 + debug? ( dev-util/lttng-ust )
158 + dmapi? ( sys-apps/dmapi )
159 + fam? ( virtual/fam )
160 + gnutls? (
161 + dev-libs/libgcrypt:0
162 + >=net-libs/gnutls-1.4.0
163 + )
164 + gpg? ( app-crypt/gpgme )
165 + json? ( dev-libs/jansson )
166 + ldap? ( net-nds/openldap[${MULTILIB_USEDEP}] )
167 + system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl,${MULTILIB_USEDEP}] )
168 + system-mitkrb5? ( >=app-crypt/mit-krb5-1.15.1[${MULTILIB_USEDEP}] )
169 + systemd? ( sys-apps/systemd:0= )
170 +"
171 +DEPEND="${CDEPEND}
172 + ${PYTHON_DEPS}
173 + app-text/docbook-xsl-stylesheets
174 + dev-libs/libxslt
175 + net-libs/libtirpc[${MULTILIB_USEDEP}]
176 + virtual/pkgconfig
177 + || (
178 + net-libs/rpcsvc-proto
179 + <sys-libs/glibc-2.26[rpc(+)]
180 + )
181 + test? (
182 + !system-mitkrb5? (
183 + >=sys-libs/nss_wrapper-1.1.3
184 + >=net-dns/resolv_wrapper-1.1.4
185 + >=net-libs/socket_wrapper-1.1.9
186 + >=sys-libs/uid_wrapper-1.2.1
187 + )
188 + )"
189 +RDEPEND="${CDEPEND}
190 + python? ( ${PYTHON_DEPS} )
191 + client? ( net-fs/cifs-utils[ads?] )
192 + selinux? ( sec-policy/selinux-samba )
193 + !dev-perl/Parse-Yapp
194 +"
195 +
196 +REQUIRED_USE="
197 + addc? ( python gnutls json winbind )
198 + addns? ( python )
199 + ads? ( acl gnutls ldap winbind )
200 + cluster? ( ads )
201 + gpg? ( addc )
202 + test? ( python )
203 + ?? ( system-heimdal system-mitkrb5 )
204 + ${PYTHON_REQUIRED_USE}
205 +"
206 +
207 +# the test suite is messed, it uses system-installed samba
208 +# bits instead of what was built, tests things disabled via use
209 +# flags, and generally just fails to work in a way ebuilds could
210 +# rely on in its current state
211 +RESTRICT="test"
212 +
213 +S="${WORKDIR}/${MY_P}"
214 +
215 +PATCHES=(
216 + "${FILESDIR}/${PN}-4.4.0-pam.patch"
217 + "${FILESDIR}/${PN}-4.5.1-compile_et_fix.patch"
218 + "${FILESDIR}/${PN}-4.9.2-timespec.patch"
219 + "${FILESDIR}/${PN}-4.10.0-disable_gnutls_build_fix.patch"
220 +)
221 +
222 +#CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
223 +CONFDIR="${FILESDIR}/4.4"
224 +
225 +WAF_BINARY="${S}/buildtools/bin/waf"
226 +
227 +SHAREDMODS=""
228 +
229 +pkg_setup() {
230 + python-single-r1_pkg_setup
231 + if use cluster ; then
232 + SHAREDMODS="idmap_rid,idmap_tdb2,idmap_ad"
233 + elif use ads ; then
234 + SHAREDMODS="idmap_ad"
235 + fi
236 +}
237 +
238 +src_prepare() {
239 + default
240 +
241 + # un-bundle dnspython
242 + sed -i -e '/"dns.resolver":/d' "${S}"/third_party/wscript || die
243 +
244 + # unbundle iso8601 unless tests are enabled
245 + if ! use test ; then
246 + sed -i -e '/"iso8601":/d' "${S}"/third_party/wscript || die
247 + fi
248 +
249 + # ugly hackaround for bug #592502
250 + cp /usr/include/tevent_internal.h "${S}"/lib/tevent/ || die
251 +
252 + sed -e 's:<gpgme\.h>:<gpgme/gpgme.h>:' \
253 + -i source4/dsdb/samdb/ldb_modules/password_hash.c \
254 + || die
255 +
256 + # Friggin' WAF shit
257 + multilib_copy_sources
258 +}
259 +
260 +multilib_src_configure() {
261 + # when specifying libs for samba build you must append NONE to the end to
262 + # stop it automatically including things
263 + local bundled_libs="NONE"
264 + if ! use system-heimdal && ! use system-mitkrb5 ; then
265 + bundled_libs="heimbase,heimntlm,hdb,kdc,krb5,wind,gssapi,hcrypto,hx509,roken,asn1,com_err,NONE"
266 + fi
267 +
268 + local myconf=(
269 + --enable-fhs
270 + --sysconfdir="${EPREFIX}/etc"
271 + --localstatedir="${EPREFIX}/var"
272 + --with-modulesdir="${EPREFIX}/usr/$(get_libdir)/samba"
273 + --with-piddir="${EPREFIX}/run/${PN}"
274 + --bundled-libraries="${bundled_libs}"
275 + --builtin-libraries=NONE
276 + --disable-rpath
277 + --disable-rpath-install
278 + --nopyc
279 + --nopyo
280 + $(multilib_native_use_with acl acl-support)
281 + $(multilib_native_usex addc '' '--without-ad-dc')
282 + $(multilib_native_use_with addns dnsupdate)
283 + $(multilib_native_use_with ads)
284 + $(multilib_native_use_enable ceph cephfs)
285 + $(multilib_native_use_with cluster cluster-support)
286 + $(multilib_native_use_enable cups)
287 + $(multilib_native_use_with dmapi)
288 + $(multilib_native_use_with fam)
289 + $(multilib_native_use_with gpg gpgme)
290 + $(multilib_native_use_with json)
291 + $(multilib_native_use_enable iprint)
292 + $(multilib_native_use_with pam)
293 + $(multilib_native_usex pam "--with-pammodulesdir=${EPREFIX}/$(get_libdir)/security" '')
294 + $(multilib_native_use_with quota quotas)
295 + $(multilib_native_use_with syslog)
296 + $(multilib_native_use_with systemd)
297 + $(multilib_native_use_with winbind)
298 + $(multilib_native_usex python '' '--disable-python')
299 + $(multilib_native_use_enable zeroconf avahi)
300 + $(multilib_native_usex test '--enable-selftest' '')
301 + $(usex system-mitkrb5 "--with-system-mitkrb5 $(multilib_native_usex addc --with-experimental-mit-ad-dc '')" '')
302 + $(use_enable gnutls)
303 + $(use_with debug lttng)
304 + $(use_with ldap)
305 + )
306 +
307 + multilib_is_native_abi && myconf+=( --with-shared-modules=${SHAREDMODS} )
308 +
309 + CPPFLAGS="-I${SYSROOT}${EPREFIX}/usr/include/et ${CPPFLAGS}" \
310 + waf-utils_src_configure ${myconf[@]}
311 +}
312 +
313 +multilib_src_compile() {
314 + waf-utils_src_compile
315 +}
316 +
317 +multilib_src_install() {
318 + waf-utils_src_install
319 +
320 + # Make all .so files executable
321 + find "${ED}" -type f -name "*.so" -exec chmod +x {} + || die
322 +
323 + if multilib_is_native_abi ; then
324 + # install ldap schema for server (bug #491002)
325 + if use ldap ; then
326 + insinto /etc/openldap/schema
327 + doins examples/LDAP/samba.schema
328 + fi
329 +
330 + # create symlink for cups (bug #552310)
331 + if use cups ; then
332 + dosym ../../../bin/smbspool /usr/libexec/cups/backend/smb
333 + fi
334 +
335 + # install example config file
336 + insinto /etc/samba
337 + doins examples/smb.conf.default
338 +
339 + # Fix paths in example file (#603964)
340 + sed \
341 + -e '/log file =/s@/usr/local/samba/var/@/var/log/samba/@' \
342 + -e '/include =/s@/usr/local/samba/lib/@/etc/samba/@' \
343 + -e '/path =/s@/usr/local/samba/lib/@/var/lib/samba/@' \
344 + -e '/path =/s@/usr/local/samba/@/var/lib/samba/@' \
345 + -e '/path =/s@/usr/spool/samba@/var/spool/samba@' \
346 + -i "${ED%/}"/etc/samba/smb.conf.default || die
347 +
348 + # Install init script and conf.d file
349 + newinitd "${CONFDIR}/samba4.initd-r1" samba
350 + newconfd "${CONFDIR}/samba4.confd" samba
351 +
352 + systemd_dotmpfilesd "${FILESDIR}"/samba.conf
353 + systemd_dounit "${FILESDIR}"/nmbd.service
354 + systemd_dounit "${FILESDIR}"/smbd.{service,socket}
355 + systemd_newunit "${FILESDIR}"/smbd_at.service 'smbd@.service'
356 + systemd_dounit "${FILESDIR}"/winbindd.service
357 + systemd_dounit "${FILESDIR}"/samba.service
358 + fi
359 +
360 + if use pam && use winbind ; then
361 + newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind
362 + # bugs #376853 and #590374
363 + insinto /etc/security
364 + doins examples/pam_winbind/pam_winbind.conf || die
365 + fi
366 +
367 + keepdir /var/cache/samba
368 + keepdir /var/lib/ctdb
369 + keepdir /var/lib/samba/{bind-dns,private}
370 + keepdir /var/lock/samba
371 + keepdir /var/log/samba
372 + keepdir /var/run/{ctdb,samba}
373 +}
374 +
375 +multilib_src_test() {
376 + if multilib_is_native_abi ; then
377 + "${WAF_BINARY}" test || die "test failed"
378 + fi
379 +}
380 +
381 +pkg_postinst() {
382 + ewarn "Be aware the this release contains the best of all of Samba's"
383 + ewarn "technology parts, both a file server (that you can reasonably expect"
384 + ewarn "to upgrade existing Samba 3.x releases to) and the AD domain"
385 + ewarn "controller work previously known as 'samba4'."
386 +
387 + elog "For further information and migration steps make sure to read "
388 + elog "https://samba.org/samba/history/${P}.html "
389 + elog "https://wiki.samba.org/index.php/Samba4/HOWTO "
390 +}
391
392 diff --git a/net-fs/samba/samba-4.9.6.ebuild b/net-fs/samba/samba-4.9.6.ebuild
393 new file mode 100644
394 index 00000000000..6427d579620
395 --- /dev/null
396 +++ b/net-fs/samba/samba-4.9.6.ebuild
397 @@ -0,0 +1,305 @@
398 +# Copyright 1999-2019 Gentoo Authors
399 +# Distributed under the terms of the GNU General Public License v2
400 +
401 +EAPI=6
402 +PYTHON_COMPAT=( python2_7 )
403 +PYTHON_REQ_USE='threads(+),xml(+)'
404 +
405 +inherit python-single-r1 waf-utils multilib-minimal linux-info systemd pam
406 +
407 +MY_PV="${PV/_rc/rc}"
408 +MY_P="${PN}-${MY_PV}"
409 +
410 +SRC_PATH="stable"
411 +[[ ${PV} = *_rc* ]] && SRC_PATH="rc"
412 +
413 +SRC_URI="mirror://samba/${SRC_PATH}/${MY_P}.tar.gz"
414 +[[ ${PV} = *_rc* ]] || \
415 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
416 +
417 +DESCRIPTION="Samba Suite Version 4"
418 +HOMEPAGE="https://www.samba.org/"
419 +LICENSE="GPL-3"
420 +
421 +SLOT="0"
422 +
423 +IUSE="acl addc addns ads ceph client cluster cups debug dmapi fam gnutls gpg iprint json ldap
424 +pam python quota selinux syslog system-heimdal +system-mitkrb5 systemd test winbind zeroconf"
425 +
426 +MULTILIB_WRAPPED_HEADERS=(
427 + /usr/include/samba-4.0/policy.h
428 + /usr/include/samba-4.0/dcerpc_server.h
429 + /usr/include/samba-4.0/ctdb.h
430 + /usr/include/samba-4.0/ctdb_client.h
431 + /usr/include/samba-4.0/ctdb_protocol.h
432 + /usr/include/samba-4.0/ctdb_private.h
433 + /usr/include/samba-4.0/ctdb_typesafe_cb.h
434 + /usr/include/samba-4.0/ctdb_version.h
435 +)
436 +
437 +# sys-apps/attr is an automagic dependency (see bug #489748)
438 +CDEPEND="
439 + >=app-arch/libarchive-3.1.2[${MULTILIB_USEDEP}]
440 + dev-lang/perl:=
441 + dev-libs/libaio[${MULTILIB_USEDEP}]
442 + dev-libs/libbsd[${MULTILIB_USEDEP}]
443 + dev-libs/iniparser:0
444 + dev-libs/popt[${MULTILIB_USEDEP}]
445 + dev-python/subunit[${PYTHON_USEDEP},${MULTILIB_USEDEP}]
446 + >=dev-util/cmocka-1.1.1[${MULTILIB_USEDEP}]
447 + net-libs/libnsl:=[${MULTILIB_USEDEP}]
448 + sys-apps/attr[${MULTILIB_USEDEP}]
449 + >=sys-libs/ldb-1.4.6[ldap(+)?,python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
450 + <sys-libs/ldb-1.5.0[ldap(+)?,python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
451 + sys-libs/libcap
452 + sys-libs/ncurses:0=[${MULTILIB_USEDEP}]
453 + sys-libs/readline:0=
454 + >=sys-libs/talloc-2.1.14[python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
455 + >=sys-libs/tdb-1.3.16[python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
456 + >=sys-libs/tevent-0.9.37[python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
457 + sys-libs/zlib[${MULTILIB_USEDEP}]
458 + virtual/libiconv
459 + pam? ( virtual/pam )
460 + acl? ( virtual/acl )
461 + addns? (
462 + net-dns/bind-tools[gssapi]
463 + dev-python/dnspython:=[${PYTHON_USEDEP}]
464 + )
465 + ceph? ( sys-cluster/ceph )
466 + cluster? (
467 + net-libs/rpcsvc-proto
468 + !dev-db/ctdb
469 + )
470 + cups? ( net-print/cups )
471 + debug? ( dev-util/lttng-ust )
472 + dmapi? ( sys-apps/dmapi )
473 + fam? ( virtual/fam )
474 + gnutls? (
475 + dev-libs/libgcrypt:0
476 + >=net-libs/gnutls-1.4.0
477 + )
478 + gpg? ( app-crypt/gpgme )
479 + json? ( dev-libs/jansson )
480 + ldap? ( net-nds/openldap[${MULTILIB_USEDEP}] )
481 + system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl,${MULTILIB_USEDEP}] )
482 + system-mitkrb5? ( >=app-crypt/mit-krb5-1.15.1[${MULTILIB_USEDEP}] )
483 + systemd? ( sys-apps/systemd:0= )
484 +"
485 +DEPEND="${CDEPEND}
486 + ${PYTHON_DEPS}
487 + app-text/docbook-xsl-stylesheets
488 + dev-libs/libxslt
489 + net-libs/libtirpc[${MULTILIB_USEDEP}]
490 + virtual/pkgconfig
491 + || (
492 + net-libs/rpcsvc-proto
493 + <sys-libs/glibc-2.26[rpc(+)]
494 + )
495 + test? (
496 + !system-mitkrb5? (
497 + >=sys-libs/nss_wrapper-1.1.3
498 + >=net-dns/resolv_wrapper-1.1.4
499 + >=net-libs/socket_wrapper-1.1.9
500 + >=sys-libs/uid_wrapper-1.2.1
501 + )
502 + )"
503 +RDEPEND="${CDEPEND}
504 + python? ( ${PYTHON_DEPS} )
505 + client? ( net-fs/cifs-utils[ads?] )
506 + selinux? ( sec-policy/selinux-samba )
507 + !dev-perl/Parse-Yapp
508 +"
509 +
510 +REQUIRED_USE="
511 + addc? ( python gnutls json winbind )
512 + addns? ( python )
513 + ads? ( acl gnutls ldap winbind )
514 + cluster? ( ads )
515 + gpg? ( addc )
516 + test? ( python )
517 + ?? ( system-heimdal system-mitkrb5 )
518 + ${PYTHON_REQUIRED_USE}
519 +"
520 +
521 +# the test suite is messed, it uses system-installed samba
522 +# bits instead of what was built, tests things disabled via use
523 +# flags, and generally just fails to work in a way ebuilds could
524 +# rely on in its current state
525 +RESTRICT="test"
526 +
527 +S="${WORKDIR}/${MY_P}"
528 +
529 +PATCHES=(
530 + "${FILESDIR}/${PN}-4.4.0-pam.patch"
531 + "${FILESDIR}/${PN}-4.5.1-compile_et_fix.patch"
532 + "${FILESDIR}/${PN}-4.9.2-timespec.patch"
533 +)
534 +
535 +#CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
536 +CONFDIR="${FILESDIR}/4.4"
537 +
538 +WAF_BINARY="${S}/buildtools/bin/waf"
539 +
540 +SHAREDMODS=""
541 +
542 +pkg_setup() {
543 + python-single-r1_pkg_setup
544 + if use cluster ; then
545 + SHAREDMODS="idmap_rid,idmap_tdb2,idmap_ad"
546 + elif use ads ; then
547 + SHAREDMODS="idmap_ad"
548 + fi
549 +}
550 +
551 +src_prepare() {
552 + default
553 +
554 + # un-bundle dnspython
555 + sed -i -e '/"dns.resolver":/d' "${S}"/third_party/wscript || die
556 +
557 + # unbundle iso8601 unless tests are enabled
558 + if ! use test ; then
559 + sed -i -e '/"iso8601":/d' "${S}"/third_party/wscript || die
560 + fi
561 +
562 + # ugly hackaround for bug #592502
563 + cp /usr/include/tevent_internal.h "${S}"/lib/tevent/ || die
564 +
565 + sed -e 's:<gpgme\.h>:<gpgme/gpgme.h>:' \
566 + -i source4/dsdb/samdb/ldb_modules/password_hash.c \
567 + || die
568 +
569 + # Friggin' WAF shit
570 + multilib_copy_sources
571 +}
572 +
573 +multilib_src_configure() {
574 + # when specifying libs for samba build you must append NONE to the end to
575 + # stop it automatically including things
576 + local bundled_libs="NONE"
577 + if ! use system-heimdal && ! use system-mitkrb5 ; then
578 + bundled_libs="heimbase,heimntlm,hdb,kdc,krb5,wind,gssapi,hcrypto,hx509,roken,asn1,com_err,NONE"
579 + fi
580 +
581 + local myconf=(
582 + --enable-fhs
583 + --sysconfdir="${EPREFIX}/etc"
584 + --localstatedir="${EPREFIX}/var"
585 + --with-modulesdir="${EPREFIX}/usr/$(get_libdir)/samba"
586 + --with-piddir="${EPREFIX}/run/${PN}"
587 + --bundled-libraries="${bundled_libs}"
588 + --builtin-libraries=NONE
589 + --disable-rpath
590 + --disable-rpath-install
591 + --nopyc
592 + --nopyo
593 + $(multilib_native_use_with acl acl-support)
594 + $(multilib_native_usex addc '' '--without-ad-dc')
595 + $(multilib_native_use_with addns dnsupdate)
596 + $(multilib_native_use_with ads)
597 + $(multilib_native_use_enable ceph cephfs)
598 + $(multilib_native_use_with cluster cluster-support)
599 + $(multilib_native_use_enable cups)
600 + $(multilib_native_use_with dmapi)
601 + $(multilib_native_use_with fam)
602 + $(multilib_native_use_with gpg gpgme)
603 + $(multilib_native_use_with json json-audit)
604 + $(multilib_native_use_enable iprint)
605 + $(multilib_native_use_with pam)
606 + $(multilib_native_usex pam "--with-pammodulesdir=${EPREFIX}/$(get_libdir)/security" '')
607 + $(multilib_native_use_with quota quotas)
608 + $(multilib_native_use_with syslog)
609 + $(multilib_native_use_with systemd)
610 + $(multilib_native_use_with winbind)
611 + $(multilib_native_usex python '' '--disable-python')
612 + $(multilib_native_use_enable zeroconf avahi)
613 + $(multilib_native_usex test '--enable-selftest' '')
614 + $(usex system-mitkrb5 "--with-system-mitkrb5 $(multilib_native_usex addc --with-experimental-mit-ad-dc '')" '')
615 + $(use_enable gnutls)
616 + $(use_with debug lttng)
617 + $(use_with ldap)
618 + )
619 + multilib_is_native_abi && myconf+=( --with-shared-modules=${SHAREDMODS} )
620 +
621 + CPPFLAGS="-I${SYSROOT}${EPREFIX}/usr/include/et ${CPPFLAGS}" \
622 + waf-utils_src_configure ${myconf[@]}
623 +}
624 +
625 +multilib_src_compile() {
626 + waf-utils_src_compile
627 +}
628 +
629 +multilib_src_install() {
630 + waf-utils_src_install
631 +
632 + # Make all .so files executable
633 + find "${ED}" -type f -name "*.so" -exec chmod +x {} + || die
634 +
635 + if multilib_is_native_abi ; then
636 + # install ldap schema for server (bug #491002)
637 + if use ldap ; then
638 + insinto /etc/openldap/schema
639 + doins examples/LDAP/samba.schema
640 + fi
641 +
642 + # create symlink for cups (bug #552310)
643 + if use cups ; then
644 + dosym ../../../bin/smbspool /usr/libexec/cups/backend/smb
645 + fi
646 +
647 + # install example config file
648 + insinto /etc/samba
649 + doins examples/smb.conf.default
650 +
651 + # Fix paths in example file (#603964)
652 + sed \
653 + -e '/log file =/s@/usr/local/samba/var/@/var/log/samba/@' \
654 + -e '/include =/s@/usr/local/samba/lib/@/etc/samba/@' \
655 + -e '/path =/s@/usr/local/samba/lib/@/var/lib/samba/@' \
656 + -e '/path =/s@/usr/local/samba/@/var/lib/samba/@' \
657 + -e '/path =/s@/usr/spool/samba@/var/spool/samba@' \
658 + -i "${ED%/}"/etc/samba/smb.conf.default || die
659 +
660 + # Install init script and conf.d file
661 + newinitd "${CONFDIR}/samba4.initd-r1" samba
662 + newconfd "${CONFDIR}/samba4.confd" samba
663 +
664 + systemd_dotmpfilesd "${FILESDIR}"/samba.conf
665 + systemd_dounit "${FILESDIR}"/nmbd.service
666 + systemd_dounit "${FILESDIR}"/smbd.{service,socket}
667 + systemd_newunit "${FILESDIR}"/smbd_at.service 'smbd@.service'
668 + systemd_dounit "${FILESDIR}"/winbindd.service
669 + systemd_dounit "${FILESDIR}"/samba.service
670 + fi
671 +
672 + if use pam && use winbind ; then
673 + newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind
674 + # bugs #376853 and #590374
675 + insinto /etc/security
676 + doins examples/pam_winbind/pam_winbind.conf || die
677 + fi
678 +
679 + keepdir /var/cache/samba
680 + keepdir /var/lib/ctdb
681 + keepdir /var/lib/samba/{bind-dns,private}
682 + keepdir /var/lock/samba
683 + keepdir /var/log/samba
684 + keepdir /var/run/{ctdb,samba}
685 +}
686 +
687 +multilib_src_test() {
688 + if multilib_is_native_abi ; then
689 + "${WAF_BINARY}" test || die "test failed"
690 + fi
691 +}
692 +
693 +pkg_postinst() {
694 + ewarn "Be aware the this release contains the best of all of Samba's"
695 + ewarn "technology parts, both a file server (that you can reasonably expect"
696 + ewarn "to upgrade existing Samba 3.x releases to) and the AD domain"
697 + ewarn "controller work previously known as 'samba4'."
698 +
699 + elog "For further information and migration steps make sure to read "
700 + elog "https://samba.org/samba/history/${P}.html "
701 + elog "https://wiki.samba.org/index.php/Samba4/HOWTO "
702 +}