Gentoo Archives: gentoo-commits

From: Ben Kohler <bkohler@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-fs/samba/
Date: Sun, 09 Feb 2020 14:47:01
Message-Id: 1581259598.6a19e6bd0004fdf91141e798b405b069412fa114.bkohler@gentoo
1 commit: 6a19e6bd0004fdf91141e798b405b069412fa114
2 Author: Ben Kohler <bkohler <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 9 14:40:02 2020 +0000
4 Commit: Ben Kohler <bkohler <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 9 14:46:38 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a19e6bd
7
8 net-fs/samba: revbump to switch to upstream's systemd units
9
10 Switch to upstream's packaged systemd units with new filenames. Add
11 symlinks to preserve existing setups. Remove unused samba.service when
12 addc is disabled. Fix minor whitespace issue in IUSE.
13
14 Bug: https://bugs.gentoo.org/692602
15 Closes: https://bugs.gentoo.org/573976
16 Package-Manager: Portage-2.3.88, Repoman-2.3.20
17 Signed-off-by: Ben Kohler <bkohler <AT> gentoo.org>
18
19 net-fs/samba/samba-4.11.6-r1.ebuild | 314 ++++++++++++++++++++++++++++++++++++
20 1 file changed, 314 insertions(+)
21
22 diff --git a/net-fs/samba/samba-4.11.6-r1.ebuild b/net-fs/samba/samba-4.11.6-r1.ebuild
23 new file mode 100644
24 index 00000000000..02ee234b50e
25 --- /dev/null
26 +++ b/net-fs/samba/samba-4.11.6-r1.ebuild
27 @@ -0,0 +1,314 @@
28 +# Copyright 1999-2020 Gentoo Authors
29 +# Distributed under the terms of the GNU General Public License v2
30 +
31 +EAPI=6
32 +PYTHON_COMPAT=( python3_{6,7} )
33 +PYTHON_REQ_USE='threads(+),xml(+)'
34 +
35 +inherit python-single-r1 waf-utils multilib-minimal linux-info systemd pam
36 +
37 +MY_PV="${PV/_rc/rc}"
38 +MY_P="${PN}-${MY_PV}"
39 +
40 +SRC_PATH="stable"
41 +[[ ${PV} = *_rc* ]] && SRC_PATH="rc"
42 +
43 +SRC_URI="mirror://samba/${SRC_PATH}/${MY_P}.tar.gz"
44 +[[ ${PV} = *_rc* ]] || \
45 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
46 +
47 +DESCRIPTION="Samba Suite Version 4"
48 +HOMEPAGE="https://www.samba.org/"
49 +LICENSE="GPL-3"
50 +
51 +SLOT="0"
52 +
53 +IUSE="acl addc addns ads ceph client cluster cups debug dmapi fam gpg iprint
54 +json ldap pam profiling-data python quota selinux syslog system-heimdal
55 ++system-mitkrb5 systemd test winbind zeroconf"
56 +
57 +MULTILIB_WRAPPED_HEADERS=(
58 + /usr/include/samba-4.0/policy.h
59 + /usr/include/samba-4.0/dcerpc_server.h
60 + /usr/include/samba-4.0/ctdb.h
61 + /usr/include/samba-4.0/ctdb_client.h
62 + /usr/include/samba-4.0/ctdb_protocol.h
63 + /usr/include/samba-4.0/ctdb_private.h
64 + /usr/include/samba-4.0/ctdb_typesafe_cb.h
65 + /usr/include/samba-4.0/ctdb_version.h
66 +)
67 +
68 +# sys-apps/attr is an automagic dependency (see bug #489748)
69 +CDEPEND="
70 + >=app-arch/libarchive-3.1.2[${MULTILIB_USEDEP}]
71 + dev-lang/perl:=
72 + dev-libs/libaio[${MULTILIB_USEDEP}]
73 + dev-libs/libbsd[${MULTILIB_USEDEP}]
74 + dev-libs/libgcrypt:0
75 + dev-libs/iniparser:0
76 + dev-libs/popt[${MULTILIB_USEDEP}]
77 + dev-python/subunit[${PYTHON_USEDEP},${MULTILIB_USEDEP}]
78 + >=dev-util/cmocka-1.1.1[${MULTILIB_USEDEP}]
79 + >=net-libs/gnutls-3.2.0
80 + net-libs/libnsl:=[${MULTILIB_USEDEP}]
81 + sys-apps/attr[${MULTILIB_USEDEP}]
82 + >=sys-libs/ldb-2.0.8[ldap(+)?,python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
83 + <sys-libs/ldb-2.2.0[ldap(+)?,python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
84 + sys-libs/libcap
85 + sys-libs/ncurses:0=[${MULTILIB_USEDEP}]
86 + sys-libs/readline:0=
87 + >=sys-libs/talloc-2.2.0[python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
88 + >=sys-libs/tdb-1.4.2[python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
89 + >=sys-libs/tevent-0.10.0[python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
90 + sys-libs/zlib[${MULTILIB_USEDEP}]
91 + virtual/libiconv
92 + pam? ( sys-libs/pam )
93 + acl? ( virtual/acl )
94 + addns? (
95 + net-dns/bind-tools[gssapi]
96 + dev-python/dnspython:=[${PYTHON_USEDEP}]
97 + )
98 + ceph? ( sys-cluster/ceph )
99 + cluster? (
100 + net-libs/rpcsvc-proto
101 + !dev-db/ctdb
102 + )
103 + cups? ( net-print/cups )
104 + debug? ( dev-util/lttng-ust )
105 + dmapi? ( sys-apps/dmapi )
106 + fam? ( virtual/fam )
107 + gpg? ( app-crypt/gpgme )
108 + json? ( dev-libs/jansson )
109 + ldap? ( net-nds/openldap[${MULTILIB_USEDEP}] )
110 + system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl,${MULTILIB_USEDEP}] )
111 + system-mitkrb5? ( >=app-crypt/mit-krb5-1.15.1[${MULTILIB_USEDEP}] )
112 + systemd? ( sys-apps/systemd:0= )
113 + zeroconf? ( net-dns/avahi )
114 +"
115 +DEPEND="${CDEPEND}
116 + ${PYTHON_DEPS}
117 + app-text/docbook-xsl-stylesheets
118 + dev-libs/libxslt
119 + net-libs/libtirpc[${MULTILIB_USEDEP}]
120 + virtual/pkgconfig
121 + || (
122 + net-libs/rpcsvc-proto
123 + <sys-libs/glibc-2.26[rpc(+)]
124 + )
125 + test? (
126 + !system-mitkrb5? (
127 + >=sys-libs/nss_wrapper-1.1.3
128 + >=net-dns/resolv_wrapper-1.1.4
129 + >=net-libs/socket_wrapper-1.1.9
130 + >=sys-libs/uid_wrapper-1.2.1
131 + )
132 + )"
133 +RDEPEND="${CDEPEND}
134 + python? ( ${PYTHON_DEPS} )
135 + client? ( net-fs/cifs-utils[ads?] )
136 + selinux? ( sec-policy/selinux-samba )
137 + !dev-perl/Parse-Yapp
138 +"
139 +
140 +REQUIRED_USE="
141 + addc? ( python json winbind )
142 + addns? ( python )
143 + ads? ( acl ldap winbind )
144 + cluster? ( ads )
145 + gpg? ( addc )
146 + test? ( python )
147 + ?? ( system-heimdal system-mitkrb5 )
148 + ${PYTHON_REQUIRED_USE}
149 +"
150 +
151 +# the test suite is messed, it uses system-installed samba
152 +# bits instead of what was built, tests things disabled via use
153 +# flags, and generally just fails to work in a way ebuilds could
154 +# rely on in its current state
155 +RESTRICT="test"
156 +
157 +S="${WORKDIR}/${MY_P}"
158 +
159 +PATCHES=(
160 + "${FILESDIR}/${PN}-4.4.0-pam.patch"
161 + "${FILESDIR}/${PN}-4.9.2-timespec.patch"
162 +)
163 +
164 +#CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
165 +CONFDIR="${FILESDIR}/4.4"
166 +
167 +WAF_BINARY="${S}/buildtools/bin/waf"
168 +
169 +SHAREDMODS=""
170 +
171 +pkg_setup() {
172 + python-single-r1_pkg_setup
173 + if use cluster ; then
174 + SHAREDMODS="idmap_rid,idmap_tdb2,idmap_ad"
175 + elif use ads ; then
176 + SHAREDMODS="idmap_ad"
177 + fi
178 +}
179 +
180 +src_prepare() {
181 + default
182 +
183 + # un-bundle dnspython
184 + sed -i -e '/"dns.resolver":/d' "${S}"/third_party/wscript || die
185 +
186 + # unbundle iso8601 unless tests are enabled
187 + if ! use test ; then
188 + sed -i -e '/"iso8601":/d' "${S}"/third_party/wscript || die
189 + fi
190 +
191 + # ugly hackaround for bug #592502
192 + cp /usr/include/tevent_internal.h "${S}"/lib/tevent/ || die
193 +
194 + sed -e 's:<gpgme\.h>:<gpgme/gpgme.h>:' \
195 + -i source4/dsdb/samdb/ldb_modules/password_hash.c \
196 + || die
197 +
198 + # Friggin' WAF shit
199 + multilib_copy_sources
200 +}
201 +
202 +multilib_src_configure() {
203 + # when specifying libs for samba build you must append NONE to the end to
204 + # stop it automatically including things
205 + local bundled_libs="NONE"
206 + if ! use system-heimdal && ! use system-mitkrb5 ; then
207 + bundled_libs="heimbase,heimntlm,hdb,kdc,krb5,wind,gssapi,hcrypto,hx509,roken,asn1,com_err,NONE"
208 + fi
209 +
210 + local myconf=(
211 + --enable-fhs
212 + --sysconfdir="${EPREFIX}/etc"
213 + --localstatedir="${EPREFIX}/var"
214 + --with-modulesdir="${EPREFIX}/usr/$(get_libdir)/samba"
215 + --with-piddir="${EPREFIX}/run/${PN}"
216 + --bundled-libraries="${bundled_libs}"
217 + --builtin-libraries=NONE
218 + --disable-rpath
219 + --disable-rpath-install
220 + --nopyc
221 + --nopyo
222 + $(multilib_native_use_with acl acl-support)
223 + $(multilib_native_usex addc '' '--without-ad-dc')
224 + $(multilib_native_use_with addns dnsupdate)
225 + $(multilib_native_use_with ads)
226 + $(multilib_native_use_enable ceph cephfs)
227 + $(multilib_native_use_with cluster cluster-support)
228 + $(multilib_native_use_enable cups)
229 + $(multilib_native_use_with dmapi)
230 + $(multilib_native_use_with fam)
231 + $(multilib_native_use_with gpg gpgme)
232 + $(multilib_native_use_with json)
233 + $(multilib_native_use_enable iprint)
234 + $(multilib_native_use_with pam)
235 + $(multilib_native_usex pam "--with-pammodulesdir=${EPREFIX}/$(get_libdir)/security" '')
236 + $(multilib_native_use_with quota quotas)
237 + $(multilib_native_use_with syslog)
238 + $(multilib_native_use_with systemd)
239 + --systemd-install-services
240 + --with-systemddir="$(systemd_get_systemunitdir)"
241 + $(multilib_native_use_with winbind)
242 + $(multilib_native_usex python '' '--disable-python')
243 + $(multilib_native_use_enable zeroconf avahi)
244 + $(multilib_native_usex test '--enable-selftest' '')
245 + $(usex system-mitkrb5 "--with-system-mitkrb5 $(multilib_native_usex addc --with-experimental-mit-ad-dc '')" '')
246 + $(use_with debug lttng)
247 + $(use_with ldap)
248 + $(use_with profiling-data)
249 + )
250 +
251 + multilib_is_native_abi && myconf+=( --with-shared-modules=${SHAREDMODS} )
252 +
253 + CPPFLAGS="-I${SYSROOT}${EPREFIX}/usr/include/et ${CPPFLAGS}" \
254 + waf-utils_src_configure ${myconf[@]}
255 +}
256 +
257 +multilib_src_compile() {
258 + waf-utils_src_compile
259 +}
260 +
261 +multilib_src_install() {
262 + waf-utils_src_install
263 +
264 + # Make all .so files executable
265 + find "${ED}" -type f -name "*.so" -exec chmod +x {} + || die
266 +
267 + if multilib_is_native_abi ; then
268 + # install ldap schema for server (bug #491002)
269 + if use ldap ; then
270 + insinto /etc/openldap/schema
271 + doins examples/LDAP/samba.schema
272 + fi
273 +
274 + # create symlink for cups (bug #552310)
275 + if use cups ; then
276 + dosym ../../../bin/smbspool /usr/libexec/cups/backend/smb
277 + fi
278 +
279 + # install example config file
280 + insinto /etc/samba
281 + doins examples/smb.conf.default
282 +
283 + # Fix paths in example file (#603964)
284 + sed \
285 + -e '/log file =/s@/usr/local/samba/var/@/var/log/samba/@' \
286 + -e '/include =/s@/usr/local/samba/lib/@/etc/samba/@' \
287 + -e '/path =/s@/usr/local/samba/lib/@/var/lib/samba/@' \
288 + -e '/path =/s@/usr/local/samba/@/var/lib/samba/@' \
289 + -e '/path =/s@/usr/spool/samba@/var/spool/samba@' \
290 + -i "${ED%/}"/etc/samba/smb.conf.default || die
291 +
292 + # Install init script and conf.d file
293 + newinitd "${CONFDIR}/samba4.initd-r1" samba
294 + newconfd "${CONFDIR}/samba4.confd" samba
295 +
296 + systemd_dotmpfilesd "${FILESDIR}"/samba.conf
297 + use addc || rm "${D}/$(systemd_get_systemunitdir)/samba.service" || die
298 +
299 + # Preserve functionality for old gentoo-specific unit names
300 + dosym nmb.service "$(systemd_get_systemunitdir)/nmbd.service"
301 + dosym smb.service "$(systemd_get_systemunitdir)/smbd.service"
302 + dosym winbind.service "$(systemd_get_systemunitdir)/winbindd.service"
303 + fi
304 +
305 + if use pam && use winbind ; then
306 + newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind
307 + # bugs #376853 and #590374
308 + insinto /etc/security
309 + doins examples/pam_winbind/pam_winbind.conf
310 + fi
311 +
312 + keepdir /var/cache/samba
313 + keepdir /var/lib/ctdb
314 + keepdir /var/lib/samba/{bind-dns,private}
315 + keepdir /var/lock/samba
316 + keepdir /var/log/samba
317 + keepdir /var/run/{ctdb,samba}
318 +}
319 +
320 +multilib_src_install_all() {
321 + # Attempt to fix bug #673168
322 + find "${ED}" -type d -name "Yapp" -print0 \
323 + | xargs -0 --no-run-if-empty rm -r || die
324 +}
325 +
326 +multilib_src_test() {
327 + if multilib_is_native_abi ; then
328 + "${WAF_BINARY}" test || die "test failed"
329 + fi
330 +}
331 +
332 +pkg_postinst() {
333 + ewarn "Be aware the this release contains the best of all of Samba's"
334 + ewarn "technology parts, both a file server (that you can reasonably expect"
335 + ewarn "to upgrade existing Samba 3.x releases to) and the AD domain"
336 + ewarn "controller work previously known as 'samba4'."
337 +
338 + elog "For further information and migration steps make sure to read "
339 + elog "https://samba.org/samba/history/${P}.html "
340 + elog "https://wiki.samba.org/index.php/Samba4/HOWTO "
341 +}