updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / intel-compilers-common / PKGBUILD
blob75cf6340b656c0dc92cc94b3199f803a06005647
1 # Contributor: Nicolas Bigaouette <nbigaouette@gmail.com>
2 # CARCH=i686
4 # Based on ifort's PKGBUILD
6 pkgname=intel-compilers-common
7 _comp=f
8 _COMP=`echo "${_comp}" | tr "[a-z]" "[A-Z]"`
9 #pkgver=11.0.069
10 #_urlnumber=1259
11 pkgver=11.0.074
12 _urlnumber=1315
13 pkgrel=2
14 pkgdesc="The Intel Compilers common files"
15 url="http://developer.intel.com/software/products/compilers/flin/"
16 arch=('i686' 'x86_64')
17 license=('custom')
18 depends=()
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
24     _intel_arch=i386
25     _bits=32
26     _intel_arch2=ia32
27     _intel_64char=
28     md5sums=('7d9221b5b59b2d6edc6e51c756be84bb' ${md5sums[@]})
29 else
30     _intel_arch=em64t
31     _bits=64
32     _intel_arch2=intel64
33     _intel_64char=e
34     md5sums=('6c7db08ec48665f81b29cafed81f2eac' ${md5sums[@]})
36 _archive_arch=${_archive}_${_intel_arch2}
37 source=(http://registrationcenter-download.intel.com/irc_nas/${_urlnumber}/${_archive_arch}.tgz ${source[@]})
39 build() {
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
68     msg "Copying EULA..."
69     install -D -m 644 \
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
80         dir=`dirname ${f}`
81         mkdir -p ${pkgdir}${DESTINATION}/${dir} || return 1
82         if [[ -e .${DESTINATION}/${f} ]]; then
83             cp .${DESTINATION}/${f} ${pkgdir}${DESTINATION}/${dir} || return 1
84         fi
85     done