diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2009-11-12 09:29:49 +0000 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2009-11-12 09:29:49 +0000 |
commit | 18a76994c5d6c9d6431c3366485f2f6730556a63 (patch) | |
tree | b51748b4ebdcb3b86eec60eb64611ac9ce47912d /sys-block/open-iscsi/open-iscsi-2.0.871-r1.ebuild | |
parent | Version bump (diff) | |
download | gentoo-2-18a76994c5d6c9d6431c3366485f2f6730556a63.tar.gz gentoo-2-18a76994c5d6c9d6431c3366485f2f6730556a63.tar.bz2 gentoo-2-18a76994c5d6c9d6431c3366485f2f6730556a63.zip |
Cleanup remaining modules code so that kernel sources are no longer required. Do not decide what to include in the binpkg based on $ROOT, as it may be for use on a different machine. Always install the utils. Bug #273321: Do not build iscsistart statically. Bug #284871: Fix init.d return codes. Bug #291584: install initiatorname.iscsi in the correct place.
(Portage version: 2.2_rc49/cvs/Linux x86_64)
Diffstat (limited to 'sys-block/open-iscsi/open-iscsi-2.0.871-r1.ebuild')
-rw-r--r-- | sys-block/open-iscsi/open-iscsi-2.0.871-r1.ebuild | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/sys-block/open-iscsi/open-iscsi-2.0.871-r1.ebuild b/sys-block/open-iscsi/open-iscsi-2.0.871-r1.ebuild new file mode 100644 index 000000000000..ebf24f0944d9 --- /dev/null +++ b/sys-block/open-iscsi/open-iscsi-2.0.871-r1.ebuild @@ -0,0 +1,89 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/open-iscsi-2.0.871-r1.ebuild,v 1.1 2009/11/12 09:29:49 robbat2 Exp $ + +EAPI=2 +inherit versionator linux-info eutils flag-o-matic + +DESCRIPTION="Open-iSCSI is a high performance, transport independent, multi-platform implementation of RFC3720" +HOMEPAGE="http://www.open-iscsi.org/" +MY_PV="${PN}-$(replace_version_separator 2 "-" $MY_PV)" +SRC_URI="http://www.open-iscsi.org/bits/${MY_PV}.tar.gz" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86 ~amd64 ~ppc ~mips" +IUSE="debug" +DEPEND="" +RDEPEND="${DEPEND} + sys-apps/util-linux" + +S="${WORKDIR}/${MY_PV}" + +pkg_setup() { + linux-info_pkg_setup + + if [ $KV_PATCH -lt 15 ]; then + die "Sorry, your kernel must be 2.6.16-rc5 or newer!" + fi + + # Needs to be done, as iscsid currently only starts, when having the iSCSI + # support loaded as module. Kernel builtion options don't work. See this for + # more information: + # http://groups.google.com/group/open-iscsi/browse_thread/thread/cc10498655b40507/fd6a4ba0c8e91966 + # If there's a new release, check whether this is still valid! + if linux_config_exists; then + for module in ${CONFIG_CHECK_MODULES}; do + linux_chkconfig_module ${module} || die "${module} needs to be built as module (builtin doesn't work)" + done + fi +} + +src_prepare() { + export EPATCH_OPTS="-d${S}" + epatch "${FILESDIR}"/CVE-2009-1297.patch + epatch "${FILESDIR}"/${PN}-2.0.871-makefile-cleanup.patch +} + +src_compile() { + use debug && append-flags -DDEBUG_TCP -DDEBUG_SCSI + + einfo "Building userspace" + cd "${S}" && \ + CFLAGS="" emake OPTFLAGS="${CFLAGS}" user \ + || die "emake failed" +} + +src_install() { + einfo "Installing userspace" + dosbin usr/iscsid usr/iscsiadm usr/iscsistart + + einfo "Installing utilities" + dosbin utils/iscsi-iname utils/iscsi_discovery + + einfo "Installing docs" + doman doc/*[1-8] + dodoc README THANKS + docinto test + dodoc test/* + + einfo "Installing configuration" + insinto /etc/iscsi + doins etc/iscsid.conf + newins "${FILESDIR}"/initiatorname.iscsi initiatorname.iscsi.example + insinto /etc/iscsi/ifaces + doins etc/iface.example + + newconfd "${FILESDIR}"/iscsid-conf.d iscsid + newinitd "${FILESDIR}"/iscsid-2.0.871-r1.init.d iscsid + + keepdir /var/db/iscsi + fperms 700 /var/db/iscsi + fperms 600 /etc/iscsi/iscsid.conf +} + +pkg_postinst() { + in='/etc/iscsi/initiatorname.iscsi' + if [ ! -f "${ROOT}${in}" -a -f "${ROOT}${in}.example" ]; then + cp -f "${ROOT}${in}.example" "${ROOT}${in}" + fi +} |