pdb-tools-0.2.1-r1.ebuild 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python2_7 pypy )
  5. inherit fortran-2 python-single-r1 toolchain-funcs
  6. MY_PN="pdbTools"
  7. DESCRIPTION="Tools for manipulating and doing calculations on wwPDB macromolecule structure files"
  8. HOMEPAGE="https://github.com/harmslab/pdbtools"
  9. SRC_URI="https://${PN}.googlecode.com/files/${MY_PN}_${PV}.tar.gz"
  10. SLOT="0"
  11. LICENSE="GPL-3"
  12. KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
  13. IUSE=""
  14. REQUIRED_USE="${PYTHON_REQUIRED_USE}"
  15. RDEPEND="${PYTHON_DEPS}"
  16. DEPEND="${RDEPEND}"
  17. S="${WORKDIR}"/${MY_PN}_${PV}
  18. pkg_setup() {
  19. python-single-r1_pkg_setup
  20. fortran-2_pkg_setup
  21. }
  22. src_prepare() {
  23. sed \
  24. -e "s:script_dir,\"pdb_data\":\"${EPREFIX}/usr/share/${PN}\",\"pdb_data\":g" \
  25. -i pdb_sasa.py || die
  26. sed \
  27. -e "/satk_path =/s:^.*$:satk_path = \"${EPREFIX}/usr/bin\":g" \
  28. -i pdb_satk.py || die
  29. sed \
  30. -e 's:> %:>%:g' \
  31. -i pdb_seq.py || die
  32. }
  33. src_compile() {
  34. mkdir bin
  35. cd satk
  36. for i in *.f; do
  37. einfo "$(tc-getFC) ${FFLAGS} ${LDFLAGS} ${i} -o ${i/.f}"
  38. $(tc-getFC) ${FFLAGS} -c ${i} -o ${i/.f/.o} || die
  39. $(tc-getFC) ${LDFLAGS} -o ../bin/${i/.f} ${i/.f/.o} || die
  40. sed \
  41. -e "s:${i/.f}.out:${i/.f}:g" \
  42. -i ../pdb_satk.py || die
  43. done
  44. }
  45. src_install() {
  46. local script
  47. insinto /usr/share/${PN}
  48. doins -r pdb_data/peptides
  49. rm -rf pdb_data/peptides || die
  50. python_domodule helper pdb_data
  51. python_moduleinto ${PN/-/_}
  52. python_domodule *.py
  53. for i in pdb_*.py; do
  54. cat > ${i/.py} <<- EOF
  55. #!${EPREFIX}/bin/bash
  56. ${PYTHON} -O "$(python_get_sitedir)/${PN/-/_}/${i}" \$@
  57. EOF
  58. dobin ${i/.py}
  59. done
  60. dobin bin/*
  61. dodoc README
  62. }