Gentoo Archives: gentoo-commits

From: Andrew Savchenko <bircoph@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-fs/openafs/
Date: Mon, 07 Jan 2019 00:34:20
Message-Id: 1546821246.cc16a1c4c7c5bf5ba63a0ac762333d8a681f3660.bircoph@gentoo
1 commit: cc16a1c4c7c5bf5ba63a0ac762333d8a681f3660
2 Author: Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 6 23:51:43 2019 +0000
4 Commit: Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 7 00:34:06 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc16a1c4
7
8 net-fs/openafs: fix broken dependencies
9
10 1.8.2-r1 fixes seriously broken deps due to RDEPEND <-> DEPEND
11 typo: was "DEPEND=${RDPEND}" instead of the opposite.
12
13 Aside from this missing subslot is provided and couple of
14 deps are moved BDEPEND -> DEPEND because they contain no
15 executables.
16
17 Package-Manager: Portage-2.3.54, Repoman-2.3.12
18 Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org>
19
20 net-fs/openafs/openafs-1.8.2-r1.ebuild | 341 +++++++++++++++++++++++++++++++++
21 1 file changed, 341 insertions(+)
22
23 diff --git a/net-fs/openafs/openafs-1.8.2-r1.ebuild b/net-fs/openafs/openafs-1.8.2-r1.ebuild
24 new file mode 100644
25 index 00000000000..581e282d0b7
26 --- /dev/null
27 +++ b/net-fs/openafs/openafs-1.8.2-r1.ebuild
28 @@ -0,0 +1,341 @@
29 +# Copyright 1999-2019 Gentoo Authors
30 +# Distributed under the terms of the GNU General Public License v2
31 +
32 +EAPI=7
33 +
34 +inherit autotools linux-mod flag-o-matic pam systemd toolchain-funcs
35 +
36 +MY_PV=${PV/_/}
37 +MY_P="${PN}-${MY_PV}"
38 +PVER=20190106
39 +KERNEL_LIMIT=4.21
40 +
41 +DESCRIPTION="The OpenAFS distributed file system"
42 +HOMEPAGE="https://www.openafs.org/"
43 +# We always d/l the doc tarball as man pages are not USE=doc material
44 +[[ ${PV} == *_pre* ]] && MY_PRE="candidate/" || MY_PRE=""
45 +SRC_URI="
46 + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-src.tar.bz2
47 + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-doc.tar.bz2
48 + https://dev.gentoo.org/~bircoph/afs/${PN}-patches-${PVER}.tar.xz
49 +"
50 +
51 +LICENSE="IBM BSD openafs-krb5-a APSL-2"
52 +SLOT="0"
53 +KEYWORDS="~amd64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
54 +
55 +IUSE="api bitmap-later debug doc fuse kauth kerberos +modules +namei
56 +ncurses perl +pthreaded-ubik +supergroups tsm ubik-read-while-write"
57 +
58 +BDEPEND="
59 + dev-lang/perl
60 + sys-devel/flex
61 + virtual/yacc
62 + api? (
63 + app-doc/doxygen
64 + media-gfx/graphviz
65 + )
66 + doc? (
67 + dev-libs/libxslt
68 + || (
69 + dev-java/fop
70 + app-text/dblatex
71 + app-text/docbook-sgml-utils[jadetex]
72 + )
73 + )
74 + perl? ( dev-lang/swig )"
75 +DEPEND="
76 + !net-fs/openafs-kernel
77 + virtual/libintl
78 + amd64? ( tsm? ( app-backup/tsm ) )
79 + doc? (
80 + app-text/docbook-xsl-stylesheets
81 + app-text/docbook-xml-dtd:4.3
82 + )
83 + fuse? ( sys-fs/fuse:0= )
84 + kauth? ( virtual/pam )
85 + kerberos? ( virtual/krb5 )
86 + ncurses? ( sys-libs/ncurses:0= )"
87 +RDEPEND="${DEPEND}"
88 +
89 +S="${WORKDIR}/${MY_P}"
90 +
91 +PATCHES=( "${WORKDIR}/gentoo/patches" )
92 +
93 +CONFIG_CHECK="~!AFS_FS KEYS"
94 +ERROR_AFS_FS="OpenAFS conflicts with the in-kernel AFS-support. Make sure not to load both at the same time!"
95 +ERROR_KEYS="OpenAFS needs CONFIG_KEYS option enabled"
96 +MODULES_OPTIONAL_USE="modules"
97 +
98 +QA_TEXTRELS_x86_fbsd="/boot/modules/libafs.ko"
99 +QA_TEXTRELS_amd64_fbsd="/boot/modules/libafs.ko"
100 +
101 +pkg_pretend() {
102 + if use modules && use kernel_linux && kernel_is -ge ${KERNEL_LIMIT/\./ } ; then
103 + ewarn "Gentoo supports kernels which are supported by OpenAFS"
104 + ewarn "which are limited to the kernel versions: < ${KERNEL_LIMIT}"
105 + ewarn ""
106 + ewarn "You are free to utilize epatch_user to provide whatever"
107 + ewarn "support you feel is appropriate, but will not receive"
108 + ewarn "support as a result of those changes."
109 + ewarn ""
110 + ewarn "Please do not file a bug report about this."
111 + ewarn ""
112 + ewarn "Alternatively, you may:"
113 + ewarn "1. Use OpenAFS FUSE client, build OpenAFS with USE=fuse to enable it."
114 + ewarn "2. Use native kernel AFS client: configure your kernel with CONFIG_AFS_FS."
115 + ewarn "net-fs/openafs is not required in this case, but client's functionality will be limited."
116 + fi
117 +}
118 +
119 +pkg_setup() {
120 + use kernel_linux && linux-mod_pkg_setup
121 +}
122 +
123 +src_prepare() {
124 + default
125 +
126 + # fixing 2-nd level makefiles to honor flags
127 + sed -i -r 's/\<CFLAGS[[:space:]]*=/CFLAGS+=/; s/\<LDFLAGS[[:space:]]*=/LDFLAGS+=/' \
128 + src/*/Makefile.in || die '*/Makefile.in sed failed'
129 + # fix xml docs to use local dtd files
130 + sed -i 's|http://www.oasis-open.org/docbook/xml/4.3|/usr/share/sgml/docbook/xml-dtd-4.3|' \
131 + doc/xml/*/*000.xml || die
132 +
133 + # packaging is f-ed up, so we can't run eautoreconf
134 + # run autotools commands based on what is listed in regen.sh
135 + eaclocal -I src/cf -I src/external/rra-c-util/m4
136 + eautoconf
137 + eautoconf -o configure-libafs configure-libafs.ac
138 + eautoheader
139 + einfo "Deleting autom4te.cache directory"
140 + rm -rf autom4te.cache || die
141 +}
142 +
143 +src_configure() {
144 + local -a myconf
145 +
146 + if use debug; then
147 + use kauth && myconf+=( --enable-debug-pam )
148 + use modules && myconf+=( --enable-debug-kernel )
149 + fi
150 +
151 + if use modules; then
152 + if use kernel_linux; then
153 + if kernel_is -ge 3 17 && kernel_is -le 3 17 2; then
154 + myconf+=( --enable-linux-d_splice_alias-extra-iput )
155 + fi
156 + myconf+=( --with-linux-kernel-headers="${KV_DIR}" \
157 + --with-linux-kernel-build="${KV_OUT_DIR}" )
158 + elif use kernel_FreeBSD; then
159 + myconf+=( --with-bsd-kernel-build="${BSD_BUILD_DIR}" )
160 + fi
161 + fi
162 +
163 + use amd64 && use tsm && myconf+=( --enable-tivoli-tsm )
164 +
165 + local ARCH="$(tc-arch-kernel)"
166 + local MY_ARCH="$(tc-arch)"
167 + local BSD_BUILD_DIR="/usr/src/sys/${MY_ARCH}/compile/GENERIC"
168 +
169 + AFS_SYSKVERS=26 \
170 + econf \
171 + --disable-strip-binaries \
172 + $(use_enable bitmap-later) \
173 + $(use_enable debug) \
174 + $(use_enable debug debug-locks) \
175 + $(use_enable debug debug-lwp) \
176 + $(use_enable fuse fuse-client) \
177 + $(use_enable kauth) \
178 + $(use_enable modules kernel-module) \
179 + $(use_enable namei namei-fileserver) \
180 + $(use_enable ncurses gtx) \
181 + $(use_enable pthreaded-ubik) \
182 + $(use_enable supergroups) \
183 + $(use_enable ubik-read-while-write) \
184 + $(use_with api dot) \
185 + $(use_with doc docbook-stylesheets /usr/share/sgml/docbook/xsl-stylesheets) \
186 + $(use_with kerberos krb5) \
187 + $(use_with kerberos gssapi) \
188 + $(use_with perl swig) \
189 + "${myconf[@]}"
190 +}
191 +
192 +src_compile() {
193 + ARCH="$(tc-arch-kernel)" AR="$(tc-getAR)" emake V=1
194 + local d
195 + if use doc; then
196 + emake -C doc/xml/AdminGuide auagd000.pdf
197 + emake -C doc/xml/AdminRef auarf000.pdf
198 + emake -C doc/xml/QuickStartUnix auqbg000.pdf
199 + emake -C doc/xml/UserGuide auusg000.pdf
200 + fi
201 + use api && doxygen doc/doxygen/Doxyfile
202 +}
203 +
204 +src_install() {
205 + local OPENRCDIR="${WORKDIR}/gentoo/openrc"
206 + local SYSTEMDDIR="${WORKDIR}/gentoo/systemd"
207 +
208 + emake DESTDIR="${ED}" install_nolibafs
209 +
210 + if use modules; then
211 + if use kernel_linux; then
212 + local srcdir=$(expr "${S}"/src/libafs/MODLOAD-*)
213 + [[ -f ${srcdir}/libafs.${KV_OBJ} ]] || die "Couldn't find compiled kernel module"
214 +
215 + MODULE_NAMES="libafs(fs/openafs:${srcdir})"
216 +
217 + linux-mod_src_install
218 + elif use kernel_FreeBSD; then
219 + insinto /boot/modules
220 + doins "${S}"/src/libafs/MODLOAD/libafs.ko
221 + fi
222 + fi
223 +
224 + insinto /etc/openafs
225 + doins src/afsd/CellServDB
226 + echo "/afs:/var/cache/openafs:200000" > "${ED}"/etc/openafs/cacheinfo
227 + echo "openafs.org" > "${ED}"/etc/openafs/ThisCell
228 +
229 + # pam_afs and pam_afs.krb have been installed in irregular locations, fix
230 + if use kauth; then
231 + dopammod "${ED}"/usr/$(get_libdir)/pam_afs*
232 + fi
233 + rm -f "${ED}"/usr/$(get_libdir)/pam_afs* || die
234 +
235 + # remove kdump stuff provided by kexec-tools #222455
236 + rm -rf "${ED}"/usr/sbin/kdump* || die
237 +
238 + # avoid collision with mit_krb5's version of kpasswd
239 + if use kauth; then
240 + mv "${ED}"/usr/bin/kpasswd{,_afs} || die
241 + mv "${ED}"/usr/share/man/man1/kpasswd{,_afs}.1 || die
242 + fi
243 +
244 + # avoid collision with heimdal's pagsh
245 + if has_version app-crypt/heimdal; then
246 + mv "${ED}"/usr/bin/pagsh{,_afs} || die
247 + mv "${ED}"/usr/share/man/man1/pagsh{,_afs}.1 || die
248 + fi
249 +
250 + # move lwp stuff around #200674 #330061
251 + mv "${ED}"/usr/include/{lwp,lock,timer}.h "${ED}"/usr/include/afs/ || die
252 + mv "${ED}"/usr/$(get_libdir)/liblwp* "${ED}"/usr/$(get_libdir)/afs/ || die
253 + # update paths to the relocated lwp headers
254 + sed -ri \
255 + -e '/^#include <(lwp|lock|timer).h>/s:<([^>]*)>:<afs/\1>:' \
256 + "${ED}"/usr/include/*.h \
257 + "${ED}"/usr/include/*/*.h \
258 + || die
259 +
260 + # minimal documentation
261 + use kauth && doman src/pam/pam_afs.5
262 + DOCS=( "${WORKDIR}/gentoo/README.Gentoo"
263 + src/afsd/CellServDB NEWS README )
264 +
265 + # documentation package
266 + rm -rf doc/txt/winnotes || die # unneeded docs
267 + if use doc; then
268 + DOCS+=( doc/{pdf,protocol,txt} CODING CONTRIBUTING )
269 + newdoc doc/xml/AdminGuide/auagd000.pdf AdminGuide.pdf
270 + newdoc doc/xml/AdminRef/auarf000.pdf AdminRef.pdf
271 + newdoc doc/xml/QuickStartUnix/auqbg000.pdf QuickStartUnix.pdf
272 + newdoc doc/xml/UserGuide/auusg000.pdf UserGuide.pdf
273 + fi
274 + use api && DOCS+=( doc/doxygen/output/html )
275 + einstalldocs
276 +
277 + # Gentoo related scripts
278 + newinitd "${OPENRCDIR}"/openafs-client.initd openafs-client
279 + newconfd "${OPENRCDIR}"/openafs-client.confd openafs-client
280 + newinitd "${OPENRCDIR}"/openafs-server.initd openafs-server
281 + newconfd "${OPENRCDIR}"/openafs-server.confd openafs-server
282 + systemd_dotmpfilesd "${SYSTEMDDIR}"/tmpfiles.d/openafs-client.conf
283 + systemd_dounit "${SYSTEMDDIR}"/openafs-client.service
284 + systemd_dounit "${SYSTEMDDIR}"/openafs-server.service
285 + systemd_install_serviced "${SYSTEMDDIR}"/openafs-client.service.conf
286 + systemd_install_serviced "${SYSTEMDDIR}"/openafs-server.service.conf
287 +
288 + # used directories: client
289 + keepdir /etc/openafs
290 +
291 + # used directories: server
292 + keepdir /etc/openafs/server
293 + diropts -m0700
294 + keepdir /var/lib/openafs
295 + keepdir /var/lib/openafs/db
296 + diropts -m0755
297 + keepdir /var/lib/openafs/logs
298 +
299 + # link logfiles to /var/log
300 + dosym ../lib/openafs/logs /var/log/openafs
301 +}
302 +
303 +pkg_preinst() {
304 + ## Somewhat intelligently install default configuration files
305 + ## (when they are not present)
306 + local x
307 + for x in cacheinfo CellServDB ThisCell ; do
308 + if [ -e "${EROOT}"/etc/openafs/${x} ] ; then
309 + cp "${EROOT}"/etc/openafs/${x} "${ED}"/etc/openafs/
310 + fi
311 + done
312 +}
313 +
314 +pkg_postinst() {
315 + if use modules; then
316 + # Update linker.hints file
317 + use kernel_FreeBSD && /usr/sbin/kldxref "${EPREFIX}/boot/modules"
318 + use kernel_linux && linux-mod_pkg_postinst
319 + fi
320 +
321 + elog "This installation should work out of the box (at least the"
322 + elog "client part doing global afs-cell browsing, unless you had"
323 + elog "a previous and different configuration). If you want to"
324 + elog "set up your own cell or modify the standard config,"
325 + elog "please have a look at the Gentoo OpenAFS documentation"
326 + elog "(warning: it is not yet up to date wrt the new file locations)"
327 + elog
328 + elog "The documentation can be found at:"
329 + elog " https://wiki.gentoo.org/wiki/OpenAFS"
330 + elog
331 + elog "Systemd users should run emerge --config ${CATEGORY}/${PN} before"
332 + elog "first use and whenever ${EROOT}/etc/openafs/cacheinfo is edited."
333 +}
334 +
335 +pkg_postrm() {
336 + if use modules; then
337 + # Update linker.hints file
338 + use kernel_FreeBSD && /usr/sbin/kldxref "${EPREFIX}/boot/modules"
339 + use kernel_linux && linux-mod_pkg_postrm
340 + fi
341 +}
342 +
343 +pkg_config() {
344 + elog "Setting cache options for systemd."
345 +
346 + SERVICED_FILE="${EROOT}"/etc/systemd/system/openafs-client.service.d/00gentoo.conf
347 + [ ! -e "${SERVICED_FILE}" ] && die "Systemd service.d file ${SERVICED_FILE} not found."
348 +
349 + CACHESIZE=$(cut -d ':' -f 3 "${EROOT}"/etc/openafs/cacheinfo)
350 + [ -z ${CACHESIZE} ] && die "Failed to parse ${EROOT}/etc/openafs/cacheinfo."
351 +
352 + if [ ${CACHESIZE} -lt 131070 ]; then
353 + AFSD_CACHE_ARGS="-stat 300 -dcache 100 -daemons 2 -volumes 50"
354 + elif [ ${CACHESIZE} -lt 524288 ]; then
355 + AFSD_CACHE_ARGS="-stat 2000 -dcache 800 -daemons 3 -volumes 70"
356 + elif [ ${CACHESIZE} -lt 1048576 ]; then
357 + AFSD_CACHE_ARGS="-stat 2800 -dcache 2400 -daemons 5 -volumes 128"
358 + elif [ ${CACHESIZE} -lt 2209715 ]; then
359 + AFSD_CACHE_ARGS="-stat 3600 -dcache 3600 -daemons 5 -volumes 196 -files 50000"
360 + else
361 + AFSD_CACHE_ARGS="-stat 4000 -dcache 4000 -daemons 6 -volumes 256 -files 50000"
362 + fi
363 +
364 + # Replace existing env var if exists, else append line
365 + grep -q "^Environment=\"AFSD_CACHE_ARGS=" "${SERVICED_FILE}" && \
366 + sed -i "s/^Environment=\"AFSD_CACHE_ARGS=.*/Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"/" "${SERVICED_FILE}" || \
367 + sed -i "$ a\Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"" "${SERVICED_FILE}" || \
368 + die "Updating ${SERVICED_FILE} failed."
369 +}