create.sh revision d20db9dd18673cf482111b9cd3ecc6823d0e45a3
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye#! /bin/ksh -p
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye#
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# CDDL HEADER START
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye#
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# The contents of this file are subject to the terms of the
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# Common Development and Distribution License (the "License").
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# You may not use this file except in compliance with the License.
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye#
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# or http://www.opensolaris.org/os/licensing.
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# See the License for the specific language governing permissions
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# and limitations under the License.
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye#
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# When distributing Covered Code, include this CDDL HEADER in each
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# If applicable, add the following below this CDDL HEADER, with the
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# fields enclosed by brackets "[]" replaced with your own identifying
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# information: Portions Copyright [yyyy] [name of copyright owner]
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye#
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# CDDL HEADER END
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye#
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# Use is subject to license terms.
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyeversion=`grep 'name="version"' build.xml | cut -f 4 -d \"`
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyerevision=`hg log --template '{rev}' -r tip`
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyePKGSEND() {
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye pkgsend "$@"
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye if [ $? != 0 ]
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye then
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye echo Command failed: pkgsend "$@"
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye pkgsend close -A
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye exit 1
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye fi
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye}
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyeeval `pkgsend open OSOLopengrok@${version}-${revision}`
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyeif [ $? != 0 ]
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyethen
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye echo "Fatal: could not open OSOLopengrok@${version}-${revision}"
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye exit 1
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyefi
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyefor dir in /etc/opengrok /usr/opengrok /usr/opengrok/bin /usr/opengrok/lib \
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye /usr/opengrok/man /usr/opengrok/man/sman1
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyedo
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye PKGSEND add dir mode=0755 owner=root group=sys path=${dir}
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyedone
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyefor dir in /var/opengrok /var/opengrok/data /var/opengrok/etc \
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye /var/opengrok/log /var/opengrok/source
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyedo
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye PKGSEND add dir mode=0755 owner=noaccess group=noaccess path=${dir}
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyedone
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyePKGSEND add file platform/solaris/smf/opengrok.xml mode=0444 owner=root group=sys path=/var/svc/manifest/application/opengrok.xml restart_fmri=svc:/system/manifest-import:default
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyePKGSEND add file platform/solaris/smf/opengrok mode=0555 owner=bin group=bin path=/lib/svc/method/opengrok
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyePKGSEND add file dist/opengrok.jar mode=0555 owner=bin group=bin path=/usr/opengrok/bin/opengrok.jar
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyePKGSEND add link path=/usr/opengrok/bin/lib target=../lib
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# install libs
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyefor file in bcel-5.1.jar jakarta-oro-2.0.8.jar \
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye lucene-core-2.2.0.jar lucene-spellchecker-2.2.0.jar \
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye org.apache.commons.jrcs.diff.jar org.apache.commons.jrcs.rcs.jar \
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye swing-layout-0.9.jar
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyedo
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye PKGSEND add file dist/lib/${file} mode=0444 owner=bin group=bin path=/usr/opengrok/lib/${file}
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyedone
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# install man page
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyePKGSEND add file dist/opengrok.1 mode=0444 owner=bin group=bin path=/usr/opengrok/man/sman1/opengrok.1
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# install default configuration
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyePKGSEND add file platform/solaris/default/opengrok.properties mode=0444 owner=root group=sys path=/etc/opengrok/opengrok.properties preserve=renameold
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyePKGSEND add link path=/usr/opengrok/bin/lib/ant.jar target=/usr/share/lib/ant/ant.jar
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyePKGSEND add link path=/usr/opengrok/bin/lib/jmxremote_optional.jar target=/usr/share/lib/jdmk/jmxremote_optional.jar
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyePKGSEND add depend fmri=pkg:/SUNWjdmk-base type=require
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyePKGSEND add depend fmri=pkg:/SUNWant type=require
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyePKGSEND add set name=description value="OpenGrok - Wicked fast source browser"
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyePKGSEND close