nco-3.9.9.ebuild 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Copyright 1999-2011 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=2
  4. inherit eutils flag-o-matic
  5. DESCRIPTION="Command line utilities for operating on netCDF files"
  6. SRC_URI="http://dust.ess.uci.edu/nco/src/${P}.tar.gz"
  7. HOMEPAGE="http://nco.sourceforge.net/"
  8. LICENSE="GPL-3"
  9. SLOT="0"
  10. KEYWORDS="amd64 ppc x86"
  11. IUSE="doc mpi ncap2 udunits"
  12. RDEPEND="sci-libs/netcdf
  13. mpi? ( virtual/mpi )
  14. udunits? ( >=sci-libs/udunits-2 )"
  15. DEPEND="${RDEPEND}
  16. ncap2? ( !mpi? ( dev-java/antlr:0 ) )
  17. doc? ( virtual/latex-base )"
  18. pkg_setup() {
  19. if use mpi && use ncap2; then
  20. elog
  21. elog "mpi and ncap2 are still incompatible flags"
  22. elog "nco configure will automatically disables ncap2"
  23. elog
  24. fi
  25. }
  26. src_configure() {
  27. local myconf
  28. if has_version ">=sci-libs/netcdf-4" && built_with_use sci-libs/netcdf hdf5; then
  29. append-cppflags -DHAVE_NETCDF4_H
  30. myconf="--enable-netcdf4"
  31. else
  32. myconf="--disable-netcdf4"
  33. fi
  34. econf \
  35. ${myconf} \
  36. --disable-udunits \
  37. $(use_enable ncap2) \
  38. $(use_enable udunits udunits2) \
  39. $(use_enable mpi)
  40. }
  41. src_compile() {
  42. emake || die "emake failed"
  43. cd doc
  44. emake clean info
  45. if use doc; then
  46. VARTEXFONTS="${T}/fonts" emake html pdf || die "emake doc failed"
  47. fi
  48. }
  49. src_install() {
  50. emake DESTDIR="${D}" install || die "emake install failed"
  51. cd doc
  52. dodoc ANNOUNCE ChangeLog MANIFEST NEWS README TAG TODO VERSION *.txt \
  53. || die "dodoc failed"
  54. doinfo *.info* || die "doinfo failed"
  55. if use doc; then
  56. dohtml nco.html/* || die "dohtml failed"
  57. insinto /usr/share/doc/${PF}
  58. doins nco.pdf || die "pdf install failed"
  59. fi
  60. }