/recipes/bioconductor-hgu133afrmavecs/post-link.sh
Shell | 47 lines | 36 code | 5 blank | 6 comment | 13 complexity | 5e338a2d9867e18368f0fcdc64a399c0 MD5 | raw file
Possible License(s): AGPL-3.0, GPL-3.0, Apache-2.0, MIT, BSD-3-Clause, 0BSD, LGPL-3.0, GPL-2.0, AGPL-1.0
- #!/bin/bash
- FN="hgu133afrmavecs_1.5.0.tar.gz"
- URLS=(
- "https://bioconductor.org/packages/3.11/data/annotation/src/contrib/hgu133afrmavecs_1.5.0.tar.gz"
- "https://bioarchive.galaxyproject.org/hgu133afrmavecs_1.5.0.tar.gz"
- "https://depot.galaxyproject.org/software/bioconductor-hgu133afrmavecs/bioconductor-hgu133afrmavecs_1.5.0_src_all.tar.gz"
- "https://depot.galaxyproject.org/software/bioconductor-hgu133afrmavecs/bioconductor-hgu133afrmavecs_1.5.0_src_all.tar.gz"
- )
- MD5="85034ab02491f5b3699d210cef50812d"
- # Use a staging area in the conda dir rather than temp dirs, both to avoid
- # permission issues as well as to have things downloaded in a predictable
- # manner.
- STAGING=$PREFIX/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM
- mkdir -p $STAGING
- TARBALL=$STAGING/$FN
- SUCCESS=0
- for URL in ${URLS[@]}; do
- curl $URL > $TARBALL
- [[ $? == 0 ]] || continue
- # Platform-specific md5sum checks.
- if [[ $(uname -s) == "Linux" ]]; then
- if md5sum -c <<<"$MD5 $TARBALL"; then
- SUCCESS=1
- break
- fi
- else if [[ $(uname -s) == "Darwin" ]]; then
- if [[ $(md5 $TARBALL | cut -f4 -d " ") == "$MD5" ]]; then
- SUCCESS=1
- break
- fi
- fi
- fi
- done
- if [[ $SUCCESS != 1 ]]; then
- echo "ERROR: post-link.sh was unable to download any of the following URLs with the md5sum $MD5:"
- printf '%s\n' "${URLS[@]}"
- exit 1
- fi
- # Install and clean up
- R CMD INSTALL --library=$PREFIX/lib/R/library $TARBALL
- rm $TARBALL
- rmdir $STAGING