diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /eclass/openib.eclass | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'eclass/openib.eclass')
-rw-r--r-- | eclass/openib.eclass | 155 |
1 files changed, 155 insertions, 0 deletions
diff --git a/eclass/openib.eclass b/eclass/openib.eclass new file mode 100644 index 000000000000..1b2102ae0403 --- /dev/null +++ b/eclass/openib.eclass @@ -0,0 +1,155 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +# @ECLASS: openib.eclass +# @AUTHOR: +# Original Author: Alexey Shvetsov <alexxy@gentoo.org> +# @BLURB: Simplify working with OFED packages + +inherit eutils rpm versionator + +EXPORT_FUNCTIONS src_unpack + +HOMEPAGE="http://www.openfabrics.org/" +LICENSE="|| ( GPL-2 BSD-2 )" + +# @ECLASS-VARIABLE: OFED_VER +# @DESCRIPTION: +# Defines OFED version eg 1.4 or 1.4.0.1 + +# @ECLASS-VARIABLE: OFED_RC +# @DESCRIPTION: +# Sets if this version is RC + +# @ECLASS-VARIABLE: OFED_RC_VER +# @DESCRIPTION: +# Sets RC version + + +# @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 + +SLOT="${OFED_VER}" + +# @ECLASS-VARIABLE: OFED_VERSIONS +# @DESCRIPTION: +# Defines array of ofed version supported by eclass + +OFED_VERSIONS=( + "1.5.4.1" + "3.5" + "3.12" + ) + +# @FUNCTION: block_other_ofed_versions +# @DESCRIPTION: +# function that creates blockers list for ofed +block_other_ofed_versions() { + local slot + RDEPEND="${RDEPEND} !sys-infiniband/${PN}:0" + for slot in ${OFED_VERSIONS[@]}; do + if [[ ${slot} != ${SLOT} ]]; then + RDEPEND+=" !sys-infiniband/${PN}:${slot}" + fi + done +} + +OFED_BASE_VER=$(get_version_component_range 1-3 ${OFED_VER}) + +if [ -z $OFED_RC ] ; then + SRC_URI="https://www.openfabrics.org/downloads/OFED/ofed-${OFED_BASE_VER}/OFED-${OFED_VER}.tgz" +else + SRC_URI="https://www.openfabrics.org/downloads/OFED/ofed-${OFED_BASE_VER}/OFED-${OFED_VER}-rc${OFED_RC_VER}.tgz" +fi + +case ${PN} in + ofed) + case ${PV} in + 1.5.*|1.5.*.*) + MY_PN="ofa_kernel" + ;; + *) + MY_PN="compat-rdma" + ;; + esac + ;; + *) + MY_PN="${PN}" + ;; +esac + +case ${PV} in + *p*) + MY_PV="${PV/p/}" + ;; + *) + MY_PV="${PV}" + ;; +esac + +case ${MY_PN} in + ofa_kernel|compat-rdma) + EXT="tgz" + ;; + *) + EXT="tar.gz" + ;; +esac + +if [ -z ${OFED_SRC_SNAPSHOT} ]; then + S="${WORKDIR}/${MY_PN}-${MY_PV}" +else + S="${WORKDIR}/${MY_PN}-${MY_PV}-${OFED_SUFFIX}" +fi + + +# @FUNCTION: openib_src_unpack +# @DESCRIPTION: +# This function will unpack OFED packages +openib_src_unpack() { + unpack ${A} + if [ -z ${OFED_RC} ]; then + case ${PN} in + ofed) + rpm_unpack "./OFED-${OFED_VER}/SRPMS/${MY_PN}-${OFED_VER}-${OFED_SUFFIX}.src.rpm" + ;; + *) + rpm_unpack "./OFED-${OFED_VER}/SRPMS/${MY_PN}-${MY_PV}-${OFED_SUFFIX}.src.rpm" + ;; + esac + else + case ${PN} in + ofed) + rpm_unpack "./OFED-${OFED_VER}-rc${OFED_RC_VER}/SRPMS/${MY_PN}-${OFED_VER}-${OFED_SUFFIX}.src.rpm" + ;; + *) + rpm_unpack "./OFED-${OFED_VER}-rc${OFED_RC_VER}/SRPMS/${MY_PN}-${MY_PV}-${OFED_SUFFIX}.src.rpm" + ;; + esac + fi + if [ -z ${OFED_SNAPSHOT} ]; then + case ${PN} in + ofed) + unpack ./${MY_PN}-${OFED_VER}.${EXT} + ;; + *) + unpack ./${MY_PN}-${MY_PV}.${EXT} + ;; + esac + else + case ${PN} in + ofed) + unpack ./${MY_PN}-${OFED_VER}-${OFED_SUFFIX}.${EXT} + ;; + *) + unpack ./${MY_PN}-${MY_PV}-${OFED_SUFFIX}.${EXT} + ;; + esac + fi +} |