blob: 85078916b2fd4d4faf86585a068b3a7b2179478f (
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-misc/hachoir-metadata/hachoir-metadata-1.3.3-r1.ebuild,v 1.1 2014/06/11 14:40:47 mgorny Exp $
EAPI=5
PYTHON_COMPAT=( python2_7 )
inherit distutils-r1
DESCRIPTION="Program to extract metadata using Hachoir library"
HOMEPAGE="http://bitbucket.org/haypo/hachoir/wiki/hachoir-metadata http://pypi.python.org/pypi/hachoir-metadata"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE="gnome gtk kde qt4"
RDEPEND=">=dev-python/hachoir-core-1.3[${PYTHON_USEDEP}]
>=dev-python/hachoir-parser-1.3[${PYTHON_USEDEP}]
gtk? ( >=dev-python/pygtk-2.0[${PYTHON_USEDEP}] )
gnome? ( gnome-base/nautilus gnome-extra/zenity )
kde? ( kde-base/konqueror )
qt4? ( dev-python/PyQt4[${PYTHON_USEDEP}] )"
DEPEND="${RDEPEND}
dev-python/setuptools[${PYTHON_USEDEP}]"
python_prepare_all() {
if ! use gtk; then
sed -i -e '/SCRIPTS/s:, "hachoir-metadata-gtk"::' setup.py || die
fi
distutils-r1_python_prepare_all
}
python_configure_all() {
mydistutilsargs=( --setuptools )
use qt4 || mydistutilsargs+=( --disable-qt )
}
python_test() {
"${PYTHON}" test_doc.py || die "Tests fail with ${EPYTHON}"
}
python_install_all() {
distutils-r1_python_install_all
if use gnome; then
exeinto /usr/share/nautilus-scripts
doexe gnome/hachoir
fi
if use kde; then
exeinto /usr/bin
doexe kde/hachoir-metadata-kde
insinto /usr/share/apps/konqueror/servicemenus
doins kde/hachoir.desktop
fi
if ! use gtk; then
rm "${ED}usr/bin/hachoir-metadata-gtk"*
fi
}
pkg_postinst() {
if use gnome; then
elog "To enable the nautilus script, symlink it with:"
elog " $ mkdir -p ~/.gnome2/nautilus-scripts"
elog " $ ln -s /usr/share/nautilus-scripts/hachoir ~/.gnome2/nautilus-script"
fi
}
|