##################################################
#
#  Net-Fu (version 0.9):
#   A WWW graphic-art generation system
#
#  Copyright 1997 by:
#   Spencer Kimball       (spencer@xcf.berkeley.edu)
#   Peter Mattis          (petm@xcf.berkeley.edu)
#   Yaroslav Faybishenko  (yaroslav@xcf.berkeley.edu)
#
##################################################


This document contains preliminary directions for installing net-fu.


***  IMPORTANT--READ FIRST  ***

Review the following checklist of installation prerequisites and make
sure all items apply to you before proceeding:

1) Have gimp version 0.99.14 & gtk+970925 source trees

2) Have access to a WWW server capable of serving simple html pages
    containing java applets as well as run cgi-bin programs

3) Have appropriate permissions to install cgi-bin programs.

4) Have a C compiler and the Java Developer's Kit (JDK)

5) Have freefont and sharefont packages installed

6) It is not required, but it is recommended that you be able to create
    a separate account through which all net-fu operations are handled



***  Installing  ***

Assuming you meet the criteria listed above, you can begin the
installation process.  Remember, this release is officially a BETA
release, and should be treated as such.  We appreciate input that is
intended to improve the state of the software, but discourage whining
and demands for fixes.

This is a very, very rough guide to the installation process, and will
be updated as this software evolves.  All improvements are welcome.

*) Consider creating a new net-fu account to host the net-fu server
    so that a special gimprc file can be created

1) In order to prevent interactive debugging messages when GIMP
    experiences a segmentation fault, this step replaces the
    standard glib g_debug function with one which checks for the
    environment variable GLIB_NO_DEBUG before continuing.  Since
    interactive debugging will cause problems for gimp in batch
    mode, it is necessary to define the GLIB_NO_DEBUG variable in
    the supplied net-fu server-start script.

   To effect this change, copy the supplied gerror.c file to the
    your gtk distribution source tree and remake from the toplevel
    gtk directory

    cp <unpack_dir>/net-fu/gerror.c <gtk_dist>/glib
    cd <gtk_dist>
    make
    make install (as root)

   If you compiled GIMP with dynamic libraries turned on, nothing else
    needs to be done.  Otherwise, change to the gimp source directory
    and remake.

2) To fix a problem with the emboss plug-ins (as distributed with
    0.99.14) copy emboss.c to the <gimp_dist>/plug-ins directory,
    remake the emboss plug-in, and re-install.

    cp <unpack_dir>/net-fu/emboss.c <gimp_dist_dir>/plug-ins
    cd <gimp_dist_dir>/plug-ins
    make
    make install (as root)

3) Unzip and untar the net-fu distribution

4) Change directory to net-fu/cgi-bin

5) Modify proxy.c to reflect the gimp script-fu server and port #.
    These values are set by #defines at the top of proxy.c.
    The script-fu server hostname should be the hostname of the host which
    will run the gimp & script-fu processes.  There is one restriction
    on this host: it must share a disk drive with the http server that
    net-fu will run on.  This can either be a local drive (if the http
    and gimp servers are on the same machine or share a disk farm), or
    a shared NFS drive.  The port number is completely arbitrary, and
    must be chosen only so there is no conflict with existing applications
    and so that the script-fu process and the proxy.cgi process use the
    same number.

6) Run "make"

7) As super-user, install proxy.cgi in the appropriate system cgi-bin
    directory on the http server.  Make sure the permissions are set to 755.

    chmod 755 <cgi_bin_dir>/proxy.cgi

8) Change directory to <unpack_dir>/net-fu/html/netfu

9) In order to successfully compile the net-fu java applet, you must set
    your classpath environment variable to reflect the location of net-fu
    class packages.  In Bourne/Korn shell environments:

    CLASSPATH=$CLASSPATH:<unpack_dir>/net-fu/html
    export CLASSPATH

    In C shell environments:

    setenv CLASSPATH $CLASSPATH:<unpack_dir>/net-fu/html

10) Optionally edit the Makefile to set the location of the java compiler.

11) Edit the selectors/ArgumentsListSelector.java file to reflect the name
     of the host which will run the http server.  It is set to
     "scheme.xcf.berkeley.edu" by default.

12) Run "make"

13) On the http server, in the system html directory, make a symbolic
     link to the net-fu src tree.  This makes the net-fu html pages visible
     through your http server.

     cd <system_html_dir>
     ln -s <unpack_dir>/net-fu/html ./net-fu

14) A temporary directory must be designated to store newly created images.
     This temporary directory is specified in the gimprc file as
     (temp-path), and make a symbolic link to it from
     <unpack_dir>/net-fu/html called "tmp".  Keep in mind that this tmp
     directory must be visible from both the gimp server and the http server.

     cd <unpack_dir>/net-fu/html
     ln -s <tmp_dir> ./tmp

15) Run gimp to make sure a ~/.gimp directory is created with a gimprc file

16) Edit the following variables in the gimprc file:

     temp-path       ->  <tmp_dir>
     script-fu-path  ->  <unpack_dir>/net-fu/scripts

17) Edit the script <unpack_dir>/net-fu/server-start to reflect the
     following:

     PS_CMD        ->  ps command for the system
     FONT_PATH     ->  The path to freefont and sharefont fonts
     GIMP_PATH     ->  The absolute path to the gimp executable
     SFU_PATH      ->  The absolute path to the script-fu executable
     LOG_PATH      ->  The absolute path to the script-fu log file
     OLD_LOG_PATH  ->  The absolute path to a directory for old logs
     ERR_PATH      ->  The absolute path to a gimp error file
     SF_PORT       ->  The port used for the script-fu process

18) Install the contents of the included "crontab" file to the net-fu
     user's crontab with:

     crontab -e

    Make sure to replace <tmp_dir> with the directory you've already chosen
     for temporary files

19) Run <unpack_dir>/net-fu/server-start

20) From a WWW browser, attempt to connect to the httpd server and access
     the net-fu pages.

21) Test each available net-fu script option

22) Assuming all of the previous steps were completed, you're ready to roll.
