Skip to content

anonymous /gist:457986
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
# 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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.