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