# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-fs/openafs/openafs-1.2.11.ebuild,v 1.5 2004/06/25 03:10:12 agriffis Exp $ inherit check-kernel fixheadtails flag-o-matic eutils gcc 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 net-misc/ntp" 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.79 for example (beta) which also support files larger 2GB." 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() { # 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 --enable-namei-fileserver --enable-full-vos-listvol-switch --with-linux-kernel-headers=/usr/src/linux --enable-bitmap-later --enable-fast-restart --enable-largefile-fileserver --enable-bos-new-config || die econf make CC="$(gcc-getCC)" MT_CC="$(gcc-getCC)" || die make } src_install() { local sys_name=$(sed -n 's/^SYS_NAME=//p' Makefile) || die sys_name # compile and produce classical, IBM like dest tree make dest || die dest # Don't run make install, it's screwed up in openafs as it installs into # weird locations. Instead, install following the IBM/TransArc path # locations (i.e. /usr/vice and /usr/afs). # Install the client kernel module necessary to make the AFS space visible # under /afs/. cd ${S}/${sys_name}/dest/root.client/usr/vice dodir /usr/vice/etc cd ${S}/${sys_name}/dest/root.client/usr/vice/etc insinto /usr/vice/etc insopts -m0444 # install the client daemon doins afsd insopts -m0411 doins ThisCell CellServDB # install the config file dodir /etc/afs insinto /etc/afs insopts -m0411 doins afs.conf doins ${FILESDIR}/{ThisCell,CellServDB} # symlink configfiles in TransArc location to Gentoo's typical place # dosym /usr/vice/etc/CellServDB /etc/afs/CellServDB # dosym /usr/vice/etc/ThisCell /etc/afs/ThisCell # touch /usr/vice/etc/cacheinfo # install the kernel module cd ${S}/${sys_name}/dest/root.client/usr/vice/etc/modload dodir /usr/vice/etc/C dodir /usr/vice/etc/modload insinto /usr/vice/etc/modload insopts -m0444 doins * # install some catalog file cd ${S}/${sys_name}/dest/root.client/usr/vice/etc/C insinto /usr/vice/etc/C insopts -m0444 doins * # make sure client cache exists dodir /usr/vice/cache mount -t afs | awk '{ exit $3 == "/afs" }' && keepdir /afs exeinto /etc/init.d newexe ${FILESDIR}/afs.rc.rc6 afs # Install the pam library. Warning, it used to be on Gentoo in # /usr/afsws/lib/pam_afs.so.1. I have to figure out why find # still looks for pam module in that location. insinto /lib/security insopts -m0444 cd ${S}/${sys_name}/dest/lib doins pam_afs.krb.so.1 dosym /lib/security/pam_afs.krb.so.1 /lib/security/pam_afs.so # Install the server part, which is a set of daemons and utilities # able to speak to those daemons. dodir /usr/afs insinto /usr/afs/bin insopts -m0444 cd ${S}/${sys_name}/dest/root.server/usr/afs/bin doins * # Install the binary installation tree into TransArc location, # so that afs utilities can fetch the files from there and place # them on other afs machines automatically. dodir /usr/afsws dodir /usr/afsws/${sys_name} cd ${S}/${sys_name}/dest insinto /usr/afsws/${sys_name} insopts -m0444 # Damn, but this doesn't copy the directories, how can I do "cp -r"? doins * cp -a * ${D}/usr/afsws # Hmm, what about this? dodir /etc/env.d # don't know what's this CONFIG_PROTECT_MASK usefull for echo 'CONFIG_PROTECT_MASK="/etc/afs/C /etc/afs/afsws"' \ >> ${D}/etc/env.d/01${PN} echo 'PATH=/usr/afs/bin' \ >> ${D}/etc/env.d/01${PN} echo 'ROOTPATH=/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 /usr/vice/etc/CellServDB, /usr/vice/etc/ThisCell," einfo "/usr/vice/etc/cacheinfo" einfo "to your needs !!" einfo "FOLLOW THE INSTRUCTIONS IN AFS QUICK BEGINNINGS" einfo "PAGE >45 TO DO INITIAL SERVER SETUP:" einfo " http://www.openafs.org/doc/index.htm" 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 "2. 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 "3. app-crypt/mit-krb5, if export restrictions allow you to do so." } pkg_prerm() { # See note in src_install regarding this rmdir /afs 2>/dev/null }