1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit linux-mod eutils flag-o-matic
9 if [ ${PV} == "9999" ] ; then
11 ESVN_REPO_URI="http://svn.code.sf.net/p/iscsitarget/code/trunk"
13 SRC_URI="https://dev.gentoo.org/~ryao/dist/${P}.tar.xz"
14 KEYWORDS="~amd64 ~ppc ~x86"
17 DESCRIPTION="Open Source iSCSI target with professional features"
18 HOMEPAGE="http://iscsitarget.sourceforge.net/"
24 DEPEND="dev-libs/openssl"
27 MODULE_NAMES="iscsi_trgt(misc:${S}/kernel)"
30 CONFIG_CHECK="CRYPTO_CRC32C"
31 ERROR_CFG="iscsitarget needs support for CRC32C in your kernel."
33 kernel_is ge 2 6 14 || die "Linux 2.6.14 or newer required"
35 [ ${PV} != "9999" ] && \
36 { kernel_is le 3 11 || die "Linux 3.11 is the latest supported version."; }
41 if [ ${PV} != "9999" ]
43 # Fix build system to apply proper patches
44 epatch "${FILESDIR}/${PN}-1.4.20.2_p20130103-fix-3.2-support.patch"
46 # Respect LDFLAGS. Bug #365735
47 epatch "${FILESDIR}/${PN}-1.4.20.2-respect-flags-v2.patch"
49 # Avoid use of WRITE_SAME_16 in Linux 2.6.32 and earlier
50 epatch "${FILESDIR}/${PN}-1.4.20.2_p20130103-restore-linux-2.6.32-support.patch"
53 # Apply kernel-specific patches
54 emake KSRC="${KERNEL_DIR}" patch || die
60 emake KSRC="${KERNEL_DIR}" usr || die
64 emake KSRC="${KERNEL_DIR}" kernel || die
68 einfo "Installing userspace"
70 # Install ietd into libexec; we don't need ietd to be in the path
71 # for ROOT, since it's just a service.
75 dosbin usr/ietadm || die
78 doins etc/ietd.conf etc/initiators.allow || die
80 # We moved ietd in /usr/libexec, so update the init script accordingly.
81 sed -e 's:/usr/sbin/ietd:/usr/libexec/ietd:' "${FILESDIR}"/ietd-init.d-2 > "${T}"/ietd-init.d
82 newinitd "${T}"/ietd-init.d ietd || die
83 newconfd "${FILESDIR}"/ietd-conf.d ietd || die
85 # Lock down perms, per bug 198209
86 fperms 0640 /etc/ietd.conf /etc/initiators.allow
88 doman doc/manpages/*.[1-9] || die
89 dodoc ChangeLog README RELEASE_NOTES README.initiators README.mcs README.vmware || die
91 einfo "Installing kernel module"
93 linux-mod_src_install || die