
Welcome to the GNUstep-RedHat HOWTO.

My goal is to increase the number of people running (and developing)
GNUstep by making the compilation as easy as possible for users of
RedHat 5.2. 

I do not claim that this is the "correct" way of installing GNUstep
and ask you to please refer to the real GNUstep HOWTO at:
           ftp://alpha.gnu.org/gnu/gnustep/GNUstep-HOWTO

The main GNUstep pages are located at http://www.gnustep.org.

The most up-to-date version of this document can be found at
           http://borrelli.org/gnustep-RH.txt


-------------------------------------------------------------------------
Author: Steven Borrelli <steve@borrelli.org>
Copyright (C) 1999 - Free Software Foundation, Inc.

Version Control Information:
$Id: GNUstep-HOWTO-RH.txt,v 1.4.2.1 1999/08/26 14:36:29 fedor Exp $
-------------------------------------------------------------------------

========================================================================
CHANGES IN THIS VERSION:

1. Removed installation of tetex packages as they are no longer required.
2. Changed  'Testing' directory 
3. Other minor changes
=======================================================================

Introduction:                                 

This HOWTO concentrates on installing GNUstep on RedHat 5.2, a popular
operating system based around the Linux kernel. RedHat 5.2 comes with
all the tools you need to build GNUstep so you don't have to spend
your time downloading and compiling tools and libraries. I also
welcome RedHat 6.0 users to try out the HOWTO and give me feedback so
I can improve this document.

Roughly speaking, the tasks you need to complete are as follows:

* Installing a handful of RPMS from your RedHat 5.2 CD
* Downloading one file
* Cutting and pasting configure parameters
* Compiling, Installing
* Cutting and pasting environment variables 


If you read through this once before starting, I think you will see
that installing GNUstep can be quite simple and painless. Of course, 
since GNUstep is still in heavy development, chances are that things
can break at any time. 

When I first created this guide, I installed a fresh copy of RedHat
5.2 onto a blank partition, making sure to install all the development
tools. I then went through the steps outlined here and successfully
compiled the CVS snapshot from January 1999.

I checked this version of the HOWTO against the August 15, 1999 
GNUstep snapshots. 

I really appreciate the feedback I have gotten (from all over
the world!) and wish to thank everyone for their suggestions and
bugfixes.

Please drop me a line if you have any problems or wish to make
comments. Good luck!

_steve

steve@borrelli.org         http://borrelli.org

Start of GNUstep-RedHat HOWTO...

======================================================================
Phase I: Download and Compile GNUstep

Step 1: Preparation for GNUstep ( 10 minutes ) 

[Summary for advanced users: make sure egcs-objc package is installed]

We need to lay a little groundwork. For most RedHat users, this should
be a straightforward process.

RPM issues:

The good news here is that every tool and library you need to compile GNUstep
already comes on your RedHat 5.2 CD. All you have to do is make sure
all the tools are installed. (I am going to assume you have installed
the basic gnu and X development tools.)

The main gotcha with GNUstep is that we are going to use egcs instead of
gcc to compile it. 

Let's make sure you have the objective-c libraries for egcs by querying your
machine's RPM database:

          rpm -q egcs-objc

If it tells you the package is not installed, get the package off the CD-ROM
and install it with:

          rpm -Uvh egcs-objc-1.xxx.i386.rpm

If you get dependency errors, you are going to have to install the packages
it says are missing. This can be a pain, as you might run into a chain of
dependencies.

(If you find yourself struggling with RPM dependencies, Michael
Giddings has suggested using the "rpmfind" tool. rpmfind is available at:

       http://rpmfind.net/linux/rpm2html/rpmfind.html  )

That's all the preparation you have to do. We are ready to download the
source code.

----------------------------------------------------------------------

Step 2: Getting GNUstep (time 5 minutes + download time for 3 megabytes)

[Summary for advanced users: get gstep-core snapshot from 
   ftp://alpha.gnu.org/gnu/gnustep/snap  ]

Snapshots of the GNUstep source code tree are released on a regular
basis. You can find the most recent snapshot at:
          
         ftp://alpha.gnu.org/gnu/gnustep/snap

Make sure you are in a directory where you can download files...

          [steve@chaos src]$ ftp alpha.gnu.org
          Connected to melange.gnu.org.

          <login as ftp, use your email address as password....>

          ftp> cd  /gnu/gnustep/snap

You should see about ten files.  We only want to download: 

	       gstep-core-xxxxxx.tar.gz 

With the xxxx being the date of the latest snapshot or the major
version number of GNUstep.

As of July 1999, gstep-core is about 2.7 megabytes in size.  Make sure
you are in binary mode (type bin at the ftp prompt) and download gstep-core. 

Step 2 is Done! 

----------------------------------------------------------------------

Step 3: Compile GNUstep (5 minutes your time, lots of computer time)

[Summary for advanced users: 
         parameters to pass to 'configure'  described below]

Make sure the gstep-core-xxxxxx.tar.gz file is in the directory where
you want to place your GNUstep source tree and extract it:

         tar zxvf gstep-core-xxxxxx.tar.gz 

I like to rename the directory that is created to just plain ol' "gnustep".

         mv gstep-xxxxxx/ gnustep/

Let's cd into the gnustep directory and run the configure script.
         
         cd gnustep

                           *** IMPORTANT  ***
Make sure you run configure as follows. This is will set gnustep to use egcs
as a compiler, install in /usr/local/GNUstep, and use the xgps gui library.

If you want, cut and paste this right into your shell prompt. Make sure it 
executes as a one-line command.

   CC='egcs' ./configure --prefix=/usr/local/GNUstep \
                         --with-library-combo=gnu-gnu-gnu-xgps

[Note: In previous versions of the HOWTO, we used the now-obsolete
xraw GUI library.]

Now, hopefully nothing has exploded on us and the ./configure script has
completed happily. 

You are now at the moment of truth. Remember that GNUstep is still a work in
progress, so it may not compile cleanly. Type 

          make

and let the compiler do its thing. On my Pentium 90 (80 mb ram) with Kernel
2.2.3 it takes about an hour to compile the GNUstep snapshot.

The only step left is installing GNUstep onto your system. As root just
type 
 
         make install

   and you are done with your basic GNUstep installation. 

======================================================================

Part II: Playing with GNUstep

1. Setting up your GNUstep environment (3 minutes)

You need to set up your shell environment in order for GNUstep applications
to work correctly. I've added the following lines to the end of the
.bash_profile file in my home directory (again, I am assuming you installed
GNUstep in /usr/local/GNUstep). By adding these lines, your environment will
automatically be set correctly the next time you log in. Note that this will
slightly slow down your login process.


#-------- 8< cut here  8< ------------

# Set up the GNUstep environment 
GNUSTEP_SYSTEM_ROOT=/usr/local/GNUstep
export GNUSTEP_SYSTEM_ROOT
. $GNUSTEP_SYSTEM_ROOT/Makefiles/GNUstep.sh 

#-------- 8< cut here  8< -----------


If you don't feel like logging out and logging back in, you can have
the change take place immediately by typing: 
          
          . ~/.bash_profile

from a shell prompt. 


2. Compiling the sample programs (1 minute + compile time)

The first thing we should so is play around with some sample apps. By
looking at the code, you can quickly learn how to program with GNUstep.

         cd to the 'Testing' directory off the main source tree

	 make

If you get an error that a makefile wasn't found, go back to the previous
section on setting up your environment see what you did wrong. :)

Sometimees, the Testing directory will not compile cleanly. If this
happens to you, your best bet is to update via CVS or wait for the
next snapshot.


3. Playing with GNUstep programs

Assuming your GNUstep environment is correct and you were able to build
the Test programs correctly, you are ready to play with GNUstep. First, check
to see what applications were built (remember we are in gnustep/xraw/Testing).

[steve@chaos Testing]$ ls -d *.app
Edit.app              menu.app              nsscroller.app
GNUstepInstaller.app  nsbox.app             nstabview.app
alertpanel.app        nsbrowser.app         popupbuttons.app
buttons.app           nsbrowsercell.app     scrollview.app
fontpanel.app         nscursor.app          scrollview2.app
gstextnetwork.app     nsimage.app           slider.app
matrix.app            nsimagecell.app       windows.app

To run a GNUstep application, use the 'openapp' command, for example:

          openapp fontpanel.app

[Note: some Testing applications are still a little buggy as of this
writing and tend to crash and misbehave.]

----------------------------------------------------------------------
Read this section only if you have gdomap errors when you try to run
a Testing app.

If you get a gdomap error like the following:

>Mar 11 21:04:57 Edit[654] Failed to find gdomap port with name 'gdomap',
>perhaps your /etc/services file is not correctly set up?
>Retrying with default (IANA allocated) port number 538

It means gdomap is not starting. Usually, a GNUstep application will
complain and try to start gdomap if it can't already find one running.
However, if your /etc/hosts file is not correctly set up, gdomap
cannot be started.

For this particular error, it seems that localhost needs to be
associated with the loopback (127.0.0.1) address. Make sure this
information is correctly set up in your /etc/hosts file.

You can also start gdomap automatically through SysV init. There is a
SysV init script located within the gnustep-core.spec file in the main
gnustep directory.

----------------------------------------------------------------------


----------------------------------------------------------------------

+++++++++++++++++++++++++++++++
Appendix I:
       Keeping up to date.
++++++++++++++++++++++++++++++++

Since point releases are released rather infrequently, you have two
choices if you want to keep up to date with GNUstep development.  You
can download the weekly snapshots as we have done above, or you can
update your local source tree at any time via CVS. 

I have found that the quickest way to update via cvs is to
issue a 
         cvs -z3 update -Pd 

from the toplevel "gnustep" source directory. If you are prompted for a 
login, use 'anoncvs' as a password.

There is a more detailed CVS tutorial in the GNUstep HOWTO
(ftp://alpha.gnu.org/gnu/gnustep/GNUstep-HOWTO) by Michael Hanni.

++++++++++++++++++++++++++++++++++
Appendix 2: 
      Setting the Local time      
++++++++++++++++++++++++++++++++++

When the time zone is not set in GNUstep, you will get the following error:

Feb 19 00:57:08 nscursor[27916] No local time zone specified.
Feb 19 00:57:08 nscursor[27916] Using time zone with absolute offset 0.


First, we need to determine the time zone that we have set for the system:

         ls -al /etc/localtime

Since I am in Missouri, I have set:

lrwxrwxrwx   1 root     root           32 Jun 27  1998 /etc/localtime -> ../usr/share/zoneinfo/US/Central

The NeXT step (ahem) is to use the defaults program to set the NSTimeZone. To
see what Time Zones are available:

 cd $GNUSTEP_SYSTEM_ROOT/Libraries/Resources/gnustep/NSTimeZones/zones

and poke around.  
          
Once you have a Time Zone picked, run the command ("Central" is my time 
zone and it is located in the "US" directory):

          defaults write NSGlobalDomain "Local Time Zone" "US/Central"

If upon running the defaults program you get an error like:

libgnustep-base.so.0: cannot open shared object file: No such file or directory

It means you haven't set up your environment correctly. You should
run your .bash_profile script again. 

There is more detailed timezone information in the GNUstep HOWTO
(ftp://alpha.gnu.org/gnu/gnustep/GNUstep-HOWTO) by Michael Hanni.

++++++++++++++++++++++++++++++++++
Appendix 3: 
      Credits
++++++++++++++++++++++++++++++++++

This HOWTO was my first contribution to the Free Software community-
I hope it has helped you get started with the GNUstep environment.

I'd like to thank the following people for their help and comments:

Bruce Bennett
Adam Fedor
Michael Giddings
Peter Rasmussen  
Steve Romero                                 
Robert J. Slover  
Andrew White

And finally, I would like to thank my wife for being so understanding
of my Linux addiction.

Enjoy GNUstep! 

_steve


----------------------------------------------------------------------

-- End of GNUstep-RedHat HOWTO --






















