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