/[gentoo-x86]/sys-block/open-iscsi/open-iscsi-2.0.872-r1.ebuild
Gentoo

Contents of /sys-block/open-iscsi/open-iscsi-2.0.872-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Sun Aug 18 15:27:36 2013 UTC (13 months, 2 weeks ago) by ssuominen
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
old

(Portage version: 2.2.0/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/open-iscsi-2.0.872-r1.ebuild,v 1.6 2013/01/06 11:10:30 ago Exp $
4
5 EAPI=2
6 inherit versionator linux-info eutils flag-o-matic toolchain-funcs
7
8 DESCRIPTION="Open-iSCSI is a high performance, transport independent, multi-platform implementation of RFC3720"
9 HOMEPAGE="http://www.open-iscsi.org/"
10 MY_PV="${PN}-$(replace_version_separator 2 "-" $MY_PV)"
11 SRC_URI="http://www.open-iscsi.org/bits/${MY_PV}.tar.gz"
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
15 IUSE="debug slp"
16 DEPEND="slp? ( net-libs/openslp )"
17 RDEPEND="${DEPEND}
18 sys-apps/util-linux"
19
20 S="${WORKDIR}/${MY_PV}"
21
22 pkg_setup() {
23 linux-info_pkg_setup
24
25 if kernel_is -lt 2 6 16; then
26 die "Sorry, your kernel must be 2.6.16-rc5 or newer!"
27 fi
28
29 # Needs to be done, as iscsid currently only starts, when having the iSCSI
30 # support loaded as module. Kernel builtion options don't work. See this for
31 # more information:
32 # http://groups.google.com/group/open-iscsi/browse_thread/thread/cc10498655b40507/fd6a4ba0c8e91966
33 # If there's a new release, check whether this is still valid!
34 CONFIG_CHECK_MODULES="SCSI_ISCSI_ATTRS ISCSI_TCP"
35 if linux_config_exists; then
36 for module in ${CONFIG_CHECK_MODULES}; do
37 linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)"
38 done
39 fi
40 }
41
42 src_prepare() {
43 export EPATCH_OPTS="-d${S}"
44 epatch "${FILESDIR}"/${PN}-2.0.872-makefile-cleanup.patch
45 epatch "${FILESDIR}"/${P}-glibc212.patch
46 epatch "${FILESDIR}"/${P}-dont-call-configure.patch
47 epatch "${FILESDIR}"/${P}-ldflags.patch
48 epatch "${FILESDIR}"/${P}-isns-slp.patch
49 epatch "${FILESDIR}"/${PN}-2.0.872-makefile-cleanup-pass2.patch
50 }
51
52 src_configure() {
53 cd utils/open-isns || die
54 econf $(use_with slp)
55 }
56
57 src_compile() {
58 use debug && append-flags -DDEBUG_TCP -DDEBUG_SCSI
59
60 einfo "Building userspace"
61 local SLP_LIBS
62 use slp && SLP_LIBS="-lslp"
63 cd "${S}" && \
64 KSRC="${KV_DIR}" CFLAGS="" \
65 emake \
66 OPTFLAGS="${CFLAGS}" SLP_LIBS="${SLP_LIBS}" \
67 AR="$(tc-getAR)" CC="$(tc-getCC)" \
68 user \
69 || die "emake failed"
70 }
71
72 src_install() {
73 einfo "Installing userspace"
74 dosbin usr/iscsid usr/iscsiadm usr/iscsistart || die
75
76 einfo "Installing utilities"
77 dosbin utils/iscsi-iname utils/iscsi_discovery || die
78
79 einfo "Installing docs"
80 doman doc/*[1-8] || die
81 dodoc README THANKS || die
82 docinto test || die
83 dodoc test/* || die
84
85 einfo "Installing configuration"
86 insinto /etc/iscsi
87 doins etc/iscsid.conf || die
88 newins "${FILESDIR}"/initiatorname.iscsi initiatorname.iscsi.example || die
89 insinto /etc/iscsi/ifaces
90 doins etc/iface.example || die
91
92 newconfd "${FILESDIR}"/${P}-conf.d iscsid || die
93 newinitd "${FILESDIR}"/${P}-init.d iscsid || die
94
95 keepdir /var/db/iscsi
96 fperms 700 /var/db/iscsi || die
97 fperms 600 /etc/iscsi/iscsid.conf || die
98 }
99
100 pkg_postinst() {
101 in='/etc/iscsi/initiatorname.iscsi'
102 if [ ! -f "${ROOT}${in}" -a -f "${ROOT}${in}.example" ]; then
103 cp -f "${ROOT}${in}.example" "${ROOT}${in}"
104 fi
105 }

  ViewVC Help
Powered by ViewVC 1.1.20