New install-sfw
  1 #!/bin/sh
  2 # 
  3 # CDDL HEADER START
  4 #
  5 # The contents of this file are subject to the terms of the
  6 # Common Development and Distribution License (the "License").
  7 # You may not use this file except in compliance with the License.
  8 #
  9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 10 # or http://www.opensolaris.org/os/licensing.
 11 # See the License for the specific language governing permissions
 12 # and limitations under the License.
 13 #
 14 # When distributing Covered Code, include this CDDL HEADER in each
 15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 16 # If applicable, add the following below this CDDL HEADER, with the
 17 # fields enclosed by brackets "[]" replaced with your own identifying
 18 # information: Portions Copyright [yyyy] [name of copyright owner]
 19 #
 20 # CDDL HEADER END
 21 #
 22 #
 23 
 24 #
 25 # Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 26 # Use is subject to license terms.
 27 #
 28 # install sudo's objects in the proto area, since it would really
 29 # like to install locally, but that doesn't scale.
 30 #
 31 
 32 VERS=1.7.2p5
 33 SUDOVERS=sudo-${VERS}
 34 PREFIX=${ROOT}/opt/sfw
 35 BINDIR=${PREFIX}/bin
 36 SBINDIR=${PREFIX}/sbin
 37 MANDIR=${PREFIX}/man
 38 MAN1MDIR=${MANDIR}/man1m
 39 MAN4DIR=${MANDIR}/man4
 40 ETCDIR=${PREFIX}/etc
 41 LIBEXEC=${PREFIX}/libexec
 42 
 43 cd ${SUDOVERS}
 44 
 45 # Install the binary sudo under .../opt/sfw/bin
 46 # Note how not installing this with setuid.  
 47 rm -f ${BINDIR}/sudo
 48 cp sudo ${BINDIR}/sudo
 49 strip ${BINDIR}/sudo
 50 chmod 0511 ${BINDIR}/sudo
 51 
 52 
 53 # Install the binary visudo under .../opt/sfw/sbin
 54 rm -f ${SBINDIR}/visudo
 55 cp visudo ${SBINDIR}/visudo
 56 strip ${SBINDIR}/visudo
 57 chmod 0511 ${SBINDIR}/visudo
 58 
 59 
 60 # Install man pages under man1m and man4
 61 rm -f ${MAN1MDIR}/sudo.1m
 62 cp sudo.man  ${MAN1MDIR}/sudo.1m
 63 chmod 444 ${MAN1MDIR}/sudo.1m
 64 
 65 rm -f ${MAN1MDIR}/visudo.1m
 66 cp visudo.man  ${MAN1MDIR}/visudo.1m
 67 chmod 444 ${MAN1MDIR}/visudo.1m
 68 
 69 rm -f ${MAN4DIR}/sudoers.4
 70 cp sudoers.man  ${MAN4DIR}/sudoers.4
 71 chmod 444 ${MAN4DIR}/sudoers.4
 72 
 73 
 74 # Install sudoers configuration file under etc 
 75 rm -f ${ETCDIR}/sudoers
 76 cp sudoers ${ETCDIR}/sudoers
 77 chmod 440 ${ETCDIR}/sudoers
 78 
 79 # Install sudo_noexec.so in libexec
 80 rm -r ${LIBEXEC}/sudo_noexec.so
 81 cp .libs/sudo_noexec.so ${LIBEXEC}/sudo_noexec.so
 82 chmod 755 ${LIBEXEC}/sudo_noexec.so
 83 
 84 exit 0