These instructions are for installation GNUE on Mac OS X 10.4.2.  They
do not assume any knowledge of the core technologies (fink, python,
postgresql etc.)  You will install all GNU Enterprise tools and run a
sample form application.

Do not let the length or apparent complexity fool you.  Setting up GNUE
with Mac OS X is easy.

These instructions use appserver (which is not required), fink, bbedit,
and PostgreSQL database. The path you use for the postgresql database
should be different. You may use vi instead of bbedit to edit text
files.

For information about installing fink see http://fink.sourceforge.net/

These instructions assume you are using the command line terminal. 
Lines starting with "#" are comments.

Report any problems with these instructions to neilt<at>gnue.org.  These
notes tested with the following:

	%fink --version
	Package manager version: 0.24.10
	Distribution version: 0.8.0.rsync

	% sw_vers
	ProductName:    Mac OS X
	ProductVersion: 10.4.2
	BuildVersion:   8C46


# Install Prerequisites
# ===========================
fink install xorg
fink install xorg-dev
fink install wxgtk
fink install python24
fink install wxpython-py24 
fink install wxpython-py24-dev
fink install postgresql80-unified
fink install postgresql80-unified-dev
fink install pyxml-py24
fink install python-mx-py24

# Install GNUE
# ==================

# get ready to edit the .cshrc file

cd ~
bbedit .cshrc

# add the following to your ".cshrc" file. (assumes you are running c shell)
setenv DISPLAY localhost:0.0

# save the file and exit the editor

# close and reopen terminal

# start xDarwin.app (click on it)

# for the following you will need to download fink info files from the gnue
# site.  They are located in the folder <package name>/packaging/fink.
# psycopg-py24 is the folder for gnue-common.
# Download gnue-common example location:
#    http://svn.gnuenterprise.org/gnue/trunk/gnue-common/packaging/fink/

fink install psycopg-py24
fink install gnue-common
fink install gnue-appserver
fink install gnue-forms
fink install gnue-reports
fink install gnue-designer
fink install gnue-navigator

# Quick Configuration
# ===================
# initialize postgresql database
# any writable path will work here, but be sure to use the same path in the
# following commands for postgresql.

/sw/bin/initdb -D /Maui-Dev/gnue_mac_porting_notes/pg_data

# start postgresql

/sw/bin/pg_ctl -D /Maui-Dev/gnue_mac_porting_notes/pg_data -l /Maui-Dev/gnue_mac_porting_notes/pg_data/pg_logfile.txt start

createlang plpgsql template1

sudo cp /sw/etc/sample.connections.conf /sw/etc/connections.conf

# edit /sw/etc/connections.conf

bbedit /sw/etc/connections.conf

sudo cp /sw/etc/sample.gnue.conf /sw/etc/gnue.conf

# edit /sw/etc/gnue.conf

bbedit /sw/etc/gnue.conf

# setup appserver database

cd /sw/share/gnue/appserver
/sw/bin/gnue-setupdb --connection=gnue ./gnue.gsd

# Quick Run Example
# =================

cd /sw/share/doc/gnue-appserver/examples

gnue-readgcd --connection=gnue sample.gcd

# (expect to see the following)
# Loading gcd files ...
# Updating schema ...
# Updating class repository ...
#   Modules   :   1 inserted,   0 updated,   0 unchanged.
#   Classes   :   2 inserted,   0 updated,   0 unchanged.
#   Properties:  24 inserted,   0 updated,   0 unchanged.
#   Procedures:   6 inserted,   0 updated,   0 unchanged.
#   Parameters:   0 inserted,   0 updated,   0 unchanged.

gnue-readgld --connection=gnue sample-*.gld

# (expect to see the following)
# Loading GNUe language definitions
#   Labels  :  30 inserted,   0 updated,   0 unchanged.
#   Messages:   4 inserted,   0 updated,   0 unchanged.

gnue-schema --connection=gnue sample.gsd

# (expect to see the following)
# You are about to change the database 'gnue'. Continue [y,N]: y
# Updating schema ...
# Updating data ...
#   updating table 'address_country' ...
#     Rows: 240 inserted, 0 updated, 0 unchanged.
#   updating table 'address_person' ...
#     Rows: 4 inserted, 0 updated, 0 unchanged.

# start appserver

/sw/bin/gnue-appserver -Z -u ntiffin

# alternative start command if you need debug info
# /sw/bin/gnue-appserver -Z --debug-level 9 -u ntiffin

#try sample application

/sw/bin/gnue-forms -s sample.gfd

# you should see a form in xWindows
# done with basic installation and testing

For more information about using appserver please refer to the development
guide located at:

http://www.gnuenterprise.org/tools/appserver/docs/manual/devguide/index.html
