Gentoo Archives: gentoo-commits

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