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: Sat, 30 Apr 2016 14:05:26
Message-Id: 1462025110.efdf53386143027429f7293272221fb193527c51.bircoph@gentoo
1 commit: efdf53386143027429f7293272221fb193527c51
2 Author: Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 30 14:04:49 2016 +0000
4 Commit: Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 30 14:05:10 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=efdf5338
7
8 net-fs/openafs: version bump
9
10 - add missed deps
11 - new USE flags based on configure options previously ignored
12
13 Package-Manager: portage-2.2.28
14 Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org>
15
16 net-fs/openafs/Manifest | 2 +
17 net-fs/openafs/metadata.xml | 5 +
18 net-fs/openafs/openafs-1.6.18.ebuild | 223 +++++++++++++++++++++++++++++++++++
19 3 files changed, 230 insertions(+)
20
21 diff --git a/net-fs/openafs/Manifest b/net-fs/openafs/Manifest
22 index 1469457..4a0162f 100644
23 --- a/net-fs/openafs/Manifest
24 +++ b/net-fs/openafs/Manifest
25 @@ -1,3 +1,5 @@
26 DIST openafs-1.6.17-doc.tar.bz2 3529538 SHA256 803e895f9a5dc4c74866e8de20e07a8b7b972ee48b1603fab215b49116117921 SHA512 6056d5f410984a333fcd1581de623c4a4f218269138ab6ee4c9b9622a85ab89748b35d36517c092d8a7bace932fac0d6566645abbca087ae2b5d40e72cd52593 WHIRLPOOL 093b1c770748910af4c2144710350cef131b5621575d5d1648ff90ba54c4de13a1cc0bbcd9c8fcf81b126a81f20998806c90ab3d904446630eac214679c9b650
27 DIST openafs-1.6.17-src.tar.bz2 14607107 SHA256 96413a2dbffdc9170cc5dde6aa5ad0ae2383c6106994285ed8f186928813a398 SHA512 3ca61a7731c9bd9bae7da2f7b3900438fcc9f75c95b354574389c2203af2ec0a7b4dcaaf13a437743477fcad8a46c3bbb8c68255a976b9a9917b8f0a0cdf028f WHIRLPOOL 92de51878836a721e6fadbe2f6c7a8069ecf622a08fd05e3a01d8fef376bd2e18e9f3b4715d42a26e8d5f1d665f91924520ed6928ed1f460bac49b1bc906e129
28 +DIST openafs-1.6.18-doc.tar.bz2 3533400 SHA256 c6a72f5a8c6982202f4b19b038e76abe439f3ce2f867f39ebb6dcce943bf0a84 SHA512 2926f85408cea18da0eacd0cfb5eb61076649e4fc9f85da894a988978874576424af5287ab4080fec9a5012a2079750af6b3fa0ed81a2ede3f2b5001339cbf1e WHIRLPOOL d42ae4a655d5c6e216136df160950976a1f4a559d685a8cd889f5969e25f95be2cfd8e67fb923abb5d2bbc35af279761506e2002a0d81d1f77856cb30ad1d245
29 +DIST openafs-1.6.18-src.tar.bz2 14645551 SHA256 b3c35e7be6b6c86b91e7c699fd015f53c87bc19d1ae8ec3ec9cda6b97327d3b6 SHA512 e4c9afe857bed240ba2c8fdb0b22e680c10d3bed4cde8966c314610982c5fa6e6ead81bcf869a3cc9d41b8bbcefaaf2d165e8ae6dd6606ebcb5b986fc1aecee8 WHIRLPOOL 62cc93f6a3a549dae4ad111cdaaba907502c75329cbfd0052d4026df29323e35782e4cd9f073c71ac7df42258c5f4a18ba8e0820dbf2dce44a1627ed107b91dc
30 DIST openafs-patches-20160321.tar.xz 10940 SHA256 b8919d4db7ac962922f797b5f6a855de27f019f43163d4362946ae9b80d73278 SHA512 581f2248cd9926e79d9b2d30d5e9e3349794e8751e0382fd47c59d5d131f7d814744ed9926f008525466afa9c783e59b2f10d3def5d37966aad98c04873cf4c5 WHIRLPOOL 6da7619158dccb5fcc86e73d9d2f0c83f16fdf2dee8bf51e860db307e96262f5e669e2f3d34b166f0b5cd83f9b5b36018efc4de8e45e1265964919b24ac85b1a
31
32 diff --git a/net-fs/openafs/metadata.xml b/net-fs/openafs/metadata.xml
33 index a205208..82ce026 100644
34 --- a/net-fs/openafs/metadata.xml
35 +++ b/net-fs/openafs/metadata.xml
36 @@ -11,7 +11,12 @@
37 <description>please CC on bugs</description>
38 </maintainer>
39 <use>
40 + <flag name="bitmap-later">Enable fast startup of file server by
41 + not reading bitmap till needed.</flag>
42 + <flag name="fuse">Build fuse client.</flag>
43 <flag name="modules">Build libafs kernel module. Disable only if you know
44 what you're doing: without this module OpenAFS client will not work.</flag>
45 + <flag name="pthreaded-ubik">Enable installation of pthreaded ubik applications.</flag>
46 + <flag name="supergroups">Enable support for nested pts groups.</flag>
47 </use>
48 </pkgmetadata>
49
50 diff --git a/net-fs/openafs/openafs-1.6.18.ebuild b/net-fs/openafs/openafs-1.6.18.ebuild
51 new file mode 100644
52 index 0000000..36149ff
53 --- /dev/null
54 +++ b/net-fs/openafs/openafs-1.6.18.ebuild
55 @@ -0,0 +1,223 @@
56 +# Copyright 1999-2016 Gentoo Foundation
57 +# Distributed under the terms of the GNU General Public License v2
58 +# $Id$
59 +
60 +EAPI="6"
61 +
62 +inherit autotools eutils flag-o-matic multilib pam systemd toolchain-funcs versionator
63 +
64 +MY_PV=$(delete_version_separator '_')
65 +MY_P="${PN}-${MY_PV}"
66 +PVER="20160321"
67 +
68 +DESCRIPTION="The OpenAFS distributed file system"
69 +HOMEPAGE="https://www.openafs.org/"
70 +# We always d/l the doc tarball as man pages are not USE=doc material
71 +[[ ${PV} == *_pre* ]] && MY_PRE="candidate/" || MY_PRE=""
72 +SRC_URI="
73 + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-src.tar.bz2
74 + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-doc.tar.bz2
75 + https://dev.gentoo.org/~bircoph/afs/${PN}-patches-${PVER}.tar.xz
76 +"
77 +
78 +LICENSE="IBM BSD openafs-krb5-a APSL-2"
79 +SLOT="0"
80 +KEYWORDS="~amd64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
81 +
82 +IUSE="bitmap-later debug doc fuse kerberos +modules ncurses pam pthreaded-ubik +supergroups"
83 +
84 +CDEPEND="
85 + virtual/libintl
86 + fuse? ( sys-fs/fuse )
87 + kerberos? ( virtual/krb5 )
88 + ncurses? ( sys-libs/ncurses:0= )
89 + pam? ( virtual/pam )"
90 +
91 +DEPEND="${CDEPEND}
92 + virtual/yacc
93 + doc? (
94 + app-text/docbook-xsl-stylesheets
95 + dev-libs/libxslt
96 + )"
97 +
98 +RDEPEND="${CDEPEND}
99 + modules? ( ~net-fs/openafs-kernel-${PV} )"
100 +
101 +S="${WORKDIR}/${MY_P}"
102 +
103 +PATCHES=( "${WORKDIR}/gentoo/patches" )
104 +
105 +src_prepare() {
106 + default
107 +
108 + # fixing 2-nd level makefiles to honor flags
109 + sed -i -r 's/\<CFLAGS[[:space:]]*=/CFLAGS+=/; s/\<LDFLAGS[[:space:]]*=/LDFLAGS+=/' \
110 + src/*/Makefile.in || die '*/Makefile.in sed failed'
111 +
112 + # packaging is f-ed up, so we can't run eautoreconf
113 + # run autotools commands based on what is listed in regen.sh
114 + eaclocal -I src/cf
115 + eautoconf
116 + eautoconf -o configure-libafs configure-libafs.ac
117 + eautoheader
118 + einfo "Deleting autom4te.cache directory"
119 + rm -rf autom4te.cache
120 +}
121 +
122 +src_configure() {
123 + local myconf
124 + use debug && use pam && myconf="--enable-debug-pam"
125 +
126 + AFS_SYSKVERS=26 \
127 + econf \
128 + --disable-kernel-module \
129 + --disable-strip-binaries \
130 + $(use_enable bitmap-later) \
131 + $(use_enable debug) \
132 + $(use_enable debug debug-lwp) \
133 + $(use_enable fuse fuse-client) \
134 + $(use_enable ncurses gtx) \
135 + $(use_enable pam) \
136 + $(use_enable pthreaded-ubik) \
137 + $(use_enable supergroups) \
138 + $(use_with doc html-xsl /usr/share/sgml/docbook/xsl-stylesheets/html/chunk.xsl) \
139 + $(use_with kerberos krb5) \
140 + "${myconf}"
141 +}
142 +
143 +src_compile() {
144 + emake all_nolibafs
145 + local d
146 + if use doc; then
147 + for d in doc/xml/{AdminGuide,QuickStartUnix,UserGuide}; do
148 + emake -C "${d}" html;
149 + done
150 + fi
151 +}
152 +
153 +src_install() {
154 + local OPENRCDIR="${WORKDIR}/gentoo/openrc"
155 + local SYSTEMDDIR="${WORKDIR}/gentoo/systemd"
156 +
157 + emake DESTDIR="${ED}" install_nolibafs
158 +
159 + insinto /etc/openafs
160 + doins src/afsd/CellServDB
161 + echo "/afs:/var/cache/openafs:200000" > "${ED}"/etc/openafs/cacheinfo
162 + echo "openafs.org" > "${ED}"/etc/openafs/ThisCell
163 +
164 + # pam_afs and pam_afs.krb have been installed in irregular locations, fix
165 + if use pam ; then
166 + dopammod "${ED}"/usr/$(get_libdir)/pam_afs*
167 + fi
168 + rm -f "${ED}"/usr/$(get_libdir)/pam_afs* || die
169 +
170 + # remove kdump stuff provided by kexec-tools #222455
171 + rm -rf "${ED}"/usr/sbin/kdump*
172 +
173 + # avoid collision with mit_krb5's version of kpasswd
174 + mv "${ED}"/usr/bin/kpasswd{,_afs} || die
175 + mv "${ED}"/usr/share/man/man1/kpasswd{,_afs}.1 || die
176 +
177 + # move lwp stuff around #200674 #330061
178 + mv "${ED}"/usr/include/{lwp,lock,timer}.h "${ED}"/usr/include/afs/ || die
179 + mv "${ED}"/usr/$(get_libdir)/liblwp* "${ED}"/usr/$(get_libdir)/afs/ || die
180 + # update paths to the relocated lwp headers
181 + sed -ri \
182 + -e '/^#include <(lwp|lock|timer).h>/s:<([^>]*)>:<afs/\1>:' \
183 + "${ED}"/usr/include/*.h \
184 + "${ED}"/usr/include/*/*.h \
185 + || die
186 +
187 + # minimal documentation
188 + use pam && doman src/pam/pam_afs.5
189 + DOCS=( "${WORKDIR}/gentoo/README.Gentoo"
190 + src/afsd/CellServDB NEWS README )
191 +
192 + # documentation package
193 + if use doc ; then
194 + DOCS+=( doc/{arch,examples,pdf,protocol,txt} )
195 + dohtml -r doc/xml/
196 + fi
197 +
198 + einstalldocs
199 +
200 + # Gentoo related scripts
201 + newinitd "${OPENRCDIR}"/openafs-client.initd openafs-client
202 + newconfd "${OPENRCDIR}"/openafs-client.confd openafs-client
203 + newinitd "${OPENRCDIR}"/openafs-server.initd openafs-server
204 + newconfd "${OPENRCDIR}"/openafs-server.confd openafs-server
205 + systemd_dotmpfilesd "${SYSTEMDDIR}"/tmpfiles.d/openafs-client.conf
206 + systemd_dounit "${SYSTEMDDIR}"/openafs-client.service
207 + systemd_dounit "${SYSTEMDDIR}"/openafs-server.service
208 + systemd_install_serviced "${SYSTEMDDIR}"/openafs-client.service.conf
209 + systemd_install_serviced "${SYSTEMDDIR}"/openafs-server.service.conf
210 +
211 + # used directories: client
212 + keepdir /etc/openafs
213 +
214 + # used directories: server
215 + keepdir /etc/openafs/server
216 + diropts -m0700
217 + keepdir /var/lib/openafs
218 + keepdir /var/lib/openafs/db
219 + diropts -m0755
220 + keepdir /var/lib/openafs/logs
221 +
222 + # link logfiles to /var/log
223 + dosym ../lib/openafs/logs /var/log/openafs
224 +}
225 +
226 +pkg_preinst() {
227 + ## Somewhat intelligently install default configuration files
228 + ## (when they are not present)
229 + local x
230 + for x in cacheinfo CellServDB ThisCell ; do
231 + if [ -e "${EROOT}"/etc/openafs/${x} ] ; then
232 + cp "${EROOT}"/etc/openafs/${x} "${ED}"/etc/openafs/
233 + fi
234 + done
235 +}
236 +
237 +pkg_postinst() {
238 + elog "This installation should work out of the box (at least the"
239 + elog "client part doing global afs-cell browsing, unless you had"
240 + elog "a previous and different configuration). If you want to"
241 + elog "set up your own cell or modify the standard config,"
242 + elog "please have a look at the Gentoo OpenAFS documentation"
243 + elog "(warning: it is not yet up to date wrt the new file locations)"
244 + elog
245 + elog "The documentation can be found at:"
246 + elog " https://wiki.gentoo.org/wiki/OpenAFS"
247 + elog
248 + elog "Systemd users should run emerge --config ${CATEGORY}/${PN} before"
249 + elog "first use and whenever ${EROOT}/etc/openafs/cacheinfo is edited."
250 +}
251 +
252 +pkg_config() {
253 + elog "Setting cache options for systemd."
254 +
255 + SERVICED_FILE="${EROOT}"/etc/systemd/system/openafs-client.service.d/00gentoo.conf
256 + [ ! -e "${SERVICED_FILE}" ] && die "Systemd service.d file ${SERVICED_FILE} not found."
257 +
258 + CACHESIZE=$(cut -d ':' -f 3 "${EROOT}"/etc/openafs/cacheinfo)
259 + [ -z ${CACHESIZE} ] && die "Failed to parse ${EROOT}/etc/openafs/cacheinfo."
260 +
261 + if [ ${CACHESIZE} -lt 131070 ]; then
262 + AFSD_CACHE_ARGS="-stat 300 -dcache 100 -daemons 2 -volumes 50"
263 + elif [ ${CACHESIZE} -lt 524288 ]; then
264 + AFSD_CACHE_ARGS="-stat 2000 -dcache 800 -daemons 3 -volumes 70"
265 + elif [ ${CACHESIZE} -lt 1048576 ]; then
266 + AFSD_CACHE_ARGS="-stat 2800 -dcache 2400 -daemons 5 -volumes 128"
267 + elif [ ${CACHESIZE} -lt 2209715 ]; then
268 + AFSD_CACHE_ARGS="-stat 3600 -dcache 3600 -daemons 5 -volumes 196 -files 50000"
269 + else
270 + AFSD_CACHE_ARGS="-stat 4000 -dcache 4000 -daemons 6 -volumes 256 -files 50000"
271 + fi
272 +
273 + # Replace existing env var if exists, else append line
274 + grep -q "^Environment=\"AFSD_CACHE_ARGS=" "${SERVICED_FILE}" && \
275 + sed -i "s/^Environment=\"AFSD_CACHE_ARGS=.*/Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"/" "${SERVICED_FILE}" || \
276 + sed -i "$ a\Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"" "${SERVICED_FILE}" || \
277 + die "Updating ${SERVICED_FILE} failed."
278 +}