This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

pymol-svn

By: a guest on Nov 21st, 2010  |  syntax: Bash  |  size: 3.01 KB  |  views: 125  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. THIS WORK FOR ME
  2. YOU NEED THE FILES: PKGBUILD, pymol.sh, pymol.desktop and pymol.jpg
  3.  
  4.  
  5.  
  6. ###PKGBUILD
  7.  
  8. #pymol PKGBUILD
  9. #Maintainter: Duca <edumlopes at yahoo dot com dot br>
  10. #Contributors: yescalona <yescalona at ug dot uchile dot cl>
  11. #              crosvera  <crosvera at gmail dot com>
  12.  
  13. pkgname=pymol-svn
  14. pkgver=3925
  15. pkgrel=1
  16. pkgdesc="PyMOL is a molecular visualization system written in Python"
  17. arch=('i686' 'x86_64')
  18. url="http://pymol.sourceforge.net/"
  19. license=('GPL')
  20. _python_ver=2.7
  21. depends=('python2' 'freeglut' 'libpng' 'python-numpy' 'python-pmw' 'freetype2')
  22. makedepends=("subversion")
  23. source=('pymol.sh' 'pymol.desktop' 'pymol.jpg')
  24. md5sums=('804b35d9af638ab04aa3d44b2e1443c8'
  25.          'f8c01dc0dae50925df5e203031fd6718'
  26.          'b23132933cf6c821a2f33ed08aa287d8')
  27.  
  28. _svntrunk=https://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol
  29. _svnmod=pymol
  30.  
  31. build() {
  32.   cd ${srcdir}
  33.   if [ -d $_svnmod/.svn ]; then
  34.     msg "SVN tree found, reverting changes and updating to -r$pkgver"
  35.     (cd $_svnmod && svn revert -R . && make clean; svn up -r $pkgver) || return 1
  36.   else
  37.     msg "Checking out SVN tree of -r$pkgver"
  38.     svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod || return 1
  39.   fi
  40.  
  41.   cd ${_svnmod}
  42.  
  43.   #fix for solve problem with new libpng 1.4
  44.   sed -e "s/ret = png_check_sig(buf, 8);/ret = !png_sig_cmp (buf,0,8);/" -i ${srcdir}/pymol/layer0/MyPNG.c
  45.  
  46.   python2 setup.py build
  47.   python2 setup.py install --root=$pkgdir --prefix=/usr
  48.  
  49.   #fix of setup2.py file
  50.   sed -e "s| site_packages =.*| site_packages = \"${pkgdir}/usr/lib/python${_python_ver}/site-packages\"|g" -i setup2.py
  51.   sed -e "s| pymol_path =.*| pymol_path = \"${pkgdir}/usr/lib/python${_python_ver}/site-packages/pymol/pymol_path\"|g" -i setup2.py
  52.  
  53.   #for import pymol (i dont know if lib.linux-i686-2.6 is a common directory)
  54.   if [ "$CARCH" = "i686" ]; then
  55.   export PYTHONPATH=${srcdir}/pymol/build/lib.linux-i686-2.7
  56.   fi
  57.  
  58.   if [ "$CARCH" = "x86_64" ]; then
  59.   export PYTHONPATH=${srcdir}/pymol/build/lib.linux-x86_64-2.7
  60.   fi
  61.  
  62.  
  63.  
  64.   python2 setup2.py install --root=$pkgdir --prefix=/usr
  65.  
  66.   install -D -m755 ${startdir}/pymol.sh ${pkgdir}/usr/bin/pymol
  67.   install -D -m644 ${startdir}/pymol.desktop ${pkgdir}/usr/share/applications/pymol.desktop
  68.   install -D -m644 ${startdir}/pymol.jpg ${pkgdir}/usr/share/pixmaps/pymol.jpg
  69.  
  70.   # fix of api.py ?
  71.   sed -e "s/as = show_as/#as = show_as/g" -i ${pkgdir}/usr/lib/python${_python_ver}/site-packages/pymol/api.py
  72.   sed -e 's/2.5/${_python_ver}/g' -i ${pkgdir}/usr/bin/pymol
  73. }
  74. ##
  75.  
  76. ###pymol.sh
  77. #!/bin/sh
  78. /usr/bin/python2 /usr/lib/python2.7/site-packages/pymol/__init__.py $* 2> /dev/null
  79. ##
  80.  
  81. ###pymol.desktop
  82. [Desktop Entry]
  83. Encoding=UTF-8
  84. Name=PyMOL
  85. GenericName=Molecular Modeller
  86. Comment=Molecular Modeller
  87. Type=Application
  88. Exec=/usr/bin/pymol
  89. Icon=/usr/share/pixmaps/pymol.jpg
  90. MimeType=chemical/x-pdb
  91. Categories=Application;Science;Chemistry
  92. ###
  93.  
  94. ###pymol.jpg
  95. I DONT REMEMBER THE SOURCE OF THE IMAGE, SO SEARCH ONE, PUTH THE NAME pymol.jpg AND FIX THE MD5SUM
clone this paste RAW Paste Data