1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
#!/bin/bash
#
# PICALib installation tool
# $Id: install,v 1.1 2002/06/22 18:33:31 cvs Exp $
# Read version
. VERSION
# Installation directories
if [ -z $LIBDIR ]; then
LIBDIR=/opt/picalib/lib
fi
if [ -z $CONFDIR ]; then
CONFDIR=/opt/picalib
fi
echo "Installing PICALib in:"
echo " LIBDIR : $LIBDIR"
echo " CONFDIR : $CONFDIR"
modules=`find -type d -maxdepth 1`
for module in $modules; do
if [ -f $module/MODINFO ]; then
. $module/MODINFO
echo "Installing Module: $MODULE"
# Create target directories
mkdir -p $LIBDIR/$MODULE
mkdir -p $CONFDIR/$MODULE
# Install LIBFILES
for file in $LIBFILES; do
cp -a $module/$file $LIBDIR/$MODULE/$file
done
# Install CONFFILES
for file in $CONFFILES; do
if [ -f $CONFDIR/$MODULE/$file ]; then
if ! cmp -s $module/$file $CONFDIR/$MODULE/$file; then
echo " Installing as $CONFDIR/$MODULE/$file.new"
cp -a $module/$file $CONFDIR/$MODULE/$file.new
fi
else
cp -a $module/$file $CONFDIR/$MODULE/$file
fi
done
fi
done
|