43 lines
1.3 KiB
Bash
43 lines
1.3 KiB
Bash
#!/bin/sh
|
|
|
|
###
|
|
### Copyright 2000-2005 University of Illinois Board of Trustees
|
|
### All rights reserved.
|
|
###
|
|
### pkg-install - Install script to use with FreeBSD packages
|
|
###
|
|
### Campus Information Technologies and Educational Services
|
|
### University of Illinois at Urbana-Champaign
|
|
###
|
|
|
|
PKG_PREFIX=${PKG_PREFIX:-/usr/local}
|
|
|
|
if [ $# -ne 2 ]; then
|
|
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
|
|
exit 1
|
|
fi
|
|
|
|
case $2 in
|
|
POST-INSTALL)
|
|
if [ ! -r ${PKG_PREFIX}/etc/psg.conf ]; then
|
|
echo "installing ${PKG_PREFIX}/etc/psg.conf";
|
|
cp ${PKG_PREFIX}/etc/psg.conf.sample ${PKG_PREFIX}/etc/psg.conf;
|
|
fi
|
|
|
|
if [ -f ${PORTSDIR}/Makefile ]; then
|
|
echo "configuring ${PKG_PREFIX}/etc/psgconf_modules to use ports collection";
|
|
sed -e 's/FreeBSD::Packages$/FreeBSD::Ports/' < ${PKG_PREFIX}/etc/psgconf_modules.sample > ${PKG_PREFIX}/etc/psgconf_modules.sample.new
|
|
if [ $? -eq 0 ]; then
|
|
mv ${PKG_PREFIX}/etc/psgconf_modules.sample.new ${PKG_PREFIX}/etc/psgconf_modules.sample
|
|
else
|
|
rm -f ${PKG_PREFIX}/etc/psgconf_modules.sample.new
|
|
fi
|
|
fi
|
|
if [ ! -r ${PKG_PREFIX}/etc/psgconf_modules ]; then
|
|
echo "installing ${PKG_PREFIX}/etc/psgconf_modules";
|
|
cp ${PKG_PREFIX}/etc/psgconf_modules.sample ${PKG_PREFIX}/etc/psgconf_modules
|
|
fi
|
|
;;
|
|
esac
|
|
|
|
exit 0
|