| 1 | # Copyright 2004 Gentoo Foundation |
1 | # Copyright 2004-2006 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License, v2 or later |
2 | # Distributed under the terms of the GNU General Public License, v2 or later |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/gdesklets.eclass,v 1.11 2006/01/16 18:14:47 nixphoeni Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/gdesklets.eclass,v 1.13 2006/05/26 04:14:58 nixphoeni Exp $ |
| 4 | # |
4 | # |
| 5 | # Authors: Joe Sapp <nixphoeni@gentoo.org> |
5 | # Authors: Joe Sapp <nixphoeni@gentoo.org> |
| 6 | # Mike Gardiner <obz@gentoo.org> |
6 | # Mike Gardiner <obz@gentoo.org> |
| 7 | # |
7 | # |
| 8 | # Usage: |
8 | # Usage: |
| … | |
… | |
| 14 | # Usually ${WORKDIR}/${DESKLET_NAME} if it was packaged |
14 | # Usually ${WORKDIR}/${DESKLET_NAME} if it was packaged |
| 15 | # correctly (hence, this is the default). |
15 | # correctly (hence, this is the default). |
| 16 | # RDEPEND: *Optional* Set if the desklet requires a minimum version |
16 | # RDEPEND: *Optional* Set if the desklet requires a minimum version |
| 17 | # of gDesklets greater than 0.34 or other packages. |
17 | # of gDesklets greater than 0.34 or other packages. |
| 18 | |
18 | |
| 19 | inherit eutils multilib |
19 | inherit eutils multilib python |
| 20 | |
20 | |
| 21 | |
21 | |
| 22 | MY_P="${DESKLET_NAME}-${PV}" |
22 | MY_P="${DESKLET_NAME}-${PV}" |
| 23 | S=${WORKDIR}/${DESKLET_NAME} |
23 | S=${WORKDIR}/${DESKLET_NAME} |
| 24 | |
24 | |
| … | |
… | |
| 32 | GDESKLETS_INST_DIR="/usr/$(get_libdir)/gdesklets" |
32 | GDESKLETS_INST_DIR="/usr/$(get_libdir)/gdesklets" |
| 33 | |
33 | |
| 34 | gdesklets_src_install() { |
34 | gdesklets_src_install() { |
| 35 | |
35 | |
| 36 | debug-print-function $FUNCNAME $* |
36 | debug-print-function $FUNCNAME $* |
|
|
37 | |
|
|
38 | # Disable compilation of included python modules (Controls) |
|
|
39 | python_disable_pyc |
|
|
40 | |
|
|
41 | # Do not remove - see bugs 126890 and 128289 |
|
|
42 | addwrite "${ROOT}/root/.gnome2" |
| 37 | |
43 | |
| 38 | has_version ">=gnome-extra/gdesklets-core-0.33.1" || \ |
44 | has_version ">=gnome-extra/gdesklets-core-0.33.1" || \ |
| 39 | GDESKLETS_INST_DIR="/usr/share/gdesklets" |
45 | GDESKLETS_INST_DIR="/usr/share/gdesklets" |
| 40 | |
46 | |
| 41 | # This should be done by the gdesklets-core ebuild |
47 | # This should be done by the gdesklets-core ebuild |
| … | |
… | |
| 138 | done # for in ${DISPLAY_FILES} |
144 | done # for in ${DISPLAY_FILES} |
| 139 | |
145 | |
| 140 | fi |
146 | fi |
| 141 | |
147 | |
| 142 | debug-print-section control_install |
148 | debug-print-section control_install |
| 143 | |
149 | |
| 144 | CONTROL_INSDIR="" |
150 | CONTROL_INSDIR="" |
| 145 | |
151 | |
| 146 | # Make sure that it only finds Controls and not Sensors |
152 | # Make sure that it only finds Controls and not Sensors |
| 147 | # If it uses a Sensor, it shouldn't use a Control (since |
153 | # If it uses a Sensor, it shouldn't use a Control (since |
| 148 | # Sensors are deprecated). |
154 | # Sensors are deprecated). |
| 149 | if [[ -z "${SENSOR_NAME}" ]]; then |
155 | if [[ -z "${SENSOR_NAME}" ]]; then |
| 150 | |
156 | |
| … | |
… | |
| 156 | # There are possibly multiple Controls packaged with the display. |
162 | # There are possibly multiple Controls packaged with the display. |
| 157 | # For each __init__.py found, there must be a Control associated with it. |
163 | # For each __init__.py found, there must be a Control associated with it. |
| 158 | for CTRL in ${CONTROL_INITS[@]}; do |
164 | for CTRL in ${CONTROL_INITS[@]}; do |
| 159 | |
165 | |
| 160 | cd `dirname ${CTRL}` |
166 | cd `dirname ${CTRL}` |
| 161 | CTRL_NAME=$( PYTHON_DONTCOMPILE=1 ${GDESKLETS_INST_DIR}/gdesklets-control-getid `pwd` ) |
167 | CTRL_NAME=$( ${GDESKLETS_INST_DIR}/gdesklets-control-getid `pwd` ) |
| 162 | einfo "Installing Control ${CTRL_NAME}" |
168 | einfo "Installing Control ${CTRL_NAME}" |
| 163 | # This creates the subdirectory of ${CTRL_NAME} |
169 | # This creates the subdirectory of ${CTRL_NAME} |
| 164 | # in the global Controls directory |
170 | # in the global Controls directory |
| 165 | [[ -d ${CONTROL_INSDIR}/${CTRL_NAME} ]] || \ |
171 | [[ -d ${CONTROL_INSDIR}/${CTRL_NAME} ]] || \ |
| 166 | dodir ${CONTROL_INSDIR}/${CTRL_NAME} |
172 | dodir ${CONTROL_INSDIR}/${CTRL_NAME} |