/[gentoo-x86]/eclass/gnome-python-common.eclass
Gentoo

Contents of /eclass/gnome-python-common.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun Aug 24 07:10:34 2008 UTC (12 years, 3 months ago) by ford_prefect
Branch: MAIN
Common functionality required for splitting various GNOME python bindings

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 # Original Author: Arun Raghavan <ford_prefect@gentoo.org> (based on the
6 # gnome-python-desktop eclass by Jim Ramsay <lack@gentoo.org>)
7 #
8 # Purpose: Provides common functionality requried for building the gnome-python*
9 # bindings
10 #
11 # Important environment variables:
12 #
13 # G_PY_PN: Which gnome-python* package bindings we're working with. Defaults to
14 # gnome-python if unset.
15 #
16 # G_PY_BINDINGS: The actual '--enable-<binding>' name, which by default is ${PN}
17 # excluding the -python at the end. May be overridden if necessary.
18 #
19 # EXAMPLES: The set of example files to be installed if the 'examples' USE flag
20 # is set.
21 #
22 # The naming convention for all bindings is as follows:
23 # dev-python/<original-${PN}-for-which-this-is-the-binding>-python
24 #
25 # So, for example, with the bonobo bindings, the original package is libbonobo
26 # and the packages is named dev-python/libbonobo-python
27
28 inherit versionator python autotools gnome2
29
30 G_PY_PN=${G_PY_PN:-gnome-python}
31 G_PY_BINDINGS=${G_PY_BINDINGS:-${PN%-python}}
32
33 PVP="$(get_version_component_range 1-2)"
34 SRC_URI="mirror://gnome/sources/${G_PY_PN}/${PVP}/${G_PY_PN}-${PV}.tar.bz2"
35 HOMEPAGE="http://pygtk.org/"
36
37 RESTRICT="${RESTRICT} test"
38
39 DOCS="AUTHORS ChangeLog NEWS README"
40 if [[ ${G_PY_PN} != "gnome-python" ]]; then
41 DOCS="${DOCS} MAINTAINERS"
42 fi
43
44 S="${WORKDIR}/${G_PY_PN}-${PV}"
45
46 RDEPEND="~dev-python/${G_PY_PN}-base-${PV}"
47 DEPEND="${RDEPEND}
48 dev-util/pkgconfig"
49
50 # Enable the required bindings as specified by the G_PY_BINDINGS variable
51 gnome-python-common_pkg_setup() {
52 G2CONF="${G2CONF} --disable-allbindings"
53 for binding in ${G_PY_BINDINGS}; do
54 G2CONF="${G2CONF} --enable-${binding}"
55 done
56 }
57
58 gnome-python-common_src_unpack() {
59 unpack ${A}
60 cd "${S}"
61
62 # disable pyc compiling
63 if [[ -f py-compile ]]; then
64 rm py-compile
65 ln -s $(type -P true) py-compile
66 fi
67 }
68
69 # Do a regular gnome2 src_install and then install examples if required.
70 # Set the variable EXAMPLES to provide the set of examples to be installed.
71 # (to install a directory recursively, specify it with a trailing '/' - for
72 # example, foo/bar/)
73 gnome-python-common_src_install() {
74 # The .pc file is installed by respective gnome-python*-base package
75 sed -i '/^pkgconfig_DATA/d' Makefile || die "sed failed"
76 sed -i '/^pkgconfigdir/d' Makefile || die "sed failed"
77
78 gnome2_src_install
79
80 if hasq examples ${IUSE} && use examples; then
81 insinto /usr/share/doc/${PF}/examples
82
83 for example in ${EXAMPLES}; do
84 if [[ ${example: -1} = "/" ]]; then
85 doins -r ${example}
86 else
87 doins ${example}
88 fi
89 done
90 fi
91 }
92
93 gnome-python-common_pkg_postinst() {
94 python_version
95 python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/gtk-2.0
96 }
97
98 gnome-python-common_pkg_postrm() {
99 python_mod_cleanup
100 }
101
102 EXPORT_FUNCTIONS pkg_setup src_unpack src_install pkg_postinst pkg_postrm

  ViewVC Help
Powered by ViewVC 1.1.20