fixed build with bundled OpenSSL
[public/netxms.git] / tools / create_bin_apkg.sh
CommitLineData
4e9b562e
VK
1#!/bin/sh
2
3prefix=$1
4version=$2
d4ab5735 5suffix=$3
4e9b562e 6if [ -z "$prefix" ]; then
d4ab5735 7 echo "Usage: tools/create_bin_apkg.sh <prefix> <version> [<suffix>]"
4e9b562e
VK
8 exit 1
9fi
d4ab5735
VK
10if [ -z "$suffix" ]; then
11 suffix=`uname -s`
12fi
4e9b562e
VK
13
14if [ ! -r $prefix/bin/nxagentd ]; then
15 echo "Unable to find compiled agent undex $prefix"
16 exit 1
17fi
18
19cd contrib
20if [ $? != 0 ]; then
21 echo "Cannot change directory to contrib. Do you run script from source tree root?"
22 exit 1
23fi
24
25currdir=`pwd`
26cd $prefix &&
906befb5 27tar cvf nxagent-binary.tar bin/ lib/ &&
4e9b562e
VK
28gzip nxagent-binary.tar &&
29cd $currdir &&
30rm -rf inst &&
31mkdir inst &&
32mv $prefix/nxagent-binary.tar.gz inst/ &&
33cp installBinaryAgent.sh inst/ &&
34tar cvf inst.tar inst &&
35gzip inst.tar &&
36mv inst.tar.gz ../tools/ &&
37cd ../tools/ &&
d4ab5735 38bash ./sharIt inst.tar.gz inst/installBinaryAgent.sh ../nxagent-$version-$suffix.apkg &&
4e9b562e
VK
39cd .. &&
40rm -rf contrib/inst