postinstall revision c81d47afd05baeb768e2f032636019b717899efd
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#ident "%Z%%M% %I% %E% SMI"
#
#
# If appropriate, enable this service.
#
BASEPREFIX=`echo $BASEDIR | sed "s/\//_/g"`
LPFILENAME=`echo sunwpsr_lpsched"$BASEPREFIX" | cut -c 1-256`
LPTMPFILE=/tmp/$LPFILENAME
if [ -f $LPTMPFILE ]; then
echo "/usr/sbin/svcadm enable application/print/server" >> \
$BASEDIR/var/svc/profile/upgrade
rm $LPTMPFILE
fi
PPDFILENAME=`echo sunwpsr_ppd_cache_update"$BASEPREFIX" | cut -c 1-256`
PPDTMPFILE=/tmp/$PPDFILENAME
if [ -f $PPDTMPFILE ] ; then
# Enable the ppd-cache-update service.
echo "/usr/sbin/svcadm enable application/print/ppd-cache-update" >> \
$BASEDIR/var/svc/profile/upgrade
# Ensure pre-existing printer configuration files with an
# old system PPD file delivery location are updated to
# reflect the newest location of PPD files.
NEW_PATH=/usr/share/ppd
if [ -d $NEW_PATH ] ; then
OLD_PATH=/usr/lib/lp/model/ppd/system
PNTRS=$BASEDIR/etc/lp/printers
for f in `/bin/find $PNTRS -name configuration 2>/dev/null` ; do
/bin/grep ${OLD_PATH} ${f} >/dev/null 2>&1
if [ $? -eq 0 ] ; then
/bin/sed \
-e "s;${OLD_PATH}/foomatic;${NEW_PATH}/SUNWfoomatic;g" \
-e "s;${OLD_PATH}/gimp;${NEW_PATH}/SUNWgimp;g" \
-e "s;${OLD_PATH}/hpijs;${NEW_PATH}/SUNWhpijs;g" \
${f} >/tmp/lp.$$
/bin/mv -f /tmp/lp.$$ ${f}
fi
done
rm $PPDTMPFILE
fi
fi
# This works around the problem of legacy cleanup service removal until
# r.manifest is fixed to work on alternate pkg root.
if [ "${PKG_INSTALL_ROOT:-/}" != "/" ] ; then
echo "/usr/sbin/svccfg delete -f svc:/application/print/cleanup" >> \
$BASEDIR/var/svc/profile/upgrade
fi
exit 0