
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

                                 -- 

This HOWTO concentrates on RedHat 5.2 because this particular
distribution 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.

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 and TeX. 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 February 17, 1999 
GNUstep snapshots.

I really appreciate the feedback I have gotten (from folks 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

Author: Steven Borrelli <steve@borrelli.org>

$Id: GNUstep-HOWTO-RH.txt,v 1.1.2.1 1999/02/23 05:20:38 fedor Exp $


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 and tetex packages are
     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.0.3a-14.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  )

                               ----------

The other gotcha you will come across is when GNUstep tries to create
project documentation. Make sure you have the TeX packages
installed. Again, these packages come on the RedHat 5.2 CD.

Type in
          rpm -qa | grep tex

Among other entries, you should get the following.

...
tetex-0.9-6
tetex-afm-0.9-6
tetex-dvilj-0.9-6
tetex-dvips-0.9-6
tetex-latex-0.9-6
tetex-xdvi-0.9-6
...

If you don't have these packages installed, you can install them with
the command rpm -Uvh <name of rpm file>

That's all the preparation you have to do. We are ready to become
GNUsteppers!

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

Step 2: Let's get 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, blah blah....>

          ftp> cd  /gnu/gnustep/snap

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

	       gstep-core-99xxxx.tar.gz 

With the xxxx being the date of the latest snapshot. 

As of Q1 1999, gstep-core is about 3 megabytes in size and 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-99xxxx.tar.gz file is in the directory where
you want to place your GNUstep source tree and extract it:

         tar zxvf gstep-core-99xxxx.tar.gz 

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

         mv gstep-99xxxx/ 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 xraw 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-xraw

(We use xraw because it is easier to set up than DGS and is currently
supported better under GNUstep.)

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 it's thing. On my Pentium 90 with Kernel
2.2.0 it takes about an hour to compile. I've heard reports that it takes
only a few minutes on faster systems.

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.


#-------- 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 gnustep source directory. Now 
        
         cd to the xraw/Testing directory and type 

	 make

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

In recent snapshots, the Testing directory did 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
InterfaceModeller.app  nsbox.app              scrollview.app
Workspace.app          nsbrowser.app          scrollview2.app
alertpanel.app         nsbrowsercell.app      slider.app
buttons.app            nscursor.app           windows.app
matrix.app             nsimage.app


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

          openapp slider.app

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

Congratulations, you're done! The .m files in the Testing directory
are an excellent introduction to the objective-c code used in GNUstep
development.


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

+++++++++++++++++++++++++++++++
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      (thanks to Robert J. Slover!)
++++++++++++++++++++++++++++++++++

(If you've gotten this far, you are probably looking for a challenge. This
section is still under development, so any feedback is welcome. )

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 (heh) 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. 

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

This HOWTO is my first contribution to the OpenSource community, and I hope
it has helped you out. 

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

Michael Giddings
Peter Rasmussen  
Steve Romero                                 
Robert J. Slover  
Andrew White


Enjoy GNUstep! 
_steve




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

-- End of GNUstep-RedHat HOWTO --






















