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