forked from mariadb-corporation/mariadb-columnstore-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.sh
executable file
·30 lines (24 loc) · 987 Bytes
/
package.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
. VERSION
tarName=mariadb-columnstore-tools-$COLUMNSTORE_VERSION_MAJOR.$COLUMNSTORE_VERSION_MINOR.$COLUMNSTORE_VERSION_PATCH-$COLUMNSTORE_VERSION_RELEASE.bin.tar
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #get the absolute diretory of this script
subDirs=$(find . -maxdepth 1 -mindepth 1 -type d ! -iname ".*" ! -iname "mcsimport" ! -iname "build" ! -iname "resources" ! -iname "cmake" )
tar -cvf $tarName COPYRIGHT.txt LICENSE.txt README.md VERSION $subDirs --exclude=CMakeLists.txt
# if a build dir was specified use it and include the binaries
if [ $# -ge 1 ]; then
if [ -d $1 ]; then
# mcsimport
if [ -f $DIR/$1/mcsimport/mcsimport ]; then
tar -rvf $tarName ./mcsimport --exclude=*.txt --exclude=*.cpp --exclude=test
cd $1
tar -rvf $DIR/$tarName ./mcsimport/mcsimport
cd $DIR
fi
else
echo "error: specified cmake build dir $1 could't be found"
exit 2
fi
fi
# Compress the archive
cd $DIR
gzip $tarName