# Copyright 2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License, v2 or later # $Header: /var/cvsroot/gentoo-x86/eclass/gdesklets.eclass,v 1.7 2005/07/06 20:23:20 agriffis Exp $ # # Authors: Joe Sapp # Mike Gardiner # # Usage: # As a writer for an ebuild for gDesklets, you should set a few things: # # DESKLET_NAME: The name of the desklet. # DOCS: Anything (like a README) that should be dodoc'd. # S: *Optional* The package's base directory. # Usually ${WORKDIR}/${DESKLET_NAME} if it was packaged # correctly (hence, this is the default). # RDEPEND: *Optional* Set if the desklet requires a minimum version # of gDesklets greater than 0.34 or other packages. inherit eutils multilib MY_P="${DESKLET_NAME}-${PV}" S=${WORKDIR}/${DESKLET_NAME} SRC_URI="http://gdesklets.gnomedesktop.org/files/${MY_P}.tar.gz" # Ebuild writer shouldn't need to touch these (except maybe $RDEPEND) SLOT="0" IUSE="" RDEPEND="${RDEPEND} >=gnome-extra/gdesklets-core-0.34.3" GDESKLETS_INST_DIR="/usr/$(get_libdir)/gdesklets" gdesklets_src_install() { debug-print-function $FUNCNAME $* has_version ">=gnome-extra/gdesklets-core-0.33.1" || \ GDESKLETS_INST_DIR="/usr/share/gdesklets" # This should be done by the gdesklets-core ebuild # It makes the Displays or Controls directory in the # global installation directory if it doesn't exist [[ -d ${GDESKLETS_INST_DIR}/Displays ]] || \ dodir ${GDESKLETS_INST_DIR}/Displays # The displays only need to be readable insopts -m0744 # Check to see if DISPLAY is set for the # gdesklets-control-getid script to run without # error [ -z "${DISPLAY}" ] && DISPLAY="" export DISPLAY # First, install the Sensor (if there is one) if [[ -n "${SENSOR_NAME}" ]]; then for SENS in ${SENSOR_NAME[@]}; do einfo "Installing Sensor ${SENS}" /usr/bin/python "Install_${SENS}_Sensor.bin" \ --nomsg ${D}${GDESKLETS_INST_DIR}/Sensors || \ die "Couldn't Install Sensor" chown -R root:root ${D}${GDESKLETS_INST_DIR}/Sensors/${SENSOR_NAME} done # for in ${SENSOR_NAME} fi # if -n "${SENSOR_NAME}" # This finds the Displays DISPLAY_FILES=(`find . -iname "*.display"`) GD_INSDIR="" # There is more than likely only one display per package if [[ -n "${DISPLAY_FILES[@]}" ]]; then # Base installation directory for displays GD_INSDIR="${GDESKLETS_INST_DIR}/Displays/${DESKLET_NAME}" # This creates the subdirectory of ${DESKLET_NAME} # in the global Displays directory [[ -d ${GD_INSDIR} ]] || \ dodir ${GD_INSDIR} # For each of the Display files, there may be # scripts included inline which don't necessarily # follow any naming scheme. # So for each of them, determine what those scripts are # and install them. for DSP in ${DISPLAY_FILES[@]}; do einfo "Installing Display `basename ${DSP} .display`" insinto ${GD_INSDIR} doins ${DSP} SCRIPTS=$(grep "script uri" ${DSP} | \ sed -e 's:.*