app-emacs/ebuild-mode: sparc stable wrt bug #706066
[gentoo.git] / app-emacs / org-mode / org-mode-9.2.6.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 NEED_EMACS=24
6
7 inherit elisp readme.gentoo-r1
8
9 DESCRIPTION="An Emacs mode for notes and project planning"
10 HOMEPAGE="https://www.orgmode.org/"
11 SRC_URI="http://orgmode.org/org-${PV}.tar.gz"
12
13 LICENSE="GPL-3+ FDL-1.3+ contrib? ( GPL-2+ MIT ) odt-schema? ( OASIS-Open )"
14 SLOT="0"
15 KEYWORDS="amd64 ppc x86 ~x86-macos"
16 IUSE="contrib doc odt-schema"
17 RESTRICT="test"
18
19 BDEPEND="doc? ( virtual/texi2dvi )"
20
21 S="${WORKDIR}/org-${PV}"
22 SITEFILE="50${PN}-gentoo.el"
23
24 src_compile() {
25         emake datadir="${EPREFIX}${SITEETC}/${PN}"
26         use doc && emake pdf card
27 }
28
29 src_install() {
30         emake \
31                 DESTDIR="${D}" \
32                 ETCDIRS="styles $(use odt-schema && echo schema)" \
33                 lispdir="${EPREFIX}${SITELISP}/${PN}" \
34                 datadir="${EPREFIX}${SITEETC}/${PN}" \
35                 infodir="${EPREFIX}/usr/share/info" \
36                 install
37
38         cp "${FILESDIR}/${SITEFILE}" "${T}/${SITEFILE}" || die
39
40         if use contrib; then
41                 elisp-install ${PN}/contrib contrib/lisp/{org,ob,ox}*.el
42                 ( docinto contrib; dodoc -r contrib/README contrib/scripts )
43                 find "${ED}/usr/share/doc/${PF}/contrib" -type f -name '.*' \
44                         -exec rm -f '{}' '+'
45                 # add the contrib subdirectory to load-path
46                 sed -i -e 's:\(.*@SITELISP@\)\(.*\):&\n\1/contrib\2:' \
47                         "${T}/${SITEFILE}" || die
48         fi
49
50         elisp-site-file-install "${T}/${SITEFILE}"
51         dodoc README etc/ORG-NEWS
52         use doc && dodoc doc/org.pdf doc/orgcard.pdf doc/orgguide.pdf
53
54         DOC_CONTENTS="Org mode has a large variety of run-time dependencies,
55                 so you may have to install one or more additional packages.
56                 A non-exhaustive list of these dependencies may be found at
57                 <http://orgmode.org/worg/org-dependencies.html>."
58         readme.gentoo_create_doc
59 }