f603c567dd933dbace6602b98a938e83aaef2f35
[gentoo.git] / app-emacs / bbdb / bbdb-2.35-r1.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=4
5
6 inherit elisp
7
8 DESCRIPTION="The Insidious Big Brother Database"
9 HOMEPAGE="http://bbdb.sourceforge.net/"
10 SRC_URI="http://bbdb.sourceforge.net/${P}.tar.gz
11         http://www.mit.edu/afs/athena/contrib/emacs-contrib/Fin/point-at.el
12         http://www.mit.edu/afs/athena/contrib/emacs-contrib/Fin/dates.el"
13
14 LICENSE="GPL-2+ Texinfo-manual"
15 SLOT="0"
16 KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris"
17 IUSE="tex"
18
19 RDEPEND="tex? ( virtual/tex-base )"
20
21 SITEFILE="50${PN}-gentoo.el"
22 TEXMF="/usr/share/texmf-site"
23
24 src_prepare() {
25         sed -i -e '0,/^--- bbdb-mail-folders.el ---$/d;/^--- end ---$/,$d' \
26                 bits/bbdb-mail-folders.el || die "sed failed"
27         sed -i -e '/^;/,$!d' bits/bbdb-sort-mailrc.el || die "sed failed"
28         cp "${DISTDIR}"/{dates,point-at}.el bits || die "cp failed"
29 }
30
31 src_configure() {
32         default
33 }
34
35 src_compile() {
36         emake -j1
37         BYTECOMPFLAGS="-L bits -L lisp" elisp-compile bits/*.el || die
38 }
39
40 src_install() {
41         elisp-install ${PN} lisp/*.el{,c} || die
42         elisp-install ${PN}/bits bits/*.el{,c} || die
43         elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die
44         doinfo texinfo/*.info*
45         dodoc ChangeLog INSTALL README bits/*.txt
46         newdoc bits/README README.bits
47         if use tex; then
48                 insinto "${TEXMF}"/tex/plain/bbdb
49                 doins tex/*.tex
50         fi
51 }
52
53 pkg_postinst() {
54         elisp-site-regen
55         use tex && texconfig rehash
56
57         elog "If you use encryption or signing, you may specify the encryption"
58         elog "method by customising variable \"bbdb/pgp-method\". For details,"
59         elog "see the documentation of this variable. Depending on the Emacs"
60         elog "version, installation of additional packages like app-emacs/gnus"
61         elog "or app-emacs/mailcrypt may be required."
62 }
63
64 pkg_postrm() {
65         elisp-site-regen
66         use tex && texconfig rehash
67 }