# -*-maplev-*-
#		 A Symbolic Circuit Analysis Package
#
#			       Joe Riel
#			  joer@k-online.com
#             joe.riel@incep.com
#            www,k-online.com/~joer
#
# This is the Maple installation script for the syrup package for
# Maple V R6.
#
#
# To install the package, modify the following three lines so that
# mtxdir is assigned the directory in which you have unpacked the
# source files (mtx extension), mwsdir is assigned the directory into
# which you have unpacked the help worksheets (mws extension), and
# maplib is assigned the directory of the Maple library into which you
# will install the packages.  NOTE: maplib must have the same form as
# the corresponding directory in your libname path.  That is, if the
# name of the directory in libname has double quotes or backslashes,
# then use the same in the assignment to maplib.  The form of mtxdir
# and mwsdir is not important.


mtxdir := "c:/maple/r6/mylib/syrup/source": # Directory of mtx files
mwsdir := "c:/maple/r6/mylib/syrup/help":   # Directory of mws files
maplib := "c:/maple/r6/mylib":              # Location of archive

install_pkg    := true:
install_help   := true:
update_browser := true:
show_help      := true:

# In order to successfully install this package, the path assigned to
# maplib must be in your libname path.  Also, you must have a Maple
# archive in the maplib directory.  The following instructions explain
# how to set that up, if you already know how, or have previously done so,
# skip to the section "Installing this package".
#
# These instructions are intended for those who have never installed
# Maple packages onto their systems. The process is straightforward
# and you shouldn't have to repeat these steps for installing other
# packages, unless you want to put them in separate archives. These
# instructions are specific for Windows NT users, but can be adapted
# for other operating systems.
#
# Creating a Maple archive
# ------------------------
#
# Use the Maple march command to create a Maple archive.  In the following
# Maple commands I assume that your base Maple directory is \maple\r6 but use
# whatever is appropriate for your setup.
#
# For more help on march, type ?march in a Maple worksheet.
#
# > mylib := "c:/maple/r6/mylib":
# > march(create,mylib,10):
#
# Modifying libname
# -----------------
# You now need to modify the initialized value of libname so that it point
# to your new archive when you start Maple. To do this, create or modify
# the maple.ini file.  This file belongs in the \maple\r6\bin.wnt directory.
# If you already have a maple.ini file there, edit it to include the
# following line,
#
# libname := libname, `c:/maple/r6/mylib`:
#
# That should work with the default Maple settings. To verify that this
# works, start Maple and type
#
# > libname;
#
#     c:/maplev5/update, c:/maple/r6/lib, c:/maple/r6/mylib
#
# If you don't see your mylib directory listed, then Maple is not reading
# the maple.ini file. It is possible that your setup may set the libname
# directory in the Maple startup file (maplev5.ini) or in its command line
# parameters which may prevent this from working.  If you cannot figure it
# out, send me some email.
#
# Installing this package
# -----------------------
# You can now install this package by executing this Maple script.
# Read it into a Maple worksheet using the following command
#
# > read `c:/maple/r6/mylib/syrup/package/install.txt`:
#
#
#---------------- You shouldn't need to read any further ------------------
#
# Install the package code and help pages.

proc()
global installhelp,installpkg;

# Check that the assigned value of maplib is in the libname path.

    if not member(maplib,[libname]) then
        ERROR(nprintf("The directory %A is not included in libname",maplib))
    fi;

# Read the mtx files

    printf("\nREADING"):
    printf("\n-------"):
    printf("\n...reading the load file"):
    read cat(mtxdir,"/load.mtx"):

# Load the installation code

    read cat(mtxdir,"/install.mtx"):

# Install the package

  if install_pkg then
        printf("\nINSTALLATION"):
        printf("\n------------"):
        installpkg(maplib);
        printf("\nFinished installing the procedures")
  fi;

# Install the help pages

  if install_help then
    installhelp(maplib);
    printf("\nHELP"):
    printf("\n----"):
    printf("\nIf your installation was successful, then you can get help"):
    printf("\nfor syrup at any time by typing ?syrup.\n"):

  fi;

# Update the browser

  if update_browser then
    updatebrowser(maplib)
  fi;

# Display the opening help page

  if show_help then

# Documentation

    printf("\nDOCUMENTATION"):
    printf("\n-------------"):
    printf("\nThe source and documentation for this package have been"):
    printf("\nintegrated into a single document by the use of mapledoc,"):
    printf("\na LaTeX macro package based on doc.\n"):

    printf("\nA dvi version of the typeset output is distributed"):
    printf("\nwith this package, see syrup.dvi.\n"):

# Salutation

    printf("\nGood luck.  Let me know if you have any problems or suggestions.\n"):
    printf("\nJoe Riel  joe.riel@incep.com"):

# Open main help page

    help(syrup)
  fi;

    NULL

end():

# quit
