postinstall revision c81d47afd05baeb768e2f032636019b717899efd
106N/A#
106N/A# CDDL HEADER START
106N/A#
106N/A# The contents of this file are subject to the terms of the
106N/A# Common Development and Distribution License (the "License").
106N/A# You may not use this file except in compliance with the License.
106N/A#
106N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
106N/A# or http://www.opensolaris.org/os/licensing.
106N/A# See the License for the specific language governing permissions
106N/A# and limitations under the License.
106N/A#
106N/A# When distributing Covered Code, include this CDDL HEADER in each
106N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
106N/A# If applicable, add the following below this CDDL HEADER, with the
106N/A# fields enclosed by brackets "[]" replaced with your own identifying
106N/A# information: Portions Copyright [yyyy] [name of copyright owner]
106N/A#
106N/A# CDDL HEADER END
106N/A#
106N/A#
106N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
106N/A# Use is subject to license terms.
106N/A#
106N/A#ident "%Z%%M% %I% %E% SMI"
106N/A#
106N/A
106N/A#
106N/A# If appropriate, enable this service.
618N/A#
106N/ABASEPREFIX=`echo $BASEDIR | sed "s/\//_/g"`
106N/ALPFILENAME=`echo sunwpsr_lpsched"$BASEPREFIX" | cut -c 1-256`
106N/ALPTMPFILE=/tmp/$LPFILENAME
106N/Aif [ -f $LPTMPFILE ]; then
106N/A echo "/usr/sbin/svcadm enable application/print/server" >> \
106N/A $BASEDIR/var/svc/profile/upgrade
106N/A rm $LPTMPFILE
106N/Afi
106N/A
106N/APPDFILENAME=`echo sunwpsr_ppd_cache_update"$BASEPREFIX" | cut -c 1-256`
106N/APPDTMPFILE=/tmp/$PPDFILENAME
106N/Aif [ -f $PPDTMPFILE ] ; then
106N/A
181N/A # Enable the ppd-cache-update service.
106N/A echo "/usr/sbin/svcadm enable application/print/ppd-cache-update" >> \
106N/A $BASEDIR/var/svc/profile/upgrade
247N/A
247N/A # Ensure pre-existing printer configuration files with an
247N/A # old system PPD file delivery location are updated to
247N/A # reflect the newest location of PPD files.
247N/A NEW_PATH=/usr/share/ppd
247N/A if [ -d $NEW_PATH ] ; then
247N/A OLD_PATH=/usr/lib/lp/model/ppd/system
106N/A PNTRS=$BASEDIR/etc/lp/printers
106N/A for f in `/bin/find $PNTRS -name configuration 2>/dev/null` ; do
106N/A /bin/grep ${OLD_PATH} ${f} >/dev/null 2>&1
106N/A 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