Home | History | Annotate | Download | only in grails
      1 #!/usr/bin/ksh93
      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 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
     24 # Use is subject to license terms.
     25 #
     26 #ident	"@(#)install-grails	1.2	08/11/24 SMI"
     27 
     28 # exit on first error
     29 set -o errexit
     30 
     31 umask 0022
     32 
     33 GRAILS_VER=$1
     34 BUILD_DIR=grails-${GRAILS_VER}
     35 
     36 source ${SRC}/tools/install.subr
     37 
     38 # unpack binaries
     39 GRAILS_BIN=${BUILD_DIR}/binaries
     40 mkdir -p ${GRAILS_BIN}
     41 unzip -o ${BUILD_DIR}/dist/grails-bin-${GRAILS_VER}.zip -d ${GRAILS_BIN}
     42 
     43 # install Grails
     44 USR_GRAILS=${ROOT}/usr/grails/${GRAILS_VER}
     45 rm -rf ${USR_GRAILS}
     46 mkdir -p ${USR_GRAILS}
     47 cp -r ${GRAILS_BIN}/grails-${GRAILS_VER}/* ${USR_GRAILS}
     48 
     49 # remove unwanted files
     50 rm ${USR_GRAILS}/bin/*.bat
     51 rm ${USR_GRAILS}/bin/cygrails
     52 rm ${USR_GRAILS}/ant/bin/*.bat
     53 rm ${USR_GRAILS}/ant/bin/*.cmd
     54 
     55 # fix shell scripts
     56 cp src/grails ${USR_GRAILS}/bin
     57 cp src/grails-debug ${USR_GRAILS}/bin
     58 for i in antRun.pl complete-ant-cmd.pl runant.pl
     59 do
     60 	_fixup_perl ${USR_GRAILS}/ant/bin/$i
     61 done
     62 
     63 # create sym links
     64 cd ${ROOT}/usr/bin
     65 rm -f grails
     66 ln -s ../grails/${GRAILS_VER}/bin/grails grails
     67 rm -f grails-debug
     68 ln -s ../grails/${GRAILS_VER}/bin/grails-debug grails-debug
     69 cd -
     70 
     71 # fix rights
     72 chmod 555 ${USR_GRAILS}/bin/grails
     73 chmod 555 ${USR_GRAILS}/bin/grails-debug
     74 chmod 555 ${USR_GRAILS}/ant/bin/*
     75 
     76 # install man pages
     77 MANSCRIPT=$(pwd)/sunman-stability
     78 MAN_PAGES_SRC=$(pwd)/src
     79 MAN_PAGES_DEST=${ROOT}/usr/share/man/man1
     80 _install M ${MAN_PAGES_SRC}/grails.1 ${MAN_PAGES_DEST}/grails.1 444
     81 _install M ${MAN_PAGES_SRC}/grails-debug.1 ${MAN_PAGES_DEST}/grails-debug.1 444
     82 
     83 # fix names with spaces
     84 # workaround for bug 6734267 (pkgmk does not allow spaces in file names)
     85 # the following files are not used directly by Grails framework...
     86 cd ${USR_GRAILS}/media/icons
     87 mv 'grails - 16x16 icon.png' grails-16x16icon.png
     88 mv 'grails - 32x32 icon.png' grails-32x32icon.png
     89 mv 'grails - 48x48 icon.png' grails-48x48icon.png
     90 mv 'grails - 64x64 icon.png' grails-64x64icon.png
     91 mv 'grails - 128x128 icon.png' grails-128x128icon.png
     92 
     93 exit 0
     94 
     95