create.sh revision 2a335dc8289c2018c8311c41a05286a205e754c4
f480a2c90c9bf75c2eded1a0577a65b262970552Vladimir Kotal#!/usr/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#
e7b21c8124ec55ffacc49c1e28a8685834715484Lubos Kosco# See LICENSE.txt included in this distribution for the specific
e7b21c8124ec55ffacc49c1e28a8685834715484Lubos Kosco# language governing permissions 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#
a8946de730d1f4298332fe8fd0a199bb2f69a764Vladimir Kotal# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
d961aa46ea0d50fed47802497e45226b1965b12dVladimir Kotal#
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG_REPO_NAME=myrepo
f480a2c90c9bf75c2eded1a0577a65b262970552Vladimir KotalPKG_PUBLISHER=opengrok
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG_NAME=opengrok
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comcase "$1" in
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com -v)
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com shift
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if [ $# -gt 0 ]
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com then
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com human_readable_version=$1
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com else
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com echo "Usage: $0 -v <version>"
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com exit 1
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com fi
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com shift
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com ;;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com *)
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com echo "Usage: $0 -v <version>"
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com exit 1
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com ;;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comesac
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comif [ ! "$human_readable_version" ]
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comthen
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com echo "Cannot identify the version"
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com exit 1
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comfi
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# Transform OpenGrok version to the IPS version standard
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# As following:
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com#
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# 0.12 ~ 0.12.0.1.0
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# 0.<n> ~ 0.<n>.0.1.0
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# ...
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com#
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# 0.12-rc1 ~ 0.12.0.0.1
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# 0.12-rc<i> ~ 0.12.0.0.<i>
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# ...
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com#
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# Note that the release candidate must follow imediately after the basic version number (0.12)
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com#
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com#
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# 0.12.1 ~ 0.12.1.0.0
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# 0.12.<j> ~ 0.12.<j>.0.0
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# ...
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com#
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# 0.12.0.1 ~ 0.12.0.1.1
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# 0.12.0.<k> ~ 0.12.0.1.<k>
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# ...
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com#
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com#
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# This is done due to IPS restriction on the version's names
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# This also keep the order of picking the versions from repository
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comversion=$(echo "$human_readable_version" | nawk -F"." '
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comfunction parse ( version )
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com{
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if ( version ~ /^[0-9]+\.[0-9]+-rc[0-9]+/ )
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com FS="-rc"
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com ret = $1".0.0."$2;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com FS="."
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com return ret;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com }
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com else if ( version ~ /^[0-9]+\.[0-9]+$/ )
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com return version".0.1.0";
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com }
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com else if ( version ~ /^[0-9]+\.[0-9]+\.[0-9]+$/ )
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com ret = 0;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if ( $3 == "0" )
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com ret = 1;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com return version"."ret".0";
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com }
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com else if ( version ~ /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/ )
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com ret = $1;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com for ( i = 2; i < 4; i ++ )
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com ret = ret"."$i;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com return ret".1."$NF;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com }
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com else if ( version ~ /rc/ )
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com return -1;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com }
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com else
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com return version;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com }
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com}
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com{
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com print parse($0);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com}
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com')
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comif [ $? != 0 ]
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comthen
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com echo "Command failed: nawk ..."
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com exit 1
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comfi
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comif [ "x$version" = "x-1" ]
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comthen
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com echo "Not supported naming scheme $version"
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com exit 1
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comfi
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# create local repo
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.commkdir -p "$PKG_REPO_NAME"
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comif [ $? != 0 ]
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comthen
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com echo Command failed: mkdir -p "$PKG_REPO_NAME"
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com exit 1
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comfi
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG()
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com{
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com "$@"
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye if [ $? != 0 ]
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye then
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com echo Command failed: "$@"
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com rm -rf "$PKG_REPO_NAME"
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye exit 1
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye fi
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye}
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgrepo create "$PKG_REPO_NAME"
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgrepo -s "$PKG_REPO_NAME" set publisher/prefix=${PKG_PUBLISHER}
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comexport PKG_REPO="$PKG_REPO_NAME"
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comeval `pkgsend open ${PKG_NAME}@${version}`
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyeif [ $? != 0 ]
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyethen
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com echo "Fatal: could not open ${PKG_NAME}@${version}"
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com rm -rf "$PKR_REPO_NAME"
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
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com PKG pkgsend add dir mode=0755 owner=root group=sys path=${dir}
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyedone
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech Republicfor dir in /usr/opengrok/bin /usr/opengrok/lib
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech Republicdo
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com PKG 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 \
01745d904b774dade4b2f1921f117c7d96438eefVladimir Kotal /var/opengrok/log /var/opengrok/src
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyedo
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com PKG pkgsend add dir mode=0755 owner=webservd group=webservd path=${dir}
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyedone
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgsend add link path=/usr/opengrok/lib/lib target=../lib
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgsend 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
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgsend add file platform/solaris/smf/svc-opengrok mode=0555 owner=root group=bin path=/lib/svc/method/svc-opengrok
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgsend add file platform/solaris/smf/ogindexd mode=0555 owner=root group=bin path=/usr/opengrok/lib/ogindexd
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgsend add file OpenGrok mode=0555 owner=root group=bin path=/usr/opengrok/bin/OpenGrok
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgsend add file dist/opengrok.jar mode=0444 owner=root group=bin path=/usr/opengrok/lib/opengrok.jar
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgsend add file logging.properties mode=0444 owner=root group=sys path=/usr/opengrok/doc/logging.properties
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgsend add file README.txt mode=0444 owner=root group=sys path=/usr/opengrok/doc/README.txt
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgsend add file CHANGES.txt mode=0444 owner=root group=sys path=/usr/opengrok/doc/CHANGES.txt
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgsend add file LICENSE.txt mode=0444 owner=root group=sys path=/usr/opengrok/doc/LICENSE.txt
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgsend add file NOTICE.txt mode=0444 owner=root group=sys path=/usr/opengrok/doc/NOTICE.txt
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgsend add file doc/EXAMPLE.txt mode=0444 owner=root group=sys path=/usr/opengrok/doc/EXAMPLE.txt
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgsend 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
2a335dc8289c2018c8311c41a05286a205e754c4Lubos KoscoLV=6.0.1
6ba6a49186aff8de4dc5251195b9917021b5ee69Knut Anders Hatlenfor file in ant.jar bcel-5.2.jar \
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com lucene-analyzers-common-${LV}.jar lucene-core-${LV}.jar lucene-queryparser-${LV}.jar lucene-suggest-${LV}.jar \
6ba6a49186aff8de4dc5251195b9917021b5ee69Knut Anders Hatlen jrcs.jar \
34ce5c2f0e9b0f6bf05895501c9f7171d4a5bab7Lubos Kosco swing-layout-0.9.jar \
34ce5c2f0e9b0f6bf05895501c9f7171d4a5bab7Lubos Kosco json-simple-1.1.1.jar
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyedo
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com PKG 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
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgsend 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
37187cd476e30232cba3afb116e079cb640f984eLubos KoscoPKG pkgsend add depend fmri=pkg:/runtime/java/jre-8 type=require
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgsend add depend fmri=pkg:/web/java-servlet/tomcat type=require
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# Following line gets commented by that the developer/tool/exuberant-ctags has been removed from IPS
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# This has to stay commented until the next release of Solaris will contain the exhuberant ctags package
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com#PKG pkgsend add depend fmri=pkg:/developer/tool/exuberant-ctags type=require
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
f480a2c90c9bf75c2eded1a0577a65b262970552Vladimir KotalPKG pkgsend add file dist/source.war mode=0444 owner=webservd group=webservd path=/usr/opengrok/lib/source.war
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgsend add set name=description value="OpenGrok - wicked fast source browser"
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgsend add set name=pkg.human-version value="${human_readable_version}"
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comPKG pkgsend close
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# checks whether the same file exists and updates it
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comif [ -f "${PKG_NAME}-${human_readable_version}.p5p" ]
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comthen
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com rm -f ${PKG_NAME}-${human_readable_version}.p5p
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comfi
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
f480a2c90c9bf75c2eded1a0577a65b262970552Vladimir Kotaloutfile="$PWD/dist/${PKG_NAME}-${human_readable_version}.p5p"
f480a2c90c9bf75c2eded1a0577a65b262970552Vladimir Kotalrm -f "${outfile}"
f480a2c90c9bf75c2eded1a0577a65b262970552Vladimir KotalPKG pkgrecv -s "$PKG_REPO_NAME" -a -d "${outfile}" ${PKG_NAME}
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com# cleanup
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comif [ -d "$PKG_REPO_NAME" ]
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comthen
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com rm -rf "$PKG_REPO_NAME"
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comfi
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comunset PKG_REPO
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comecho "SUCCESSFULLY COMPLETED"
f480a2c90c9bf75c2eded1a0577a65b262970552Vladimir Kotalecho "OpenGrok has been packaged into $outfile"
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comecho "For more information about installing OpenGrok visit pkg man page."