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

Diff of /eclass/openib.eclass

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

Revision 1.2 Revision 1.10
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2014 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.2 2011/08/22 04:46:32 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/openib.eclass,v 1.10 2014/04/16 07:31:00 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
9 9
10inherit base eutils rpm versionator 10inherit eutils rpm versionator
11 11
12EXPORT_FUNCTIONS src_unpack 12EXPORT_FUNCTIONS src_unpack
13 13
14HOMEPAGE="http://www.openfabrics.org/" 14HOMEPAGE="http://www.openfabrics.org/"
15LICENSE="|| ( GPL-2 BSD-2 )" 15LICENSE="|| ( GPL-2 BSD-2 )"
16SLOT="0"
17 16
18# @ECLASS-VARIABLE: OFED_VER 17# @ECLASS-VARIABLE: OFED_VER
19# @DESCRIPTION: 18# @DESCRIPTION:
20# Defines OFED version eg 1.4 or 1.4.0.1 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
21 29
22# @ECLASS-VARIABLE: OFED_SUFFIX 30# @ECLASS-VARIABLE: OFED_SUFFIX
23# @DESCRIPTION: 31# @DESCRIPTION:
24# Defines OFED package suffix eg -1.ofed1.4 32# Defines OFED package suffix eg -1.ofed1.4
25 33
26# @ECLASS-VARIABLE: OFED_SNAPSHOT 34# @ECLASS-VARIABLE: OFED_SNAPSHOT
27# @DESCRIPTION: 35# @DESCRIPTION:
28# Defines if src tarball is git snapshot 36# Defines if src tarball is git snapshot
29 37
38SLOT="${OFED_VER}"
39
40# @ECLASS-VARIABLE: OFED_VERSIONS
41# @DESCRIPTION:
42# Defines array of ofed version supported by eclass
43
44OFED_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
53block_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
30OFED_BASE_VER=$(get_version_component_range 1-3 ${OFED_VER}) 63OFED_BASE_VER=$(get_version_component_range 1-3 ${OFED_VER})
31 64
65if [ -z $OFED_RC ] ; then
32SRC_URI="http://www.openfabrics.org/downloads/OFED/ofed-${OFED_BASE_VER}/OFED-${OFED_VER}.tgz" 66 SRC_URI="https://www.openfabrics.org/downloads/OFED/ofed-${OFED_BASE_VER}/OFED-${OFED_VER}.tgz"
67else
68 SRC_URI="https://www.openfabrics.org/downloads/OFED/ofed-${OFED_BASE_VER}/OFED-${OFED_VER}-rc${OFED_RC_VER}.tgz"
69fi
33 70
34case ${PN} in 71case ${PN} in
35 openib-files) 72 ofed)
73 case ${PV} in
74 1.5.*|1.5.*.*)
36 MY_PN="ofa_kernel" 75 MY_PN="ofa_kernel"
76 ;;
77 *)
78 MY_PN="compat-rdma"
79 ;;
80 esac
37 ;; 81 ;;
38 *) 82 *)
39 MY_PN="${PN}" 83 MY_PN="${PN}"
40 ;; 84 ;;
41esac 85esac
48 MY_PV="${PV}" 92 MY_PV="${PV}"
49 ;; 93 ;;
50esac 94esac
51 95
52case ${MY_PN} in 96case ${MY_PN} in
53 ofa_kernel) 97 ofa_kernel|compat-rdma)
54 EXT="tgz" 98 EXT="tgz"
55 ;; 99 ;;
56 *) 100 *)
57 EXT="tar.gz" 101 EXT="tar.gz"
58 ;; 102 ;;
59esac 103esac
60 104
105if [ -z ${OFED_SRC_SNAPSHOT} ]; then
61S="${WORKDIR}/${MY_PN}-${MY_PV}" 106 S="${WORKDIR}/${MY_PN}-${MY_PV}"
107else
108 S="${WORKDIR}/${MY_PN}-${MY_PV}-${OFED_SUFFIX}"
109fi
110
62 111
63# @FUNCTION: openib_src_unpack 112# @FUNCTION: openib_src_unpack
64# @DESCRIPTION: 113# @DESCRIPTION:
65# This function will unpack OFED packages 114# This function will unpack OFED packages
66openib_src_unpack() { 115openib_src_unpack() {
67 unpack ${A} 116 unpack ${A}
117 if [ -z ${OFED_RC} ]; then
68 rpm_unpack "./OFED-${OFED_VER}/SRPMS/${MY_PN}-${MY_PV}-${OFED_SUFFIX}.src.rpm" 118 rpm_unpack "./OFED-${OFED_VER}/SRPMS/${MY_PN}-${MY_PV}-${OFED_SUFFIX}.src.rpm"
119 else
120 rpm_unpack "./OFED-${OFED_VER}-rc${OFED_RC_VER}/SRPMS/${MY_PN}-${MY_PV}-${OFED_SUFFIX}.src.rpm"
121 fi
69 if [ -z ${OFED_SNAPSHOT} ]; then 122 if [ -z ${OFED_SNAPSHOT} ]; then
70 unpack ./${MY_PN}-${MY_PV}.${EXT} 123 unpack ./${MY_PN}-${MY_PV}.${EXT}
71 else 124 else
72 unpack ./${MY_PN}-${MY_PV}-${OFED_SUFFIX}.${EXT} 125 unpack ./${MY_PN}-${MY_PV}-${OFED_SUFFIX}.${EXT}
73 fi 126 fi

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.20