/[gentoo-x86]/dev-tex/tex4ht/tex4ht-20090611_p1038-r1.ebuild
Gentoo

Contents of /dev-tex/tex4ht/tex4ht-20090611_p1038-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Wed Jul 25 14:18:20 2012 UTC (2 years, 5 months ago) by ottxor
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +11 -11 lines
added prefix support (bug #427978)

(Portage version: 2.2.0_alpha120/cvs/Linux i686)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-tex/tex4ht/tex4ht-20090611_p1038-r1.ebuild,v 1.9 2012/05/12 03:29:58 aballier Exp $
4
5 EAPI=4
6
7 inherit latex-package toolchain-funcs java-pkg-opt-2
8
9 IUSE=""
10
11 # tex4ht-20050331_p2350 -> tex4ht-1.0.2005_03_31_2350
12 MY_P="${PN}-1.0.${PV:0:4}_${PV:4:2}_${PV:6:2}_${PV/*_p/}"
13
14 DESCRIPTION="Converts (La)TeX to (X)HTML, XML and OO.org"
15 HOMEPAGE="http://www.cse.ohio-state.edu/~gurari/TeX4ht/
16 http://www.cse.ohio-state.edu/~gurari/TeX4ht/bugfixes.html"
17 SRC_URI="http://www.cse.ohio-state.edu/~gurari/TeX4ht/fix/${MY_P}.tar.gz"
18
19 LICENSE="LPPL-1.2"
20 KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
21 SLOT="0"
22
23 DEPEND=">=sys-apps/sed-4
24 java? ( >=virtual/jdk-1.5 )"
25
26 RDEPEND="app-text/ghostscript-gpl
27 media-gfx/imagemagick
28 java? ( >=virtual/jre-1.5 )"
29
30 IUSE="java"
31
32 S="${WORKDIR}/${MY_P}"
33
34 src_prepare() {
35 cd "${S}/texmf/tex4ht/base/unix"
36 sed -i \
37 -e "s#~/tex4ht.dir#${EPREFIX}/usr/share#" \
38 -e "s#tpath/tex/texmf/fonts/tfm/!#t${EPREFIX}/usr/share/texmf/fonts/tfm/!\nt${EPREFIX}/usr/local/share/texmf/fonts/tfm/!\nt${EPREFIX}/var/cache/fonts/tfm/!#" \
39 -e "s#%%~/texmf-dist#${EPREFIX}/usr/share/texmf#g" tex4ht.env \
40 || die "sed of tex4ht.env failed"
41
42 einfo "Removing precompiled java stuff"
43 find "${S}" '(' -name '*.class' -o -name '*.jar' ')' -print -delete
44 }
45
46 src_compile() {
47 cd "${S}/src/"
48 einfo "Compiling postprocessor sources..."
49 for f in tex4ht t4ht htcmd ; do
50 $(tc-getCC) ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -o $f $f.c \
51 -DENVFILE="\"${EPREFIX}/usr/share/texmf/tex4ht/base/tex4ht.env\"" \
52 -DHAVE_DIRENT_H -DKPATHSEA -lkpathsea \
53 || die "Compiling $f failed"
54 done
55 if use java; then
56 einfo "Compiling java files..."
57 cd java
58 ejavac *.java */*.java */*/*.java -d ../../texmf/tex4ht/bin
59 cd "${S}/texmf/tex4ht/bin"
60 # Create the jar needed by oolatex
61 jar -cf "${S}/${PN}.jar" * || die "failed to create jar"
62 fi
63 }
64
65 src_install () {
66 # install the binaries
67 dobin "${S}/src/tex4ht" "${S}/src/t4ht" "${S}/src/htcmd"
68 # install the scripts
69 if ! use java; then
70 rm -f "${S}"/bin/unix/oo*
71 rm -f "${S}"/bin/unix/jh*
72 fi
73 dobin "${S}"/bin/unix/mk4ht || die
74
75 # install the .4ht scripts
76 insinto /usr/share/texmf/tex/generic/tex4ht
77 doins "${S}"/texmf/tex/generic/tex4ht/* || die
78
79 # install the special htf fonts
80 insinto /usr/share/texmf/tex4ht
81 doins -r "${S}/texmf/tex4ht/ht-fonts" || die
82
83 if use java; then
84 # install the java files
85 doins -r "${S}/texmf/tex4ht/bin"
86 java-pkg_jarinto /usr/share/texmf/tex4ht/bin
87 java-pkg_dojar "${S}/${PN}.jar"
88 fi
89
90 # install the .4xt files
91 doins -r "${S}/texmf/tex4ht/xtpipes" || die
92
93 # install the env file
94 insinto /usr/share/texmf/tex4ht/base
95 newins "${S}/texmf/tex4ht/base/unix/tex4ht.env" tex4ht.env || die
96
97 if latex-package_has_tetex_3 ; then
98 insinto /etc/texmf/texmf.d
99 doins "${FILESDIR}/50tex4ht.cnf" || die
100 fi
101
102 insinto /usr/share/texmf/tex/generic/${PN}
103 insopts -m755
104 doins "${S}"/bin/ht/unix/* || die
105 }
106
107 pkg_postinst() {
108 use java || elog 'ODF converters (oolatex & friends) require the java use flag'
109 latex-package_pkg_postinst
110 elog "In order to avoid collisions with multiple packages"
111 elog "We are not installing the scripts in /usr/bin anymore"
112 elog "If you want to use, say, htlatex, you can use 'mk4ht htlatex file'"
113 }

  ViewVC Help
Powered by ViewVC 1.1.20