/[gentoo-x86]/eclass/openib.eclass
Gentoo

Contents of /eclass/openib.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Sun Oct 14 18:18:20 2012 UTC (21 months, 2 weeks ago) by alexxy
Branch: MAIN
Changes since 1.8: +2 -2 lines
[eclass] Add compat-rdma

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/openib.eclass,v 1.8 2012/10/12 16:49:59 alexxy Exp $
4
5 # @ECLASS: openib.eclass
6 # @AUTHOR:
7 # Original Author: Alexey Shvetsov <alexxy@gentoo.org>
8 # @BLURB: Simplify working with OFED packages
9
10 inherit base eutils rpm versionator
11
12 EXPORT_FUNCTIONS src_unpack
13
14 HOMEPAGE="http://www.openfabrics.org/"
15 LICENSE="|| ( GPL-2 BSD-2 )"
16
17 # @ECLASS-VARIABLE: OFED_VER
18 # @DESCRIPTION:
19 # Defines OFED version eg 1.4 or 1.4.0.1
20
21 # @ECLASS-VARIABLE: OFED_RC
22 # @DESCRIPTION:
23 # Sets if this version is RC
24
25 # @ECLASS-VARIABLE: OFED_RC_VER
26 # @DESCRIPTION:
27 # Sets RC version
28
29
30 # @ECLASS-VARIABLE: OFED_SUFFIX
31 # @DESCRIPTION:
32 # Defines OFED package suffix eg -1.ofed1.4
33
34 # @ECLASS-VARIABLE: OFED_SNAPSHOT
35 # @DESCRIPTION:
36 # Defines if src tarball is git snapshot
37
38 SLOT="${OFED_VER}"
39
40 # @ECLASS-VARIABLE: OFED_VERSIONS
41 # @DESCRIPTION:
42 # Defines array of ofed version supported by eclass
43
44 OFED_VERSIONS=(
45 "1.5.1"
46 "1.5.2"
47 "1.5.3"
48 "1.5.3.1"
49 "1.5.3.2"
50 "1.5.4"
51 "1.5.4.1"
52 "3.5"
53 )
54
55 # @FUNCTION: block_other_ofed_versions
56 # @DESCRIPTION:
57 # function that creates blockers list for ofed
58 block_other_ofed_versions() {
59 local slot
60 RDEPEND="${RDEPEND} !sys-infiniband/${PN}:0"
61 for slot in ${OFED_VERSIONS[@]}; do
62 if [[ ${slot} != ${SLOT} ]]; then
63 RDEPEND+=" !sys-infiniband/${PN}:${slot}"
64 fi
65 done
66 }
67
68 OFED_BASE_VER=$(get_version_component_range 1-3 ${OFED_VER})
69
70 if [ -z $OFED_RC ] ; then
71 SRC_URI="http://www.openfabrics.org/downloads/OFED/ofed-${OFED_BASE_VER}/OFED-${OFED_VER}.tgz"
72 else
73 SRC_URI="http://www.openfabrics.org/downloads/OFED/ofed-${OFED_BASE_VER}/OFED-${OFED_VER}-rc${OFED_RC_VER}.tgz"
74 fi
75
76 case ${PN} in
77 ofed)
78 case ${PV} in
79 1.5.*|1.5.*.*)
80 MY_PN="ofa_kernel"
81 ;;
82 *)
83 MY_PN="compat-rdma"
84 ;;
85 esac
86 ;;
87 *)
88 MY_PN="${PN}"
89 ;;
90 esac
91
92 case ${PV} in
93 *p*)
94 MY_PV="${PV/p/}"
95 ;;
96 *)
97 MY_PV="${PV}"
98 ;;
99 esac
100
101 case ${MY_PN} in
102 ofa_kernel|compat-rdma)
103 EXT="tgz"
104 ;;
105 *)
106 EXT="tar.gz"
107 ;;
108 esac
109
110 if [ -z ${OFED_SRC_SNAPSHOT} ]; then
111 S="${WORKDIR}/${MY_PN}-${MY_PV}"
112 else
113 S="${WORKDIR}/${MY_PN}-${MY_PV}-${OFED_SUFFIX}"
114 fi
115
116
117 # @FUNCTION: openib_src_unpack
118 # @DESCRIPTION:
119 # This function will unpack OFED packages
120 openib_src_unpack() {
121 unpack ${A}
122 if [ -z ${OFED_RC} ]; then
123 rpm_unpack "./OFED-${OFED_VER}/SRPMS/${MY_PN}-${MY_PV}-${OFED_SUFFIX}.src.rpm"
124 else
125 rpm_unpack "./OFED-${OFED_VER}-rc${OFED_RC_VER}/SRPMS/${MY_PN}-${MY_PV}-${OFED_SUFFIX}.src.rpm"
126 fi
127 if [ -z ${OFED_SNAPSHOT} ]; then
128 unpack ./${MY_PN}-${MY_PV}.${EXT}
129 else
130 unpack ./${MY_PN}-${MY_PV}-${OFED_SUFFIX}.${EXT}
131 fi
132 }

  ViewVC Help
Powered by ViewVC 1.1.20