Home | History | Annotate | Download | only in pkgdef
      1 #
      2 # CDDL HEADER START
      3 #
      4 # The contents of this file are subject to the terms of the
      5 # Common Development and Distribution License (the "License").
      6 # You may not use this file except in compliance with the License.
      7 #
      8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9 # or http://www.opensolaris.org/os/licensing.
     10 # See the License for the specific language governing permissions
     11 # and limitations under the License.
     12 #
     13 # When distributing Covered Code, include this CDDL HEADER in each
     14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15 # If applicable, add the following below this CDDL HEADER, with the
     16 # fields enclosed by brackets "[]" replaced with your own identifying
     17 # information: Portions Copyright [yyyy] [name of copyright owner]
     18 #
     19 # CDDL HEADER END
     20 #
     21 
     22 #
     23 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
     24 # Use is subject to license terms.
     25 #
     26 # ident	"@(#)postinstall	1.2	07/01/30 SMI"
     27 #
     28 
     29 cd /usr/bin
     30 
     31 find . -type f -name ppriv | \
     32 while read f ; do
     33 	f=`echo $f | sed -e 's/^.\///'`
     34 	d=`echo $f | sed -e 's/ppriv$//' -e 's/\/$//'`
     35 	if [ "$d" ]; then
     36 		echo "$d"
     37 	fi
     38 	echo "$f"
     39 done | \
     40 while read p ; do
     41 	if [ -f "$p" ]; then
     42 		d=`echo $p | sed -e 's/ppriv$//' -e 's/\/$//'`
     43 		if [ ! -f $BASEDIR/lib${d:+/$d}/forcepriv ]; then
     44 			cp /usr/bin${d:+/$d}/ppriv \
     45 			    $BASEDIR/lib${d:+/$d}/forcepriv || exit 2
     46 		fi
     47 		if [ -z "$d" ]; then
     48 			echo $BASEDIR/lib${d:+/$d}/forcepriv f 06555 root root
     49 		else
     50 			echo $BASEDIR/lib${d:+/$d}/forcepriv f 00555 root root
     51 		fi
     52 	elif [ -d "$p" ]; then
     53 		if [ ! -d $BASEDIR/lib/$p ]; then
     54 			mkdir $BASEDIR/lib/$p || exit 2
     55 		fi
     56 		echo $BASEDIR/lib/$p d 0755 root root
     57 	fi
     58 done | installf $PKGINST - || exit 2
     59 
     60 installf -f $PKGINST || exit 2
     61 
     62