1 # Contributor: Nicolas Bigaouette <nbigaouette@gmail.com>
4 # Based on ifort's PKGBUILD
6 pkgname=intel-compilers-common
8 _COMP=`echo "${_comp}" | tr "[a-z]" "[A-Z]"`
14 pkgdesc="The Intel Compilers common files"
15 url="http://developer.intel.com/software/products/compilers/flin/"
16 arch=('i686' 'x86_64')
19 makedepends=(rpmextract)
20 source=("EULA.htm" "intel-compilers-common-generic.txt")
21 md5sums=('df1337eb0b74e33cdbc6de794ade29f4' '31c1810fb4aab1a2d6c350ae5986283e')
22 _archive=l_cpro${_comp}_p_${pkgver}
23 if [ "$CARCH" = "i686" ]; then
28 md5sums=('7d9221b5b59b2d6edc6e51c756be84bb' ${md5sums[@]})
34 md5sums=('6c7db08ec48665f81b29cafed81f2eac' ${md5sums[@]})
36 _archive_arch=${_archive}_${_intel_arch2}
37 source=(http://registrationcenter-download.intel.com/irc_nas/${_urlnumber}/${_archive_arch}.tgz ${source[@]})
40 ######################################################################################
41 # Common part with icc and ifort
42 _intel_arch_file=`basename ${source[0]}`
43 _intel_arch_file=${_intel_arch_file/.tar.gz/}
44 _intel_arch_file=${_intel_arch_file##*_}
45 _compiler=${source[0]#*l_}
46 _compiler=${_compiler%%_*}
47 _comp_ver=`echo $source[0] | sed -e "s|.*/l_${_compiler}_||g" -e "s|_${pkgver}.*||g"`
49 _licensefile=${source[1]}
50 _major_version=${pkgver%%.*}
51 _build_version=${pkgver##*.}
52 _minor_version=`echo ${pkgver} | sed -e "s/${_major_version}.//g" -e "s/.${_build_version}//g"`
53 _compact_version=${_major_version}${_minor_version}${_build_version}
55 mkdir -p $startdir/src/unpacked
56 cd $startdir/src/unpacked
58 msg "Unpacking RPM archive (intel-cpro${_comp}${_compact_version}${_intel_64char}-${_major_version}.${_minor_version}-*.rpm)..."
59 i=../${_archive_arch}/${_archive}/intel-cpro${_comp}${_compact_version}${_intel_64char}-${_major_version}.${_minor_version}-*.rpm
60 rpmextract.sh $i &> /dev/null || return 1
62 # The following variables are defined in the original install script
63 # They make copying the original code easier.
64 _INSTALLROOT=/opt/intel/Compiler
65 DESTINATION=${_INSTALLROOT}/${_major_version}.${_minor_version}/${_build_version}
66 SUPPORTFILE=${pkgdir}${DESTINATION}/doc/fsupport
70 $startdir/src/EULA.htm \
71 $startdir/pkg/usr/share/licenses/$pkgname/EULA.htm || return 1
73 # End of common part with icc and ifort
74 ######################################################################################
76 msg "Copying common files..."
77 sed "s|ARCHDIR|${_intel_arch2}|g" ${srcdir}/intel-compilers-common-generic.txt > ${srcdir}/intel-compilers-common.txt || return 1
78 common_filenames=(`cat ${srcdir}/intel-compilers-common.txt`) || return 1
79 for f in ${common_filenames[*]}; do
81 mkdir -p ${pkgdir}${DESTINATION}/${dir} || return 1
82 if [[ -e .${DESTINATION}/${f} ]]; then
83 cp .${DESTINATION}/${f} ${pkgdir}${DESTINATION}/${dir} || return 1