# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils DESCRIPTION="This is a desktop applet that displays weather information and forecasts." HOMEPAGE="http://homepages.comnet.co.nz/~matt-sarah/" SRC_URI="http://www.message.co.nz/~matt-sarah/lwp-${PV}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="x86" IUSE="unicode" DEPEND=">=x11-misc/superkaramba-0.35" DIR_NAME="liquid_weather_plus" MY_DEST="/usr/share/karamba/themes/${DIR_NAME}" src_unpack() { unpack ${A} patch -p0 -F0 --no-backup-if-mismatch < ${FILESDIR}/${P}-translations.patch || die if use unicode; then cd "${WORKDIR}/${DIR_NAME}/" for FILE in translations/*; do NBRLINES=`cat ${FILE} | wc -l` TEMP=`grep -nx '' ${FILE}` IDX=`expr index $TEMP :` LINE=${TEMP:0:$((IDX-1))} NBRLINES2=$((NBRLINES-LINE + 1)) head -n ${LINE} ${FILE} > output tail -n ${NBRLINES2} ${FILE} | iconv -f ISO-8859-1 -t UTF-8 >> output mv output ${FILE} done fi } src_install() { cd "${WORKDIR}/${DIR_NAME}/" # Cleanup rm *~ icons/flat/large_icons/.png index.html rm -R background/.xvpics icons/weather.com/small_icons/.pics for DOC in translation_template.txt; do dodoc ${DOC} ; rm ${DOC} done dodir "${MY_DEST}/" mv * "${D}/${MY_DEST}/" }