summaryrefslogtreecommitdiff
path: root/net-fs
diff options
context:
space:
mode:
authorSeemant Kulleen <seemant@gentoo.org>2005-07-28 12:13:37 +0000
committerSeemant Kulleen <seemant@gentoo.org>2005-07-28 12:13:37 +0000
commitc8ac990b095df607e96c9a7510a1ef872f524de3 (patch)
tree40bfebe691bf8d7a37b609c2b588ff323160a71b /net-fs
parentoops, missed alpha keyword (diff)
downloadhistorical-c8ac990b095df607e96c9a7510a1ef872f524de3.tar.gz
historical-c8ac990b095df607e96c9a7510a1ef872f524de3.tar.bz2
historical-c8ac990b095df607e96c9a7510a1ef872f524de3.zip
version bump to: 1.2.13 in the stable (2.4 kernel) branch and 1.3.85 in the testing branch for 2.6 kernels. Note that 1.3.85 should work with 2.4 kernels as well. This hard work was done by up and coming Gentoo developer Stefaan DeRoeck <stefaan.deroeck@gmail.com>.
Package-Manager: portage-2.0.51.22-r2
Diffstat (limited to 'net-fs')
-rw-r--r--net-fs/openafs/ChangeLog12
-rw-r--r--net-fs/openafs/files/digest-openafs-1.2.10-r21
-rw-r--r--net-fs/openafs/files/digest-openafs-1.2.132
-rw-r--r--net-fs/openafs/files/digest-openafs-1.3.852
-rw-r--r--net-fs/openafs/metadata.xml8
-rw-r--r--net-fs/openafs/openafs-1.2.10-r2.ebuild132
-rw-r--r--net-fs/openafs/openafs-1.2.13.ebuild266
-rw-r--r--net-fs/openafs/openafs-1.3.85.ebuild270
8 files changed, 558 insertions, 135 deletions
diff --git a/net-fs/openafs/ChangeLog b/net-fs/openafs/ChangeLog
index e1c9045324e7..a6557f73ed50 100644
--- a/net-fs/openafs/ChangeLog
+++ b/net-fs/openafs/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for net-fs/openafs
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-fs/openafs/ChangeLog,v 1.44 2005/07/27 12:04:13 seemant Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-fs/openafs/ChangeLog,v 1.45 2005/07/28 12:13:37 seemant Exp $
+
+*openafs-1.3.85 (28 Jul 2005)
+*openafs-1.2.13 (28 Jul 2005)
+
+ 28 Jul 2005; Seemant Kulleen <seemant@gentoo.org> metadata.xml,
+ -openafs-1.2.10-r2.ebuild, +openafs-1.2.13.ebuild, +openafs-1.3.85.ebuild:
+ version bump to: 1.2.13 in the stable (2.4 kernel) branch and 1.3.85 in the
+ testing branch for 2.6 kernels. Note that 1.3.85 should work with 2.4
+ kernels as well. This hard work was done by up and coming Gentoo developer
+ Stefaan DeRoeck <stefaan.deroeck@gmail.com>.
27 Jul 2005; Seemant Kulleen <seemant@gentoo.org> -openafs-1.2.10.ebuild,
-openafs-1.2.11.ebuild:
diff --git a/net-fs/openafs/files/digest-openafs-1.2.10-r2 b/net-fs/openafs/files/digest-openafs-1.2.10-r2
deleted file mode 100644
index d83943975b9e..000000000000
--- a/net-fs/openafs/files/digest-openafs-1.2.10-r2
+++ /dev/null
@@ -1 +0,0 @@
-MD5 7c94e5d024d16c581a363de52ed21f95 openafs-1.2.10-src.tar.bz2 10343261
diff --git a/net-fs/openafs/files/digest-openafs-1.2.13 b/net-fs/openafs/files/digest-openafs-1.2.13
new file mode 100644
index 000000000000..577c7bdfddb9
--- /dev/null
+++ b/net-fs/openafs/files/digest-openafs-1.2.13
@@ -0,0 +1,2 @@
+MD5 6a1e6b5ad2da4532d6e1086024150ecd openafs-1.2.13-src.tar.bz2 10354615
+MD5 574492d1b49925ec909217053d29077a openafs-gentoo-0.1.tar.bz2 17005
diff --git a/net-fs/openafs/files/digest-openafs-1.3.85 b/net-fs/openafs/files/digest-openafs-1.3.85
new file mode 100644
index 000000000000..583831a99cd6
--- /dev/null
+++ b/net-fs/openafs/files/digest-openafs-1.3.85
@@ -0,0 +1,2 @@
+MD5 3f31a5dd8dc4c60cf5d6fe7b5e7f9e6c openafs-1.3.85-src.tar.bz2 10985038
+MD5 574492d1b49925ec909217053d29077a openafs-gentoo-0.1.tar.bz2 17005
diff --git a/net-fs/openafs/metadata.xml b/net-fs/openafs/metadata.xml
index c910e830c95e..588c67f1e7c7 100644
--- a/net-fs/openafs/metadata.xml
+++ b/net-fs/openafs/metadata.xml
@@ -3,6 +3,12 @@
<pkgmetadata>
<herd>net-fs</herd>
<maintainer>
- <email>rphillips@gentoo.org</email>
+ <email>stefaan.deroeck@gmail.com</email>
+ <name>Stefaan Deroeck</name>
+</maintainer>
+<maintainer>
+ <email>seemant@gentoo.org</email>
+ <name>Seemant Kulleen</name>
+ <description>Proxy Maintainer</description>
</maintainer>
</pkgmetadata>
diff --git a/net-fs/openafs/openafs-1.2.10-r2.ebuild b/net-fs/openafs/openafs-1.2.10-r2.ebuild
deleted file mode 100644
index 7c1415fb7097..000000000000
--- a/net-fs/openafs/openafs-1.2.10-r2.ebuild
+++ /dev/null
@@ -1,132 +0,0 @@
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-fs/openafs/openafs-1.2.10-r2.ebuild,v 1.11 2005/05/30 18:57:52 swegener Exp $
-
-inherit check-kernel fixheadtails flag-o-matic eutils toolchain-funcs
-
-DESCRIPTION="The AFS 3 scalable distributed file system"
-HOMEPAGE="http://www.openafs.org/"
-SRC_URI="http://openafs.org/dl/openafs/${PV}/${P}-src.tar.bz2"
-
-LICENSE="IPL-1"
-SLOT="0"
-KEYWORDS="~x86 ~alpha ~ia64"
-IUSE=""
-
-DEPEND="virtual/linux-sources
- >=sys-apps/portage-2.0.47-r10
- >=sys-libs/ncurses-5.2
- >=sys-libs/pam-0.75
- >=sys-apps/gawk-3.1.1"
-
-pkg_setup() {
- if is_2_5_kernel || is_2_6_kernel
- then
- die "OpenAFS does not yet support 2.5 and 2.6 kernels"
- fi
-}
-
-src_unpack() {
- unpack ${A}
-
- cd ${S}
- ht_fix_file "acinclude.m4"
- ht_fix_file "config.guess"
- ht_fix_file "src/afsd/afs.rc.linux"
- ht_fix_file "aclocal.m4"
- ht_fix_file "configure"
- ht_fix_file "configure-libafs"
- epatch ${FILESDIR}/openafs-pinstall-execve-1.2.10.patch
- #added for bug #10952
- #tested on x86, alpha, amd64 (rphillips)
- epatch ${FILESDIR}/openafs-typechange.patch
-}
-
-src_compile() {
- # The CC/MT_CC setting is required for link on alpha, and
- # recommended for link on x86 and other arches (even those that
- # don't technically require it).
- # http://marc.theaimsgroup.com/?l=gentoo-dev&m=107112691504786&w=2
- #
- # It's possible that CFLAGS could be added to MT_CC as well, but
- # I'm not experimenting here, just making it work on multiple
- # arches... (12 Jan 2004 agriffis)
- econf --enable-transarc-paths || die econf
- make CC="$(tc-getCC)" MT_CC="$(tc-getCC) -fPIC" || die make
-}
-
-src_install() {
- local sys_name=$(sed -n 's/^SYS_NAME=//p' Makefile) || die sys_name
-
- make dest || die dest
-
- # Client
- cd ${S}/${sys_name}/dest/root.client/usr/vice
-
- insinto /etc/afs/modload
- doins etc/modload/*
- insinto /etc/afs/C
- doins etc/C/*
-
- insinto /etc/afs
- doins ${FILESDIR}/{ThisCell,CellServDB}
- doins etc/afs.conf
-
- # Can't make this in src_install with keepdir because there might
- # be mounted afs filesystems at the time that this package is
- # installed/updated. Can't test with mount because this might not
- # be the host where the package will be installed. The best way
- # to do this is put it in pkg_* functions. (12 Jan 2004 agriffis)
- #mount -t afs | awk '{ exit $3 == "/afs" }' && keepdir /afs
-
- exeinto /etc/init.d
- newexe ${FILESDIR}/afs.rc.rc6 afs
-
- dosbin etc/afsd
-
- # Client Bin
- cd ${S}/${sys_name}/dest
- exeinto /usr/afsws/bin
- doexe bin/*
-
- exeinto /etc/afs/afsws
- doexe etc/*
-
- cp -a include lib ${D}/usr/afsws
- dosym /usr/afsws/lib/afs/libtermlib.a /usr/afsws/lib/afs/libnull.a
-
- # Server
- cd ${S}/${sys_name}/dest/root.server/usr/afs
- exeinto /usr/afs/bin
- doexe bin/*
-
- dodir /usr/vice
- dosym /etc/afs /usr/vice/etc
- dosym /etc/afs/afsws /usr/afsws/etc
-
- dodoc ${FILESDIR}/README
-
- dodir /etc/env.d
- echo 'CONFIG_PROTECT_MASK="/etc/afs/C /etc/afs/afsws"' \
- >> ${D}/etc/env.d/01${PN}
- echo 'PATH=/usr/afsws/bin:/etc/afs/afsws' \
- >> ${D}/etc/env.d/01${PN}
- echo 'ROOTPATH=/usr/afsws/bin:/etc/afs/afsws:/usr/afs/bin' \
- >> ${D}/etc/env.d/01${PN}
-}
-
-pkg_postinst() {
- # See note in src_install regarding this
- mkdir /afs 2>/dev/null
-
- einfo
- einfo "UPDATE CellServDB and ThisCell to your needs !!"
- einfo "FOLLOW THE INSTRUCTIONS IN AFS QUICK BEGINNINGS"
- einfo "PAGE >45 TO DO INITIAL SERVER SETUP"
- einfo
-}
-
-pkg_prerm() {
- # See note in src_install regarding this
- rmdir /afs 2>/dev/null
-}
diff --git a/net-fs/openafs/openafs-1.2.13.ebuild b/net-fs/openafs/openafs-1.2.13.ebuild
new file mode 100644
index 000000000000..6e527b383741
--- /dev/null
+++ b/net-fs/openafs/openafs-1.2.13.ebuild
@@ -0,0 +1,266 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/openafs/openafs-1.2.13.ebuild,v 1.1 2005/07/28 12:13:37 seemant Exp $
+
+inherit check-kernel fixheadtails flag-o-matic eutils toolchain-funcs versionator
+
+PATCHVER=0.1
+DESCRIPTION="The OpenAFS distributed file system"
+HOMEPAGE="http://www.openafs.org/"
+SRC_URI="http://openafs.org/dl/${PN}/${PV}/${P}-src.tar.bz2
+ mirror://gentoo/${PN}-gentoo-${PATCHVER}.tar.bz2
+ http://dev.gentoo.org/~seemant/distfiles/${PN}-gentoo-${PATCHVER}.tar.bz2"
+
+LICENSE="IPL-1"
+SLOT="0"
+KEYWORDS="~x86 ~alpha ~ia64"
+IUSE="pam"
+
+RDEPEND="=net-fs/openafs-kernel-${PV}*"
+
+PATCHDIR=${WORKDIR}/gentoo/patches/$(get_version_component_range 1-2)
+CONFDIR=${WORKDIR}/gentoo/configs
+
+pkg_setup() {
+ if is_2_5_kernel || is_2_6_kernel
+ then
+ die "Linux 2.6 kernels do not support this openafs version, use 1.3.x"
+ fi
+}
+
+src_unpack() {
+ unpack ${A}; cd ${S}
+
+ ht_fix_file "acinclude.m4"
+ ht_fix_file "config.guess"
+ ht_fix_file "src/afsd/afs.rc.linux"
+ ht_fix_file "aclocal.m4"
+ ht_fix_file "configure"
+ ht_fix_file "configure-libafs"
+ epatch ${FILESDIR}/openafs-pinstall-execve-env.patch
+}
+
+src_compile() {
+ econf \
+ --enable-full-vos-listvol-switch \
+ || die econf
+
+ emake CC="$(tc-getCC) -fPIC" MT_CC="$(tc-getCC)" all_nolibafs || die "Build failed"
+}
+
+src_install() {
+ make DESTDIR=${D} install_nolibafs || die "Installing failed"
+
+ # pam_afs and pam_afs.krb have been installed in irregular locations, fix
+ if use pam; then
+ dodir /$(get_libdir)/security
+ mv ${D}/usr/$(get_libdir)/pam_afs* ${D}/$(get_libdir)/security
+ fi
+
+ # compile_et collides with com_err. Remove it from this package.
+ rm ${D}/usr/bin/compile_et
+
+ # avoid collision with mit_krb5's version of kpasswd
+ mv ${D}/usr/bin/kpasswd ${D}/usr/bin/kpasswd_afs
+
+ # install manuals
+ doman src/man/*.?
+ doman src/aklog/aklog.1
+ use pam && doman src/pam/pam_afs.5
+
+ # documentation
+ dodoc ${CONFDIR}/README ${CONFDIR}/CellServDB ${CONFDIR}/ChangeLog*
+
+ # Gentoo related scripts
+ newconfd ${CONFDIR}/afsconfd afs
+ newinitd ${CONFDIR}/afsinitd afs
+}
+
+pkg_preinst() {
+ # conventions:
+ # only automatically migrate if the destination directories are
+ # as of yet non-existant
+
+ # path translations
+ oldafsconfdir=${ROOT}usr/afs/etc
+ newafsconfdir=${ROOT}etc/openafs/server
+ oldviceetcdir=${ROOT}usr/vice/etc
+ newviceetcdir=${ROOT}etc/openafs
+ oldafsdbdir=${ROOT}usr/afs/db
+ newafsdbdir=${ROOT}var/lib/openafs/db
+ oldafslocaldir=${ROOT}usr/afs/local
+ newafslocaldir=${ROOT}var/lib/openafs
+
+ # detect Transarc afsconfdir
+ afsconfdir=0
+ [ ! -L ${oldafsconfdir} -a -d ${oldafsconfdir} -a ! -e ${newafsconfdir} ] && afsconfdir=1
+
+ # detect Transarc viceetcdir
+ viceetcdir=0
+ viceetcsoftlink=0
+ if [ -d ${oldviceetcdir} -a ! -e ${newviceetcdir} ]; then
+ if [ ! -L ${oldviceetcdir} ]; then
+ viceetcdir=1
+ else
+ if [ $(readlink ${oldviceetcdir}) = /etc/afs ]; then
+ viceetcdir=1
+ viceetcsoftlink=1
+ fi
+ fi
+ fi
+
+ # detect Transarc afsdbdir
+ afsdbdir=0
+ [ ! -L ${oldafsdbdir} -a -d ${oldafsdbdir} -a ! -e ${newafsdbdir} ] && afsdbdir=1
+
+ # detect Transarc afslocaldir
+ afslocaldir=0
+ [ ! -L ${oldafslocaldir} -a -d ${oldafslocaldir} -a ! -e ${newafslocaldir} ] && afslocaldir=1
+
+ # detect Transarc afsbosconfigdir
+ afsbosconfigdir=0
+ [ ${afslocaldir} = 1 -a -f ${ROOT}usr/afs/local/BosConfig ] && afsbosconfigdir=1
+
+ # any of these?
+ any=$((${afsconfdir}+${viceetcdir}+${afsdbdir}+${afslocaldir}))
+
+ # No migration needed? Then bail out
+ if [ ${any} = 0 ]; then
+ return 0
+ fi
+
+ # Root not / ? Then do not attempt automatic migration
+ if [ "$ROOT" != "/" ]; then
+ ewarn Old-style configuration files found, but not migrating
+ ewarn because installation rootdir is not /
+ ebeep 5
+ return 0
+ fi
+
+ # detect whether an installation with old config files is running
+ if pid=$(pgrep -n -U 0 bosserver) &>/dev/null; then
+ # find location of executable
+ if ! executable=$(readlink /proc/${pid}/exe); then
+ die "Couldn't execute readlink on bosserver process"
+ fi
+ # if executable is not located in /usr/sbin, assume Transarc locations
+ if [[ $executable != ${ROOT}usr/sbin/* ]]; then
+ ewarn "Found a running process with the name \"bosserver\" and pid ${pid}"
+ ewarn "that is not located in /usr/sbin. This suggests a running"
+ ewarn "OpenAFS-server with traditional TransARC path conventions."
+ ewarn "This installation procedure aims to migrate old"
+ ewarn "configuration files to new FHS-conform locations."
+ ewarn "Please stop the running server and reattempt the upgrade"
+ die "Installation aborted because of running OpenAFS server"
+ fi
+ fi
+
+ # warn about migration
+ ewarn
+ ewarn "OpenAFS configuration/data-files have been found in old"
+ ewarn "TransARC-style locations, for which the standard FHS equivalents"
+ ewarn "do not exist yet. "
+ ewarn "Following procedure will copy those files to the new locations such"
+ ewarn "that, given a previously working configuration, both server"
+ ewarn "and client should restart without problems. Files will be copied"
+ ewarn "only, and not removed from the old locations. For assistance"
+ ewarn "in removing the old files, consult the documentation in"
+ ewarn "/usr/share/openafs/gentoo"
+ ewarn "Will continue in 30 seconds, press Ctrl-C to abort"
+ ewarn
+ ebeep 10
+ epause 20
+
+ # fortunately, there's no overlap between the old locations and the new ones
+
+ # afsconfdir: migrate /usr/afs/etc to /etc/openafs/server
+ if [ ${afsconfdir} = 1 ]; then
+ mkdir -m 755 -p ${newafsconfdir}
+ cp ${oldafsconfdir}/* ${newafsconfdir}
+ fi
+
+ # viceetcdir: migrate /usr/vice/etc (likely a link to /etc/afs) to /etc/openafs
+ if [ ${viceetcdir} = 1 ]; then
+ mkdir -m 755 -p ${newviceetcdir}
+ cp ${oldviceetcdir}/* ${newviceetcdir}
+ fi
+
+ # afsdbdir: migrate /usr/afs/db to /var/lib/openafs/db
+ if [ ${afsdbdir} = 1 ]; then
+ mkdir -m 755 -p ${newafsdbdir}
+ cp ${oldafsdbdir}/* ${newafsdbdir}
+ fi
+
+ # afslocaldir: migrate /usr/afs/local to /var/lib/openafs
+ if [ ${afslocaldir} = 1 ]; then
+ mkdir -m 755 -p ${newafslocaldir}
+ cp ${oldafslocaldir}/* ${newafslocaldir}
+
+ # afsbosconfigdir: migrate /usr/afs/local/BosConfig to /etc/openafs/BosConfig
+ if [ ${afsbosconfigdir} = 1 ]; then
+ sed -i \
+ -e 's:/usr/afs/bin/:/usr/libexec/openafs/:g' \
+ -e 's:/usr/afs/etc:/etc/openafs:g' \
+ -e 's:/usr/afs/bin:/usr/bin:g' \
+ ${newafslocaldir}/BosConfig
+ if [ -d ${newviceetcdir} ]; then
+ mv ${newafslocaldir}/BosConfig ${newviceetcdir}
+ else
+ ewarn
+ ewarn "No ${newviceetcdir} found, couldn't move BosConfig there,"
+ ewarn "it will remain in ${newafslocaldir}. Please investigate"
+ ewarn "before attempting to start the server"
+ ewarn
+ ebeep 3
+ fi
+ fi
+ fi
+
+ ewarn "Migration finished"
+ ewarn "Please remember to manually migrate disk-cache (if present)"
+ ewarn "Alter /etc/openafs/cacheinfo to do so"
+ ebeep 5
+}
+
+pkg_postinst() {
+ # See bug 9849
+ # Create afs mountpoint
+ mkdir /afs 2>/dev/null
+
+ einfo
+ einfo "For browsing global Cells, please get CellServDB from"
+ einfo "/usr/share/doc/${PF} and put in /etc/openafs. Then start"
+ einfo "using /etc/init.d/afs right away."
+ einfo "For more functionality, look at the limited README in the"
+ einfo "same directory, or turn to the more elaborate procedures"
+ einfo "described on http://www.openafs.org (quick beginnings)"
+ einfo "After initial server setup, you can edit /etc/conf.d/afs"
+ einfo "to enable the BOS Server."
+ einfo ""
+ einfo "To use AFS fully, you need either to start:"
+ einfo "1. kaserver, which is included with openafs but as it is"
+ einfo "based on kerberos4, it is not recommended."
+ einfo "2. app-crypt/kth-krb, but as it is also based on kerberos4 protocol,"
+ einfo " you can keep passwords replicated in contrast to kaserver, but still"
+ einfo " don't waste your time here."
+ einfo "3. app-crypt/heimdal, which is kerberos5 distribution written in Europe,"
+ einfo " so no US export restrictions apply (*recommended*, compatible with"
+ einfo " MIT krb5, see below)."
+ einfo " BTW: if you need kerberos4 backwards compatibility,"
+ einfo " heimdal can be compiled with --with-krb4 switch to provide it, but"
+ einfo " app-crypt/kth-krb must be installed so that heimdal's configure"
+ einfo " can find it. Beware that krb4 approach is not considered"
+ einfo " safe anymore, so do not install kth-krb unless you really need it."
+ einfo "4. app-crypt/mit-krb5, if export restrictions allow you to do so."
+ einfo
+
+ epause 20
+ ebeep 5
+}
+
+pkg_prerm() {
+ # See bug 9849
+ # Remove afs mountpoint
+ rmdir /afs 2>/dev/null
+}
+
diff --git a/net-fs/openafs/openafs-1.3.85.ebuild b/net-fs/openafs/openafs-1.3.85.ebuild
new file mode 100644
index 000000000000..f82929c253b2
--- /dev/null
+++ b/net-fs/openafs/openafs-1.3.85.ebuild
@@ -0,0 +1,270 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/openafs/openafs-1.3.85.ebuild,v 1.1 2005/07/28 12:13:37 seemant Exp $
+
+inherit flag-o-matic eutils toolchain-funcs versionator
+
+PATCHVER=0.1
+DESCRIPTION="The OpenAFS distributed file system"
+HOMEPAGE="http://www.openafs.org/"
+SRC_URI="http://openafs.org/dl/${PN}/${PV}/${P}-src.tar.bz2
+ mirror://gentoo/${PN}-gentoo-${PATCHVER}.tar.bz2
+ http://dev.gentoo.org/~seemant/distfiles/${PN}-gentoo-${PATCHVER}.tar.bz2"
+
+LICENSE="IPL-1"
+SLOT="0"
+KEYWORDS="~x86 ~amd64 ~alpha"
+IUSE="debug kerberos pam"
+
+RDEPEND="=net-fs/openafs-kernel-${PV}
+ pam? ( sys-libs/pam )
+ kerberos? ( virtual/krb5 )"
+
+PATCHDIR=${WORKDIR}/gentoo/patches/$(get_version_component_range 1-2)
+CONFDIR=${WORKDIR}/gentoo/configs
+
+pkg_setup() {
+ if use kerberos; then
+ ewarn "kerberos enabled: This is untested!"
+ fi
+}
+
+src_unpack() {
+ unpack ${A} ; cd ${S}
+
+ # Apply patches to apply chosen compiler settings, fix the hardcoded paths
+ # to be more FHS friendly, and the fix the incorrect typecasts for va_arg
+ EPATCH_SUFFIX="patch" epatch ${PATCHDIR}
+}
+
+src_compile() {
+ # cannot use "use_with" macro, as --without-krb5-config crashes the econf
+ local myconf=""
+ if use kerberos; then
+ myconf="--with-krb5-conf=$(type -p krb5-config)"
+ fi
+
+ econf \
+ $(use_enable pam) \
+ $(use_enable debug) \
+ ${myconf} || die econf
+
+ emake all_nolibafs || die "Build failed"
+}
+
+src_install() {
+ make DESTDIR=${D} install_nolibafs || die "Installing failed"
+
+ # pam_afs and pam_afs.krb have been installed in irregular locations, fix
+ if use pam; then
+ dodir /$(get_libdir)/security
+ mv ${D}/usr/$(get_libdir)/pam_afs* ${D}/$(get_libdir)/security
+ fi
+
+ # compile_et collides with com_err. Remove it from this package.
+ rm ${D}/usr/bin/compile_et
+
+ # avoid collision with mit_krb5's version of kpasswd
+ mv ${D}/usr/bin/kpasswd ${D}/usr/bin/kpasswd_afs
+
+ # install manuals
+ doman src/man/*.?
+
+ use kerberos && doman src/aklog/aklog.1
+ use pam && doman src/pam/pam_afs.5
+
+ # documentation
+ dodoc ${CONFDIR}/README ${CONFDIR}/CellServDB ${CONFDIR}/ChangeLog*
+
+ # Gentoo related scripts
+ newconfd ${CONFDIR}/afsconfd afs
+ newinitd ${CONFDIR}/afsinitd afs
+}
+
+pkg_preinst() {
+ # conventions:
+ # only automatically migrate if the destination directories are
+ # as of yet non-existant
+
+ # path translations
+ oldafsconfdir=${ROOT}usr/afs/etc
+ newafsconfdir=${ROOT}etc/openafs/server
+ oldviceetcdir=${ROOT}usr/vice/etc
+ newviceetcdir=${ROOT}etc/openafs
+ oldafsdbdir=${ROOT}usr/afs/db
+ newafsdbdir=${ROOT}var/lib/openafs/db
+ oldafslocaldir=${ROOT}usr/afs/local
+ newafslocaldir=${ROOT}var/lib/openafs
+
+ # detect Transarc afsconfdir
+ afsconfdir=0
+ [ ! -L ${oldafsconfdir} -a -d ${oldafsconfdir} -a ! -e ${newafsconfdir} ] && afsconfdir=1
+
+ # detect Transarc viceetcdir
+ viceetcdir=0
+ viceetcsoftlink=0
+ if [ -d ${oldviceetcdir} -a ! -e ${newviceetcdir} ]; then
+ if [ ! -L ${oldviceetcdir} ]; then
+ viceetcdir=1
+ else
+ if [ $(readlink ${oldviceetcdir}) = /etc/afs ]; then
+ viceetcdir=1
+ viceetcsoftlink=1
+ fi
+ fi
+ fi
+
+ # detect Transarc afsdbdir
+ afsdbdir=0
+ [ ! -L ${oldafsdbdir} -a -d ${oldafsdbdir} -a ! -e ${newafsdbdir} ] && afsdbdir=1
+
+ # detect Transarc afslocaldir
+ afslocaldir=0
+ [ ! -L ${oldafslocaldir} -a -d ${oldafslocaldir} -a ! -e ${newafslocaldir} ] && afslocaldir=1
+
+ # detect Transarc afsbosconfigdir
+ afsbosconfigdir=0
+ [ ${afslocaldir} = 1 -a -f ${ROOT}usr/afs/local/BosConfig ] && afsbosconfigdir=1
+
+ # any of these?
+ any=$((${afsconfdir}+${viceetcdir}+${afsdbdir}+${afslocaldir}))
+
+ # No migration needed? Then bail out
+ if [ $any = 0 ]; then
+ return 0
+ fi
+
+ # Root not / ? Then do not attempt automatic migration
+ if [ "$ROOT" != "/" ]; then
+ ewarn Old-style configuration files found, but not migrating
+ ewarn because installation rootdir is not /
+ ebeep 5
+ return 0
+ fi
+
+ # detect whether an installation with old config files is running
+ if pid=$(pgrep -n -U 0 bosserver) &>/dev/null; then
+ # find location of executable
+ if ! executable=$(readlink /proc/${pid}/exe); then
+ die "Couldn't execute readlink on bosserver process"
+ fi
+ # if executable is not located in /usr/sbin, assume Transarc locations
+ if [[ $executable != ${ROOT}usr/sbin/* ]]; then
+ ewarn "Found a running process with the name \"bosserver\" and pid ${pid}"
+ ewarn "that is not located in /usr/sbin. This suggests a running"
+ ewarn "OpenAFS-server with traditional TransARC path conventions."
+ ewarn "This installation procedure aims to migrate old"
+ ewarn "configuration files to new FHS-conforming locations."
+ ewarn "Please stop the running server and reattempt the upgrade"
+ die "Installation aborted because of running OpenAFS server"
+ fi
+ fi
+
+ # warn about migration
+ ewarn
+ ewarn "OpenAFS configuration/data-files have been found in old"
+ ewarn "TransARC-style locations, for which the standard FHS equivalents"
+ ewarn "do not exist yet. "
+ ewarn "Following procedure will copy those files to the new locations such"
+ ewarn "that, given a previously working configuration, both server"
+ ewarn "and client should restart without problems. Files will be copied"
+ ewarn "only, and not removed from the old locations. For assistance"
+ ewarn "in removing the old files, consult the documentation in"
+ ewarn "/usr/share/openafs/gentoo"
+ ewarn "Will continue in 30 seconds, press Ctrl-C to abort"
+ ewarn
+ ebeep 10
+ epause 20
+
+ # fortunately, there's no overlap between the old locations and the new ones
+
+ # afsconfdir: migrate /usr/afs/etc to /etc/openafs/server
+ if [ ${afsconfdir} = 1 ]; then
+ mkdir -m 755 -p ${newafsconfdir}
+ cp ${oldafsconfdir}/* ${newafsconfdir}
+ fi
+
+ # viceetcdir: migrate /usr/vice/etc (likely a link to /etc/afs) to /etc/openafs
+ if [ ${viceetcdir} = 1 ]; then
+ mkdir -m 755 -p ${newviceetcdir}
+ cp ${oldviceetcdir}/* ${newviceetcdir}
+ fi
+
+ # afsdbdir: migrate /usr/afs/db to /var/lib/openafs/db
+ if [ ${afsdbdir} = 1 ]; then
+ mkdir -m 755 -p ${newafsdbdir}
+ cp ${oldafsdbdir}/* $newafsdbdir}
+ fi
+
+ # afslocaldir: migrate /usr/afs/local to /var/lib/openafs
+ if [ ${afslocaldir} = 1 ]; then
+ mkdir -m 755 -p ${newafslocaldir}
+ cp ${oldafslocaldir}/* ${newafslocaldir}
+
+ # afsbosconfigdir: migrate /usr/afs/local/BosConfig to /etc/openafs/BosConfig
+ if [ ${afsbosconfigdir} = 1 ]; then
+ sed -i \
+ -e 's:/usr/afs/bin/:/usr/libexec/openafs/:g' \
+ -e 's:/usr/afs/etc:/etc/openafs:g' \
+ -e 's:/usr/afs/bin:/usr/bin:g' \
+ ${newafslocaldir}/BosConfig
+ if [ -d ${newviceetcdir} ]; then
+ mv ${newafslocaldir}/BosConfig ${newviceetcdir}
+ else
+ ewarn
+ ewarn "No ${newviceetcdir} found, couldn't move BosConfig there,"
+ ewarn "it will remain in ${newafslocaldir}. Please investigate"
+ ewarn "before attempting to start the server"
+ ewarn
+ ebeep 3
+ fi
+ fi
+ fi
+
+ ewarn "Migration finished"
+ ewarn "Please remember to manually migrate disk-cache (if present)"
+ ewarn "Alter /etc/openafs/cacheinfo to do so"
+ ebeep 5
+}
+
+pkg_postinst() {
+ # See bug 9849
+ # Create afs mountpoint
+ mkdir /afs 2>/dev/null
+
+ einfo
+ einfo "For browsing global Cells, please get CellServDB from"
+ einfo "/usr/share/doc/${PF} and put in /etc/openafs. Then start"
+ einfo "using /etc/init.d/afs right away."
+ einfo "For more functionality, look at the limited README in the"
+ einfo "same directory, or turn to the more elaborate procedures"
+ einfo "described on http://www.openafs.org (quick beginnings)"
+ einfo "After initial server setup, you can edit /etc/conf.d/afs"
+ einfo "to enable the BOS Server."
+ einfo ""
+ einfo "To use AFS fully, you need either to start:"
+ einfo "1. kaserver, which is included with openafs but as it is"
+ einfo "based on kerberos4, it is not recommended."
+ einfo "2. app-crypt/kth-krb, but as it is also based on kerberos4 protocol,"
+ einfo " you can keep passwords replicated in contrast to kaserver, but still"
+ einfo " don't waste your time here."
+ einfo "3. app-crypt/heimdal, which is kerberos5 distribution written in Europe,"
+ einfo " so no US export restrictions apply (*recommended*, compatible with"
+ einfo " MIT krb5, see below)."
+ einfo " BTW: if you need kerberos4 backwards compatibility,"
+ einfo " heimdal can be compiled with --with-krb4 switch to provide it, but"
+ einfo " app-crypt/kth-krb must be installed so that heimdal's configure"
+ einfo " can find it. Beware that krb4 approach is not considered"
+ einfo " safe anymore, so do not install kth-krb unless you really need it."
+ einfo "4. app-crypt/mit-krb5, if export restrictions allow you to do so."
+ einfo
+ epause 20
+ ebeep 5
+}
+
+pkg_prerm() {
+ # See bug 9849
+ # Remove afs mountpoint
+ rmdir /afs 2>/dev/null
+}
+