#!/bin/sh # $NetBSD: install-openacs,v 1.1.1.1 2001/07/19 04:36:06 cjones Exp $ PATH=/bin:/usr/bin:@PREFIX@/bin # Script to copy the openacs tree, create db, and populate db. while [ `expr "$1" : -.*` -ne 0 ] ; do case "$1" in "-u") ACSUSER=$2 shift;shift ;; "-d") ACSDB=$2 shift;shift ;; *) echo "Usage: $0 -u dbuser -d dbname destpath" echo "dbuser is the postgres user, dbname is the database name." echo "destpath is the path to install OpenACS in." exit 1 ;; esac done DEST=$1 if [ -z "$DEST" ] ; then echo "No destination given!" exit 1 fi if [ -z "$ACSUSER" ] ; then echo "No dbuser given!" exit 1 fi if [ -z "$ACSDB" ] ; then echo "No dbname given!" exit 1 fi echo -n "copying the openacs tree to $DEST..." if [ ! -d $DEST ] ; then mkdir -p $DEST fi ( cd @PREFIX@/share/openacs ; tar cf - . ) | \ ( cd $DEST ; tar xf - ) if [ $? -ne 0 ] ; then exit 1 fi echo "done." NAME=`basename $DEST` mv $DEST/parameters/ad.tcl $DEST/parameters/$NAME.tcl rm $DEST/parameters/ad.ini echo "" echo "Creating $ACSDB owned by $ACSUSER:" PGUSER=$ACSUSER export PGUSER psql -q -c "create database $ACSDB" template1 || exit 1 echo "" echo "Loading geo tables:" for I in $DEST/www/install/acs_geo_parents.sql $DEST/www/install/*.ctl ; do psql -q -f $I $ACSDB || exit 1 done echo "" echo "Loading OpenACS schema:" cd $DEST/www/doc/sql psql -q -f load-data-model.sql $ACSDB || exit 1 echo "done." echo "" echo "Don't forget to take a look at $DEST/parameters/$NAME.tcl" echo "and @PREFIX@/etc/httpd/tcl_modules/nsd.tcl." echo "You'll at least want to check the database info in the latter file," echo "and the homedir variable in both files."