/[gentoo-x86]/eclass/gdesklets.eclass
Gentoo

Diff of /eclass/gdesklets.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.11 Revision 1.16
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.16 2008/02/19 01:51:00 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
19inherit eutils multilib 19inherit eutils multilib python
20 20
21 21
22MY_P="${DESKLET_NAME}-${PV}" 22MY_P="${DESKLET_NAME}-${PV}"
23S=${WORKDIR}/${DESKLET_NAME} 23S=${WORKDIR}/${DESKLET_NAME}
24 24
27# Ebuild writer shouldn't need to touch these (except maybe $RDEPEND) 27# Ebuild writer shouldn't need to touch these (except maybe $RDEPEND)
28SLOT="0" 28SLOT="0"
29IUSE="" 29IUSE=""
30RDEPEND=">=gnome-extra/gdesklets-core-0.34.3-r1" 30RDEPEND=">=gnome-extra/gdesklets-core-0.34.3-r1"
31 31
32GDESKLETS_INST_DIR="/usr/$(get_libdir)/gdesklets" 32GDESKLETS_INST_DIR="${ROOT}usr/$(get_libdir)/gdesklets"
33 33
34gdesklets_src_install() { 34gdesklets_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
42 # It makes the Displays or Controls directory in the 48 # It makes the Displays or Controls directory in the
43 # global installation directory if it doesn't exist 49 # global installation directory if it doesn't exist
44 [[ -d ${GDESKLETS_INST_DIR}/Displays ]] || \ 50 [[ -d "${GDESKLETS_INST_DIR}/Displays" ]] || \
45 dodir ${GDESKLETS_INST_DIR}/Displays 51 dodir "${GDESKLETS_INST_DIR}/Displays"
46 52
47 # The displays only need to be readable 53 # The displays only need to be readable
48 insopts -m0744 54 insopts -m0744
49 55
50 # Check to see if DISPLAY is set for the 56 # Check to see if DISPLAY is set for the
57 # First, install the Sensor (if there is one) 63 # First, install the Sensor (if there is one)
58 if [[ -n "${SENSOR_NAME}" ]]; then 64 if [[ -n "${SENSOR_NAME}" ]]; then
59 for SENS in ${SENSOR_NAME[@]}; do 65 for SENS in ${SENSOR_NAME[@]}; do
60 einfo "Installing Sensor ${SENS}" 66 einfo "Installing Sensor ${SENS}"
61 /usr/bin/python "Install_${SENS}_Sensor.bin" \ 67 /usr/bin/python "Install_${SENS}_Sensor.bin" \
62 --nomsg ${D}${GDESKLETS_INST_DIR}/Sensors || \ 68 --nomsg "${D}${GDESKLETS_INST_DIR}/Sensors" || \
63 die "Couldn't Install Sensor" 69 die "Couldn't Install Sensor"
64 70
65 chown -R root:0 ${D}${GDESKLETS_INST_DIR}/Sensors/${SENSOR_NAME} 71 chown -R root:0 "${D}${GDESKLETS_INST_DIR}/Sensors/${SENSOR_NAME}"
66 done # for in ${SENSOR_NAME} 72 done # for in ${SENSOR_NAME}
67 fi # if -n "${SENSOR_NAME}" 73 fi # if -n "${SENSOR_NAME}"
68 74
69 debug-print-section display_install 75 debug-print-section display_install
70 # This finds the Displays 76 # This finds the Displays
77 # Base installation directory for displays from this desklet 83 # Base installation directory for displays from this desklet
78 DESKLET_INSDIR="${GDESKLETS_INST_DIR}/Displays/${DESKLET_NAME}" 84 DESKLET_INSDIR="${GDESKLETS_INST_DIR}/Displays/${DESKLET_NAME}"
79 85
80 # This creates the subdirectory of ${DESKLET_NAME} 86 # This creates the subdirectory of ${DESKLET_NAME}
81 # in the global Displays directory 87 # in the global Displays directory
82 [[ -d ${DESKLET_INSDIR} ]] || \ 88 [[ -d "${DESKLET_INSDIR}" ]] || \
83 dodir ${DESKLET_INSDIR} 89 dodir "${DESKLET_INSDIR}"
84 90
85 # For each of the Display files, there may be 91 # For each of the Display files, there may be
86 # scripts included inline which don't necessarily 92 # scripts included inline which don't necessarily
87 # follow any naming scheme. 93 # follow any naming scheme.
88 # So for each of them, determine what those scripts are 94 # So for each of them, determine what those scripts are
91 97
92 cd `dirname ${DSP}` 98 cd `dirname ${DSP}`
93 einfo "Installing Display `basename ${DSP} .display`" 99 einfo "Installing Display `basename ${DSP} .display`"
94 debug-print "Installing ${DSP} into ${DESKLET_INSDIR}" 100 debug-print "Installing ${DSP} into ${DESKLET_INSDIR}"
95 DSP=`basename ${DSP}` 101 DSP=`basename ${DSP}`
96 insinto ${DESKLET_INSDIR} 102 insinto "${DESKLET_INSDIR}"
97 doins ${DSP} 103 doins "${DSP}"
98 104
99 SCRIPTS=$(grep "script .*uri" ${DSP} | \ 105 SCRIPTS=$(grep "script .*uri" ${DSP} | \
100 sed -e 's:.*<script .*uri=": :g' -e 's:"/>.*: :g') 106 sed -e 's:.*<script .*uri=": :g' -e 's:"/>.*: :g')
101 107
102 # For each one of the scripts, change to its 108 # For each one of the scripts, change to its
103 # base directory and change the install location 109 # base directory and change the install location
104 # so it gets installed at the proper place 110 # so it gets installed at the proper place
105 # relative to the display. 111 # relative to the display.
106 for SCR in ${SCRIPTS[@]}; do 112 for SCR in ${SCRIPTS[@]}; do
107 113
108 cd `dirname ${SCR}`
109
110 insinto ${DESKLET_INSDIR}/`dirname ${SCR}` 114 insinto "${DESKLET_INSDIR}/`dirname ${SCR}`"
111 doins `basename ${SCR}` 115 doins "${SCR}"
112 debug-print "Installed `basename ${SCR}` into ${DESKLET_INSDIR}/`dirname ${SCR}`" 116 debug-print "Installed ${SCR} into ${DESKLET_INSDIR}/`dirname ${SCR}`"
113
114 cd ${S}/`dirname ${DSP}`
115 117
116 done # for in ${SCRIPTS} 118 done # for in ${SCRIPTS}
117 119
118 # Install the graphics for this display. 120 # Install the graphics for this display.
119 # If there are multiple displays in this 121 # If there are multiple displays in this
125 -o -iname "*.jpg" -o -iname "*.gif" \ 127 -o -iname "*.jpg" -o -iname "*.gif" \
126 -o -iname "*.xcf"`) 128 -o -iname "*.xcf"`)
127 129
128 for G in ${GFX[@]}; do 130 for G in ${GFX[@]}; do
129 131
130 insinto ${DESKLET_INSDIR}/`dirname ${G}` 132 insinto "${DESKLET_INSDIR}/`dirname ${G}`"
131 doins ${G} 133 doins "${G}"
132 debug-print "Installed ${G} into ${DESKLET_INSDIR}/`dirname ${G}`" 134 debug-print "Installed ${G} into ${DESKLET_INSDIR}/`dirname ${G}`"
133 135
134 done # for in ${GFX} 136 done # for in ${GFX}
135 137
136 cd ${S} 138 cd "${S}"
137 139
138 done # for in ${DISPLAY_FILES} 140 done # for in ${DISPLAY_FILES}
139 141
140 fi 142 fi
141 143
142 debug-print-section control_install 144 debug-print-section control_install
143 145
144 CONTROL_INSDIR="" 146 CONTROL_INSDIR=""
145 147
146 # Make sure that it only finds Controls and not Sensors 148 # Make sure that it only finds Controls and not Sensors
147 # If it uses a Sensor, it shouldn't use a Control (since 149 # If it uses a Sensor, it shouldn't use a Control (since
148 # Sensors are deprecated). 150 # Sensors are deprecated).
149 if [[ -z "${SENSOR_NAME}" ]]; then 151 if [[ -z "${SENSOR_NAME}" ]]; then
150 152
156 # There are possibly multiple Controls packaged with the display. 158 # There are possibly multiple Controls packaged with the display.
157 # For each __init__.py found, there must be a Control associated with it. 159 # For each __init__.py found, there must be a Control associated with it.
158 for CTRL in ${CONTROL_INITS[@]}; do 160 for CTRL in ${CONTROL_INITS[@]}; do
159 161
160 cd `dirname ${CTRL}` 162 cd `dirname ${CTRL}`
161 CTRL_NAME=$( PYTHON_DONTCOMPILE=1 ${GDESKLETS_INST_DIR}/gdesklets-control-getid `pwd` ) 163 CTRL_NAME=$( "${GDESKLETS_INST_DIR}/gdesklets-control-getid" `pwd` )
162 einfo "Installing Control ${CTRL_NAME}" 164 einfo "Installing Control ${CTRL_NAME}"
163 # This creates the subdirectory of ${CTRL_NAME} 165 # This creates the subdirectory of ${CTRL_NAME}
164 # in the global Controls directory 166 # in the global Controls directory
165 [[ -d ${CONTROL_INSDIR}/${CTRL_NAME} ]] || \ 167 [[ -d "${CONTROL_INSDIR}/${CTRL_NAME}" ]] || \
166 dodir ${CONTROL_INSDIR}/${CTRL_NAME} 168 dodir "${CONTROL_INSDIR}/${CTRL_NAME}"
167 169
168 insinto ${CONTROL_INSDIR}/${CTRL_NAME} 170 insinto "${CONTROL_INSDIR}/${CTRL_NAME}"
169 171
170 doins -r * 172 doins -r *
171 173
172 cd ${S} 174 cd "${S}"
173 175
174 done # for in ${CONTROL_INITS} 176 done # for in ${CONTROL_INITS}
175 177
176 fi # if no Sensors 178 fi # if no Sensors
177 179
184 -o -iname "*.xcf") 186 -o -iname "*.xcf")
185 187
186 if [[ -n "${GFX}" ]]; then 188 if [[ -n "${GFX}" ]]; then
187 189
188 # Install to the Displays directory of the Desklet 190 # Install to the Displays directory of the Desklet
189 insinto ${GDESKLETS_INST_DIR}/Displays/${DESKLET_NAME} 191 insinto "${GDESKLETS_INST_DIR}/Displays/${DESKLET_NAME}"
190 doins ${GFX} 192 doins "${GFX}"
191 debug-print "Installed ${GFX} into ${GDESKLETS_INST_DIR}/Displays/${DESKLET_NAME}" 193 debug-print "Installed ${GFX} into ${GDESKLETS_INST_DIR}/Displays/${DESKLET_NAME}"
192 194
193 fi # if -n "${GFX}" 195 fi # if -n "${GFX}"
194 196
195 # Install some docs if so requested 197 # Install some docs if so requested
196 [[ -n "${DOCS}" ]] && dodoc ${DOCS} 198 [[ -n "${DOCS}" ]] && dodoc "${DOCS}" && \
197 debug-print "Installed ${DOCS}" 199 debug-print "Installed ${DOCS}"
198 200
199} 201}
200 202
201 203

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.20