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

Contents of /eclass/openib.eclass

Parent Directory Parent Directory | Revision Log Revision Log


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

1 alexxy 1.6 # Copyright 1999-2012 Gentoo Foundation
2 alexxy 1.1 # Distributed under the terms of the GNU General Public License v2
3 alexxy 1.9 # $Header: /var/cvsroot/gentoo-x86/eclass/openib.eclass,v 1.8 2012/10/12 16:49:59 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     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 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.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 alexxy 1.8 "3.5"
53 alexxy 1.3 )
54    
55 alexxy 1.5 # @FUNCTION: block_other_ofed_versions
56     # @DESCRIPTION:
57     # function that creates blockers list for ofed
58 alexxy 1.3 block_other_ofed_versions() {
59     local slot
60 alexxy 1.8 RDEPEND="${RDEPEND} !sys-infiniband/${PN}:0"
61 alexxy 1.3 for slot in ${OFED_VERSIONS[@]}; do
62     if [[ ${slot} != ${SLOT} ]]; then
63 alexxy 1.8 RDEPEND+=" !sys-infiniband/${PN}:${slot}"
64 alexxy 1.3 fi
65     done
66     }
67    
68 alexxy 1.8 OFED_BASE_VER=$(get_version_component_range 1-3 ${OFED_VER})
69 alexxy 1.1
70 alexxy 1.8 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 alexxy 1.1
76     case ${PN} in
77 alexxy 1.3 ofed)
78 alexxy 1.7 case ${PV} in
79     1.5.*|1.5.*.*)
80     MY_PN="ofa_kernel"
81     ;;
82     *)
83     MY_PN="compat-rdma"
84     ;;
85     esac
86 alexxy 1.1 ;;
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 alexxy 1.9 ofa_kernel|compat-rdma)
103 alexxy 1.1 EXT="tgz"
104     ;;
105     *)
106     EXT="tar.gz"
107     ;;
108     esac
109    
110 alexxy 1.5 if [ -z ${OFED_SRC_SNAPSHOT} ]; then
111 alexxy 1.3 S="${WORKDIR}/${MY_PN}-${MY_PV}"
112     else
113     S="${WORKDIR}/${MY_PN}-${MY_PV}-${OFED_SUFFIX}"
114     fi
115 alexxy 1.1
116 alexxy 1.5
117 alexxy 1.1 # @FUNCTION: openib_src_unpack
118     # @DESCRIPTION:
119     # This function will unpack OFED packages
120     openib_src_unpack() {
121     unpack ${A}
122 alexxy 1.8 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 alexxy 1.1 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