summaryrefslogtreecommitdiff
blob: e75e7257a70018177be6c7d9301c1eb3fe45cbac (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
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-misc/pythoncad/pythoncad-1.37.ebuild,v 1.2 2010/07/06 14:56:37 arfrever Exp $

EAPI="3"
PYTHON_DEPEND="2"
SUPPORT_PYTHON_ABIS="1"
RESTRICT_PYTHON_ABIS="3.*"

inherit eutils distutils versionator

MY_PN="PythonCAD"
MY_PV="DS$(get_major_version)-R$(get_after_major_version)"
MY_P=${MY_PN}-${MY_PV}

DESCRIPTION="CAD program written in PyGTK"
HOMEPAGE="http://www.pythoncad.org/"
SRC_URI="mirror://sourceforge/pythoncad/${MY_P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

RDEPEND=">=dev-python/pygtk-1.99.16"
DEPEND=""

PYTHON_MODNAME=${MY_PN}

S=${WORKDIR}/${MY_P}

src_prepare() {
	epatch "${FILESDIR}/${P}-png.patch"

	sed -i \
		-e "s/gtkpycad.png/pythoncad.png/" \
		-e "s/gtkpycad.py/pythoncad/" \
		"pythoncad.desktop" || die "sed failed"
}

src_install() {
	distutils_src_install

	install_pythoncad() {
		newbin gtkpycad.py pythoncad-${PYTHON_ABI}
	}
	python_execute_function -q install_pythoncad
	python_generate_wrapper_scripts "${ED}usr/bin/pythoncad"

	insinto /etc/"${PN}"
	doins prefs.py
	domenu pythoncad.desktop
	insinto /usr/share/pixmaps
	newins gtkpycad.png pythoncad.png
}