Skip to content

Instantly share code, notes, and snippets.

@Athemis
Created May 16, 2018 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Athemis/add039dac65f9675d3a81d176c5f55ce to your computer and use it in GitHub Desktop.
Save Athemis/add039dac65f9675d3a81d176c5f55ce to your computer and use it in GitHub Desktop.
ucsf-chimera-1.12 PKGBUILD
# Maintainer: Alexander Minges <alexander.minges@gmail.com>
# Contributor: Bjorn Neergaard (neersighted) <bjorn@neersighted.com>
pkgroot=ucsf-chimera
pkgname=ucsf-chimera
pkgver=1.12
pkgrel=2
pkgdesc='Extensible molecular modeling system'
url='https://rbvi.ucsf.edu/chimera/'
_source=https://rbvi.ucsf.edu/chimera/cgi-bin/secure/chimera-get.py
license=('custom:ucsf-chimera')
install=ucsf-chimera.install
arch=('i686' 'x86_64')
case "${CARCH}" in
(i686)
_file="chimera-${pkgver}-linux.bin"
_filepath="linux/${_file}"
;;
(x86_64)
_file="chimera-${pkgver}-linux_x86_64.bin"
_filepath="linux_x86_64/${_file}"
;;
esac
prepare(){
cd "${srcdir}"
if [ -f "${_file}" ]; then
return
fi
echo 'IMPORTANT: By downloading you accept the UCSF Chimera Non-Commercial Software License Agreement!'
echo 'IMPORTANT: The license agreement can be found here: https://rvbi.ucsf.edu/chimera/license.html'
echo 'IMPORTANT: If you do not agree, please press Ctrl-C now.'
echo 'IMPORTANT: Downloading in 10 seconds...'
sleep 10
_ident="$(curl -s -F file="${_filepath}" -F choice=Accept "${_source}")"
_ident="$(echo "$_ident" | grep 'a href' | awk -F'[?=&]' '{print $4}')"
_ident="$(echo "$_ident" | sed 's@+@ @g;s@%@\\x@g' | xargs -0 printf "%b")"
curl -L -F file="${_filepath}" -F ident="${_ident}" -F choice=Notified "${_source}" -o "${_file}"
}
package() {
cd "${srcdir}"
# Prepare the directory structure.
install -dm755 "${pkgdir}/opt"
# Run the installer.
chmod +x "${_file}"
echo "${pkgdir}/opt/ucsf-chimera" | "./${_file}"
# Remove libraries that conflict with system libraries
cd "${pkgdir}/opt/ucsf-chimera/lib/"
rm libfreetype.* libz.*
}
# vim: ft=sh ts=2 sw=2 et
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment