/[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.2 - (hide annotations) (download)
Sun Sep 14 16:24:17 2008 UTC (12 years, 2 months ago) by ford_prefect
Branch: MAIN
Changes since 1.1: +2 -3 lines
Should use gnome2_src_unpack instead of a manual unpack()

1 ford_prefect 1.1 # Copyright 1999-2008 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 ford_prefect 1.2 # $Header: /var/cvsroot/gentoo-x86/eclass/gnome-python-common.eclass,v 1.1 2008/08/24 07:10:34 ford_prefect Exp $
4 ford_prefect 1.1
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 ford_prefect 1.2 gnome2_src_unpack
60 ford_prefect 1.1
61     # disable pyc compiling
62     if [[ -f py-compile ]]; then
63     rm py-compile
64     ln -s $(type -P true) py-compile
65     fi
66     }
67    
68     # Do a regular gnome2 src_install and then install examples if required.
69     # Set the variable EXAMPLES to provide the set of examples to be installed.
70     # (to install a directory recursively, specify it with a trailing '/' - for
71     # example, foo/bar/)
72     gnome-python-common_src_install() {
73     # The .pc file is installed by respective gnome-python*-base package
74     sed -i '/^pkgconfig_DATA/d' Makefile || die "sed failed"
75     sed -i '/^pkgconfigdir/d' Makefile || die "sed failed"
76    
77     gnome2_src_install
78    
79     if hasq examples ${IUSE} && use examples; then
80     insinto /usr/share/doc/${PF}/examples
81    
82     for example in ${EXAMPLES}; do
83     if [[ ${example: -1} = "/" ]]; then
84     doins -r ${example}
85     else
86     doins ${example}
87     fi
88     done
89     fi
90     }
91    
92     gnome-python-common_pkg_postinst() {
93     python_version
94     python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/gtk-2.0
95     }
96    
97     gnome-python-common_pkg_postrm() {
98     python_mod_cleanup
99     }
100    
101     EXPORT_FUNCTIONS pkg_setup src_unpack src_install pkg_postinst pkg_postrm

  ViewVC Help
Powered by ViewVC 1.1.20