]> Pileus Git - ~andy/sunrise/blob - app-misc/ccpublisher/ccpublisher-2.2.1.ebuild
app-misc/ccpublisher: Use MY_P and correct deps
[~andy/sunrise] / app-misc / ccpublisher / ccpublisher-2.2.1.ebuild
1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit eutils zproduct python
6
7 MY_PN="ccPublisher"
8 MY_P="${MY_PN}-${PV}"
9
10 DESCRIPTION="Tool to tag and upload CC-licensed media files"
11 HOMEPAGE="http://wiki.creativecommons.org/CcPublisher"
12 SRC_URI="http://download.berlios.de/cctools/${MY_P}.tar.gz"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~x86"
17 IUSE="zope"
18
19 ZPROD_LIST="${MY_PN}"
20 S="${WORKDIR}/${MY_P}"
21
22 DEPEND=""
23 RDEPEND=">=dev-python/wxpython-2.6.3.2
24         >=x11-libs/wxGTK-2.6.3.3
25         zope? ( net-zope/zope )
26         || ( ( dev-python/elementtree >=dev-lang/python-2.4 ) >=dev-lang/python-2.5 )"
27         # wxGTK and wxpython have to be the same x.y.z version
28
29 src_install() {
30         cd "${S}"
31
32         # change directories, so that the python library is found
33         sed -i "s#\.:#/usr/lib/${P}:# ; s#ccp.py#/usr/lib/${P}/ccp.py#" \
34                 ccPublisher.sh
35
36         newbin ccPublisher.sh ccPublisher
37
38         # docs
39         dodoc README.txt resources/*txt
40
41         # copy python libraries, no not include the script, readme or
42         # zope libraries. zope libs will be installed if USE="zope"
43         rm ccPublisher.sh README.txt -f
44         mv "zope" "${WORKDIR}"
45         insinto /usr/lib/${P}
46         doins -r *
47
48         # optimize python by compiling it
49         python_mod_optimize /usr/lib/${P}
50
51         # copy the zope Product folder
52         if use zope; then
53
54                 einfo "Installing the Zope Product"
55
56                 # we need to reorganize a bit, since the zproduct
57                 # eclass defines S=$WORKDIR
58                 # the zope directory is already in $WORKDIR
59                 rm -rf "${S}/*"
60                 mv "${WORKDIR}/zope" "${S}/${MY_PN}"
61
62                 zproduct_src_install all
63
64         fi
65 }
66
67 pkg_postrm() {
68         python_mod_cleanup /usr/lib/${P}
69 }
70
71 pkg_postinst() {
72         elog
73         elog "ccPublisher is now installed to /usr/bin/ccPublisher"
74         elog
75         elog "If you get python errors, check that both wxpython and"
76         elog "wxGTK are the same version."
77         elog
78         if use zope; then
79                 elog "The Zope Product has been installed."
80                 elog "Use \"zprod-manager add\" to activate it."
81                 elog
82         fi
83 }