x11-drivers/xf86-video-i740: ia64 stable wrt bug #611056
[gentoo.git] / sys-block / open-iscsi / open-iscsi-2.0.873.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit versionator linux-info eutils flag-o-matic toolchain-funcs
7
8 MY_P="${PN}-$(replace_version_separator 2 "-")"
9
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"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~alpha amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc x86"
17 IUSE="debug slp"
18
19 DEPEND="slp? ( net-libs/openslp )"
20 RDEPEND="${DEPEND}
21         sys-fs/lsscsi
22         sys-apps/util-linux"
23
24 S="${WORKDIR}/${MY_P}"
25
26 pkg_setup() {
27         linux-info_pkg_setup
28
29         if kernel_is -lt 2 6 16; then
30                 die "Sorry, your kernel must be 2.6.16-rc5 or newer!"
31         fi
32
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
35         # more information:
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)"
42                 done
43         fi
44 }
45
46 src_prepare() {
47         epatch "${FILESDIR}"/${P}-Makefiles.patch
48
49         sed -i -e 's:^\(iscsid.startup\)\s*=.*:\1 = /usr/sbin/iscsid:' etc/iscsid.conf || die
50 }
51
52 src_configure() {
53         cd utils/open-isns || die
54
55         # SSL (--with-security) is broken
56         econf $(use_with slp) \
57                 --without-security
58 }
59
60 src_compile() {
61         use debug && append-flags -DDEBUG_TCP -DDEBUG_SCSI
62
63         KSRC="${KV_DIR}" CFLAGS="" \
64         emake \
65                 OPTFLAGS="${CFLAGS}" \
66                 AR="$(tc-getAR)" CC="$(tc-getCC)" \
67                 user
68 }
69
70 src_install() {
71         emake DESTDIR="${ED}" sbindir="/usr/sbin" install
72
73         dodoc README THANKS
74
75         docinto test/
76         dodoc test/*
77
78         insinto /etc/iscsi
79         newins "${FILESDIR}"/initiatorname.iscsi initiatorname.iscsi.example
80
81         # udev pieces
82         insinto /lib/udev/rules.d
83         doins "${FILESDIR}"/99-iscsi.rules
84         exeinto /etc/udev/scripts
85         doexe "${FILESDIR}"/iscsidev.sh
86
87         newconfd "${FILESDIR}"/iscsid-conf.d iscsid
88         newinitd "${FILESDIR}"/iscsid-init.d iscsid
89
90         keepdir /var/db/iscsi
91         fperms 700 /var/db/iscsi
92         fperms 600 /etc/iscsi/iscsid.conf
93 }