ClickHouse/release

76 lines
1.8 KiB
Plaintext
Raw Normal View History

2016-02-07 20:02:44 +00:00
#!/bin/bash
set -e
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
cd $CURDIR
source "./release_lib.sh"
2016-02-07 20:02:44 +00:00
DEB_CC=${DEB_CC:=gcc-7}
DEB_CXX=${DEB_CXX:=g++-7}
2017-08-30 14:08:19 +00:00
2016-02-07 20:02:44 +00:00
CONTROL=debian/control
DEBUILD_NOSIGN_OPTIONS="-us -uc"
DEBUILD_NODEPS_OPTIONS="-d"
if [ -z "$REVISION" ] ; then
get_revision_author
fi
2016-06-10 14:42:05 +00:00
while [[ $1 == --* ]]
do
if [[ $1 == '--test' ]]; then
TEST='yes'
VERSION_POSTFIX+=-test
shift
elif [[ $1 == '--check-build-dependencies' ]]; then
DEBUILD_NODEPS_OPTIONS=""
shift
elif [[ $1 == '--version' ]]; then
gen_revision_author
git push
exit 0
elif [[ $1 == '--head' ]]; then
REVISION=`git rev-parse HEAD`
shift
else
echo "Unknown option $1"
exit 2
fi
2016-06-10 14:42:05 +00:00
done
# Build options
if [ -n "$SANITIZER" ]
2016-06-10 14:42:05 +00:00
then
CMAKE_BUILD_TYPE=$SANITIZER
VERSION_POSTFIX+=-${SANITIZER,,}
# todo: нужно ли отключить libtcmalloc?
LIBTCMALLOC_OPTS="-DENABLE_TCMALLOC=0"
# GLIBC_COMPATIBILITY отключен по умолчанию
elif [[ $BUILD_TYPE == 'valgrind' ]]; then
LIBTCMALLOC_OPTS="-DENABLE_TCMALLOC=0"
VERSION_POSTFIX+=-$BUILD_TYPE
elif [[ $BUILD_TYPE == 'debug' ]]; then
CMAKE_BUILD_TYPE=Debug
LIBTCMALLOC_OPTS="-DDEBUG_TCMALLOC=1"
VERSION_POSTFIX+=-$BUILD_TYPE
fi
if [ -z "$THREAD_COUNT" ] ; then
THREAD_COUNT=`nproc || grep -c ^processor /proc/cpuinfo`
2016-06-10 14:42:05 +00:00
fi
CMAKE_FLAGS+=" $LIBTCMALLOC_OPTS -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DUSE_EMBEDDED_COMPILER=1"
REVISION+=$VERSION_POSTFIX
2016-02-07 20:02:44 +00:00
echo -e "\nCurrent revision is $REVISION"
gen_changelog "$REVISION" "" "$AUTHOR" ""
2016-02-07 20:02:44 +00:00
# Build (only binary packages).
debuild -e PATH -e SSH_AUTH_SOCK -e DEB_BUILD_OPTIONS=parallel=$THREAD_COUNT \
-e DEB_CC=$DEB_CC -e DEB_CXX=$DEB_CXX -e CMAKE_FLAGS="$CMAKE_FLAGS" \
-b ${DEBUILD_NOSIGN_OPTIONS} ${DEBUILD_NODEPS_OPTIONS}