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

Contents of /eclass/openib.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Wed Apr 18 16:29:47 2012 UTC (2 years, 4 months ago) by alexxy
Branch: MAIN
Changes since 1.2: +31 -4 lines
[eclass] Update openib eclass

1 # Copyright 1999-2011 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.2 2011/08/22 04:46:32 vapier 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 OFED_VERSIONS=(
32 "1.5.1"
33 "1.5.2"
34 "1.5.3"
35 "1.5.3.1"
36 "1.5.3.2"
37 "1.5.4"
38 "1.5.4.1"
39 "3.2"
40 )
41
42 block_other_ofed_versions() {
43 local slot
44 RDEPEND+=" !sys-infiniband/${PN}:0"
45 for slot in ${OFED_VERSIONS[@]}; do
46 if [[ ${slot} != ${SLOT} ]]; then
47 RDEPEDN+=" !sys-infiniband/${PN}:${slot}"
48 fi
49 done
50 }
51
52 OFED_BASE_VER=$(get_version_component_range 1-3 ${OFED_VER})
53
54 SRC_URI="http://www.openfabrics.org/downloads/OFED/ofed-${OFED_BASE_VER}/OFED-${OFED_VER}.tgz"
55
56 case ${PN} in
57 ofed)
58 MY_PN="ofa_kernel"
59 ;;
60 *)
61 MY_PN="${PN}"
62 ;;
63 esac
64
65 case ${PV} in
66 *p*)
67 MY_PV="${PV/p/}"
68 ;;
69 *)
70 MY_PV="${PV}"
71 ;;
72 esac
73
74 case ${MY_PN} in
75 ofa_kernel)
76 EXT="tgz"
77 ;;
78 *)
79 EXT="tar.gz"
80 ;;
81 esac
82
83 # if its snapshot then S may be different
84 if [ -z ${OFED_SNAPSHOT} ]; then
85 S="${WORKDIR}/${MY_PN}-${MY_PV}"
86 else
87 S="${WORKDIR}/${MY_PN}-${MY_PV}-${OFED_SUFFIX}"
88 fi
89
90 # @FUNCTION: openib_src_unpack
91 # @DESCRIPTION:
92 # This function will unpack OFED packages
93 openib_src_unpack() {
94 unpack ${A}
95 rpm_unpack "./OFED-${OFED_VER}/SRPMS/${MY_PN}-${MY_PV}-${OFED_SUFFIX}.src.rpm"
96 if [ -z ${OFED_SNAPSHOT} ]; then
97 unpack ./${MY_PN}-${MY_PV}.${EXT}
98 else
99 unpack ./${MY_PN}-${MY_PV}-${OFED_SUFFIX}.${EXT}
100 fi
101 }

  ViewVC Help
Powered by ViewVC 1.1.20