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