Torsten Kurbad
9f7196c9b7
git-svn-id: svn+ssh://svnintern.kmrc.de/projects/gentoo/iwm-overlay@4226 cbe59ace-07ea-0310-918e-868702b5370d
79 lines
2.2 KiB
Bash
79 lines
2.2 KiB
Bash
# Copyright 1999-2006 Gentoo Foundation
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/open-iscsi-1.0.514.ebuild,v 1.2 2006/05/23 01:55:46 robbat2 Exp $
|
|
|
|
inherit versionator linux-mod eutils flag-o-matic
|
|
|
|
DESCRIPTION="High performance, transport independent, multi-platform implementation of RFC3720."
|
|
HOMEPAGE="http://www.open-iscsi.org/"
|
|
MY_PV="$(replace_version_separator 2 '-')"
|
|
MY_P="${PN}-${MY_PV}"
|
|
SRC_URI="http://www.open-iscsi.org/bits/${MY_P}.tar.gz"
|
|
LICENSE="GPL-2"
|
|
SLOT="0"
|
|
KEYWORDS="~x86 ~amd64 ~ppc"
|
|
IUSE="debug module"
|
|
RDEPEND="virtual/modutils
|
|
sys-apps/util-linux"
|
|
DEPEND="${RDEPEND}
|
|
virtual/linux-sources"
|
|
|
|
S="${WORKDIR}/${MY_P}"
|
|
|
|
MODULE_NAMES_ARG="kernel/drivers/scsi:${S}/kernel"
|
|
MODULE_NAMES="iscsi_tcp(${MODULE_NAMES_ARG}) libiscsi(${MODULE_NAMES_ARG}) scsi_transport_iscsi(${MODULE_NAMES_ARG})"
|
|
BUILD_TARGETS="all"
|
|
CONFIG_CHECK="CRYPTO_CRC32C"
|
|
ERROR_CFG="open-iscsi needs CRC32C support in your kernel."
|
|
|
|
src_compile() {
|
|
if use module; then
|
|
use debug && append-flags -DDEBUG_TCP -DDEBUG_SCSI
|
|
einfo "Building kernel modules"
|
|
export KSRC="${KERNEL_DIR}"
|
|
linux-mod_src_compile || die "failed to build modules"
|
|
fi
|
|
einfo "Building userspace"
|
|
cd usr && emake || die "emake failed"
|
|
}
|
|
|
|
src_install() {
|
|
if use module; then
|
|
einfo "Installing kernel modules"
|
|
export KSRC="${KERNEL_DIR}"
|
|
linux-mod_src_install
|
|
fi
|
|
|
|
einfo "Installing userspace"
|
|
dosbin usr/iscsid usr/iscsiadm usr/iscsistart
|
|
|
|
einfo "Installing docs"
|
|
doman doc/*[1-8]
|
|
dodoc README THANKS
|
|
docinto test
|
|
dodoc test/*
|
|
|
|
einfo "Installing configuration"
|
|
insinto /etc/iscsi
|
|
doins etc/iscsid.conf
|
|
doins ${FILESDIR}/initiatorname.iscsi
|
|
newinitd ${FILESDIR}/iscsid-init.d iscsid
|
|
|
|
# security
|
|
keepdir /var/db/iscsi
|
|
fperms 700 /var/db/iscsi
|
|
fperms 600 /etc/iscsi/iscsid.conf
|
|
}
|
|
|
|
pkg_postinst() {
|
|
use module && linux-mod_pkg_postinst
|
|
[ -d ${ROOT}/var/db/iscsi ] && chmod 700 ${ROOT}/var/db/iscsi
|
|
[ -f ${ROOT}/etc/iscsi/iscsid.conf ] && chmod 600 ${ROOT}/etc/iscsi/iscsid.conf
|
|
ewarn "This new version of open-iscsi is not compatible with the"
|
|
ewarn "open-iscsi-1.0-485 release. You must upgrade your tools and you must"
|
|
ewarn "clear your old DB."
|
|
ewarn "To remove your old DB run: iscsiadm -m db --remove"
|
|
ebeep
|
|
epause 5
|
|
}
|