summaryrefslogtreecommitdiff
blob: d360d6a0b1ed65c1eb7d2906fbee63962f9337aa (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
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-text/wiki2beamer/wiki2beamer-0.9.4.ebuild,v 1.2 2011/06/30 00:11:37 sping Exp $

EAPI="3"
PYTHON_DEPEND="*"
SUPPORT_PYTHON_ABIS="1"

inherit python

DESCRIPTION="Tool to produce LaTeX Beamer code from wiki-like input."

HOMEPAGE="http://wiki2beamer.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}.zip"

LICENSE="|| ( GPL-2 GPL-3 ) FDL-1.3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+examples"

DEPEND="app-arch/unzip"
RDEPEND=""

src_install() {
	if use examples; then
		# Patch example Makefile
		sed -e 's|../../code/wiki2beamer|wiki2beamer|' \
				-i doc/example/Makefile \
				|| die

		insinto /usr/share/doc/${PF}/example
		doins doc/example/* || die
	fi

	doman doc/man/${PN}.1 || die
	dodoc ChangeLog README || die

	per_abi_install() {
		local MAIN_DIR="$(python_get_sitedir)"/${PN}
		insinto "${MAIN_DIR}"
		newins code/${PN} ${PN}.py || die

		fperms 755 "${MAIN_DIR}"/${PN}.py || die
		dosym "${MAIN_DIR}"/${PN}.py /usr/bin/${PN}-${PYTHON_ABI} || die
	}
	python_execute_function per_abi_install

	python_generate_wrapper_scripts "${ED}usr/bin/${PN}"
}

pkg_postinst() {
	python_mod_optimize ${PN}
}

pkg_postrm() {
	python_mod_cleanup ${PN}
}