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

Contents of /eclass/openib.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Thu Jun 30 20:47:43 2011 UTC (3 years, 4 months ago) by alexxy
Branch: MAIN
[eclass] Add openib eclass

1 alexxy 1.1 # Copyright 1999-2011 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3     # $Header: $
4    
5     #
6     # Original Author: Alexey Shvetsov <alexxy@gentoo.org>
7     # Purpose: Simplify working with OFED packages
8     #
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     SLOT="0"
17    
18     # @ECLASS-VARIABLE: OFED_VER
19     # @DESCRIPTION:
20     # Defines OFED version eg 1.4 or 1.4.0.1
21    
22     # @ECLASS-VARIABLE: OFED_SUFFIX
23     # @DESCRIPTION:
24     # Defines OFED package suffix eg -1.ofed1.4
25    
26     # @ECLASS-VARIABLE: OFED_SNAPSHOT
27     # @DESCRIPTION:
28     # Defines if src tarball is git snapshot
29    
30     OFED_BASE_VER=$(get_version_component_range 1-3 ${OFED_VER})
31    
32     SRC_URI="http://www.openfabrics.org/downloads/OFED/ofed-${OFED_BASE_VER}/OFED-${OFED_VER}.tgz"
33    
34     case ${PN} in
35     openib-files)
36     MY_PN="ofa_kernel"
37     ;;
38     *)
39     MY_PN="${PN}"
40     ;;
41     esac
42    
43     case ${PV} in
44     *p*)
45     MY_PV="${PV/p/}"
46     ;;
47     *)
48     MY_PV="${PV}"
49     ;;
50     esac
51    
52     case ${MY_PN} in
53     ofa_kernel)
54     EXT="tgz"
55     ;;
56     *)
57     EXT="tar.gz"
58     ;;
59     esac
60    
61     S="${WORKDIR}/${MY_PN}-${MY_PV}"
62    
63     # @FUNCTION: openib_src_unpack
64     # @DESCRIPTION:
65     # This function will unpack OFED packages
66     openib_src_unpack() {
67     unpack ${A}
68     rpm_unpack "./OFED-${OFED_VER}/SRPMS/${MY_PN}-${MY_PV}-${OFED_SUFFIX}.src.rpm"
69     if [ -z ${OFED_SNAPSHOT} ]; then
70     unpack ./${MY_PN}-${MY_PV}.${EXT}
71     else
72     unpack ./${MY_PN}-${MY_PV}-${OFED_SUFFIX}.${EXT}
73     fi
74     }

  ViewVC Help
Powered by ViewVC 1.1.20