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

Contents of /eclass/openib.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Fri Oct 12 13:20:56 2012 UTC (18 months ago) by alexxy
Branch: MAIN
Changes since 1.6: +10 -3 lines
[eclass] update openib

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.6 2012/10/12 11:44:23 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 '-' $(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 case ${PV} in
66 1.5.*|1.5.*.*)
67 MY_PN="ofa_kernel"
68 ;;
69 *)
70 MY_PN="compat-rdma"
71 ;;
72 esac
73 ;;
74 *)
75 MY_PN="${PN}"
76 ;;
77 esac
78
79 case ${PV} in
80 *p*)
81 MY_PV="${PV/p/}"
82 ;;
83 *)
84 MY_PV="${PV}"
85 ;;
86 esac
87
88 case ${MY_PN} in
89 ofa_kernel)
90 EXT="tgz"
91 ;;
92 *)
93 EXT="tar.gz"
94 ;;
95 esac
96
97 if [ -z ${OFED_SRC_SNAPSHOT} ]; then
98 S="${WORKDIR}/${MY_PN}-${MY_PV}"
99 else
100 S="${WORKDIR}/${MY_PN}-${MY_PV}-${OFED_SUFFIX}"
101 fi
102
103
104 # @FUNCTION: openib_src_unpack
105 # @DESCRIPTION:
106 # This function will unpack OFED packages
107 openib_src_unpack() {
108 unpack ${A}
109 rpm_unpack "./OFED-${OFED_VER}/SRPMS/${MY_PN}-${MY_PV}-${OFED_SUFFIX}.src.rpm"
110 if [ -z ${OFED_SNAPSHOT} ]; then
111 unpack ./${MY_PN}-${MY_PV}.${EXT}
112 else
113 unpack ./${MY_PN}-${MY_PV}-${OFED_SUFFIX}.${EXT}
114 fi
115 }

  ViewVC Help
Powered by ViewVC 1.1.20