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

Contents of /eclass/openib.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Fri Oct 12 11:44:23 2012 UTC (18 months ago) by alexxy
Branch: MAIN
Changes since 1.5: +3 -3 lines
[eclass] Update ofed

1 # Copyright 1999-2012 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.5 2012/04/18 18:16:12 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 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 # @ECLASS-VARIABLE: OFED_SUFFIX
22 # @DESCRIPTION:
23 # Defines OFED package suffix eg -1.ofed1.4
24
25 # @ECLASS-VARIABLE: OFED_SNAPSHOT
26 # @DESCRIPTION:
27 # Defines if src tarball is git snapshot
28
29 SLOT="${OFED_VER}"
30
31 # @ECLASS-VARIABLE: OFED_VERSIONS
32 # @DESCRIPTION:
33 # Defines array of ofed version supported by eclass
34
35 OFED_VERSIONS=(
36 "1.5.1"
37 "1.5.2"
38 "1.5.3"
39 "1.5.3.1"
40 "1.5.3.2"
41 "1.5.4"
42 "1.5.4.1"
43 "3.5-rc2"
44 )
45
46 # @FUNCTION: block_other_ofed_versions
47 # @DESCRIPTION:
48 # function that creates blockers list for ofed
49 block_other_ofed_versions() {
50 local slot
51 RDEPEND+=" !sys-infiniband/${PN}:0"
52 for slot in ${OFED_VERSIONS[@]}; do
53 if [[ ${slot} != ${SLOT} ]]; then
54 RDEPEDN+=" !sys-infiniband/${PN}:${slot}"
55 fi
56 done
57 }
58
59 OFED_BASE_VER=$(get_version_component_range 1-3 ${OFED_VER})
60
61 SRC_URI="http://www.openfabrics.org/downloads/OFED/ofed-${OFED_BASE_VER}/OFED-${OFED_VER}.tgz"
62
63 case ${PN} in
64 ofed)
65 MY_PN="ofa_kernel"
66 ;;
67 *)
68 MY_PN="${PN}"
69 ;;
70 esac
71
72 case ${PV} in
73 *p*)
74 MY_PV="${PV/p/}"
75 ;;
76 *)
77 MY_PV="${PV}"
78 ;;
79 esac
80
81 case ${MY_PN} in
82 ofa_kernel)
83 EXT="tgz"
84 ;;
85 *)
86 EXT="tar.gz"
87 ;;
88 esac
89
90 if [ -z ${OFED_SRC_SNAPSHOT} ]; then
91 S="${WORKDIR}/${MY_PN}-${MY_PV}"
92 else
93 S="${WORKDIR}/${MY_PN}-${MY_PV}-${OFED_SUFFIX}"
94 fi
95
96
97 # @FUNCTION: openib_src_unpack
98 # @DESCRIPTION:
99 # This function will unpack OFED packages
100 openib_src_unpack() {
101 unpack ${A}
102 rpm_unpack "./OFED-${OFED_VER}/SRPMS/${MY_PN}-${MY_PV}-${OFED_SUFFIX}.src.rpm"
103 if [ -z ${OFED_SNAPSHOT} ]; then
104 unpack ./${MY_PN}-${MY_PV}.${EXT}
105 else
106 unpack ./${MY_PN}-${MY_PV}-${OFED_SUFFIX}.${EXT}
107 fi
108 }

  ViewVC Help
Powered by ViewVC 1.1.20