#!/bin/sh
#
# Copyright 2007 Zach Borgerding <zborgerd@gmail.com>
# Available under the terms of the GNU GPL.
#

NAME="dropline-theme"
PKG_TARNAME="murrine"

THEME_NAME="TwoEighteen-current"
GDM_NAME="TwoEighteenGDM"
WALLPAPER_NAME="TwoEighteenWallpaper"

VERSION="2.28_alpha"
MURRINE_VERSION="0.90.3"

REVISION="2"

PKG_SOURCEURL='http://ftp.gnome.org/pub/GNOME/sources/$PKG_TARNAME/0.90/$PKG_TARNAME-$MURRINE_VERSION.tar.bz2'
THEME_SOURCEURL='http://ertz.droplinegnome.org/packages/TwoEighteen-current.tar.gz'
GDM_SOURCEURL='http://zborgerd.droplinegnome.org/2.18.3/TwoEighteenGDM.tar.gz'
WALLPAPER_SOURCEURL='http://zborgerd.droplinegnome.org/2.18.3/TwoEighteenWallpaper.tar.gz'

PKG_PATCH[0]='murrine-appropriate-free.diff'

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

cflags $PKG_CFLAGS -g

prepare
analyzesource
#applypatch 0 0
configure --enable-animation
make
makeinstall install-strip 

# Download Ertz's GTK/Metacity themes.  Remove the old one first.
if [ -e $PKG_COREREPOS/$THEME_NAME.tar.gz ]; then
        spewdo "rm $PKG_COREREPOS/$THEME_NAME.tar.gz"
fi
downloadfile $PKG_COREREPOS $THEME_SOURCEURL

# Unpack them to the staging space.
spewdo "mkdir -p $PKG_STAGEROOT$PKG_PREFIX/share/themes"
spewdo "tar -zxvf $PKG_COREREPOS/$THEME_NAME.tar.gz -C \
        $PKG_STAGEROOT$PKG_PREFIX/share/themes/"


# Download Ertz's GDM themes.  Remove the old one first.
if [ -e $PKG_COREREPOS/$GDM_NAME.tar.gz ]; then
        spewdo "rm $PKG_COREREPOS/$GDM_NAME.tar.gz"
fi
downloadfile $PKG_COREREPOS $GDM_SOURCEURL

# Unpack them to the staging space.
spewdo "mkdir -p $PKG_STAGEROOT$PKG_PREFIX/share/gdm/themes"
spewdo "tar -zxvf $PKG_COREREPOS/$GDM_NAME.tar.gz -C \
        $PKG_STAGEROOT$PKG_PREFIX/share/gdm/themes/"


# Download Ertz's Wallpaper.  Remove the old one first.
if [ -e $PKG_COREREPOS/$WALLPAPER_NAME.tar.gz ]; then
        spewdo "rm $PKG_COREREPOS/$WALLPAPER_NAME.tar.gz"
fi
downloadfile $PKG_COREREPOS $WALLPAPER_SOURCEURL

# Unpack them to the staging space.
spewdo "mkdir -p $PKG_STAGEROOT$PKG_PREFIX/share/"
spewdo "tar -zxvf $PKG_COREREPOS/$WALLPAPER_NAME.tar.gz -C \
        $PKG_STAGEROOT$PKG_PREFIX/share/"

# Cleanup ownership.
spewdo "chown -R root.root $PKG_STAGEROOT$PKG_PREFIX/*"

tidydocumentation
analyzebinaries
finalizepackage
packagize
cleanup
