## Below is a detailed description covering the installation of most
## of the "stock" programs required by our in-house software.  This is
## _my_ interpretation of the standards and if its incorrect i hope
## those in the know will correct me ASAP!
## 
## As should be obvious my comments are follow a couple of pound signs.
## Prompts by the various install scripts are prefaced by a percent sign.
## 
## Commands you ought to issue are prefaced by the lowest level of the
## present working directory you are in.  To make it look just like the
## text below type:
## 
## 	PS1="\W> "
## 
## in your shell (assumes you use bash).  I.e. "src>" is really what
## you'd see if you were in "/usr/local/src>".
##
## Here are the source files I hope to install:
## 
##
src> ls -1
VERITAS_alpha.tar.gz
XEphem-disk1-3.6.1-free.tar.bz2
ZThread-2.2.10.tar.gz
boost-jam-3.1.10-1-linuxx86.tgz
boost_1_31_0.tar.bz2
links-1.00pre9.tar.gz
mysql-4.0.21.tar.gz
omniORB-4.0.3.tar.gz
qt-x11-free-3.3.1.tar.bz2
##
## The following perhaps ought to be installed but I don't do so (for
## now):
##
j2re-1_4_2_05-linux-i586.bin
qwt-4.2.0rc2.tar.bz2
root_v4.00.06.Linux.RH9.0.gcc32a.tar.gz
tinyxml_2_3_2.tar.gz
##
## Here we go ...
##
xxx> cd /home/local/src
src> mkdir /usr/local/veritas
src> mkdir /usr/local/veritas/bin
src> mkdir /usr/local/veritas/include
src> mkdir /usr/local/veritas/lib
##
##
## DAST is part of Filip's much larger "VERITAS" package.  You may need
## more of than DAST but that is all i'll deal with here.
##
src> tar -zxf VERITAS_alpha.tar.gz
src> cd VERITAS
VERITAS> mkdir lib
VERITAS> cd DAST
DAST> make
DAST> cp ../lib/libdast.a /usr/local/veritas/lib
DAST> mkdir /usr/local/veritas/include/DAST
DAST> cp *.hpp  /usr/local/veritas/include/DAST
##
##
## XEphem:
##
xxx> cd /home/local/src
src> bunzip2 XEphem-disk1-3.6.1-free.tar.bz2
tar -xf XEphem-disk1-3.6.1-free.tar
src> cd XEphem-disk1-3.6.1-free
XEphem-disk1-3.6.1-free> ./install
##
## The installation script will ask a series of questions, the default
## is ok then just hit a carriage-return <cr>.
## Here is what you'll be asked:
##
% Proceed to install XEphem Version 3.6.1? (y/n) [y] <cr>
% Have you read the notices above and agree to abide by them? (y/n) [n] y<cr>
% X Window app defaults directory: [/usr/X11R6/lib/X11/app-defaults] <cr>
% Installation root directory: [/usr/local/xephem] /usr/local/XEphem_3.6.1
##
## NB, some packages like XEphem install quite a bit of guff besides what
## would end up in the standard lib, include and bin directories.  I prefer
## to install these packages into directories which contain their full
## names including version numbers and then create a symbolic link to that
## directory with a "simple" name (see below).  Continuing on ...
##
%  Create /usr/local/XEphem_3.6.1? (y/n) [y] <cr>
% 
% Manual page directory: [/usr/share/man/man1] <cr>
% Executables directory: [/usr/local/bin] <cr>
% Private dir directory: [/root/.xephem] <cr>
%
% 0  none                 Install all supporting files but no binaries
% 1  linux-x86            Linux 2.4 on x86
% 2  OSX                  Mac OS X Panther on G4
% Enter line number of your system type, or 0 to skip: [1] <cr>
% Install hooks for KDE and Gnome desktops? (y/n) <cr>
% No more questions ...
%
##
## Done (almost)
##
XEphem-disk1-3.6.1-free> cd /usr/local/
local> ln -s XEphem_3.6.1 XEphem
##
## For this package there is almost no reason to create this symbolic
## link but what the heck.
##
##
## ZThreads:
##
xxx> cd /usr/local/src
src> tar -zxf ZThread-2.2.10.tar.gz
src> cd ZThread-2.2.10
##
## Now the zthreads package is broken (sort of).  You need to create a
## subdirectory and create a symbolic link to a standard package before
## you build the code.
##
## NB the "\" indicate line continuation (ie, the whole long line has to
## be entered.
##
ZThread-2.2.10> mkdir include/asm
ZThread-2.2.10> ln -s  \
   /usr/src/linux-2.4.20-6/include/asm-i386/atomic.h \
   ./include/asm/atomic.h
##
## IF you are using Fedora Core 2 you must also do the following:
##
ZThread-2.2.10> ln -s  \
   /usr/src/linux-2.6.5-1.358/include/asm-i386/atomic.h \
   ./include/asm/atomic.h
##
## In addition, because the gcc 3.3.x compiler is stricter than the 3.2
## series you have to "fix" two more things ...
## 
ZThread-2.2.10> cd src/posix
posix> emacs -nw FastLock.h
##
## After the line "#include <pthread.h>" insert a new line containing
## the following "#include <assert.h>" (omit the quotes).  Save the file.
## One more (not critical) thing to fix ...
##
posix> cd ../../tests
tests> emacs -nw  ReadWriteTests.cxx
##
## After the line "#include <iostream>" insert a new line containing
## the following "#include <assert.h>" (omit the quotes).  Save the file.
##
tests> cd ..
ZThread-2.2.10> ./configure --prefix=/usr/local/ZThread-2.2.10
ZThread-2.2.10> make
ZThread-2.2.10> make install
##
## Thats it.
## The ZThread libraries are put into /usr/local/ZThread-2.2.10/lib
## The ZThread include files are put into /usr/local/ZThread-2.2.10/include
##
##
## boost:
##
## To install boost you first need to install boost-jam
##
cd /usr/local/src
src> tar -zxf boost-jam-3.1.10-1-linuxx86.tgz
src> bunzip2 boost_1_31_0.tar.bz2
src> tar -xf boost_1_31_0.tar
src> cd boost_1_31_0
boost_1_31_0>  /usr/local/src/boost-jam-3.1.10-1-linuxx86/bjam \
   "-sTOOLS=gcc" install
##
## This installs boost lib files in /usr/local/lib and include files in
## /usr/local/include/boost-1_31
##
##
## links:
## 
## "links" is a ascii style web browser similar to lynx but somewhat less
## dog eared.  For taking a quick look at html documents or a fast browse
## of the web its pretty good.  So i'll install it ...
##
xxx> cd /usr/local/src
src> tar -zxf links-1.00pre9.tar.gz
src> cd links-1.00pre9
links-1.00pre9> ./configure
links-1.00pre9> make
links-1.00pre9> make install
##
## PRESTO!
##
##
## mySQL:
##
## Guy has very clear instructions on his db website:
## http://veritas.sao.arizona.edu/private/Software/\
## 	observer.Software/Database/mysql_install.html
##
xxx> cd /usr/local/src
src> tar -zxf mysql-4.0.21.tar.gz
src> cd mysql-4.0.21
mysql-4.0.21> ./configure --enable-thread-safe-client --with-innodb --with-openssl --without-server
mysql-4.0.21> make
mysql-4.0.21> make install
##
## This inserts the required files in the standard locattions e.g.
## header files in /usr/local/include/mysql, etc..
##
##
## omniORB and QT install somewhat differently from mySQL (for example)
## The "live" entirely within their own directories and you "reference"
## them by way of an environment variable (set in your shell).  The main
## (and compelling) reason to do it this way as this is how the folks
## who provided the code said to and that is good enough for me.
##
##
## omniORB:
##
## During installation and subsequent use omniORB uses an environment
## variable "OMNIORB_TOPDIR" which ought to defined as /usr/local/omniORB.
## In your .bash_profile you should place the following lines:
## 
## 	OMNIORB_TOPDIR=/usr/local/omniORB
## 	LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OMNIORB_TOPDIR/lib
## 	PATH=$PATH:$OMNIORB_TOPDIR/bin
## 
xxx> cd /usr/local
local> mkdir omniORB-4.0.3
local> ln -s omniORB-4.0.3 omniORB
local> cd src
src> tar -zxf omniORB-4.0.3.tar.gz
src> cd omniORB-4.0.3
omniORB-4.0.3> mkdir build
omniORB-4.0.3> cd build
build> ../configure --prefix=/usr/local/omniORB-4.0.3
build> make
build> make install
##
##
## qt-x11-free-3.3.1:
##
## qt ends up being installed in a manner similar to omniORB with the
## following environment variables:
##
##	QTDIR=/usr/local/qt
##	CPLUS_INCLUDE_PATH=$QTDIR/include
##	LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$QTDIR/lib
##	MANPATH=$MANPATH:$QTDIR/doc/man
##	PATH=$PATH:$QTDIR/bin
##
## The exact process of installing it is a bit different (mainly you
## don't use the --prefix argument to the ./configure script and the
## package just gets stuck in the directory into which it naturally gets
## untarred).
##
xxx> cp /usr/local/src/qt-x11-free-3.3.1.tar.bz2 /usr/local
xxx> cd /usr/local
local> bunzip2 qt-x11-free-3.3.1.tar.bz2
local> tar -xf qt-x11-free-3.3.1.tar
local> rm qt-x11-free-3.3.1.tar
local> ln -s qt-x11-free-3.3.1 qt
local> cd qt
qt> ./configure
##
## The installation script will ask whether you accept the terms of the
## license, enter "yes":
##
% Do you accept the terms of either license? yes
##
## WHEREUPON IT PROCEEDS TO CONFIGURE THE MAKEFILE
##
qt> make
qt> make install
qt> make clean
##
## Thats it!  Unless you need qwt, or tinyxml you should be good to go.
##
## /usr/local now looks something like this:
XEphem -> XEphem_3.6.1
ZThread -> ZThread-2.2.10
bin
etc
games
include
info
lib
libexec
man
mysql-test
omniORB -> omniORB-4.0.3
qt -> qt-x11-free-3.3.1
sbin
share
sql-bench
src
veritas

##
## Most of the bin, lib and include files are in the respective
## directories.  However, both omniORB and qt require you to set up
## your environment something like this:
##

#CORBA
OMNIORB_TOPDIR=/usr/local/omniORB
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OMNIORB_TOPDIR/lib
PATH=$PATH:$OMNIORB_TOPDIR/bin

# Qt related
QTDIR=/usr/local/qt
CPLUS_INCLUDE_PATH=$QTDIR/include
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$QTDIR/lib
MANPATH=$MANPATH:$QTDIR/doc/man
PATH=$PATH:$QTDIR/bin

##
## A Makefile which includes ZThreads, omniORB and qt then might be
## set up something like:
##

#zthread 2.2.10
ZTHREADDIR=/usr/local/ZThread
ZTHREADLIB = -L$(ZTHREADDIR)/lib
ZTHREADINC = -I$(ZTHREADDIR)/include

#qt v3.1
#QTDIR = /usr/lib/qt
#QTLIB = -L$(QTDIR)/lib  -lqt-mt
#QTINC = -I$(QTDIR)/include

#qt v3.3.1
QTDIR = /usr/local/qt
QTLIB = -L$(QTDIR)/lib
QTINC = -I$(QTDIR)/include

#omniORB 4.0.3
OMNIDIR=/usr/local/omniORB
OMNILIB = -L$(OMNIDIR)/lib
OMNIINC = -I$(OMNIDIR)/include
IDL=$(OMNIDIR)/bin/omniidl
OMNIDEFS = -D__OMNIORB4__ -D__x86__ -D_linux__ -D__OSVERSION__=2 -D_REENTRANT

#
#GENERAL
#
LDFLAGS = -L/usr/local/lib $(ZTHREADLIB) -lZThread $(QTLIB) -lqt \
        $(OMNILIB) -lomniORB4 -lomnithread