latex2html-2008.ebuild 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # Copyright 1999-2010 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. inherit eutils multilib
  4. DESCRIPTION="convertor written in Perl that converts LATEX documents to HTML"
  5. SRC_URI="http://saftsack.fs.uni-bayreuth.de/~latex2ht/current/${P}.tar.gz"
  6. HOMEPAGE="http://www.latex2html.org/"
  7. LICENSE="GPL-2"
  8. SLOT="0"
  9. KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
  10. IUSE="gif png"
  11. DEPEND="app-text/ghostscript-gpl
  12. virtual/latex-base
  13. media-libs/netpbm
  14. dev-lang/perl
  15. gif? ( media-libs/giflib )
  16. png? ( media-libs/libpng )"
  17. RDEPEND="${DEPEND}"
  18. src_unpack() {
  19. unpack ${A}
  20. cd "${S}"
  21. epatch "${FILESDIR}/${PN}-convert-length.patch"
  22. epatch "${FILESDIR}/${PN}-perl_name.patch"
  23. epatch "${FILESDIR}/${PN}-extract-major-version.patch"
  24. epatch "${FILESDIR}/${PN}-destdir.patch"
  25. # Dont install old url.sty and other files
  26. # Bug #240980
  27. rm -f texinputs/url.sty texinputs/latin9.def || die "failed to remove duplicate latex files"
  28. }
  29. src_compile() {
  30. local myconf
  31. use gif || use png || myconf="${myconf} --disable-images"
  32. econf --libdir=/usr/$(get_libdir)/latex2html \
  33. --shlibdir=/usr/$(get_libdir)/latex2html \
  34. --enable-pk \
  35. --enable-eps \
  36. --enable-reverse \
  37. --enable-pipes \
  38. --enable-paths \
  39. --enable-wrapper \
  40. --with-texpath=/usr/share/texmf-site/tex/latex/html \
  41. --without-mktexlsr \
  42. $(use_enable gif) \
  43. $(use_enable png) \
  44. ${myconf} || die "econf failed"
  45. emake || die "make failed"
  46. }
  47. src_install() {
  48. emake DESTDIR="${D}" install || die "make install failed"
  49. dodoc BUGS Changes FAQ LICENSE.orig MANIFEST README* TODO
  50. # make /usr/share/latex2html sticky
  51. keepdir /usr/share/latex2html
  52. # clean the perl scripts up to remove references to the sandbox
  53. einfo "fixing sandbox references"
  54. # pstoimg isn't built unless gif or png useflags are enabled
  55. { use png || use gif ; } && dosed "s:${T}:/tmp:g" /usr/$(get_libdir)/latex2html/pstoimg.pl
  56. dosed "s:${S}::g" /usr/$(get_libdir)/latex2html/latex2html.pl
  57. dosed "s:${T}:/tmp:g" /usr/$(get_libdir)/latex2html/cfgcache.pm
  58. dosed "s:${T}:/tmp:g" /usr/$(get_libdir)/latex2html/l2hconf.pm
  59. }
  60. pkg_postinst() {
  61. einfo "Running ${ROOT}usr/bin/mktexlsr to rebuild ls-R database...."
  62. "${ROOT}"usr/bin/mktexlsr
  63. }
  64. pkg_postrm() {
  65. einfo "Running ${ROOT}usr/bin/mktexlsr to rebuild ls-R database...."
  66. "${ROOT}"usr/bin/mktexlsr
  67. }