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