**** How to build Gnumeric under Slackware without installing Gnome ****
****                      Kees Lemmens, February 2006               ****

The latest Slackware 10.2 has (almost) no support for Gnome anymore as
several parts require major changes deep in Slackware that thwart the
Slackware philosophy (like the PAM authentication modules).

This is however a pity as there are many very good packages under Gnome that
won't run anymore under Slack, such as Gnumeric.

I first installed Dropline Gnome but that ruined my system by installing new
binaries for su, login, passwd and a lot other PAM rubbish and also damaged
my Nvidia card setup by installing a new /usr/X11R6/lib/libGL.

After that I installed FreeRock Gnome. That works a lot better and is a lot
less intrusive, but I really want to be able to run Gnumeric from a remote
NFS fileserver without having to install anything locally but a plain Slack.

For that reason I tried to compile and install Gnumeric myself in
/usr/local/gnome (without installing anything outside this tree).
I always install under my own UID by first giving the install dir to myself
using chown lemmens /usr/local/gnome : if that works I can be sure it will
run on every system where I mount this /usr/local or where I copy the tree.

Procedure :

1) Create a temporary working directory for the compilation (e.g.
$HOME/Develop/Gnumeric denoted as $WORK) and cd $WORK

2) Obtain the following packages (e.g. "from Beyond Linux From Scratch"
at http://www.linuxfromscratch.org/blfs/download.html ) and store them in 
$WORK. Extension is no problem as the script uncompresses both .tar.bz2 and
tar.gz :

 gnome-icon-theme-2.10.1
 gnumeric-1.6.2
 goffice-0.2.0
 hicolor-icon-theme-0.5
 libart_lgpl-2.3.17
 libgnomecanvas-2.9.1
 libgnomeprint-2.12.1
 libgnomeprintui-2.12.1
 libgsf-1.13.3
 pango-1.8.1
 pygtk-2.4.1

3) Create a directory where you want to install Gnumeric and the rest of the
stuff (e.g. /usr/local/gnome4gnumeric denote as $GNUMERIC ) and make sure it
is owned by the person who compiles Gnumeric.

4) Run the following script : it will simply unpack the tars, run configure
and the install them. If everything goes well you'll have a working
gnumeric in $GNUMERIC/bin after an hour or 2 :-)

#!/bin/sh
#

# This script shows how to compile gnumeric on a slack 10.2 system without
# having to install a full Gnome like Dropline or FreeRock

GNUMERIC=/opt/gnome4gnumeric
WORK=$PWD
LOG=$WORK/compile.log

export PKG_CONFIG_PATH="$GNUMERIC/lib/pkgconfig"

LIBS="-I/usr/include/gtk-2.0 \
      -I/usr/include/atk-1.0 \
      -I/usr/lib/gtk-2.0/include"

rm -f $LOG

for package in \
 libart_lgpl-2.3.17 \
 libgsf-1.13.3 \
 pango-1.8.1 \
 pygtk-2.4.1 \
 hicolor-icon-theme-0.5 \
 gnome-icon-theme-2.10.1 \
 libgnomecanvas-2.9.1 \
 libgnomeprint-2.12.1 \
 libgnomeprintui-2.12.1 \
 goffice-0.2.0 \
 gnumeric-1.6.2
do
   cd $WORK
   echo "Compiling $package ..."
   test -d $WORK/$package || tar -xvzf $WORK/$package.tar.gz
   test -d $WORK/$package || tar -xvjf $WORK/$package.tar.bz2
   cd $WORK/$package
   env CFLAGS="$LIBS" CPPFLAGS="$LIBS" ./configure \
   --prefix=$GNUMERIC --disable-gtk-doc --without-cups >> $LOG
   make clean >> $LOG
   make >> $LOG
   make install >> $LOG || exit 1
done

echo "Gnumeric compiled succesfully !"