#!/bin/sh # $OpenBSD: INSTALL,v 1.1 2001/01/18 16:41:28 naddy Exp $ # # Pre/post-installation setup of xmcd # exit on errors, use a sane path and install prefix # set -e PATH=/bin:/usr/bin:/sbin:/usr/sbin PREFIX=${PKG_PREFIX:-/usr/local} CONFIG_DIR=${SYSCONFDIR}/xmcd DB_DIR=/var/db/xmcd SAMPLE_DIR=$PREFIX/share/examples/xmcd # Function: tell the user what they need to do to use the port just installed # do_notice() { echo echo "+---------------" echo "| The existing $1 configuration and database files in" echo "| ${CONFIG_DIR} and ${DB_DIR} have NOT been changed." echo "| You may want to compare them to the current sample files" echo "| in ${SAMPLE_DIR} and update your" echo "| configuration as needed." echo "+---------------" echo } # Function: install configuration files # do_install() { cd $SAMPLE_DIR install -d -m 755 -o root -g wheel ${CONFIG_DIR} for i in common.cfg device.cfg sites; do install -m 644 -o root -g wheel $i ${CONFIG_DIR} done install -d -m 755 -o root -g bin ${DB_DIR}/discog for i in bkgnd.gif discog.html xmcdlogo.gif; do install -m 644 -o root -g bin $i ${DB_DIR}/discog done echo echo "+---------------" echo "| The $1 configuration and database files in" echo "| ${CONFIG_DIR} and ${DB_DIR} have been installed." echo "| Please view these files and change the configuration" echo "| to meet your needs." echo "|" echo "| Before using xmcd/cda for the first time, you must" echo "| set up the software by running the following program:" echo "|" echo "| $PREFIX/sbin/xmcdconfig" echo "|" echo "| Xmcd/cda will not work until that is done." echo "|" echo "| You may also want to set up cron(8) to run the" echo "| $PREFIX/share/xmcd/scripts/genidx script periodically" echo "| (e.g., nightly) to re-generate the local discography" echo "| category index pages." echo "+---------------" echo } # Verify proper execution # if [ $# -ne 2 ]; then echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 exit 1 fi # Verify/process the command # case $2 in PRE-INSTALL) : nothing to pre-install for this port ;; POST-INSTALL) if [ -e ${CONFIG_DIR} -o -e ${DB_DIR} ]; then do_notice "$1" else do_install "$1" fi ;; *) echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 exit 1 ;; esac exit 0