dev-libs/libnfc: bump
[gentoo.git] / dev-libs / mathjax / mathjax-2.7.4.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit eutils vcs-clean
7
8 DESCRIPTION="JavaScript display engine for LaTeX, MathML and AsciiMath"
9 HOMEPAGE="https://www.mathjax.org/"
10 SRC_URI="https://github.com/mathjax/MathJax/archive/${PV}.tar.gz -> ${P}.tar.gz"
11
12 LICENSE="Apache-2.0"
13 SLOT="0"
14 KEYWORDS="amd64 arm ~arm64 ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux"
15 IUSE="doc examples"
16
17 RESTRICT="binchecks strip"
18
19 S=${WORKDIR}/MathJax-${PV}
20
21 make_webconf() {
22         # web server config file - should we really do this?
23         cat > $1 <<-EOF
24                 Alias /MathJax/ ${EPREFIX}${webinstalldir}/
25                 Alias /mathjax/ ${EPREFIX}${webinstalldir}/
26
27                 <Directory ${EPREFIX}${webinstalldir}>
28                         Options None
29                         AllowOverride None
30                         Order allow,deny
31                         Allow from all
32                 </Directory>
33         EOF
34 }
35
36 src_prepare() {
37         default
38         egit_clean
39 }
40
41 src_install() {
42         local DOCS=( README* )
43         use doc && local HTML_DOCS=( docs/html/* )
44         default
45         if use examples; then
46                 insinto /usr/share/${PN}/examples
47                 doins -r test/*
48         fi
49         rm -r test docs LICENSE README* || die
50
51         webinstalldir=/usr/share/${PN}
52         insinto ${webinstalldir}
53         doins -r *
54
55         make_webconf MathJax.conf
56         insinto /etc/httpd/conf.d
57         doins MathJax.conf
58 }