Gentoo Archives: gentoo-commits

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