21271721d03f3c2b6f506c223ea64d2abd6fa90d
[portage-overlay.git] / dev-tex / mathtex / mathtex-1.05.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=5
6 inherit toolchain-funcs
7
8 DESCRIPTION="Tool to easily embed LaTeX math in html pages"
9 HOMEPAGE="http://www.forkosh.com/mathtex.html"
10
11 LICENSE="GPL-3"
12 SLOT="0"
13 IUSE="png"
14 SRC_URI="https://download.sumptuouscapital.com/gentoo/releases/${CATEGORY}/${PN}/${P}.zip"
15
16 KEYWORDS="~amd64 ~x86"
17
18 CDEPEND="virtual/latex-base
19         app-text/dvipng"
20
21 DEPEND="${CDEPEND}"
22 RDEPEND="${CDEPEND}"
23
24 S=${WORKDIR}
25
26 src_compile()
27 {
28         #This package ships as a single .c file, manual compile process needed
29         $(tc-getCC) mathtex.c \
30             –DLATEX=\"$(which latex)\"   \
31             –DDVIPNG=\"$(which dvipng)\"   \
32             $(use png && echo "-DPNG") \
33             –o mathtex.cgi || die
34 }
35
36 src_install()
37 {
38         dodoc README
39         exeinto /usr/libexec/${PN}
40         doexe ${PN}.cgi
41 }
42
43 pkg_postinst()
44 {
45         elog "${PN}.cgi has been installed in /usr/libexec/${PN},"
46         elog "if you want to enable this for a webserver please create a symlink"\
47              " to your cgi-bin"
48 }