-# Copyright 2006-2006 Mikael Lammentausta
+# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+# $Header: $
-inherit eutils zproduct
+EAPI="1"
+WX_GTK_VER="2.6"
+inherit zproduct python multilib wxwidgets
-MY_P="ccPublisher-${PV}"
+MY_PN="ccPublisher"
+MY_P="${MY_PN}-${PV}"
DESCRIPTION="Tool to tag and upload CC-licensed media files"
HOMEPAGE="http://wiki.creativecommons.org/CcPublisher"
-SRC_URI="http://download.berlios.de/cctools/${MY_P}.tar.gz"
+SRC_URI="mirror://berlios/cctools/${MY_P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE="zope"
-ZPROD_LIST="ccPublisher"
+ZPROD_LIST="${MY_PN}"
+S="${WORKDIR}/${MY_P}"
-DEPEND=">=dev-python/wxpython-2.6.3.2
- >=x11-libs/wxGTK-2.6.3.3
+DEPEND=""
+RDEPEND=">=dev-python/wxpython-2.6.3.2:2.6
+ >=x11-libs/wxGTK-2.6.3.3:2.6
zope? ( net-zope/zope )
- || ( dev-python/elementtree >=dev-lang/python-2.5 )"
-RDEPEND="${DEPEND}"
-
-S="${WORKDIR}/${MY_P}"
+ || ( ( dev-python/elementtree >=dev-lang/python-2.4 ) >=dev-lang/python-2.5 )"
src_install() {
# change directories, so that the python library is found
- sed -i -e "s#\.:#/usr/lib/${P}:# ; s#ccp.py#/usr/lib/${P}/ccp.py#" ccPublisher.sh
+ sed -i "s#\.:#/usr/$(get_libdir)/${P}:# ; s#ccp.py#/usr/$(get_libdir)/${P}/ccp.py#" \
+ ccPublisher.sh
- dobin ccPublisher.sh ccPublisher
+ newbin ccPublisher.sh ccPublisher
# docs
- dodoc README.txt
- dodoc resources/*txt
+ dodoc README.txt resources/*txt
- rm -f ccPublisher* README.txt
+ # copy python libraries, no not include the script, readme or
+ # zope libraries. zope libs will be installed if USE="zope"
+ rm ccPublisher.sh README.txt -f
+ mv "zope" "${WORKDIR}"
+ insinto /usr/$(get_libdir)/${P}
+ doins -r *
- # copy python libraries
- dodir /usr/lib/${P}
- insinto /usr/lib/${P}
- doins -r ${S}/*
+ # optimize python by compiling it
+ python_mod_optimize /usr/$(get_libdir)/${P}
- # copying the zope Product folder
+ # copy the zope Product folder
if use zope; then
+
einfo "Installing the Zope Product"
+
+ # we need to reorganize a bit, since the zproduct
+ # eclass defines S=$WORKDIR
+ # the zope directory is already in $WORKDIR
+ rm -rf "${S}/*"
+ mv "${WORKDIR}/zope" "${S}/${MY_PN}"
+
zproduct_src_install all
+
fi
}
+pkg_postrm() {
+ python_mod_cleanup /usr/$(get_libdir)/${P}
+}
+
pkg_postinst() {
+ python_version
+ python_mod_optimize "${ROOT}"usr/$(get_libdir)/${P}
+
elog
elog "ccPublisher is now installed to /usr/bin/ccPublisher"
elog
elog "If you get python errors, check that both wxpython and"
elog "wxGTK are the same version."
elog
+
if use zope; then
- elog "The Zope Product has been installed."
- elog "Use \"zprod-manager add\" to activate it."
- elog
+ elog "The Zope Product has been installed."
+ elog "Use \"zprod-manager add\" to activate it."
+ elog
fi
}