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

Contents of /eclass/openib.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Wed Apr 18 16:47:30 2012 UTC (2 years, 4 months ago) by alexxy
Branch: MAIN
Changes since 1.3: +3 -1 lines
[eclass] add docs variable

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.3 2012/04/18 16:29:47 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 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 DOCS=( AUTHORS ChangeLog README TODO )
57
58 case ${PN} in
59 ofed)
60 MY_PN="ofa_kernel"
61 ;;
62 *)
63 MY_PN="${PN}"
64 ;;
65 esac
66
67 case ${PV} in
68 *p*)
69 MY_PV="${PV/p/}"
70 ;;
71 *)
72 MY_PV="${PV}"
73 ;;
74 esac
75
76 case ${MY_PN} in
77 ofa_kernel)
78 EXT="tgz"
79 ;;
80 *)
81 EXT="tar.gz"
82 ;;
83 esac
84
85 # if its snapshot then S may be different
86 if [ -z ${OFED_SNAPSHOT} ]; then
87 S="${WORKDIR}/${MY_PN}-${MY_PV}"
88 else
89 S="${WORKDIR}/${MY_PN}-${MY_PV}-${OFED_SUFFIX}"
90 fi
91
92 # @FUNCTION: openib_src_unpack
93 # @DESCRIPTION:
94 # This function will unpack OFED packages
95 openib_src_unpack() {
96 unpack ${A}
97 rpm_unpack "./OFED-${OFED_VER}/SRPMS/${MY_PN}-${MY_PV}-${OFED_SUFFIX}.src.rpm"
98 if [ -z ${OFED_SNAPSHOT} ]; then
99 unpack ./${MY_PN}-${MY_PV}.${EXT}
100 else
101 unpack ./${MY_PN}-${MY_PV}-${OFED_SUFFIX}.${EXT}
102 fi
103 }

  ViewVC Help
Powered by ViewVC 1.1.20