-
Notifications
You must be signed in to change notification settings - Fork 3
/
createTarball.sh
executable file
·55 lines (44 loc) · 1.75 KB
/
createTarball.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
set -e
if [ $# -eq 0 ]
then
echo "Error: No arguments supplied. First and only argument has to be Version"
exit 1
fi
if [ $# -ne 1 ]
then
echo "Error: Wrong number arguments supplied. First and only argument has to be Version"
exit 1
fi
VERSION=$1
MAJOR=`echo $VERSION | cut -d. -f1`
MINOR=`echo $VERSION | cut -d. -f2`
FOLDER_TO_TAR=usr
INSTALL_DIR_LIB=${FOLDER_TO_TAR}/lib64
INSTALL_DIR_BIN=${FOLDER_TO_TAR}/bin
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT") # path where this script is located in
TARBALL_NAME=Digitizer-${VERSION}.tar
TARBALL_NAME_MAJOR=Digitizer-${MAJOR}.tar
TARBALL_NAME_MAJOR_MINOR=Digitizer-${MAJOR}.${MINOR}.tar
INSTALL_PATH_ASL=/common/export/fesa/arch/x86_64
mkdir -p ${INSTALL_DIR_LIB}
mkdir -p ${INSTALL_DIR_BIN}
#cp ${SCRIPTPATH}/build/lib/libgnuradio-digitizers-*.master.so.0.0.0 ${INSTALL_DIR_LIB}
cp /common/usr/cscofe/opt/gr-digitizer/${VERSION}/lib64/libgnuradio-digitizers-*.so.0.0.0 ${INSTALL_DIR_LIB}
#cp ${SCRIPTPATH}/build/lib/test-digitizers ${INSTALL_DIR_BIN} ## needed for what ?
#cp ${SCRIPTPATH}/build/lib/test_digitizers_test.sh ${INSTALL_DIR_BIN} ## needed for what ?
tar cfv ${TARBALL_NAME} ${FOLDER_TO_TAR}
rm -rf ${FOLDER_TO_TAR}
gzip ${TARBALL_NAME}
cp ${TARBALL_NAME}.gz ${INSTALL_PATH_ASL}
echo "${TARBALL_NAME}.gz copied to ${INSTALL_PATH_ASL}"
if [ -L ${INSTALL_PATH_ASL}/${TARBALL_NAME_MAJOR}.gz ]; then
unlink ${INSTALL_PATH_ASL}/${TARBALL_NAME_MAJOR}.gz
fi
if [ -L ${INSTALL_PATH_ASL}/${TARBALL_NAME_MAJOR_MINOR}.gz ]; then
unlink ${INSTALL_PATH_ASL}/${TARBALL_NAME_MAJOR_MINOR}.gz
fi
ln -s ${TARBALL_NAME_MAJOR_MINOR}.gz ${INSTALL_PATH_ASL}/${TARBALL_NAME_MAJOR}.gz
ln -s ${TARBALL_NAME}.gz ${INSTALL_PATH_ASL}/${TARBALL_NAME_MAJOR_MINOR}.gz
echo "symlinks updated"