/[gentoo-x86]/eclass/intel-sdp.eclass
Gentoo

Diff of /eclass/intel-sdp.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.13 Revision 1.14
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/intel-sdp.eclass,v 1.13 2013/07/19 14:00:50 jlec Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/intel-sdp.eclass,v 1.14 2013/07/29 09:50:09 jlec Exp $
4 4
5# @ECLASS: intel-sdp.eclass 5# @ECLASS: intel-sdp.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Justin Lecher <jlec@gentoo.org> 7# Justin Lecher <jlec@gentoo.org>
8# Sci Team <sci@gentoo.org> 8# Sci Team <sci@gentoo.org>
63# @DEFAULT_UNSET 63# @DEFAULT_UNSET
64# @DESCRIPTION: 64# @DESCRIPTION:
65# Possibility to skip the mandatory check for licenses. Only set this if there 65# Possibility to skip the mandatory check for licenses. Only set this if there
66# is really no fix. 66# is really no fix.
67 67
68# @ECLASS-VARIABLE: INTEL_RPMS_DIRS 68# @ECLASS-VARIABLE: INTEL_RPMS_DIR
69# @DESCRIPTION: 69# @DESCRIPTION:
70# List of subdirectories in the main archive which contains the 70# Main subdirectory which contains the rpms to extract.
71# rpms to extract.
72: ${INTEL_RPMS_DIRS:=rpm} 71: ${INTEL_RPMS_DIR:=rpm}
73 72
74# @ECLASS-VARIABLE: INTEL_X86 73# @ECLASS-VARIABLE: INTEL_X86
75# @DESCRIPTION: 74# @DESCRIPTION:
76# 32bit arch in rpm names 75# 32bit arch in rpm names
77# 76#
82# @DEFAULT_UNSET 81# @DEFAULT_UNSET
83# @DESCRIPTION: 82# @DESCRIPTION:
84# Functional name of rpm without any version/arch tag 83# Functional name of rpm without any version/arch tag
85# 84#
86# e.g. compilerprof 85# e.g. compilerprof
86#
87# if the rpm is located in a directory different to INTEL_RPMS_DIR you can
88# specify the full path
89#
90# e.g. CLI_install/rpm/intel-vtune-amplifier-xe-cli
87 91
88# @ECLASS-VARIABLE: INTEL_DAT_RPMS 92# @ECLASS-VARIABLE: INTEL_DAT_RPMS
89# @DEFAULT_UNSET 93# @DEFAULT_UNSET
90# @DESCRIPTION: 94# @DESCRIPTION:
91# Functional name of rpm of common data which are arch free 95# Functional name of rpm of common data which are arch free
92# without any version tag 96# without any version tag
93# 97#
94# e.g. openmp 98# e.g. openmp
99#
100# if the rpm is located in a directory different to INTEL_RPMS_DIR you can
101# specify the full path
102#
103# e.g. CLI_install/rpm/intel-vtune-amplifier-xe-cli-common
104
105# @ECLASS-VARIABLE: INTEL_SINGLE_ARCH
106# @DESCRIPTION:
107# Unset, if only the multilib package will be provided by intel
108: ${INTEL_SINGLE_ARCH:=true}
95 109
96# @ECLASS-VARIABLE: INTEL_SDP_DB 110# @ECLASS-VARIABLE: INTEL_SDP_DB
97# @DESCRIPTION: 111# @DESCRIPTION:
98# Full path to intel registry db 112# Full path to intel registry db
99INTEL_SDP_DB="${EROOT%/}"/opt/intel/intel-sdp-products.db 113INTEL_SDP_DB="${EROOT%/}"/opt/intel/intel-sdp-products.db
104_INTEL_PV2=$(get_version_component_range 2) 118_INTEL_PV2=$(get_version_component_range 2)
105_INTEL_PV3=$(get_version_component_range 3) 119_INTEL_PV3=$(get_version_component_range 3)
106_INTEL_PV4=$(get_version_component_range 4) 120_INTEL_PV4=$(get_version_component_range 4)
107_INTEL_URI="http://registrationcenter-download.intel.com/irc_nas/${INTEL_DID}/${INTEL_DPN}" 121_INTEL_URI="http://registrationcenter-download.intel.com/irc_nas/${INTEL_DID}/${INTEL_DPN}"
108 122
123if [ ${INTEL_SINGLE_ARCH} == true ]; then
109SRC_URI=" 124 SRC_URI="
110 amd64? ( multilib? ( ${_INTEL_URI}_${INTEL_DPV}.${INTEL_TARX} ) ) 125 amd64? ( multilib? ( ${_INTEL_URI}_${INTEL_DPV}.${INTEL_TARX} ) )
111 amd64? ( !multilib? ( ${_INTEL_URI}_${INTEL_DPV}_intel64.${INTEL_TARX} ) ) 126 amd64? ( !multilib? ( ${_INTEL_URI}_${INTEL_DPV}_intel64.${INTEL_TARX} ) )
112 x86? ( ${_INTEL_URI}_${INTEL_DPV}_ia32.${INTEL_TARX} )" 127 x86? ( ${_INTEL_URI}_${INTEL_DPV}_ia32.${INTEL_TARX} )"
128else
129 SRC_URI="${_INTEL_URI}_${INTEL_DPV}.${INTEL_TARX}"
130fi
113 131
114LICENSE="Intel-SDP" 132LICENSE="Intel-SDP"
115# Future work, #394411 133# Future work, #394411
116#SLOT="${_INTEL_PV1}.${_INTEL_PV2}" 134#SLOT="${_INTEL_PV1}.${_INTEL_PV2}"
117SLOT="0" 135SLOT="0"
326 if has_multilib_profile; then 344 if has_multilib_profile; then
327 arch="x86_64 ${INTEL_X86}" 345 arch="x86_64 ${INTEL_X86}"
328 INTEL_ARCH="intel64 ia32" 346 INTEL_ARCH="intel64 ia32"
329 fi 347 fi
330 fi 348 fi
331 INTEL_RPMS="" 349 INTEL_RPMS=()
350 INTEL_RPMS_FULL=()
332 for p in ${INTEL_BIN_RPMS}; do 351 for p in ${INTEL_BIN_RPMS}; do
333 for a in ${arch}; do 352 for a in ${arch}; do
353 if [ ${p} == $(basename ${p}) ]; then
334 INTEL_RPMS+=" intel-${p}-${_INTEL_PV4}-${_INTEL_PV1}.${_INTEL_PV2}-${_INTEL_PV3}.${a}.rpm" 354 INTEL_RPMS+=( intel-${p}-${_INTEL_PV4}-${_INTEL_PV1}.${_INTEL_PV2}-${_INTEL_PV3}.${a}.rpm )
355 else
356 INTEL_RPMS_FULL+=( ${p}-${_INTEL_PV4}-${_INTEL_PV1}.${_INTEL_PV2}-${_INTEL_PV3}.${a}.rpm )
357 fi
335 done 358 done
336 done 359 done
337 for p in ${INTEL_DAT_RPMS}; do 360 for p in ${INTEL_DAT_RPMS}; do
361 if [ ${p} == $(basename ${p}) ]; then
338 INTEL_RPMS+=" intel-${p}-${_INTEL_PV4}-${_INTEL_PV1}.${_INTEL_PV2}-${_INTEL_PV3}.noarch.rpm" 362 INTEL_RPMS+=( intel-${p}-${_INTEL_PV4}-${_INTEL_PV1}.${_INTEL_PV2}-${_INTEL_PV3}.noarch.rpm )
363 else
364 INTEL_RPMS_FULL+=( ${p}-${_INTEL_PV4}-${_INTEL_PV1}.${_INTEL_PV2}-${_INTEL_PV3}.noarch.rpm )
365 fi
339 done 366 done
340 367
341 case "${EAPI:-0}" in 368 case "${EAPI:-0}" in
342 0|1|2|3) intel-sdp_pkg_pretend ;; 369 0|1|2|3) intel-sdp_pkg_pretend ;;
343 esac 370 esac
345 372
346# @FUNCTION: intel-sdp_src_unpack 373# @FUNCTION: intel-sdp_src_unpack
347# @DESCRIPTION: 374# @DESCRIPTION:
348# Unpacking necessary rpms from tarball, extract them and rearrange the output. 375# Unpacking necessary rpms from tarball, extract them and rearrange the output.
349intel-sdp_src_unpack() { 376intel-sdp_src_unpack() {
350 local l r subdir rb t list=() 377 local l r subdir rb t list=() debug_list
351 378
352 for t in ${A}; do 379 for t in ${A}; do
353 for r in ${INTEL_RPMS}; do 380 for r in ${INTEL_RPMS[@]}; do
354 for subdir in ${INTEL_RPMS_DIRS}; do 381 rpmdir=${t%%.*}/${INTEL_RPMS_DIR}
355 rpmdir=${t%%.*}/${subdir}
356 debug-print "Adding to decompression list: ${rpmdir}/${r}"
357 list+=( ${rpmdir}/${r}) 382 list+=( ${rpmdir}/${r} )
358 done 383 done
384
385 for r in ${INTEL_RPMS_FULL[@]}; do
386 list+=( ${t%%.*}/${r} )
359 done 387 done
388
389 debug_list="$(IFS=$'\n'; echo ${list[@]} )"
390
391 debug-print "Adding to decompression list:"
392 debug-print ${debug_list}
393
360 tar xvf "${DISTDIR}"/${t} ${list[@]} &> "${T}"/rpm-extraction.log || die 394 tar xvf "${DISTDIR}"/${t} ${list[@]} &> "${T}"/rpm-extraction.log
395
361 for r in ${list[@]}; do 396 for r in ${list[@]}; do
362 rb=$(basename ${r}) 397 rb=$(basename ${r})
363 l=.${rb}_$(date +'%d%m%y_%H%M%S').log 398 l=.${rb}_$(date +'%d%m%y_%H%M%S').log
364 einfo "Unpacking ${rb}" 399 einfo "Unpacking ${rb}"
365 rpm2tar -O ${r} | tar xvf - | sed -e \ 400 rpm2tar -O ${r} | tar xvf - | sed -e \
366 "s:^\.:${EROOT#/}:g" > ${l} || die "unpacking ${r} failed" 401 "s:^\.:${EROOT#/}:g" > ${l}; assert "unpacking ${r} failed"
367 mv ${l} opt/intel/ || die "failed moving extract log file" 402 mv ${l} opt/intel/ || die "failed moving extract log file"
368 done 403 done
369 done 404 done
370 405
371 mv opt/intel/* ${INTEL_SDP_DIR} || die "mv to INTEL_SDP_DIR failed" 406 mv opt/intel/* ${INTEL_SDP_DIR} || die "mv to INTEL_SDP_DIR failed"

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.20