1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit versionator linux-info eutils flag-o-matic toolchain-funcs
8 MY_P="${PN}-$(replace_version_separator 2 "-")"
10 DESCRIPTION="Open-iSCSI is a high performance, transport independent, multi-platform implementation of RFC3720"
11 HOMEPAGE="http://www.open-iscsi.org/"
12 SRC_URI="http://www.open-iscsi.org/bits/${MY_P}.tar.gz"
16 KEYWORDS="~alpha amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc x86"
19 DEPEND="slp? ( net-libs/openslp )"
24 S="${WORKDIR}/${MY_P}"
29 if kernel_is -lt 2 6 16; then
30 die "Sorry, your kernel must be 2.6.16-rc5 or newer!"
33 # Needs to be done, as iscsid currently only starts, when having the iSCSI
34 # support loaded as module. Kernel builtion options don't work. See this for
36 # https://groups.google.com/group/open-iscsi/browse_thread/thread/cc10498655b40507/fd6a4ba0c8e91966
37 # If there's a new release, check whether this is still valid!
38 CONFIG_CHECK_MODULES="SCSI_ISCSI_ATTRS ISCSI_TCP"
39 if linux_config_exists; then
40 for module in ${CONFIG_CHECK_MODULES}; do
41 linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)"
47 epatch "${FILESDIR}"/${P}-Makefiles.patch
49 sed -i -e 's:^\(iscsid.startup\)\s*=.*:\1 = /usr/sbin/iscsid:' etc/iscsid.conf || die
53 cd utils/open-isns || die
55 # SSL (--with-security) is broken
56 econf $(use_with slp) \
61 use debug && append-flags -DDEBUG_TCP -DDEBUG_SCSI
63 KSRC="${KV_DIR}" CFLAGS="" \
65 OPTFLAGS="${CFLAGS}" \
66 AR="$(tc-getAR)" CC="$(tc-getCC)" \
71 emake DESTDIR="${ED}" sbindir="/usr/sbin" install
79 newins "${FILESDIR}"/initiatorname.iscsi initiatorname.iscsi.example
82 insinto /lib/udev/rules.d
83 doins "${FILESDIR}"/99-iscsi.rules
84 exeinto /etc/udev/scripts
85 doexe "${FILESDIR}"/iscsidev.sh
87 newconfd "${FILESDIR}"/iscsid-conf.d iscsid
88 newinitd "${FILESDIR}"/iscsid-init.d iscsid
91 fperms 700 /var/db/iscsi
92 fperms 600 /etc/iscsi/iscsid.conf