#!/bin/sh
#
# This script grabs the latest E17 from CVS and builds it.
# It works for me... season to taste. Specifically, set the E_PREFIX
# and note that i'm putting imlib2 somewhere else.
# 
# Run this from the directory you want to put e17/ in.
# 
# If you intend to run this as root (for the "make install" parts),
# you can remove the "sudo" command from the beginning of those lines.
# Depending on the speed of your machine and the length of your sudo
# timeout, you may only need to type in your password for the larger libs.
#
# Only uncomment the "Tidy up" section if you're sure that's what you
# want to do.

# Where i'm putting it:
E_PREFIX=/opt/e17

# Go get it:
echo Just press enter here.
cvs -d:pserver:anonymous@cvs.enlightenment.sourceforge.net:/cvsroot/enlightenment login
cvs -z3 -d:pserver:anonymous@cvs.enlightenment.sourceforge.net:/cvsroot/enlightenment co e17

cd e17

# Start with the libs:

# This one's separate, 'cos i use it other places, too
cd libs/imlib2
./autogen.sh --prefix=/usr --disable-static
make
sudo make install
cd ../..

# Just in case these aren't set:
export PATH=$PATH:$E_PREFIX/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$E_PREFIX/lib
export CFLAGS=-L$E_PREFIX/include
export LDFLAGS=-L$E_PREFIX/lib

# And compile the rest of libs:
for i in \
 libs/edb \
 libs/eet \
 libs/imlib2_loaders \
 libs/evas \
 libs/ecore \
 libs/epeg \
 libs/epsilon \
 proto/esmart \
 libs/edje \
 libs/ewd \
 libs/estyle \
 libs/etox \
 libs/ewl
do
    cd $i
    ./autogen.sh --prefix=$E_PREFIX --disable-static
    make
    sudo make install
    cd ../..
done

# Tidy up:
#sudo mv $E_PREFIX/lib/imlib2_loaders/image/* /usr/lib/imlib2_loaders/image
#sudo rm -r $E_PREFIX/lib/imlib2_loaders
#sudo mv $E_PREFIX/lib/pkgconfig/* /usr/local/lib/pkgconfig
#sudo rmdir $E_PREFIX/lib/pkgconfig

# Now for some apps:
cd apps

for i in \
 iconbar \
 entice
do
    cd $i
    ./autogen.sh --prefix=$E_PREFIX --disable-static
    make
    sudo make install
    cd ..
done
