public
anonymous / gist:457986
Created

  • Download Gist
gistfile1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
# Maintainer: Nicolas Bigaouette <nbigaouette@gmail.com>
# Contributor: Nicolas Bigaouette <nbigaouette@gmail.com>
# Contributor: v01d
# CARCH=i686
 
pkgname=ifort
_comp=f
#pkgver=11.0.069
#_urlnumber=1255
#pkgver=11.0.074
#_urlnumber=1309
# pkgver=11.0.081
# _urlnumber=1377
# pkgver=11.0.083
# _urlnumber=1431
# pkgver=11.1.046
# _urlnumber=1536
# pkgver=11.1.056
# _urlnumber=1583
# pkgver=11.1.059
# _urlnumber=1624
# pkgver=11.1.064
# _urlnumber=1657
pkgver=11.1.072
_urlnumber=1769
 
pkgrel=1
pkgdesc="The Intel Fortran Compiler (debugger included)"
url="http://software.intel.com/en-us/intel-compilers/"
arch=('i686' 'x86_64')
license=('custom')
depends=("glibc" "libstdc++5" "bash")
makedepends=("rpmextract")
conflicts=("intel-compilers-common")
#optdepends=("gcc43: GCC v4.3.4 (Last version compatible with ICC)")
 
if [ "$CARCH" = "i686" ]; then
_intel_arch=i386
_bits=32
_intel_arch2=ia32
_intel_64char=
_archive_md5="754aa01e43208630ca4e3c0e510be95f"
else
_intel_arch=em64t
_bits=64
_intel_arch2=intel64
_intel_64char=e
#depends=(lib32-libstdc++5 ${depends[@]})
_archive_md5="a911841173231b42e729aba73e658a6d"
fi
_archive=l_cpro${_comp}_p_${pkgver}
_archive_arch=${_archive}_${_intel_arch2}
 
source=("http://registrationcenter-download.intel.com/irc_nas/${_urlnumber}/${_archive_arch}.tgz"
"profile.sh"
"silent.ini")
 
md5sums=("${_archive_md5}" # Main archive
'c4b4d62408e0a5c56b8497e674329c4e' # profile.sh
'32e6a3398e2625a816b8c894fbf88fae' # silent.ini
)
install=${pkgname}.install
 
function change_link() {
# Remove pkgdir from link
link=`\ls -l $1 | sed -e "s|.*${pkgdir}\(.*\)|\1|g"`
rm -f $1
ln -s ${link} $1
}
 
build() {
_major_version=${pkgver%%.*}
_build_version=${pkgver##*.}
_minor_version=`echo ${pkgver} | sed -e "s/${_major_version}.//g" -e "s/.${_build_version}//g"`
_compact_version=${_major_version}${_minor_version}${_build_version}
 
_INSTALLROOT=/opt/intel/ifort
DESTINATION=${_INSTALLROOT}/${_major_version}.${_minor_version}/${_build_version}
SUPPORTFILE=${pkgdir}${DESTINATION}/doc/fsupport
######################################################################################
 
cd ${srcdir}/${_archive_arch}
 
echo " " && echo " "
msg " Please obtain a license file from:"
msg " http://software.intel.com/en-us/intel-compilers/"
msg " and place it in /opt/intel/licenses/"
msg "Press any key to continue..."
read -p " "
 
_licensefile_nb=0
for f in /opt/intel/licenses/*.lic; do
_licensefile[_licensefile_nb]=$f
_licensefile_nb=$(($_licensefile_nb+1))
done
 
# Make sure we install in pkgdir
sed -e "s|PSET_INSTALL_DIR=.*|PSET_INSTALL_DIR=${pkgdir}${DESTINATION}|g" ${srcdir}/silent.ini > ./silent.ini
 
# See http://software.intel.com/en-us/articles/intel-compilers-for-linux-version-111-silent-installation-guide/
msg "Unpacking..."
./install.sh --silent silent.ini
 
msg "Removing '${pkgdir}' from all files containing it"
grep -irl "${pkgdir}" ${pkgdir}${DESTINATION}/* | xargs sed -i "s|${pkgdir}||g" || return 1
 
cd ${srcdir}
 
msg "Updating etc/profile.d/${pkgname}.sh..."
install -D -m 755 ${srcdir}/profile.sh \
${pkgdir}/etc/profile.d/${pkgname}.sh || return 1
sed \
-e "s|DESTINATION|${DESTINATION}|g" \
-e "s|INTELARCH|${_intel_arch2}|g" \
-e "s|PKGNAME|${pkgname}|g" \
-i ${pkgdir}/etc/profile.d/${pkgname}.sh || return 1
 
msg "Copying release notes..."
_COMP=`echo "${_comp}" | tr "[a-z]" "[A-Z]"`
_release_notes=`find . -name *Release_Notes*en*`
if [[ "$_release_notes" != "" ]]; then
install -D -m 644 \
$_release_notes \
${pkgdir}${DESTINATION}/Release_Notes.pdf || return 1
fi
rm -f ${pkgdir}/usr/share/licenses/$pkgname/*.lic || return 1
 
msg "Installing license..."
install -D -m 644 \
${srcdir}/${_archive_arch}/license.txt \
${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
 
msg "Updating ${pkgname}.install to edit ld.so.conf correctly..."
#sed -e "s|.*ntel/Compiler.*||g" /etc/ld.so.conf
sed \
-e "s#echo \".*#echo \"${DESTINATION}/lib\" >> /etc/ld.so.conf#g" \
-e "s#sed -i \".*#sed -i \"s|.*ntel/Compiler.*||g\" /etc/ld.so.conf#g" \
-i ${startdir}/${pkgname}.install \
|| return 1
 
msg "Fix namcap reported errors/warnings..."
#### Fix "icc W: Library ([...]) does not have permission set to 644."
find ${pkgdir}${DESTINATION} -name *.a -exec chmod 0644 {} \;
 
#### Remove IDB and MKL
rm -r ${pkgdir}${DESTINATION}/{idb,mkl}
 
#### Fix "icc W: Potential non-FHS man page ([...]) found."
# Delete japanese man pages
rm -fr ${pkgdir}${DESTINATION}/man/ja_JP
# Move (english) man pages to FHS location
mkdir -p ${pkgdir}/usr/share/man
mv ${pkgdir}${DESTINATION}/man/en_US/man1 ${pkgdir}/usr/share/man/
rm -fr ${pkgdir}${DESTINATION}/man
ln -s /usr/share/man/ ${pkgdir}${DESTINATION}/man
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.