2013-12-26 08:05:38 +08:00
|
|
|
#!/bin/bash
|
2018-07-31 05:23:24 +08:00
|
|
|
#
|
2023-03-20 02:00:24 +08:00
|
|
|
# Copyright (C) 2014-2023 Martin Dvorak <martin.dvorak@mindforger.com>
|
2018-07-31 05:23:24 +08:00
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
2018-08-01 05:52:52 +08:00
|
|
|
|
2018-08-01 13:30:49 +08:00
|
|
|
# Script used to create TARBALL and to build HSTR using autotools:
|
|
|
|
# - run this script from Git repository.
|
|
|
|
# - it copies repository content and result to given release directory
|
2013-12-26 08:05:38 +08:00
|
|
|
|
2018-08-01 05:23:20 +08:00
|
|
|
export SCRIPT_HOME=`pwd`
|
2017-06-04 15:33:20 +08:00
|
|
|
|
2023-04-19 05:10:27 +08:00
|
|
|
export HSTR_VERSION="3.1.0"
|
2018-08-01 05:52:52 +08:00
|
|
|
|
|
|
|
export NOW=`date +%Y-%m-%d--%H-%M-%S`
|
|
|
|
export GH_RELEASE_DIR=~/p/hstr/release
|
2020-11-19 14:16:14 +08:00
|
|
|
export GH_SRC_DIR=~/p/hstr/github/hstr
|
2018-08-01 05:52:52 +08:00
|
|
|
export GH_DISTRO_DIR=${GH_RELEASE_DIR}/release-${NOW}
|
|
|
|
|
2018-08-01 05:23:20 +08:00
|
|
|
function makeTarballRelease() {
|
2020-11-19 14:16:14 +08:00
|
|
|
cp -vrf ${GH_SRC_DIR} .
|
|
|
|
mv `basename ${GH_SRC_DIR}` hstr
|
2019-12-09 15:03:04 +08:00
|
|
|
cd hstr && rm -vrf debian doc test hstr && cd build/tarball && ./tarball-automake.sh --purge
|
2018-08-01 05:52:52 +08:00
|
|
|
if [ ${?} -ne 0 ]
|
2017-06-04 15:33:20 +08:00
|
|
|
then
|
2018-08-01 05:52:52 +08:00
|
|
|
echo "ERROR: automake prepare phase failed"
|
|
|
|
exit 1;
|
2017-06-04 15:33:20 +08:00
|
|
|
fi
|
2018-08-01 05:52:52 +08:00
|
|
|
cd ../../..
|
2018-08-22 14:53:23 +08:00
|
|
|
tar zcfv hstr-${HSTR_VERSION}-tarball.tgz hstr
|
2019-12-09 15:03:04 +08:00
|
|
|
cd hstr && ./configure && make && cd src
|
|
|
|
tar zcfv ../../hstr-${HSTR_VERSION}-bin-64b.tgz hstr
|
2018-08-01 05:23:20 +08:00
|
|
|
}
|
|
|
|
|
2018-08-01 05:52:52 +08:00
|
|
|
# ############################################################################
|
|
|
|
# # Main #
|
|
|
|
# ############################################################################
|
2017-06-04 15:33:20 +08:00
|
|
|
|
2018-08-01 13:30:49 +08:00
|
|
|
echo "HSTR tarball and binary builder"
|
|
|
|
if [ ! -e "../../.git" ]
|
|
|
|
then
|
|
|
|
echo "ERROR: this script must be run FROM Git repository"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-11-19 14:16:14 +08:00
|
|
|
if [ ! -e "${GH_SRC_DIR}" ]
|
|
|
|
then
|
|
|
|
echo "ERROR: HSTR sources directory must exist: ${GH_SRC_DIR}"
|
|
|
|
exit 1
|
|
|
|
fi
|
2018-08-03 14:47:26 +08:00
|
|
|
if [ ! -e "${GH_RELEASE_DIR}" ]
|
2018-08-01 13:30:49 +08:00
|
|
|
then
|
|
|
|
echo "ERROR: release directory must exist: ${GH_RELEASE_DIR}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2018-08-01 05:23:20 +08:00
|
|
|
mkdir -v ${GH_DISTRO_DIR}
|
|
|
|
cd ${GH_DISTRO_DIR} && makeTarballRelease
|
2013-12-26 08:05:38 +08:00
|
|
|
|
2014-01-04 16:27:59 +08:00
|
|
|
# eof
|