summaryrefslogtreecommitdiff
blob: 82f13605fa5ca42cf9e1e75564346765c03382ca (plain)
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
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emacs/easypg/easypg-0.0.15.ebuild,v 1.4 2008/08/28 06:35:40 ulm Exp $

inherit elisp versionator

MY_PN=epg

DESCRIPTION="GnuPG interface for Emacs"
HOMEPAGE="http://www.easypg.org/"
SRC_URI="mirror://sourceforge.jp/epg/27030/${MY_PN}-${PV}.tar.gz
	gnus? ( mirror://sourceforge.jp/epg/25608/pgg-${MY_PN}.el )"

LICENSE="GPL-2 FDL-1.1"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="gnus"

DEPEND="app-crypt/gnupg"
RDEPEND="${DEPEND}
	gnus? ( virtual/gnus )"

SITEFILE=50${PN}-gentoo.el

S="${WORKDIR}/${MY_PN}-${PV}"

src_unpack() {
	unpack ${A}
	use gnus && cp "${DISTDIR}/pgg-epg.el" "${S}"
}

src_compile() {
	econf || die "econf failed"
	emake || die "emake failed"
	elisp-make-autoload-file \
		|| die "elisp-make-autoload-file failed"

	if use gnus && version_is_at_least 22 "$(elisp-emacs-version)"; then
		# pgg-epg requires pgg, it will not compile with Emacs 21
		elisp-compile pgg-epg.el || die "elisp-compile failed"
	fi
}

src_install() {
	einstall || die "einstall failed"

	elisp-install ${MY_PN} ${PN}-autoloads.el
	elisp-site-file-install "${FILESDIR}/${SITEFILE}" ${MY_PN}
	if use gnus; then
		elisp-install ${MY_PN} pgg-epg.el*
	fi
	dodoc AUTHORS ChangeLog NEWS README || die "dodoc failed"
}

pkg_postinst() {
	elisp-site-regen
	elog "See the epa info page for more information"
	if use gnus; then
		elog "To use, add (setq pgg-scheme 'epg) to your ~/.gnus"
	fi
}