#!/bin/sh
#
# Copyright 2005 Scott Harmon
# Available under the terms of the GNU GPL.
#

NAME="dropline-version"
VERSION="2.12.1"
DATE="2005-10-08"
DISTRIBUTOR="Dropline GNOME"
#STARTPAGE="http://www.droplinegnome.org/home/paulbest/artwork/dropline-startpage-$VERSION-placeholder.tar.gz"
STARTPAGE="http://www.droplinegnome.org/home/paulbest/artwork/dropline-startpage-2.12.1.2.tar.gz"
SPLASH="http://www.droplinegnome.org/home/paulbest/misc/gnome-splash-2.12.png"
SOURCE1="gnome-desktop"
REVISION="2"
PKG_ARCH="noarch"

. $DLG_ROOT/config
. $DLG_ROOT/SCRIPTS/dropline-functions.sh

# gnome-version
PKG_SOURCEURL=http://ftp.gnome.org/pub/GNOME/sources/$SOURCE1/$VER_MAJ.$VER_MIN/$SOURCE1-$VERSION.tar.bz2

createdir $PKG_WORKROOT
createdir $PKG_LOGROOT

findtarball filename
if [ -z "$filename" ]; then
	echo "Unable to locate $PKG_SOURCEURL!  Exiting..."
	die
fi

opentarball $filename

createdir $PKG_STAGEROOT$PKG_PREFIX/share/gnome-about/
sed -e "s/<distributor>.*<\/distributor>/<distributor>$DISTRIBUTOR<\/distributor>/g" -e "s/<date>.*<\/date>/<date>$DATE<\/date>/g" $PKG_SRCROOT/gnome-version.xml > $PKG_STAGEROOT$PKG_PREFIX/share/gnome-about/gnome-version.xml

# Webpage
PKG_SOURCEURL=$STARTPAGE

removedir $PKG_WORKROOT
createdir $PKG_WORKROOT

findtarball filename
if [ -z "$filename" ]; then
	echo "Unable to locate $PKG_SOURCEURL!  Exiting..."
	die
fi

opentarball $filename
sanifysource $PKG_SRCROOT
spewdo "find $PKG_SRCROOT -type d -exec chmod 755 {} \;"
spewdo "find $PKG_SRCROOT -type f -exec chmod 644 {} \;"
createdir $PKG_STAGEROOT$PKG_PREFIX/share
mv $PKG_SRCROOT $PKG_STAGEROOT$PKG_PREFIX/share

# Splash
SPLASH_NAME=`basename $SPLASH`
createdir $PKG_STAGEROOT$PKG_PREFIX/share/pixmaps/splash
rm -rf $PKG_STAGEROOT$PKG_PREFIX/share/pixmaps/splash/gnome-splash.png
rm -rf $PKG_STAGEROOT$PKG_PREFIX/share/pixmaps/splash/$SPLASH_NAME
downloadfile $PKG_STAGEROOT$PKG_PREFIX/share/pixmaps/splash/ $SPLASH
mv $PKG_STAGEROOT$PKG_PREFIX/share/pixmaps/splash/$SPLASH_NAME $PKG_STAGEROOT$PKG_PREFIX/share/pixmaps/splash/gnome-splash.png
chown root.root $PKG_STAGEROOT$PKG_PREFIX/share/pixmaps/splash/gnome-splash.png
chmod 644 $PKG_STAGEROOT$PKG_PREFIX/share/pixmaps/splash/gnome-splash.png

# Finish up
analyzebinaries
finalizepackage
packagize
cleanup
