aboutsummaryrefslogtreecommitdiff
blob: 7666bdc12ce214292723df4c4fb8e7e2ac3ed3c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

#
# Original Author: Alexey Shvetsov <alexxy@gentoo.org>
# Purpose:  Simplify working with OFED packages
#

inherit base eutils rpm

EXPORT_FUNCTIONS src_unpack

HOMEPAGE="http://www.openfabrics.org/"
LICENSE="|| ( GPL-2 BSD-2 )"
SLOT="0"

# @ECLASS-VARIABLE: OFED_VER
# @DESCRIPTION:
# Defines OFED version eg 1.4 or 1.4.0.1

# @ECLASS-VARIABLE: OFED_SUFFIX
# @DESCRIPTION:
# Defines OFED package suffix eg -1.ofed1.4

case ${OFED_VER} in
	1.4)
		SRC_URI="http://www.openfabrics.org/downloads/OFED/ofed-1.4/OFED-1.4.tgz"
		;;
	1.4.1)
		SRC_URI="http://www.openfabrics.org/downloads/OFED/ofed-1.4.1/OFED-1.4.1.tgz"
		;;
esac

case ${PN} in
	openib-osm)
		MY_PN="opensm"
		;;
	openib-diags)
		MY_PN="infiniband-diags"
		;;
	openib-files)
		MY_PN="ofa_kernel"
		;;
	openib-perf)
		MY_PN="perftest"
		;;
	rds-tools)
		MY_PV="${PV}-${OFED_SUFFIX}"
		;;
	*)
		MY_PN="${PN}"
esac

case ${PV} in
	*p*)
		MY_PV="${PV/p/}"
		;;
	*)
		MY_PV="${PV}"
		;;
esac

case ${MY_PN} in
	ofa_kernel)
		EXT="tgz"
		;;
	*)
		EXT="tar.gz"
		;;
esac

S="${WORKDIR}/${MY_PN}-${MY_PV}"

# @FUNCTION: openib_src_unpack
# @DESCRIPTION:
# This function will unpack OFED packages
openib_src_unpack() {
	unpack ${A}
	rpm_unpack "OFED-${OFED_VER}/SRPMS/${MY_PN}-${MY_PV}-${OFED_SUFFIX}.src.rpm"
	unpack ./${MY_PN}-${MY_PV}.${EXT}
}