hstr/build/tarball/tarball-build.sh

70 lines
2.1 KiB
Bash
Raw Permalink Normal View History

2013-12-26 08:05:38 +08:00
#!/bin/bash
#
# Copyright (C) 2014-2023 Martin Dvorak <martin.dvorak@mindforger.com>
#
# 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`
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
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() {
cp -vrf ${GH_SRC_DIR} .
mv `basename ${GH_SRC_DIR}` hstr
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 ]
then
2018-08-01 05:52:52 +08:00
echo "ERROR: automake prepare phase failed"
exit 1;
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
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 #
# ############################################################################
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
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
# eof