Home | History | Annotate | Download | only in cmake
      1 #!/bin/sh -e
      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 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
     25 # Use is subject to license terms.
     26 #
     27 #ident	"@(#)install-sfw	1.2	08/12/04 SMI"
     28 
     29 set -o errexit
     30 
     31 PKGVERS=${VER}
     32 PREFIX=${ROOT}/usr
     33 SPREFIX=sfw_stage
     34 S_SHARE_INCLUDE=${SPREFIX}/share/cmake-2.6/include
     35 D_SHARE_INCLUDE=${PREFIX}/share/cmake-2.6/include
     36 S_SHARE_MODULES=${SPREFIX}/share/cmake-2.6/Modules
     37 D_SHARE_MODULES=${PREFIX}/share/cmake-2.6/Modules
     38 S_SHARE_MODULES_PLATFORM=${SPREFIX}/share/cmake-2.6/Modules/Platform
     39 D_SHARE_MODULES_PLATFORM=${PREFIX}/share/cmake-2.6/Modules/Platform
     40 S_SHARE_TEMPLATES=${SPREFIX}/share/cmake-2.6/Templates
     41 D_SHARE_TEMPLATES=${PREFIX}/share/cmake-2.6/Templates
     42 S_SHARE_DOC=${SPREFIX}/doc/cmake-2.6
     43 D_SHARE_DOC=${PREFIX}/share/cmake-2.6/doc
     44 S_BIN=${SPREFIX}/bin
     45 D_BIN=${PREFIX}/bin
     46 S_MAN1=${SPREFIX}/usr/share/man/man1
     47 D_MAN1=${PREFIX}/share/man/man1
     48 MANSCRIPT=`pwd`/sunman-stability
     49 source ${SRC}/tools/install.subr
     50 
     51 cd ${PKGVERS}
     52 TOP=`pwd`
     53 
     54 # clean up some build-related files (only show up from, apparently,
     55 # changing the cache file and they contain workspace pathnames).
     56 
     57 for i in ${S_SHARE_MODULES} ${S_SHARE_MODULES_PLATFORM} \
     58     ${S_SHARE_TEMPLATES}
     59 do
     60 	rm -f ${i}/CTestTestfile.cmake
     61 	rm -f ${i}/cmake_install.cmake
     62 done
     63 
     64 # share/include directory
     65 cd ${S_SHARE_INCLUDE}
     66 for i in *; do
     67 	test -f && _install N $i ${D_SHARE_INCLUDE}/$i 444
     68 done
     69 
     70 # share/Modules directory
     71 cd ${TOP}
     72 cd ${S_SHARE_MODULES}
     73 for i in *; do
     74 	test -f $i && _install N $i ${D_SHARE_MODULES}/$i 444
     75 done
     76 
     77 # share/Modules/Platform directory
     78 cd ${TOP}
     79 cd ${S_SHARE_MODULES_PLATFORM}
     80 for i in *; do
     81 	test -f $i && _install N $i ${D_SHARE_MODULES_PLATFORM}/$i 444
     82 done
     83 
     84 # share/Templates directory
     85 cd ${TOP}
     86 cd ${S_SHARE_TEMPLATES}
     87 for i in *; do
     88 	test -f $i && _install N $i ${D_SHARE_TEMPLATES}/$i 444
     89 done
     90 
     91 # share/doc directory
     92 cd ${TOP}
     93 cd ${S_SHARE_DOC}
     94 for i in *; do
     95 	test -f $i && _install N $i ${D_SHARE_DOC}/$i 444
     96 done
     97 
     98 # bin directory
     99 cd ${TOP}
    100 cd ${S_BIN}
    101 for i in *; do
    102 	test -f $i && _install N $i ${D_BIN}/$i 555
    103 done
    104 
    105 # man1 directory
    106 cd ${TOP}
    107 cd ${S_MAN1}
    108 for i in *; do
    109 	test -f $i && _install M $i ${D_MAN1}/$i 444
    110 done
    111 
    112 # Check to make sure there is no file or directory left behind.
    113 # This is helpful when a new version of cmake is imported.
    114 ERRCODE=0
    115 cd ${TOP}/${SPREFIX}
    116 find . -type f | (
    117 while read i; do
    118 	DNAME=`dirname $i`
    119 	for j in ./share/cmake-2.6/include ./share/cmake-2.6/Modules ./share/cmake-2.6/Modules/Platform ./share/cmake-2.6/Templates ./doc/cmake-2.6 ./bin ./usr/share/man/man1 ' ' ; do
    120 		if [ ${DNAME}. = $j. ]; then
    121 			break
    122 		fi
    123 	done
    124 	if [ $j. = . ]; then
    125 		echo "Error: Unknown file $i encountered, please check install-sfw script."
    126 		ERRCODE=10
    127 	fi
    128 done)
    129 
    130 exit ${ERRCODE}
    131