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

Diff of /eclass/openib.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20