/
sage-doc-5.2-r1.ebuild
70 lines (56 loc) · 2.13 KB
/
sage-doc-5.2-r1.ebuild
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="4"
inherit eutils versionator
MY_PV="${PV}"
MY_P="sage-$(replace_version_separator 2 '.')"
MY_P_HTML="sage-${MY_PV}-doc-html"
MY_P_PDF="sage-${MY_PV}-doc-pdf"
DESCRIPTION="Documentation, tutorials and help files for Sage"
HOMEPAGE="http://www.sagemath.org/"
SRC_URI="http://sage.math.washington.edu/home/release/${MY_P}/${MY_P}/spkg/standard/${MY_P}.spkg -> sage-${PV}.tar.bz2
http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/3-1-3/Singular-3-1-3-3-share.tar.gz
html? ( http://www.sagemath.org/doc-bz2/${MY_P_HTML}.tar.bz2 -> sage-doc-html-${MY_PV}.tar.bz2 )
pdf? ( http://www.sagemath.org/doc-bz2/${MY_P_PDF}.tar.bz2 -> sage-doc-pdf-${MY_PV}.tar.bz2 )"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="html pdf"
RESTRICT="mirror"
# TODO: depend on sage-baselayout (creates sage-main directory) ?
DEPEND=""
RDEPEND=">=dev-python/sphinx-1.1.2"
S="${WORKDIR}/${MY_P}/doc"
src_prepare() {
epatch "${FILESDIR}"/trac11395-fix_tutorial.patch
}
src_install() {
# install missing directories to satisfy builder.py test
dodir /usr/share/sage/devel/sage-main/doc/output/doctrees/en/tutorial
dodir /usr/share/sage/devel/sage-main/doc/en/tutorial/templates
dodir /usr/share/sage/devel/sage-main/doc/en/tutorial/static
dodir /usr/share/sage/devel/sage-main/doc/en/reference/templates
dodir /usr/share/sage/devel/sage-main/doc/en/reference/static
# TODO: check if all of these files are needed
rm -rf output || die "failed to remove useless files"
insinto /usr/share/sage/devel/sage-main/doc
doins -r *
doins "${WORKDIR}"/Singular/3-1-3/info/singular.hlp
if use html ; then
cd "${WORKDIR}"/${MY_P_HTML}
insinto /usr/share/sage/devel/sage-main/doc/output/html
doins -r *
fi
if use pdf ; then
cd "${WORKDIR}"/${MY_P_PDF}
insinto /usr/share/sage/devel/sage-main/doc/output/pdf
doins -r *
fi
}
pkg_postinst() {
if ! use html ; then
ewarn "You haven't requested the html documentation."
ewarn "The html version of the sage manual won't be available in the sage notebook."
fi
}