Subversion Repositories wimsdev

Rev

Rev 4460 | Rev 4494 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#! /bin/sh

if [ "$(id -ru)" = 0 ]; then
 cat <<@
You are trying to compile WIMS as 'root'. You should not do that !
Please compile as 'wims'.
@
 exit 1
fi

option=$1

##########################################################################
cat <<@
Welcome to the compilation of WIMS (WWW Interactive Multipurpose Server)

@
if [ ! "$option" ] ; then option=no ; fi ;
if [ "$option" = "--build-chroot" ] ; then
  echo "compile with option $option"
fi

cd `dirname $0`

if [ "$option" = "--build-chroot" ] ; then
  if [ -d chroot ] ; then  
    mkdir -p chroot/tmp
    mkdir -p chroot/tmp/sessions
    touch chroot/tmp/sessions/.chroot
  else
   cat <<@
   You must first get and install the chroot directory. See the README

@
   exit 1
  fi 
fi

cd src

# how do we suppress \n from 'echo' output ?
if (echo "hi\c"; echo " ") | grep c >/dev/null 2>&1 ; then
  n=-n; c=
else
  n=; c='\c'
fi

if [ -f ../.wims_maintainer_mode ]; then
  if (autoconf); then :; else
    echo "[maintainer mode] Please install autoconf first."
    exit 1
  fi
  autoheader
fi
./configure || exit
make clean || exit
make all || exit

if [ -f ../.wims_maintainer_mode ]; then
### use convert, identify
  make maintainer || exit
### all the maintainers should have Apache ant - java compilation
  if (ant -h); then :; else
    echo "[maintainer mode] Please install Apache ant first."
    exit 1
  fi
  if (convert) || (identify); then :; else
    echo "[maintainer mode] Please install convert and identify first."
    exit 1
  fi
  cd Misc ; make maintainer || exit
  cd ..
fi
cd ..

if [ -f log/wims.conf ]; then :; else
  echo "You can configure some parameters which allow the manager site"
  echo "to make more configuration from the web interface."
  echo ""
  echo "Please write the IP address of the wims webmaster (default 127.0.0.1):" $c
  read ans1
  if [ -z $ans1 ]; then :; else
    echo "manager_site=$ans1" >> log/wims.conf
    chmod 600 log/wims.conf
  fi
  echo $n "Please write the email address of the wims webmaster:" $c
  read ans2
  if [ -z $ans2 ]; then :; else  
    echo "site_manager=$ans2" >> log/wims.conf
    chmod 600 log/wims.conf
  fi
fi
if [ -f log/.wimspass ]; then :; else
  echo "Please give the password for the wims webmaster"
  echo "You can change it in the file log/.wimspass"
  echo $n "Webmaster password: " $c
  read ans3
  if [ -z $ans3 ]; then :; else
    echo "$ans3" > log/.wimspass
    chmod 600 log/.wimspass
  fi
fi
if [ $option = "--build-chroot" ] ; then
  script=wrapuid ;
else
 script=setwrapexec ;
fi
cat <<@

Please run './bin/$script' and and './bin/apache-config' as root (e.g. using sudo) 
to finish WIMS setup.

See README about installation of help and teaching modules.

@

exit

Generated by GNU Enscript 1.6.5.90.