herwig-6.5.21-r1.ebuild 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit autotools eutils fortran-2 versionator
  5. PV1=$(get_version_component_range 1 ${PV})
  6. PV2=$(get_version_component_range 2 ${PV})
  7. PV3=$(get_version_component_range 3 ${PV})
  8. MY_P=${PN}${PV1}${PV2}${PV3}
  9. MY_PINC="${PN^^}${PV1}${PV2}.INC"
  10. DESCRIPTION="High Energy Physics Event Generator"
  11. HOMEPAGE="http://www.hep.phy.cam.ac.uk/theory/webber/Herwig/"
  12. SRC_URI="
  13. ${HOMEPAGE}/${MY_P}.f
  14. ${HOMEPAGE}/${MY_P}.inc
  15. ${HOMEPAGE}/${MY_PINC}
  16. doc? ( ${HOMEPAGE}/hw65_manual.pdf )"
  17. LICENSE="all-rights-reserved"
  18. RESTRICT="mirror bindist"
  19. SLOT="0"
  20. KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
  21. IUSE="doc static-libs"
  22. RDEPEND="!sci-physics/cernlib-montecarlo[herwig]"
  23. DEPEND="${RDEPEND}"
  24. S="${WORKDIR}"
  25. src_unpack() {
  26. cp "${DISTDIR}"/{"${MY_P}".f,"${MY_P}".inc,"${MY_PINC}"} "${S}" || die
  27. }
  28. src_prepare() {
  29. sed -i \
  30. -e "s/${PN}.*.inc/${MY_P}.inc/" \
  31. ${MY_PINC} || die
  32. cat > configure.ac <<-EOF || die
  33. AC_INIT(${PN},${PV})
  34. AM_INIT_AUTOMAKE
  35. AC_PROG_F77
  36. AC_PROG_LIBTOOL
  37. AC_CONFIG_FILES(Makefile)
  38. AC_OUTPUT
  39. EOF
  40. cat > Makefile.am <<-EOF || die
  41. lib_LTLIBRARIES = lib${PN}.la
  42. lib${PN}_la_SOURCES = ${MY_P}.f
  43. include_HEADERS = \
  44. ${MY_PINC} \
  45. ${MY_P}.inc
  46. EOF
  47. eapply_user
  48. eautoreconf
  49. }
  50. src_configure() {
  51. econf $(use_enable static-libs static)
  52. }
  53. src_install() {
  54. default
  55. prune_libtool_files
  56. use doc && dodoc "${DISTDIR}"/hw65_manual.pdf
  57. }