summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorAlexey Shvetsov <alexxy@gentoo.org>2011-06-30 20:47:43 +0000
committerAlexey Shvetsov <alexxy@gentoo.org>2011-06-30 20:47:43 +0000
commit32264e6ab67b3dbfaacbd32ca4e68d5156c7767a (patch)
tree8a083214a1df728b5358f6844c59f42f910a2caf /eclass
parent[profiles] Add openib stuff to profiles (diff)
downloadgentoo-2-32264e6ab67b3dbfaacbd32ca4e68d5156c7767a.tar.gz
gentoo-2-32264e6ab67b3dbfaacbd32ca4e68d5156c7767a.tar.bz2
gentoo-2-32264e6ab67b3dbfaacbd32ca4e68d5156c7767a.zip
[eclass] Add openib eclass
Diffstat (limited to 'eclass')
-rw-r--r--eclass/openib.eclass74
1 files changed, 74 insertions, 0 deletions
diff --git a/eclass/openib.eclass b/eclass/openib.eclass
new file mode 100644
index 000000000000..8878a778342f
--- /dev/null
+++ b/eclass/openib.eclass
@@ -0,0 +1,74 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/openib.eclass,v 1.1 2011/06/30 20:47:43 alexxy Exp $
+
+#
+# Original Author: Alexey Shvetsov <alexxy@gentoo.org>
+# Purpose: Simplify working with OFED packages
+#
+
+inherit base eutils rpm versionator
+
+EXPORT_FUNCTIONS src_unpack
+
+HOMEPAGE="http://www.openfabrics.org/"
+LICENSE="|| ( GPL-2 BSD-2 )"
+SLOT="0"
+
+# @ECLASS-VARIABLE: OFED_VER
+# @DESCRIPTION:
+# Defines OFED version eg 1.4 or 1.4.0.1
+
+# @ECLASS-VARIABLE: OFED_SUFFIX
+# @DESCRIPTION:
+# Defines OFED package suffix eg -1.ofed1.4
+
+# @ECLASS-VARIABLE: OFED_SNAPSHOT
+# @DESCRIPTION:
+# Defines if src tarball is git snapshot
+
+OFED_BASE_VER=$(get_version_component_range 1-3 ${OFED_VER})
+
+SRC_URI="http://www.openfabrics.org/downloads/OFED/ofed-${OFED_BASE_VER}/OFED-${OFED_VER}.tgz"
+
+case ${PN} in
+ openib-files)
+ MY_PN="ofa_kernel"
+ ;;
+ *)
+ MY_PN="${PN}"
+ ;;
+esac
+
+case ${PV} in
+ *p*)
+ MY_PV="${PV/p/}"
+ ;;
+ *)
+ MY_PV="${PV}"
+ ;;
+esac
+
+case ${MY_PN} in
+ ofa_kernel)
+ EXT="tgz"
+ ;;
+ *)
+ EXT="tar.gz"
+ ;;
+esac
+
+S="${WORKDIR}/${MY_PN}-${MY_PV}"
+
+# @FUNCTION: openib_src_unpack
+# @DESCRIPTION:
+# This function will unpack OFED packages
+openib_src_unpack() {
+ unpack ${A}
+ rpm_unpack "./OFED-${OFED_VER}/SRPMS/${MY_PN}-${MY_PV}-${OFED_SUFFIX}.src.rpm"
+ if [ -z ${OFED_SNAPSHOT} ]; then
+ unpack ./${MY_PN}-${MY_PV}.${EXT}
+ else
+ unpack ./${MY_PN}-${MY_PV}-${OFED_SUFFIX}.${EXT}
+ fi
+}