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