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: Fri, 06 Sep 2019 07:10:43
Message-Id: 1567753803.c17eeecbb77bd4261551766336a0e7a853fa490b.polynomial-c@gentoo
1 commit: c17eeecbb77bd4261551766336a0e7a853fa490b
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 6 07:10:03 2019 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 6 07:10:03 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c17eeecb
7
8 net-fs/samba: Security bump to versions 4.9.13 and 4.10.8
9
10 Bug: https://bugs.gentoo.org/693558
11 Package-Manager: Portage-2.3.75, Repoman-2.3.17
12 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
13
14 net-fs/samba/Manifest | 2 +
15 net-fs/samba/samba-4.10.8.ebuild | 314 +++++++++++++++++++++++++++++++++++++++
16 net-fs/samba/samba-4.9.13.ebuild | 307 ++++++++++++++++++++++++++++++++++++++
17 3 files changed, 623 insertions(+)
18
19 diff --git a/net-fs/samba/Manifest b/net-fs/samba/Manifest
20 index a1182491bef..278de2d3f21 100644
21 --- a/net-fs/samba/Manifest
22 +++ b/net-fs/samba/Manifest
23 @@ -1,9 +1,11 @@
24 DIST samba-4.10.2.tar.gz 18280710 BLAKE2B f15b117d1159dfa6cd279c5011629d688fcfba94a2ca8184a827d0787a31f76a38f46b355454b916f2e62c0a88109b86664f6bb16fc0e23d0f61d09908e587cd SHA512 3d146ea12567ebb02a7babcad779b82339ffbfb19f6f2be5cac33eb18af2c9b546dc1cd910072a5c9e152ba9c4a632ed6870c48a8f6ad9d04304b130f240a4bf
25 DIST samba-4.10.6.tar.gz 18306135 BLAKE2B 236598c26294e1b7b23e48eba7d6429eec01e65a4a73a45fea16ef0e0b7cf1c7b861d824e860bc178d358c298400e829577525b0438e0384fca7bf4409bd69f0 SHA512 6c06a55ac686210965cf52f79190700a3d3a5cba8ea54b32e5bdb4d6b6167f1fa9aef308c3d5fdc7078496aa78b46d5cea3c623438d3a049b11fc58d334f8d0f
26 DIST samba-4.10.7.tar.gz 18318281 BLAKE2B ccb97823e8e23e48141b2585b9f6d1f786460a8ee9077e6a0f71d2e2c797f79cb155f4d418f0d18d046307ba5e8bf0780f975707145d1c7f94bc5aa5a65e34b6 SHA512 3ef05754fc12343cf76c7981ca25e4898bd0bf133f394b9fbe9393e8447b18626977e80ddc76f1597921abc378ad058cc363f1f277856d6fa4d783c902514c88
27 +DIST samba-4.10.8.tar.gz 18316560 BLAKE2B a1b89169a13eb96202e846e9e501b364235d61459a5d2f2e443af569d8a754df8546b5fb52e9e1b9629535d838a7fdfd9cd1fb631870880dad9981587c14be5f SHA512 14d463dfba36473f4a1d2b306ff2a18c664e1a01bc8077ef62afc6796cf4dd65461d72b519b8df3a777eaf322cb98653b416468d770541cd21fab2383c8dce66
28 DIST samba-4.11.0rc3.tar.gz 18490189 BLAKE2B 1bddf744bf33b501a67e14dfc6e935285c458d1362e9c403fdb4abbbcbd71aaa3ae87d225f270cfbd0a0f6221072db070d04a984dfbc85ba607b5326ebcf835f SHA512 0a8998977d746b6fd37f51f2615a4a91296579d17e9f19818635f2042e844a69b1669c6ee0386e6ef8068bf75a141a483d2cbce4ea75d65e254cfca12e94f428
29 DIST samba-4.5.11-disable-python-patches.tar.xz 6292 BLAKE2B c2a32a1059a02bc1c87ce5f604cbc5878c654b8f693c8486b5ba63b37513444915a7b6389fe82b7e31ab2f9577dd8462eddba60b4f4f756b4ed1145ce7bd90ae SHA512 f0e3076e3e1ecaae3f06b3ef30efc81719fb3f63a1041dcbdae4b62ca4cf693732f9eb16f047d046d4930136fed82194e82b455ea888e12cf845b3e6a122d57d
30 DIST samba-4.5.16.tar.gz 21024396 BLAKE2B e737559fb748044076608fa233700eb54c7e1c56bc234763f062b6341a179cc78a4a8cdf9f3d6f4d7f3cf8a79f846852ddd5cc753a468c3adb3a0451e1809ed9 SHA512 de8a41013cfb5ef3adcb290efd97a78a5de876d90ad05764d631f14e663a1849bb53e4ac394b46c906f1109be5748fee9316407a659c57007d36851ae8adcd7f
31 DIST samba-4.8.12.tar.gz 17764832 BLAKE2B d2c0c8b9090da7c94b9343fd3f416e9aafad64273abc9be0639b011f71072926a0b303cf53e63c4e470aeb168e8ec23003b5f4ed4258aac8d6b3d029f71fba6f SHA512 f29595f6390d01860cb6acd750d2e36b4d207dd1da16465c21c8d6d732ce27bd0582a0f34296081e2659638d839c8b12f28deccc31982afa94650da8bce8df8b
32 DIST samba-4.8.6.tar.gz 17723841 BLAKE2B 38da52e14b4417f26462eef2226c4498e54d2c276b4056e8c6d6c66079f33bcda24c1eab30b29bc7413280ec89a74a55e043e8274ac50f9a25bae7563717ff34 SHA512 f6afab5ca466bd8653a56c205b71ce94ecf0ad0c6e4c9d64cbba7b1e56f1987bc2022e6b629d87eb6078e3f6ba53833c19cfb41e40b6d589e4317ea9d85de273
33 DIST samba-4.9.11.tar.gz 18095745 BLAKE2B d06a15608f71e73e26dbb15ddfb3512a0cd6f6ce5cffe663451cdf1552473c28cc5a66fc5e28d0e3fbfc80be8524903bd42d75050b664e713efdb09855175bdf SHA512 3d1cd7e3f1ffbfa6bb44fe0cb12be47dd17c9b614b6509ecec20210ac734fa1ab90ea5d2d2180fe7c80bd4eb5bb9a73a09183edf70bdd28dde2d33e092c9e71a
34 +DIST samba-4.9.13.tar.gz 18109481 BLAKE2B 948ef6b0e1a9796c70635119f5aea5887e9f1c1d2a5264d072f3f3d218dfae3b6a16c640233063c9df0670dc7835a92a8c97447f57518aa9d387bc5d04831675 SHA512 ce80486c9ab093d44ee68b0e2ab28f9af97c7ed00cca1b8a0c65de18254ae40759a1e9fcb9a0ba18006aa296c6a6fbadf53dcd730785a96ac0c167efdbe9d3ae
35
36 diff --git a/net-fs/samba/samba-4.10.8.ebuild b/net-fs/samba/samba-4.10.8.ebuild
37 new file mode 100644
38 index 00000000000..87c4c3061f9
39 --- /dev/null
40 +++ b/net-fs/samba/samba-4.10.8.ebuild
41 @@ -0,0 +1,314 @@
42 +# Copyright 1999-2019 Gentoo Authors
43 +# Distributed under the terms of the GNU General Public License v2
44 +
45 +EAPI=6
46 +PYTHON_COMPAT=( python3_{5,6,7} )
47 +PYTHON_REQ_USE='threads(+),xml(+)'
48 +
49 +inherit python-single-r1 waf-utils multilib-minimal linux-info systemd pam
50 +
51 +MY_PV="${PV/_rc/rc}"
52 +MY_P="${PN}-${MY_PV}"
53 +
54 +SRC_PATH="stable"
55 +[[ ${PV} = *_rc* ]] && SRC_PATH="rc"
56 +
57 +SRC_URI="mirror://samba/${SRC_PATH}/${MY_P}.tar.gz"
58 +[[ ${PV} = *_rc* ]] || \
59 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
60 +
61 +DESCRIPTION="Samba Suite Version 4"
62 +HOMEPAGE="https://www.samba.org/"
63 +LICENSE="GPL-3"
64 +
65 +SLOT="0"
66 +
67 +IUSE="acl addc addns ads ceph client cluster cups debug dmapi fam gnutls gpg
68 +iprint json ldap pam profiling-data python quota selinux syslog system-heimdal
69 ++system-mitkrb5 systemd test winbind zeroconf"
70 +
71 +MULTILIB_WRAPPED_HEADERS=(
72 + /usr/include/samba-4.0/policy.h
73 + /usr/include/samba-4.0/dcerpc_server.h
74 + /usr/include/samba-4.0/ctdb.h
75 + /usr/include/samba-4.0/ctdb_client.h
76 + /usr/include/samba-4.0/ctdb_protocol.h
77 + /usr/include/samba-4.0/ctdb_private.h
78 + /usr/include/samba-4.0/ctdb_typesafe_cb.h
79 + /usr/include/samba-4.0/ctdb_version.h
80 +)
81 +
82 +# sys-apps/attr is an automagic dependency (see bug #489748)
83 +CDEPEND="
84 + >=app-arch/libarchive-3.1.2[${MULTILIB_USEDEP}]
85 + dev-lang/perl:=
86 + dev-libs/libaio[${MULTILIB_USEDEP}]
87 + dev-libs/libbsd[${MULTILIB_USEDEP}]
88 + dev-libs/iniparser:0
89 + dev-libs/popt[${MULTILIB_USEDEP}]
90 + dev-python/subunit[${PYTHON_USEDEP},${MULTILIB_USEDEP}]
91 + >=dev-util/cmocka-1.1.1[${MULTILIB_USEDEP}]
92 + net-libs/libnsl:=[${MULTILIB_USEDEP}]
93 + sys-apps/attr[${MULTILIB_USEDEP}]
94 + >=sys-libs/ldb-1.5.5[ldap(+)?,python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
95 + <sys-libs/ldb-1.6.0[ldap(+)?,python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
96 + sys-libs/libcap
97 + sys-libs/ncurses:0=[${MULTILIB_USEDEP}]
98 + sys-libs/readline:0=
99 + >=sys-libs/talloc-2.1.16[python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
100 + >=sys-libs/tdb-1.3.18[python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
101 + >=sys-libs/tevent-0.9.39[python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
102 + sys-libs/zlib[${MULTILIB_USEDEP}]
103 + virtual/libiconv
104 + pam? ( virtual/pam )
105 + acl? ( virtual/acl )
106 + addns? (
107 + net-dns/bind-tools[gssapi]
108 + dev-python/dnspython:=[${PYTHON_USEDEP}]
109 + )
110 + ceph? ( sys-cluster/ceph )
111 + cluster? (
112 + net-libs/rpcsvc-proto
113 + !dev-db/ctdb
114 + )
115 + cups? ( net-print/cups )
116 + debug? ( dev-util/lttng-ust )
117 + dmapi? ( sys-apps/dmapi )
118 + fam? ( virtual/fam )
119 + gnutls? (
120 + dev-libs/libgcrypt:0
121 + >=net-libs/gnutls-1.4.0
122 + )
123 + gpg? ( app-crypt/gpgme )
124 + json? ( dev-libs/jansson )
125 + ldap? ( net-nds/openldap[${MULTILIB_USEDEP}] )
126 + system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl,${MULTILIB_USEDEP}] )
127 + system-mitkrb5? ( >=app-crypt/mit-krb5-1.15.1[${MULTILIB_USEDEP}] )
128 + systemd? ( sys-apps/systemd:0= )
129 +"
130 +DEPEND="${CDEPEND}
131 + ${PYTHON_DEPS}
132 + app-text/docbook-xsl-stylesheets
133 + dev-libs/libxslt
134 + net-libs/libtirpc[${MULTILIB_USEDEP}]
135 + virtual/pkgconfig
136 + || (
137 + net-libs/rpcsvc-proto
138 + <sys-libs/glibc-2.26[rpc(+)]
139 + )
140 + test? (
141 + !system-mitkrb5? (
142 + >=sys-libs/nss_wrapper-1.1.3
143 + >=net-dns/resolv_wrapper-1.1.4
144 + >=net-libs/socket_wrapper-1.1.9
145 + >=sys-libs/uid_wrapper-1.2.1
146 + )
147 + )"
148 +RDEPEND="${CDEPEND}
149 + python? ( ${PYTHON_DEPS} )
150 + client? ( net-fs/cifs-utils[ads?] )
151 + selinux? ( sec-policy/selinux-samba )
152 + !dev-perl/Parse-Yapp
153 +"
154 +
155 +REQUIRED_USE="
156 + addc? ( python gnutls json winbind )
157 + addns? ( python )
158 + ads? ( acl gnutls ldap winbind )
159 + cluster? ( ads )
160 + gpg? ( addc )
161 + test? ( python )
162 + ?? ( system-heimdal system-mitkrb5 )
163 + ${PYTHON_REQUIRED_USE}
164 +"
165 +
166 +# the test suite is messed, it uses system-installed samba
167 +# bits instead of what was built, tests things disabled via use
168 +# flags, and generally just fails to work in a way ebuilds could
169 +# rely on in its current state
170 +RESTRICT="test"
171 +
172 +S="${WORKDIR}/${MY_P}"
173 +
174 +PATCHES=(
175 + "${FILESDIR}/${PN}-4.4.0-pam.patch"
176 + "${FILESDIR}/${PN}-4.5.1-compile_et_fix.patch"
177 + "${FILESDIR}/${PN}-4.9.2-timespec.patch"
178 +)
179 +
180 +#CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
181 +CONFDIR="${FILESDIR}/4.4"
182 +
183 +WAF_BINARY="${S}/buildtools/bin/waf"
184 +
185 +SHAREDMODS=""
186 +
187 +pkg_setup() {
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 + $(multilib_native_use_with acl acl-support)
239 + $(multilib_native_usex addc '' '--without-ad-dc')
240 + $(multilib_native_use_with addns dnsupdate)
241 + $(multilib_native_use_with ads)
242 + $(multilib_native_use_enable ceph cephfs)
243 + $(multilib_native_use_with cluster cluster-support)
244 + $(multilib_native_use_enable cups)
245 + $(multilib_native_use_with dmapi)
246 + $(multilib_native_use_with fam)
247 + $(multilib_native_use_with gpg gpgme)
248 + $(multilib_native_use_with json)
249 + $(multilib_native_use_enable iprint)
250 + $(multilib_native_use_with pam)
251 + $(multilib_native_usex pam "--with-pammodulesdir=${EPREFIX}/$(get_libdir)/security" '')
252 + $(multilib_native_use_with quota quotas)
253 + $(multilib_native_use_with syslog)
254 + $(multilib_native_use_with systemd)
255 + $(multilib_native_use_with winbind)
256 + $(multilib_native_usex python '' '--disable-python')
257 + $(multilib_native_use_enable zeroconf avahi)
258 + $(multilib_native_usex test '--enable-selftest' '')
259 + $(usex system-mitkrb5 "--with-system-mitkrb5 $(multilib_native_usex addc --with-experimental-mit-ad-dc '')" '')
260 + $(use_enable gnutls)
261 + $(use_with debug lttng)
262 + $(use_with ldap)
263 + $(use_with profiling-data)
264 + )
265 +
266 + multilib_is_native_abi && myconf+=( --with-shared-modules=${SHAREDMODS} )
267 +
268 + CPPFLAGS="-I${SYSROOT}${EPREFIX}/usr/include/et ${CPPFLAGS}" \
269 + waf-utils_src_configure ${myconf[@]}
270 +}
271 +
272 +multilib_src_compile() {
273 + waf-utils_src_compile
274 +}
275 +
276 +multilib_src_install() {
277 + waf-utils_src_install
278 +
279 + # Make all .so files executable
280 + find "${ED}" -type f -name "*.so" -exec chmod +x {} + || die
281 +
282 + if multilib_is_native_abi ; then
283 + # install ldap schema for server (bug #491002)
284 + if use ldap ; then
285 + insinto /etc/openldap/schema
286 + doins examples/LDAP/samba.schema
287 + fi
288 +
289 + # create symlink for cups (bug #552310)
290 + if use cups ; then
291 + dosym ../../../bin/smbspool /usr/libexec/cups/backend/smb
292 + fi
293 +
294 + # install example config file
295 + insinto /etc/samba
296 + doins examples/smb.conf.default
297 +
298 + # Fix paths in example file (#603964)
299 + sed \
300 + -e '/log file =/s@/usr/local/samba/var/@/var/log/samba/@' \
301 + -e '/include =/s@/usr/local/samba/lib/@/etc/samba/@' \
302 + -e '/path =/s@/usr/local/samba/lib/@/var/lib/samba/@' \
303 + -e '/path =/s@/usr/local/samba/@/var/lib/samba/@' \
304 + -e '/path =/s@/usr/spool/samba@/var/spool/samba@' \
305 + -i "${ED%/}"/etc/samba/smb.conf.default || die
306 +
307 + # Install init script and conf.d file
308 + newinitd "${CONFDIR}/samba4.initd-r1" samba
309 + newconfd "${CONFDIR}/samba4.confd" samba
310 +
311 + systemd_dotmpfilesd "${FILESDIR}"/samba.conf
312 + systemd_dounit "${FILESDIR}"/nmbd.service
313 + systemd_dounit "${FILESDIR}"/smbd.{service,socket}
314 + systemd_newunit "${FILESDIR}"/smbd_at.service 'smbd@.service'
315 + systemd_dounit "${FILESDIR}"/winbindd.service
316 + systemd_dounit "${FILESDIR}"/samba.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 || die
324 + fi
325 +
326 + keepdir /var/cache/samba
327 + keepdir /var/lib/ctdb
328 + keepdir /var/lib/samba/{bind-dns,private}
329 + keepdir /var/lock/samba
330 + keepdir /var/log/samba
331 + keepdir /var/run/{ctdb,samba}
332 +}
333 +
334 +multilib_src_install_all() {
335 + # Attempt to fix bug #673168
336 + find "${ED}" -type d -name "Yapp" -print0 \
337 + | xargs -0 --no-run-if-empty rm -r || die
338 +}
339 +
340 +multilib_src_test() {
341 + if multilib_is_native_abi ; then
342 + "${WAF_BINARY}" test || die "test failed"
343 + fi
344 +}
345 +
346 +pkg_postinst() {
347 + ewarn "Be aware the this release contains the best of all of Samba's"
348 + ewarn "technology parts, both a file server (that you can reasonably expect"
349 + ewarn "to upgrade existing Samba 3.x releases to) and the AD domain"
350 + ewarn "controller work previously known as 'samba4'."
351 +
352 + elog "For further information and migration steps make sure to read "
353 + elog "https://samba.org/samba/history/${P}.html "
354 + elog "https://wiki.samba.org/index.php/Samba4/HOWTO "
355 +}
356
357 diff --git a/net-fs/samba/samba-4.9.13.ebuild b/net-fs/samba/samba-4.9.13.ebuild
358 new file mode 100644
359 index 00000000000..c983eaa51e3
360 --- /dev/null
361 +++ b/net-fs/samba/samba-4.9.13.ebuild
362 @@ -0,0 +1,307 @@
363 +# Copyright 1999-2019 Gentoo Authors
364 +# Distributed under the terms of the GNU General Public License v2
365 +
366 +EAPI=6
367 +PYTHON_COMPAT=( python2_7 )
368 +PYTHON_REQ_USE='threads(+),xml(+)'
369 +
370 +inherit python-single-r1 waf-utils multilib-minimal linux-info systemd pam
371 +
372 +MY_PV="${PV/_rc/rc}"
373 +MY_P="${PN}-${MY_PV}"
374 +
375 +SRC_PATH="stable"
376 +[[ ${PV} = *_rc* ]] && SRC_PATH="rc"
377 +
378 +SRC_URI="mirror://samba/${SRC_PATH}/${MY_P}.tar.gz"
379 +[[ ${PV} = *_rc* ]] || \
380 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
381 +
382 +DESCRIPTION="Samba Suite Version 4"
383 +HOMEPAGE="https://www.samba.org/"
384 +LICENSE="GPL-3"
385 +
386 +SLOT="0"
387 +
388 +IUSE="acl addc addns ads ceph client cluster cups debug dmapi fam gnutls gpg
389 +iprint json ldap pam profiling-data python quota selinux syslog system-heimdal
390 ++system-mitkrb5 systemd test winbind zeroconf"
391 +
392 +MULTILIB_WRAPPED_HEADERS=(
393 + /usr/include/samba-4.0/policy.h
394 + /usr/include/samba-4.0/dcerpc_server.h
395 + /usr/include/samba-4.0/ctdb.h
396 + /usr/include/samba-4.0/ctdb_client.h
397 + /usr/include/samba-4.0/ctdb_protocol.h
398 + /usr/include/samba-4.0/ctdb_private.h
399 + /usr/include/samba-4.0/ctdb_typesafe_cb.h
400 + /usr/include/samba-4.0/ctdb_version.h
401 +)
402 +
403 +# sys-apps/attr is an automagic dependency (see bug #489748)
404 +CDEPEND="
405 + >=app-arch/libarchive-3.1.2[${MULTILIB_USEDEP}]
406 + dev-lang/perl:=
407 + dev-libs/libaio[${MULTILIB_USEDEP}]
408 + dev-libs/libbsd[${MULTILIB_USEDEP}]
409 + dev-libs/iniparser:0
410 + dev-libs/popt[${MULTILIB_USEDEP}]
411 + dev-python/subunit[${PYTHON_USEDEP},${MULTILIB_USEDEP}]
412 + >=dev-util/cmocka-1.1.1[${MULTILIB_USEDEP}]
413 + net-libs/libnsl:=[${MULTILIB_USEDEP}]
414 + sys-apps/attr[${MULTILIB_USEDEP}]
415 + >=sys-libs/ldb-1.4.7[ldap(+)?,python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
416 + <sys-libs/ldb-1.5.0[ldap(+)?,python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
417 + sys-libs/libcap
418 + sys-libs/ncurses:0=[${MULTILIB_USEDEP}]
419 + sys-libs/readline:0=
420 + >=sys-libs/talloc-2.1.14[python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
421 + >=sys-libs/tdb-1.3.16[python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
422 + >=sys-libs/tevent-0.9.37[python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
423 + sys-libs/zlib[${MULTILIB_USEDEP}]
424 + virtual/libiconv
425 + pam? ( virtual/pam )
426 + acl? ( virtual/acl )
427 + addns? (
428 + net-dns/bind-tools[gssapi]
429 + dev-python/dnspython:=[${PYTHON_USEDEP}]
430 + )
431 + ceph? ( sys-cluster/ceph )
432 + cluster? (
433 + net-libs/rpcsvc-proto
434 + !dev-db/ctdb
435 + )
436 + cups? ( net-print/cups )
437 + debug? ( dev-util/lttng-ust )
438 + dmapi? ( sys-apps/dmapi )
439 + fam? ( virtual/fam )
440 + gnutls? (
441 + dev-libs/libgcrypt:0
442 + >=net-libs/gnutls-1.4.0
443 + )
444 + gpg? ( app-crypt/gpgme )
445 + json? ( dev-libs/jansson )
446 + ldap? ( net-nds/openldap[${MULTILIB_USEDEP}] )
447 + system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl,${MULTILIB_USEDEP}] )
448 + system-mitkrb5? ( >=app-crypt/mit-krb5-1.15.1[${MULTILIB_USEDEP}] )
449 + systemd? ( sys-apps/systemd:0= )
450 +"
451 +DEPEND="${CDEPEND}
452 + ${PYTHON_DEPS}
453 + app-text/docbook-xsl-stylesheets
454 + dev-libs/libxslt
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 + !dev-perl/Parse-Yapp
474 +"
475 +
476 +REQUIRED_USE="
477 + addc? ( python gnutls json winbind )
478 + addns? ( python )
479 + ads? ( acl gnutls ldap winbind )
480 + cluster? ( ads )
481 + gpg? ( addc )
482 + test? ( python )
483 + ?? ( system-heimdal system-mitkrb5 )
484 + ${PYTHON_REQUIRED_USE}
485 +"
486 +
487 +# the test suite is messed, it uses system-installed samba
488 +# bits instead of what was built, tests things disabled via use
489 +# flags, and generally just fails to work in a way ebuilds could
490 +# rely on in its current state
491 +RESTRICT="test"
492 +
493 +S="${WORKDIR}/${MY_P}"
494 +
495 +PATCHES=(
496 + "${FILESDIR}/${PN}-4.4.0-pam.patch"
497 + "${FILESDIR}/${PN}-4.5.1-compile_et_fix.patch"
498 + "${FILESDIR}/${PN}-4.9.2-timespec.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 + $(multilib_native_use_with acl acl-support)
560 + $(multilib_native_usex addc '' '--without-ad-dc')
561 + $(multilib_native_use_with addns dnsupdate)
562 + $(multilib_native_use_with ads)
563 + $(multilib_native_use_enable ceph cephfs)
564 + $(multilib_native_use_with cluster cluster-support)
565 + $(multilib_native_use_enable cups)
566 + $(multilib_native_use_with dmapi)
567 + $(multilib_native_use_with fam)
568 + $(multilib_native_use_with gpg gpgme)
569 + $(multilib_native_use_with json json-audit)
570 + $(multilib_native_use_enable iprint)
571 + $(multilib_native_use_with pam)
572 + $(multilib_native_usex pam "--with-pammodulesdir=${EPREFIX}/$(get_libdir)/security" '')
573 + $(multilib_native_use_with quota quotas)
574 + $(multilib_native_use_with syslog)
575 + $(multilib_native_use_with systemd)
576 + $(multilib_native_use_with winbind)
577 + $(multilib_native_usex python '' '--disable-python')
578 + $(multilib_native_use_enable zeroconf avahi)
579 + $(multilib_native_usex test '--enable-selftest' '')
580 + $(usex system-mitkrb5 "--with-system-mitkrb5 $(multilib_native_usex addc --with-experimental-mit-ad-dc '')" '')
581 + $(use_enable gnutls)
582 + $(use_with debug lttng)
583 + $(use_with ldap)
584 + $(use_with profiling-data)
585 + )
586 + multilib_is_native_abi && myconf+=( --with-shared-modules=${SHAREDMODS} )
587 +
588 + CPPFLAGS="-I${SYSROOT}${EPREFIX}/usr/include/et ${CPPFLAGS}" \
589 + waf-utils_src_configure ${myconf[@]}
590 +}
591 +
592 +multilib_src_compile() {
593 + waf-utils_src_compile
594 +}
595 +
596 +multilib_src_install() {
597 + waf-utils_src_install
598 +
599 + # Make all .so files executable
600 + find "${ED}" -type f -name "*.so" -exec chmod +x {} + || die
601 +
602 + if multilib_is_native_abi ; then
603 + # install ldap schema for server (bug #491002)
604 + if use ldap ; then
605 + insinto /etc/openldap/schema
606 + doins examples/LDAP/samba.schema
607 + fi
608 +
609 + # create symlink for cups (bug #552310)
610 + if use cups ; then
611 + dosym ../../../bin/smbspool /usr/libexec/cups/backend/smb
612 + fi
613 +
614 + # install example config file
615 + insinto /etc/samba
616 + doins examples/smb.conf.default
617 +
618 + # Fix paths in example file (#603964)
619 + sed \
620 + -e '/log file =/s@/usr/local/samba/var/@/var/log/samba/@' \
621 + -e '/include =/s@/usr/local/samba/lib/@/etc/samba/@' \
622 + -e '/path =/s@/usr/local/samba/lib/@/var/lib/samba/@' \
623 + -e '/path =/s@/usr/local/samba/@/var/lib/samba/@' \
624 + -e '/path =/s@/usr/spool/samba@/var/spool/samba@' \
625 + -i "${ED%/}"/etc/samba/smb.conf.default || die
626 +
627 + # Install init script and conf.d file
628 + newinitd "${CONFDIR}/samba4.initd-r1" samba
629 + newconfd "${CONFDIR}/samba4.confd" samba
630 +
631 + systemd_dotmpfilesd "${FILESDIR}"/samba.conf
632 + systemd_dounit "${FILESDIR}"/nmbd.service
633 + systemd_dounit "${FILESDIR}"/smbd.{service,socket}
634 + systemd_newunit "${FILESDIR}"/smbd_at.service 'smbd@.service'
635 + systemd_dounit "${FILESDIR}"/winbindd.service
636 + systemd_dounit "${FILESDIR}"/samba.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 || die
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/{ctdb,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 the 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 +}