1 # Maintainer: Michael Schubert <mschu.dev at gmail>
7 pkgdesc="Visualization and analysis of molecular structures; includes AutoDockTools, Vision and PythonMoleculeViewer"
9 url="http://mgltools.scripps.edu/"
11 depends=('swig' 'tk' 'python2-numpy' 'python-imaging' 'python-pmw' 'glut' 'zsi' 'simpy' 'libxmu')
12 optdepends=('autodocksuite')
13 source=("http://mgltools.scripps.edu/downloads/tars/releases/REL${_pkgver}/${pkgname}_source_${pkgver}.tar.gz")
14 options=('!emptydirs')
15 md5sums=('6ff52728253532bbd3922de277e2ff2c')
18 cd "$srcdir/${pkgname}_source_$pkgver"
19 sed -i "1s:python2.5:python2:" InstTools/install
21 # replace path by os.path where needed
22 sed -i "s:path.exists:os.path.exists:; \
23 s:os.os.path.exists:os.path.exists:; \
24 s:path.join:os.path.join:; \
25 s:os.os.path.join:os.path.join:" InstTools/install
27 # do not install pmw since it is dependecy already
28 sed -i 's:getYesNo(msg, "Do you wish to install Pmw:False #:' InstTools/install
29 # fix include for strcmp in geomutils
30 sed -i "239i\ if (pkgname == \"geomutils\"): os.popen(\"sed -i '3i#include\
31 <string.h>' src/geomAlgorithms/objfile.cpp\")" InstTools/install
32 # fix opengltk to work with tcl/tk 8.5
33 sed -i "240i\ if (pkgname == \"opengltk\"): \
34 os.popen(\"sed -i 's/stub8.4/stub8.5/g' setup.py\")" InstTools/install
36 # disable license popup - we'll print it to the user later
37 cd "$srcdir/${pkgname}_source_$pkgver/MGLPACKS"
38 tar -xzf "mglutil-$_pkgver.tar.gz"
39 rm -f "mglutil-$_pkgver.tar.gz"
40 echo > "mglutil-$_pkgver/mglutil/splashregister/license.py"
41 tar -czf "mglutil-$_pkgver.tar.gz" "mglutil-$_pkgver"
45 cd "$srcdir/${pkgname}_source_$pkgver"
47 # let python know about the new modules
48 pydir=`python2 -c "from distutils.sysconfig import get_python_lib; \
49 print get_python_lib()"`
50 mkdir -p "$pkgdir/$pydir"
51 ./startInstallation --quiet --instDir="$pkgdir/$pydir"
53 # link to bin directory
54 install -Dm755 "$pkgdir/$pydir/runAdt" "$pkgdir/usr/bin/adt"
55 install -Dm755 "$pkgdir/$pydir/runPmv" "$pkgdir/usr/bin/pmv"
56 install -Dm755 "$pkgdir/$pydir/runCADD" "$pkgdir/usr/bin/CADD"
57 install -Dm755 "$pkgdir/$pydir/runVision" "$pkgdir/usr/bin/vision"
59 echo "MGLToolsPckgs" > "$pkgdir/$pydir/mgltools.pth"
61 # fix some python 2.7 issues in the package
62 sed -i "/self.__debug__ = 0/d" \
63 "$pkgdir/$pydir/MGLToolsPckgs/ViewerFramework/VF.py"
66 rm -rf `find "$pkgdir" -type d -name "CVS"`
69 cd "$pkgdir/$pydir/MGLToolsPckgs"
70 rm -f "mglutil/TestUtil/publishPack.csh"
72 # change interpreter from python/2.5 to python2
73 find . -name "*.py" | xargs sed -i "1s/python$/python2/;1s/python2.5$/python2/"
76 for LICENSE in `find . -name LICENSE`; do
77 install -Dm755 "./$LICENSE" "$pkgdir/usr/share/licenses/mgltools/$LICENSE"
81 msg "LICENSE WARNING:"
82 msg "This software is free only for non-commercial usage"
83 msg "see /usr/share/licenses/mgltools/ for more information"