forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add missed deps - new USE flags based on configure options previously ignored Package-Manager: portage-2.2.28 Signed-off-by: Andrew Savchenko <[email protected]>
- Loading branch information
Showing
3 changed files
with
230 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
DIST openafs-1.6.17-doc.tar.bz2 3529538 SHA256 803e895f9a5dc4c74866e8de20e07a8b7b972ee48b1603fab215b49116117921 SHA512 6056d5f410984a333fcd1581de623c4a4f218269138ab6ee4c9b9622a85ab89748b35d36517c092d8a7bace932fac0d6566645abbca087ae2b5d40e72cd52593 WHIRLPOOL 093b1c770748910af4c2144710350cef131b5621575d5d1648ff90ba54c4de13a1cc0bbcd9c8fcf81b126a81f20998806c90ab3d904446630eac214679c9b650 | ||
DIST openafs-1.6.17-src.tar.bz2 14607107 SHA256 96413a2dbffdc9170cc5dde6aa5ad0ae2383c6106994285ed8f186928813a398 SHA512 3ca61a7731c9bd9bae7da2f7b3900438fcc9f75c95b354574389c2203af2ec0a7b4dcaaf13a437743477fcad8a46c3bbb8c68255a976b9a9917b8f0a0cdf028f WHIRLPOOL 92de51878836a721e6fadbe2f6c7a8069ecf622a08fd05e3a01d8fef376bd2e18e9f3b4715d42a26e8d5f1d665f91924520ed6928ed1f460bac49b1bc906e129 | ||
DIST openafs-1.6.18-doc.tar.bz2 3533400 SHA256 c6a72f5a8c6982202f4b19b038e76abe439f3ce2f867f39ebb6dcce943bf0a84 SHA512 2926f85408cea18da0eacd0cfb5eb61076649e4fc9f85da894a988978874576424af5287ab4080fec9a5012a2079750af6b3fa0ed81a2ede3f2b5001339cbf1e WHIRLPOOL d42ae4a655d5c6e216136df160950976a1f4a559d685a8cd889f5969e25f95be2cfd8e67fb923abb5d2bbc35af279761506e2002a0d81d1f77856cb30ad1d245 | ||
DIST openafs-1.6.18-src.tar.bz2 14645551 SHA256 b3c35e7be6b6c86b91e7c699fd015f53c87bc19d1ae8ec3ec9cda6b97327d3b6 SHA512 e4c9afe857bed240ba2c8fdb0b22e680c10d3bed4cde8966c314610982c5fa6e6ead81bcf869a3cc9d41b8bbcefaaf2d165e8ae6dd6606ebcb5b986fc1aecee8 WHIRLPOOL 62cc93f6a3a549dae4ad111cdaaba907502c75329cbfd0052d4026df29323e35782e4cd9f073c71ac7df42258c5f4a18ba8e0820dbf2dce44a1627ed107b91dc | ||
DIST openafs-patches-20160321.tar.xz 10940 SHA256 b8919d4db7ac962922f797b5f6a855de27f019f43163d4362946ae9b80d73278 SHA512 581f2248cd9926e79d9b2d30d5e9e3349794e8751e0382fd47c59d5d131f7d814744ed9926f008525466afa9c783e59b2f10d3def5d37966aad98c04873cf4c5 WHIRLPOOL 6da7619158dccb5fcc86e73d9d2f0c83f16fdf2dee8bf51e860db307e96262f5e669e2f3d34b166f0b5cd83f9b5b36018efc4de8e45e1265964919b24ac85b1a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,223 @@ | ||
# Copyright 1999-2016 Gentoo Foundation | ||
# Distributed under the terms of the GNU General Public License v2 | ||
# $Id$ | ||
|
||
EAPI="6" | ||
|
||
inherit autotools eutils flag-o-matic multilib pam systemd toolchain-funcs versionator | ||
|
||
MY_PV=$(delete_version_separator '_') | ||
MY_P="${PN}-${MY_PV}" | ||
PVER="20160321" | ||
|
||
DESCRIPTION="The OpenAFS distributed file system" | ||
HOMEPAGE="https://www.openafs.org/" | ||
# We always d/l the doc tarball as man pages are not USE=doc material | ||
[[ ${PV} == *_pre* ]] && MY_PRE="candidate/" || MY_PRE="" | ||
SRC_URI=" | ||
https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-src.tar.bz2 | ||
https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-doc.tar.bz2 | ||
https://dev.gentoo.org/~bircoph/afs/${PN}-patches-${PVER}.tar.xz | ||
" | ||
|
||
LICENSE="IBM BSD openafs-krb5-a APSL-2" | ||
SLOT="0" | ||
KEYWORDS="~amd64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux" | ||
|
||
IUSE="bitmap-later debug doc fuse kerberos +modules ncurses pam pthreaded-ubik +supergroups" | ||
|
||
CDEPEND=" | ||
virtual/libintl | ||
fuse? ( sys-fs/fuse ) | ||
kerberos? ( virtual/krb5 ) | ||
ncurses? ( sys-libs/ncurses:0= ) | ||
pam? ( virtual/pam )" | ||
|
||
DEPEND="${CDEPEND} | ||
virtual/yacc | ||
doc? ( | ||
app-text/docbook-xsl-stylesheets | ||
dev-libs/libxslt | ||
)" | ||
|
||
RDEPEND="${CDEPEND} | ||
modules? ( ~net-fs/openafs-kernel-${PV} )" | ||
|
||
S="${WORKDIR}/${MY_P}" | ||
|
||
PATCHES=( "${WORKDIR}/gentoo/patches" ) | ||
|
||
src_prepare() { | ||
default | ||
|
||
# fixing 2-nd level makefiles to honor flags | ||
sed -i -r 's/\<CFLAGS[[:space:]]*=/CFLAGS+=/; s/\<LDFLAGS[[:space:]]*=/LDFLAGS+=/' \ | ||
src/*/Makefile.in || die '*/Makefile.in sed failed' | ||
|
||
# packaging is f-ed up, so we can't run eautoreconf | ||
# run autotools commands based on what is listed in regen.sh | ||
eaclocal -I src/cf | ||
eautoconf | ||
eautoconf -o configure-libafs configure-libafs.ac | ||
eautoheader | ||
einfo "Deleting autom4te.cache directory" | ||
rm -rf autom4te.cache | ||
} | ||
|
||
src_configure() { | ||
local myconf | ||
use debug && use pam && myconf="--enable-debug-pam" | ||
|
||
AFS_SYSKVERS=26 \ | ||
econf \ | ||
--disable-kernel-module \ | ||
--disable-strip-binaries \ | ||
$(use_enable bitmap-later) \ | ||
$(use_enable debug) \ | ||
$(use_enable debug debug-lwp) \ | ||
$(use_enable fuse fuse-client) \ | ||
$(use_enable ncurses gtx) \ | ||
$(use_enable pam) \ | ||
$(use_enable pthreaded-ubik) \ | ||
$(use_enable supergroups) \ | ||
$(use_with doc html-xsl /usr/share/sgml/docbook/xsl-stylesheets/html/chunk.xsl) \ | ||
$(use_with kerberos krb5) \ | ||
"${myconf}" | ||
} | ||
|
||
src_compile() { | ||
emake all_nolibafs | ||
local d | ||
if use doc; then | ||
for d in doc/xml/{AdminGuide,QuickStartUnix,UserGuide}; do | ||
emake -C "${d}" html; | ||
done | ||
fi | ||
} | ||
|
||
src_install() { | ||
local OPENRCDIR="${WORKDIR}/gentoo/openrc" | ||
local SYSTEMDDIR="${WORKDIR}/gentoo/systemd" | ||
|
||
emake DESTDIR="${ED}" install_nolibafs | ||
|
||
insinto /etc/openafs | ||
doins src/afsd/CellServDB | ||
echo "/afs:/var/cache/openafs:200000" > "${ED}"/etc/openafs/cacheinfo | ||
echo "openafs.org" > "${ED}"/etc/openafs/ThisCell | ||
|
||
# pam_afs and pam_afs.krb have been installed in irregular locations, fix | ||
if use pam ; then | ||
dopammod "${ED}"/usr/$(get_libdir)/pam_afs* | ||
fi | ||
rm -f "${ED}"/usr/$(get_libdir)/pam_afs* || die | ||
|
||
# remove kdump stuff provided by kexec-tools #222455 | ||
rm -rf "${ED}"/usr/sbin/kdump* | ||
|
||
# avoid collision with mit_krb5's version of kpasswd | ||
mv "${ED}"/usr/bin/kpasswd{,_afs} || die | ||
mv "${ED}"/usr/share/man/man1/kpasswd{,_afs}.1 || die | ||
|
||
# move lwp stuff around #200674 #330061 | ||
mv "${ED}"/usr/include/{lwp,lock,timer}.h "${ED}"/usr/include/afs/ || die | ||
mv "${ED}"/usr/$(get_libdir)/liblwp* "${ED}"/usr/$(get_libdir)/afs/ || die | ||
# update paths to the relocated lwp headers | ||
sed -ri \ | ||
-e '/^#include <(lwp|lock|timer).h>/s:<([^>]*)>:<afs/\1>:' \ | ||
"${ED}"/usr/include/*.h \ | ||
"${ED}"/usr/include/*/*.h \ | ||
|| die | ||
|
||
# minimal documentation | ||
use pam && doman src/pam/pam_afs.5 | ||
DOCS=( "${WORKDIR}/gentoo/README.Gentoo" | ||
src/afsd/CellServDB NEWS README ) | ||
|
||
# documentation package | ||
if use doc ; then | ||
DOCS+=( doc/{arch,examples,pdf,protocol,txt} ) | ||
dohtml -r doc/xml/ | ||
fi | ||
|
||
einstalldocs | ||
|
||
# Gentoo related scripts | ||
newinitd "${OPENRCDIR}"/openafs-client.initd openafs-client | ||
newconfd "${OPENRCDIR}"/openafs-client.confd openafs-client | ||
newinitd "${OPENRCDIR}"/openafs-server.initd openafs-server | ||
newconfd "${OPENRCDIR}"/openafs-server.confd openafs-server | ||
systemd_dotmpfilesd "${SYSTEMDDIR}"/tmpfiles.d/openafs-client.conf | ||
systemd_dounit "${SYSTEMDDIR}"/openafs-client.service | ||
systemd_dounit "${SYSTEMDDIR}"/openafs-server.service | ||
systemd_install_serviced "${SYSTEMDDIR}"/openafs-client.service.conf | ||
systemd_install_serviced "${SYSTEMDDIR}"/openafs-server.service.conf | ||
|
||
# used directories: client | ||
keepdir /etc/openafs | ||
|
||
# used directories: server | ||
keepdir /etc/openafs/server | ||
diropts -m0700 | ||
keepdir /var/lib/openafs | ||
keepdir /var/lib/openafs/db | ||
diropts -m0755 | ||
keepdir /var/lib/openafs/logs | ||
|
||
# link logfiles to /var/log | ||
dosym ../lib/openafs/logs /var/log/openafs | ||
} | ||
|
||
pkg_preinst() { | ||
## Somewhat intelligently install default configuration files | ||
## (when they are not present) | ||
local x | ||
for x in cacheinfo CellServDB ThisCell ; do | ||
if [ -e "${EROOT}"/etc/openafs/${x} ] ; then | ||
cp "${EROOT}"/etc/openafs/${x} "${ED}"/etc/openafs/ | ||
fi | ||
done | ||
} | ||
|
||
pkg_postinst() { | ||
elog "This installation should work out of the box (at least the" | ||
elog "client part doing global afs-cell browsing, unless you had" | ||
elog "a previous and different configuration). If you want to" | ||
elog "set up your own cell or modify the standard config," | ||
elog "please have a look at the Gentoo OpenAFS documentation" | ||
elog "(warning: it is not yet up to date wrt the new file locations)" | ||
elog | ||
elog "The documentation can be found at:" | ||
elog " https://wiki.gentoo.org/wiki/OpenAFS" | ||
elog | ||
elog "Systemd users should run emerge --config ${CATEGORY}/${PN} before" | ||
elog "first use and whenever ${EROOT}/etc/openafs/cacheinfo is edited." | ||
} | ||
|
||
pkg_config() { | ||
elog "Setting cache options for systemd." | ||
|
||
SERVICED_FILE="${EROOT}"/etc/systemd/system/openafs-client.service.d/00gentoo.conf | ||
[ ! -e "${SERVICED_FILE}" ] && die "Systemd service.d file ${SERVICED_FILE} not found." | ||
|
||
CACHESIZE=$(cut -d ':' -f 3 "${EROOT}"/etc/openafs/cacheinfo) | ||
[ -z ${CACHESIZE} ] && die "Failed to parse ${EROOT}/etc/openafs/cacheinfo." | ||
|
||
if [ ${CACHESIZE} -lt 131070 ]; then | ||
AFSD_CACHE_ARGS="-stat 300 -dcache 100 -daemons 2 -volumes 50" | ||
elif [ ${CACHESIZE} -lt 524288 ]; then | ||
AFSD_CACHE_ARGS="-stat 2000 -dcache 800 -daemons 3 -volumes 70" | ||
elif [ ${CACHESIZE} -lt 1048576 ]; then | ||
AFSD_CACHE_ARGS="-stat 2800 -dcache 2400 -daemons 5 -volumes 128" | ||
elif [ ${CACHESIZE} -lt 2209715 ]; then | ||
AFSD_CACHE_ARGS="-stat 3600 -dcache 3600 -daemons 5 -volumes 196 -files 50000" | ||
else | ||
AFSD_CACHE_ARGS="-stat 4000 -dcache 4000 -daemons 6 -volumes 256 -files 50000" | ||
fi | ||
|
||
# Replace existing env var if exists, else append line | ||
grep -q "^Environment=\"AFSD_CACHE_ARGS=" "${SERVICED_FILE}" && \ | ||
sed -i "s/^Environment=\"AFSD_CACHE_ARGS=.*/Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"/" "${SERVICED_FILE}" || \ | ||
sed -i "$ a\Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"" "${SERVICED_FILE}" || \ | ||
die "Updating ${SERVICED_FILE} failed." | ||
} |