2N/A#!/bin/sh
2N/A#
2N/A# CDDL HEADER START
2N/A#
2N/A# The contents of this file are subject to the terms of the
2N/A# Common Development and Distribution License (the "License").
2N/A# You may not use this file except in compliance with the License.
2N/A#
2N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A# or http://www.opensolaris.org/os/licensing.
2N/A# See the License for the specific language governing permissions
2N/A# and limitations under the License.
2N/A#
2N/A# When distributing Covered Code, include this CDDL HEADER in each
2N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A# If applicable, add the following below this CDDL HEADER, with the
2N/A# fields enclosed by brackets "[]" replaced with your own identifying
2N/A# information: Portions Copyright [yyyy] [name of copyright owner]
2N/A#
2N/A# CDDL HEADER END
2N/A#
2N/A# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
2N/A#
2N/A
2N/ABUILD_DIR=$1
2N/ACOMPONENT_SRC=$2
2N/A
2N/Aexport PATH=/bin:$PATH
2N/A
2N/A# Replace the path to that under component build dir
2N/Agsed -i 's|\"etc\"|'\""$BUILD_DIR"'/etc\"|g' $COMPONENT_SRC/src/tests/test6.c
2N/Agsed -i 's|\"etc\"|'\""$BUILD_DIR"'/etc\"|g' $COMPONENT_SRC/src/tests/test8.c
2N/A
2N/A# Make dirs under component build dir and copy necessary files under them
2N/Arm -rf $BUILD_DIR/etc/hsm.d
2N/Amkdir $BUILD_DIR/etc/hsm.d
2N/Acp $COMPONENT_SRC/etc/hsm.d/etoken-engine.xml $BUILD_DIR/etc/hsm.d
2N/Arm $BUILD_DIR/etc/objectIdentifiers.xml
2N/Acp $COMPONENT_SRC/etc/objectIdentifiers.xml $BUILD_DIR/etc
2N/Arm -rf $BUILD_DIR/etc/token.d
2N/Amkdir $BUILD_DIR/etc/token.d
2N/Acp $COMPONENT_SRC/etc/token.d/test.xml $BUILD_DIR/etc/token.d
2N/A
2N/A# Replace the path to that under component build dir
2N/Ased -e 's|/$HOME|'"$BUILD_DIR"'/etc|g' $COMPONENT_SRC/etc/token.d/default.xml > $BUILD_DIR/etc/token.d/default.xml
2N/A
2N/A# Copy .libpki dir under component build dir
2N/Arm -rf $BUILD_DIR/etc/.libpki
2N/Acp -R $COMPONENT_SRC/etc/.libpki $BUILD_DIR/etc
2N/A
2N/A# Make results dir under component build dir
2N/Arm -rf $BUILD_DIR/results
2N/Amkdir $BUILD_DIR/results
2N/A
2N/A# Build test scripts
2N/Agmake -C $BUILD_DIR/src/tests check-am
2N/A
2N/A# Test scripts need escapes because they are executed indirectly
2N/Afor i in {1..9}
2N/Ado
2N/A gsed -i 's|$libtool_install_magic|$$libtool_install_magic|g' $BUILD_DIR/src/tests/test$i
2N/A gsed -i 's|$libtool_execute_magic|$$libtool_execute_magic|g' $BUILD_DIR/src/tests/test$i
2N/A gsed -i 's|:$LD_LIBRARY_PATH|:$$LD_LIBRARY_PATH|g' $BUILD_DIR/src/tests/test$i
2N/Adone
2N/A