create.sh revision 6a26708374d7e379d9387ba862fc26a14e28919a
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#
d961aa46ea0d50fed47802497e45226b1965b12dVladimir Kotal
d961aa46ea0d50fed47802497e45226b1965b12dVladimir Kotal#
d961aa46ea0d50fed47802497e45226b1965b12dVladimir Kotal# Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
d961aa46ea0d50fed47802497e45226b1965b12dVladimir Kotal#
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyeversion=`grep 'name="version"' build.xml | cut -f 4 -d \"`
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech Republicrevision=0.`uname -v | perl -ne 's/(\d+)/print "$1\n"/e'`
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
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech Republicfor dir in /etc/opengrok /usr/opengrok /usr/opengrok/man /usr/opengrok/man/man1\
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech Republic /usr/opengrok/doc
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyedo
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye PKGSEND add dir mode=0755 owner=root group=sys path=${dir}
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyedone
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech Republicfor dir in /usr/opengrok/bin /usr/opengrok/lib
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech Republicdo
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech Republic PKGSEND add dir mode=0755 owner=root group=bin path=${dir}
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech Republicdone
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech Republic
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyefor dir in /var/opengrok /var/opengrok/data /var/opengrok/etc \
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye /var/opengrok/log /var/opengrok/source
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyedo
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech Republic PKGSEND add dir mode=0755 owner=webservd group=webservd path=${dir}
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyedone
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos KoscoPKGSEND add link path=/usr/opengrok/lib/lib target=../lib
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco
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
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech RepublicPKGSEND add file platform/solaris/smf/svc-opengrok mode=0555 owner=root group=bin path=/lib/svc/method/svc-opengrok
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech RepublicPKGSEND add file platform/solaris/smf/ogindexd mode=0555 owner=root group=bin path=/usr/opengrok/lib/ogindexd
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos KoscoPKGSEND add file OpenGrok mode=0555 owner=root group=bin path=/usr/opengrok/bin/OpenGrok
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech RepublicPKGSEND add file dist/opengrok.jar mode=0444 owner=root group=bin path=/usr/opengrok/lib/opengrok.jar
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos KoscoPKGSEND add file logging.properties mode=0444 owner=root group=sys path=/usr/opengrok/doc/logging.properties
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech RepublicPKGSEND add file README.txt mode=0444 owner=root group=sys path=/usr/opengrok/doc/README.txt
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos KoscoPKGSEND add file CHANGES.txt mode=0444 owner=root group=sys path=/usr/opengrok/doc/CHANGES.txt
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos KoscoPKGSEND add file LICENSE.txt mode=0444 owner=root group=sys path=/usr/opengrok/doc/LICENSE.txt
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos KoscoPKGSEND add file NOTICE.txt mode=0444 owner=root group=sys path=/usr/opengrok/doc/NOTICE.txt
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech RepublicPKGSEND add file doc/EXAMPLE.txt mode=0444 owner=root group=sys path=/usr/opengrok/doc/EXAMPLE.txt
d961aa46ea0d50fed47802497e45226b1965b12dVladimir KotalPKGSEND add file doc/ctags.config mode=0444 owner=root group=sys path=/usr/opengrok/doc/ctags.config
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# install libs
6a26708374d7e379d9387ba862fc26a14e28919aLubos KoscoLV=4.1.0
6ba6a49186aff8de4dc5251195b9917021b5ee69Knut Anders Hatlenfor file in ant.jar bcel-5.2.jar \
6a26708374d7e379d9387ba862fc26a14e28919aLubos Kosco lucene-analyzers-common-${LV}.jar lucene-core-${LV}.jar lucene-queryparser-${LV}.jar lucene-suggest-${LV}.jar \
6ba6a49186aff8de4dc5251195b9917021b5ee69Knut Anders Hatlen jrcs.jar \
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye swing-layout-0.9.jar
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyedo
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech Republic PKGSEND add file dist/lib/${file} mode=0444 owner=root group=bin path=/usr/opengrok/lib/${file}
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyedone
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# install man page
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech RepublicPKGSEND add file dist/opengrok.1 mode=0444 owner=root group=bin path=/usr/opengrok/man/man1/opengrok.1
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye# install default configuration
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech RepublicPKGSEND add depend fmri=pkg:/runtime/java type=require
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech RepublicPKGSEND add depend fmri=pkg:/web/java-servlet/tomcat type=require
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech RepublicPKGSEND add depend fmri=pkg:/developer/tool/exuberant-ctags type=require
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech RepublicPKGSEND add file dist/source.war mode=0444 owner=webservd group=webservd path=/var/tomcat6/webapps/source.war
9dc9150bbde9e7ccd68afb4a6eca9f4f1a928c87Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyePKGSEND add set name=description value="OpenGrok - Wicked fast source browser"
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyePKGSEND close