# Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ IUSE="static readline" inherit flag-o-matic S=${WORKDIR}/LVM2.${PV} DESCRIPTION="User-land utilities for LVM2 (Device Mapper) software" SRC_URI="ftp://ftp.sistina.com/pub/LVM2/tools/LVM2.${PV}.tgz" HOMEPAGE="http://www.sistina.com/products_lvm.htm" KEYWORDS="~x86 -ppc ~sparc ~hppa" DEPEND=">=sys-apps/sed-4.0 virtual/linux-sources readline? ( >=sys-libs/readline-4.1 >=sys-libs/ncurses-5.2 )" RDEPEND="" LICENSE="GPL-2 | LGPL-2" SLOT="0" pkg_setup() { # Try to find it. check_KV local KV_major="`uname -r | cut -d. -f1`" local KV_minor="`uname -r | cut -d. -f2`" local KV_micro="`uname -r | cut -d. -f3 | sed -e 's:[^0-9].*::'`" if [ -z "${KERNDIR}" ] then if [ "${KV_major}" -lt 2 -o "${KV_minor}" -lt 5 ] then eerror "You need to be running a 2.5 kernel to use LVM2." eerror "You can force the detection of the kernel source location by setting the KERNDIR environment variable:" eerror "export KERNDIR=/lib/modules//build OR" eerror "export KERNDIR=/usr/src/" die "You need to be running a 2.5 kernel to use LVM2." fi KERNDIR=/lib/modules/${KV}/build if [ ! -d "${KERNDIR}" ] then eerror "You appear to be running kernel version ${KV}, but" eerror "I cannot find any kernel headers in the standard" eerror "build location." echo eerror "I looked here: /lib/modules/${KV}/build." echo die "Couldnt find your kernel source location." fi else if [ ! -d "${KERNDIR}" ] then eerror "Oops? I cant seem to find a kernel here!" eerror "KERNDIR was: ${KERNDIR}" die "Couldnt find your kernel source location." fi fi einfo "Using kernel source found in ${KERNDIR}." } src_compile() { local myconf export MAKEOPTS=${MAKEOPTS/-j?/} filter-flags "-fomit-frame-pointer -pipe" use static && myconf="--enable-static_link" use readline || myconf="--disable-readline" econf ${myconf} || die "configure failed" emake || die "Make failed" } src_install() { einstall sbindir=${D}/sbin libdir=${D}/lib dodir /etc/lvm cp doc/example.conf ${D}/etc/lvm/lvm.conf insinto /etc/init.d doins ${DISTDIR}/lvm2 dodoc BUGS COPYING* INSTALL INTRO README TODO VERSION doc/* }