#!/bin/csh # $Id: newgmtguru,v 1.15 2008/01/30 20:12:27 guru Exp $ # # newgmtguru is run to initiate a new guru site # and helps setting up the guru directory with # macros suitable for this site. # # Author: P. Wessel # Date: 02-MAR-2001 # Updated: 03-JUN-2007 unalias cd set p = `pwd` set me = `whoami` cat << EOF ===>>> INITIATION OF $me AS NEW GMT GURU <<<=== Given your input, this script will create the directory GMTdev and make it the current working directory. We will then login to the GMT CVS server and, if successfull, checkout the latest GMT project directory. The GMT project directory is called (what else) GMT and is a subdirectory of your GMTdev directory. It is convenient to keep earlier versions like GMT3.4.5 as subdirectories of GMTdev. These dirs should be considered READ-ONLY. Only edit files in the GMT work directory. STEP 1: CREATE GMTdev DIRECTORY EOF echo -n "==> Enter directory in which to install GMTdev [$p]: " set dir = $< if ($dir == "") then set dir = $p endif echo "Making $dir/GMTdev" mkdir -p $dir/GMTdev if ($status) then echo "Could not make directory $dir/GMTdev - aborting" exit -1 endif cd $dir/GMTdev cat << EOF STEP 2: LOGIN to GMT CVS SERVER in HAWAII EOF echo -n "==> Enter your user name for GMT CVS server access [anonymous]: " set usr = $< if ($usr == "") then set usr = anonymous endif setenv CVSROOT :pserver:$usr@pohaku.soest.hawaii.edu:/usr/local/cvs cvs login if ($status) then echo "Please make sure your username and password are correct and try again" exit -1 endif cat << EOF STEP 3: GET CURRENT GMT PROJECT We are now ready to obtain the latest GMT project sources from the CVS server. This may take a while depending your network connection and net traffic. EOF echo -n "==> Hit return to initiate the transfer: " set answer = $< cvs checkout GMT cd GMT/guru cat << EOF STEP 4: SET GURU- AND SITE-SPECIFIC ENVIRONMENT You must edit the guru/guruenv.csh environment to work on `uname -n`. Follow instructions in the file. The modified file will be saved using the name you provide below. The contents of this file should be inserted into your .cshrc or .tcshrc file. Make sure you login out/in again or source the changes before doing GMT work. EOF echo -n "==> Enter name for environment variables [${me}_env.csh]: " set myenv = $< if ($myenv == "") then set myenv = ${me}_env.csh endif grep -v CVSROOT guruenv.csh >! $myenv echo "setenv CVSROOT :pserver:$usr@pohaku.soest.hawaii.edu:/usr/local/cvs" >> $myenv if ($?EDITOR) then $EDITOR $myenv else vi $myenv endif source $myenv cat << EOF STEP 5: SET GURU- AND SITE-SPECIFIC MAKE PARAMETERS You must edit the guru Makefile macros to work on `uname -n`. Follow instructions in the file. EOF echo -n "==> Hit return to start the editing: " set answer = $< cp -f gmtguru.macros.orig gmtguru.macros if ($?EDITOR) then $EDITOR gmtguru.macros else vi gmtguru.macros endif cd .. cat << EOF STEP 6: GET COASTLINE FILES VIA FTP The GMT coastline files are NOT under CVS control since they are themselves created from other files and this process is not yet ready to be set up in CVS. Answering y below will initiate an anonymous ftp to your nearest GMT mirror site and obtain all the coastline files and install them in GMT/share/coast. If you already have these files on your system you could manually copy them to GMT/share/coast and save some ftp time - answer n to do this later. EOF echo -n "==> Get the coastline files via ftp? (y/n) [y]: " set yn = $< if ($yn == "y" || $yn == "Y" || $yn == "") then make -f GNUmakefile get_coast endif cat << EOF STEP 7: LEARN HOW TO UPDATE THE CVS SERVER If you are a gmt-team member with write privileges, you need to learn how to commit your changes. This requires you to know CVS quite a bit. If your have CVS read access only, you send patches to gmt@soest.hawaii.edu. Some references for CVS are "Open Source Development with CVS" by Karl Vogel. Coriolis Open Press. All the relevant chapters of this book are available for free on-line from cvsbook.red-bean.com. The Cederquist - The main manual for CVS; online at www.cvshome.org/docs/manual You really need to look through one of these to get a feel for how the CVS system works. I won't grant write-access unless you know what you will be doing! STEP 8: REQUIRED 3RD PARTY TOOLS GMT guru script use several utilities to do their things, like converting man pages to html and generate gif files. You need to make sure you have: ghostscript (and utility scripts ps2epsi, ps2pdf) latex (and dvips) latex2html (+ the pbm/ppm tools) autoconf and m4 EOF