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

Contents of /eclass/openib.eclass

Parent Directory Parent Directory | Revision Log Revision Log


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

1 alexxy 1.10 # Copyright 1999-2014 Gentoo Foundation
2 alexxy 1.1 # Distributed under the terms of the GNU General Public License v2
3 alexxy 1.11 # $Header: /var/cvsroot/gentoo-x86/eclass/openib.eclass,v 1.10 2014/04/16 07:31:00 alexxy Exp $
4 alexxy 1.1
5 vapier 1.2 # @ECLASS: openib.eclass
6     # @AUTHOR:
7 alexxy 1.1 # Original Author: Alexey Shvetsov <alexxy@gentoo.org>
8 vapier 1.2 # @BLURB: Simplify working with OFED packages
9 alexxy 1.1
10 alexxy 1.10 inherit eutils rpm versionator
11 alexxy 1.1
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 alexxy 1.8 # @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 alexxy 1.1 # @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 alexxy 1.3 SLOT="${OFED_VER}"
39    
40 alexxy 1.5 # @ECLASS-VARIABLE: OFED_VERSIONS
41     # @DESCRIPTION:
42     # Defines array of ofed version supported by eclass
43    
44 alexxy 1.3 OFED_VERSIONS=(
45     "1.5.4.1"
46 alexxy 1.8 "3.5"
47 alexxy 1.10 "3.12"
48 alexxy 1.3 )
49    
50 alexxy 1.5 # @FUNCTION: block_other_ofed_versions
51     # @DESCRIPTION:
52     # function that creates blockers list for ofed
53 alexxy 1.3 block_other_ofed_versions() {
54     local slot
55 alexxy 1.8 RDEPEND="${RDEPEND} !sys-infiniband/${PN}:0"
56 alexxy 1.3 for slot in ${OFED_VERSIONS[@]}; do
57     if [[ ${slot} != ${SLOT} ]]; then
58 alexxy 1.8 RDEPEND+=" !sys-infiniband/${PN}:${slot}"
59 alexxy 1.3 fi
60     done
61     }
62    
63 alexxy 1.8 OFED_BASE_VER=$(get_version_component_range 1-3 ${OFED_VER})
64 alexxy 1.1
65 alexxy 1.8 if [ -z $OFED_RC ] ; then
66 alexxy 1.10 SRC_URI="https://www.openfabrics.org/downloads/OFED/ofed-${OFED_BASE_VER}/OFED-${OFED_VER}.tgz"
67 alexxy 1.8 else
68 alexxy 1.10 SRC_URI="https://www.openfabrics.org/downloads/OFED/ofed-${OFED_BASE_VER}/OFED-${OFED_VER}-rc${OFED_RC_VER}.tgz"
69 alexxy 1.8 fi
70 alexxy 1.1
71     case ${PN} in
72 alexxy 1.3 ofed)
73 alexxy 1.7 case ${PV} in
74     1.5.*|1.5.*.*)
75     MY_PN="ofa_kernel"
76     ;;
77     *)
78     MY_PN="compat-rdma"
79     ;;
80     esac
81 alexxy 1.1 ;;
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 alexxy 1.9 ofa_kernel|compat-rdma)
98 alexxy 1.1 EXT="tgz"
99     ;;
100     *)
101     EXT="tar.gz"
102     ;;
103     esac
104    
105 alexxy 1.5 if [ -z ${OFED_SRC_SNAPSHOT} ]; then
106 alexxy 1.3 S="${WORKDIR}/${MY_PN}-${MY_PV}"
107     else
108     S="${WORKDIR}/${MY_PN}-${MY_PV}-${OFED_SUFFIX}"
109     fi
110 alexxy 1.1
111 alexxy 1.5
112 alexxy 1.1 # @FUNCTION: openib_src_unpack
113     # @DESCRIPTION:
114     # This function will unpack OFED packages
115     openib_src_unpack() {
116     unpack ${A}
117 alexxy 1.8 if [ -z ${OFED_RC} ]; then
118 alexxy 1.11 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 alexxy 1.8 else
127 alexxy 1.11 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 alexxy 1.8 fi
136 alexxy 1.1 if [ -z ${OFED_SNAPSHOT} ]; then
137 alexxy 1.11 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 alexxy 1.1 else
146 alexxy 1.11 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 alexxy 1.1 fi
155     }

  ViewVC Help
Powered by ViewVC 1.1.20