mopac7-1.15.ebuild 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. inherit autotools fortran-2 toolchain-funcs
  5. DESCRIPTION="Autotooled, updated version of a powerful, fast semi-empirical package"
  6. HOMEPAGE="https://sourceforge.net/projects/mopac7/"
  7. SRC_URI="
  8. http://www.bioinformatics.org/ghemical/download/current/${P}.tar.gz
  9. http://wwwuser.gwdg.de/~ggroenh/qmmm/mopac/dcart.f
  10. http://wwwuser.gwdg.de/~ggroenh/qmmm/mopac/gmxmop.f"
  11. LICENSE="public-domain"
  12. SLOT="0"
  13. KEYWORDS="amd64 ppc x86 ~amd64-linux"
  14. IUSE="gmxmopac7 static-libs"
  15. DEPEND="dev-libs/libf2c"
  16. RDEPEND="${DEPEND}"
  17. src_prepare() {
  18. # Install the executable
  19. sed -i \
  20. -e "s:noinst_PROGRAMS = mopac7:bin_PROGRAMS = mopac7:g" \
  21. fortran/Makefile.am \
  22. || die "sed failed: install mopac7"
  23. # Install the script to run the executable
  24. sed -i \
  25. -e "s:EXTRA_DIST = autogen.sh run_mopac7:bin_SCRIPTS = run_mopac7:g" \
  26. Makefile.am \
  27. || die "sed failed: install run_mopac7"
  28. eautoreconf
  29. }
  30. src_configure() {
  31. #set -std=legacy -fno-automatic according to
  32. #http://www.bioinformatics.org/pipermail/ghemical-devel/2008-August/000763.html
  33. FFLAGS="${FFLAGS} -std=legacy -fno-automatic" econf
  34. }
  35. src_compile() {
  36. emake
  37. if use gmxmopac7; then
  38. einfo "Making mopac7 lib for gromacs"
  39. mkdir "${S}"/fortran/libgmxmopac7 && cd "${S}"/fortran/libgmxmopac7
  40. cp -f ../SIZES ../*.f "${FILESDIR}"/Makefile . || die
  41. emake clean
  42. cp -f "${DISTDIR}"/gmxmop.f "${DISTDIR}"/dcart.f . || die
  43. sed "s:GENTOOVERSION:${PV}:g" -i Makefile
  44. emake FC=$(tc-getFC)
  45. if use static-libs; then
  46. emake static
  47. fi
  48. fi
  49. }
  50. src_install() {
  51. # A correct fix would have a run_mopac7.in with @bindir@ that gets
  52. # replaced by configure, and run_mopac7 added to AC_OUTPUT in configure.ac
  53. sed -i "s:./fortran/mopac7:mopac7:g" run_mopac7
  54. make DESTDIR="${D}" install || die
  55. dodoc AUTHORS README ChangeLog
  56. if use gmxmopac7; then
  57. cd "${S}"/fortran/libgmxmopac7
  58. dolib.so libgmxmopac7.so*
  59. if use static-libs; then
  60. dolib.a libgmxmopac7.a
  61. fi
  62. fi
  63. }