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

Diff of /eclass/gdesklets.eclass

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

Revision 1.1 Revision 1.6
1# Copyright 2004 Gentoo Foundation 1# Copyright 2004 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.1 2005/04/19 03:16:52 obz Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/gdesklets.eclass,v 1.6 2005/07/06 20:20:03 agriffis 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 19inherit eutils multilib
20ECLASS="gdesklets" 20
21INHERITED="$INHERITED $ECLASS" 21INHERITED="$INHERITED $ECLASS"
22 22
23MY_P="${DESKLET_NAME}-${PV}" 23MY_P="${DESKLET_NAME}-${PV}"
24S=${WORKDIR}/${DESKLET_NAME} 24S=${WORKDIR}/${DESKLET_NAME}
25 25
46 dodir ${GDESKLETS_INST_DIR}/Displays 46 dodir ${GDESKLETS_INST_DIR}/Displays
47 47
48 # The displays only need to be readable 48 # The displays only need to be readable
49 insopts -m0744 49 insopts -m0744
50 50
51 # Check to see if DISPLAY is set for the
52 # gdesklets-control-getid script to run without
53 # error
54 [ -z "${DISPLAY}" ] && DISPLAY=""
55 export DISPLAY
56
51 # First, install the Sensor (if there is one) 57 # First, install the Sensor (if there is one)
52 if [[ -n "${SENSOR_NAME}" ]]; then 58 if [[ -n "${SENSOR_NAME}" ]]; then
53 for SENS in ${SENSOR_NAME[@]}; do 59 for SENS in ${SENSOR_NAME[@]}; do
54 einfo "Installing Sensor ${SENS}" 60 einfo "Installing Sensor ${SENS}"
55 /usr/bin/python "Install_${SENS}_Sensor.bin" \ 61 /usr/bin/python "Install_${SENS}_Sensor.bin" \
72 78
73 # This creates the subdirectory of ${DESKLET_NAME} 79 # This creates the subdirectory of ${DESKLET_NAME}
74 # in the global Displays directory 80 # in the global Displays directory
75 [[ -d ${GD_INSDIR} ]] || \ 81 [[ -d ${GD_INSDIR} ]] || \
76 dodir ${GD_INSDIR} 82 dodir ${GD_INSDIR}
77
78 insinto ${GD_INSDIR}
79 83
80 # For each of the Display files, there may be 84 # For each of the Display files, there may be
81 # scripts included inline which don't necessarily 85 # scripts included inline which don't necessarily
82 # follow any naming scheme. 86 # follow any naming scheme.
83 # So for each of them, determine what those scripts are 87 # So for each of them, determine what those scripts are
111 # directory, this will be done more than 115 # directory, this will be done more than
112 # once. It's the only solution I can 116 # once. It's the only solution I can
113 # come up with for now... 117 # come up with for now...
114 GFX=(`find . \ 118 GFX=(`find . \
115 -iname "*.png" -o -iname "*.svg" \ 119 -iname "*.png" -o -iname "*.svg" \
116 -o -iname "*.jpg" -o -iname "*.gif"`) 120 -o -iname "*.jpg" -o -iname "*.gif" \
121 -o -iname "*.xcf"`)
117 122
118 for G in ${GFX[@]}; do 123 for G in ${GFX[@]}; do
124
119 insinto ${GD_INSDIR}/`dirname ${G}` 125 insinto ${GD_INSDIR}/`dirname ${G}`
120 doins ${G} 126 doins ${G}
121 done 127
128 done # for in ${GFX}
122 129
123 cd ${S} 130 cd ${S}
124 131
125 done # for in ${DISPLAY_FILES} 132 done # for in ${DISPLAY_FILES}
126 133
139 # There are possibly multiple Controls packaged with the display. 146 # There are possibly multiple Controls packaged with the display.
140 # For each __init__.py found, there must be a Control associated with it. 147 # For each __init__.py found, there must be a Control associated with it.
141 for CTRL in ${CONTROL_INITS[@]}; do 148 for CTRL in ${CONTROL_INITS[@]}; do
142 149
143 cd `dirname ${CTRL}` 150 cd `dirname ${CTRL}`
144 CTRL_NAME=$( ${GDESKLETS_INST_DIR}/gdesklets-control-getid `pwd` ) 151 CTRL_NAME=$( PYTHON_DONTCOMPILE=1 ${GDESKLETS_INST_DIR}/gdesklets-control-getid `pwd` )
145 einfo "Installing Control ${CTRL_NAME}" 152 einfo "Installing Control ${CTRL_NAME}"
146 # This creates the subdirectory of ${CTRL_NAME} 153 # This creates the subdirectory of ${CTRL_NAME}
147 # in the global Controls directory 154 # in the global Controls directory
148 [[ -d ${GD_INSDIR}/${CTRL_NAME} ]] || \ 155 [[ -d ${GD_INSDIR}/${CTRL_NAME} ]] || \
149 dodir ${GD_INSDIR}/${CTRL_NAME} 156 dodir ${GD_INSDIR}/${CTRL_NAME}
150 157
151 insinto ${GD_INSDIR}/${CTRL_NAME} 158 insinto ${GD_INSDIR}/${CTRL_NAME}
152 159
161 # Install any remaining graphics and other files 168 # Install any remaining graphics and other files
162 # that are sitting in ${S}. 169 # that are sitting in ${S}.
163 170
164 GFX=$(find . -maxdepth 1 \ 171 GFX=$(find . -maxdepth 1 \
165 -iname "*.png" -o -iname "*.svg" \ 172 -iname "*.png" -o -iname "*.svg" \
166 -o -iname "*.jpg" -o -iname "*.gif") 173 -o -iname "*.jpg" -o -iname "*.gif" \
174 -o -iname "*.xcf")
167 175
168 if [[ -n "${GFX}" ]]; then 176 if [[ -n "${GFX}" ]]; then
169 # Install to the Displays directory of the Desklet 177 # Install to the Displays directory of the Desklet
170 insinto ${GDESKLETS_INST_DIR}/Displays/${DESKLET_NAME} 178 insinto ${GDESKLETS_INST_DIR}/Displays/${DESKLET_NAME}
171 doins ${GFX} 179 doins ${GFX}

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.20