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