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

Contents of /eclass/openib.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Wed Apr 16 10:09:29 2014 UTC (8 months ago) by alexxy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +33 -5 lines
Update openib eclass

1 # Copyright 1999-2014 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.10 2014/04/16 07:31:00 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 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.4.1"
46 "3.5"
47 "3.12"
48 )
49
50 # @FUNCTION: block_other_ofed_versions
51 # @DESCRIPTION:
52 # function that creates blockers list for ofed
53 block_other_ofed_versions() {
54 local slot
55 RDEPEND="${RDEPEND} !sys-infiniband/${PN}:0"
56 for slot in ${OFED_VERSIONS[@]}; do
57 if [[ ${slot} != ${SLOT} ]]; then
58 RDEPEND+=" !sys-infiniband/${PN}:${slot}"
59 fi
60 done
61 }
62
63 OFED_BASE_VER=$(get_version_component_range 1-3 ${OFED_VER})
64
65 if [ -z $OFED_RC ] ; then
66 SRC_URI="https://www.openfabrics.org/downloads/OFED/ofed-${OFED_BASE_VER}/OFED-${OFED_VER}.tgz"
67 else
68 SRC_URI="https://www.openfabrics.org/downloads/OFED/ofed-${OFED_BASE_VER}/OFED-${OFED_VER}-rc${OFED_RC_VER}.tgz"
69 fi
70
71 case ${PN} in
72 ofed)
73 case ${PV} in
74 1.5.*|1.5.*.*)
75 MY_PN="ofa_kernel"
76 ;;
77 *)
78 MY_PN="compat-rdma"
79 ;;
80 esac
81 ;;
82 *)
83 MY_PN="${PN}"
84 ;;
85 esac
86
87 case ${PV} in
88 *p*)
89 MY_PV="${PV/p/}"
90 ;;
91 *)
92 MY_PV="${PV}"
93 ;;
94 esac
95
96 case ${MY_PN} in
97 ofa_kernel|compat-rdma)
98 EXT="tgz"
99 ;;
100 *)
101 EXT="tar.gz"
102 ;;
103 esac
104
105 if [ -z ${OFED_SRC_SNAPSHOT} ]; then
106 S="${WORKDIR}/${MY_PN}-${MY_PV}"
107 else
108 S="${WORKDIR}/${MY_PN}-${MY_PV}-${OFED_SUFFIX}"
109 fi
110
111
112 # @FUNCTION: openib_src_unpack
113 # @DESCRIPTION:
114 # This function will unpack OFED packages
115 openib_src_unpack() {
116 unpack ${A}
117 if [ -z ${OFED_RC} ]; then
118 case ${PN} in
119 ofed)
120 rpm_unpack "./OFED-${OFED_VER}/SRPMS/${MY_PN}-${OFED_VER}-${OFED_SUFFIX}.src.rpm"
121 ;;
122 *)
123 rpm_unpack "./OFED-${OFED_VER}/SRPMS/${MY_PN}-${MY_PV}-${OFED_SUFFIX}.src.rpm"
124 ;;
125 esac
126 else
127 case ${PN} in
128 ofed)
129 rpm_unpack "./OFED-${OFED_VER}-rc${OFED_RC_VER}/SRPMS/${MY_PN}-${OFED_VER}-${OFED_SUFFIX}.src.rpm"
130 ;;
131 *)
132 rpm_unpack "./OFED-${OFED_VER}-rc${OFED_RC_VER}/SRPMS/${MY_PN}-${MY_PV}-${OFED_SUFFIX}.src.rpm"
133 ;;
134 esac
135 fi
136 if [ -z ${OFED_SNAPSHOT} ]; then
137 case ${PN} in
138 ofed)
139 unpack ./${MY_PN}-${OFED_VER}.${EXT}
140 ;;
141 *)
142 unpack ./${MY_PN}-${MY_PV}.${EXT}
143 ;;
144 esac
145 else
146 case ${PN} in
147 ofed)
148 unpack ./${MY_PN}-${OFED_VER}-${OFED_SUFFIX}.${EXT}
149 ;;
150 *)
151 unpack ./${MY_PN}-${MY_PV}-${OFED_SUFFIX}.${EXT}
152 ;;
153 esac
154 fi
155 }

  ViewVC Help
Powered by ViewVC 1.1.20