Debian: simpler package (#662)

* Allow use external re2 with re2_st=re2

* fix

* remove dupe

* use re2_st in FunctionsStringSearch.h

* fix

* move files from tools/etc to debian

* dont generate control

* version

* ok.

* wip

* Cmake: dont touch CMAKE_INSTALL_PREFIX

* wip

* works!

* clean

* okay

* like old

* wip

* wip

* okay

* clickhouse-server-base-dbg

* clean

* clickhouse-server-dbg

* Debian: Remove daemons

* Update rules

* add source/format

* control clean

* add watch

* clean

* clean

* temp fix build

* clean

* docs

* fake make_control

* fix

* testme

* testme

* add metrika package

* fake metrika files
This commit is contained in:
proller 2017-04-10 20:43:30 +03:00 committed by alexey-milovidov
parent 6a51c66424
commit 72ccc69212
38 changed files with 188 additions and 251 deletions

3
.gitignore vendored
View File

@ -187,7 +187,6 @@ config-9001.xml
core
vgcore*
*.install
*.deb
*.build
*.upload
@ -196,8 +195,6 @@ build-stamp
configure-stamp
debian/changelog
debian/*.debhelper.log
debian/*.cron.d
debian/*.init
debian/*.debhelper
debian/*.substvars

View File

@ -24,7 +24,7 @@ endif ()
cmake_policy (SET CMP0014 OLD) # Ignore warning about CMakeLists.txt in each directory
cmake_policy (SET CMP0012 NEW) # Don't dereference TRUE and FALSE
if (NOT CMAKE_BUILD_TYPE)
if (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE MATCHES "None")
message (STATUS "CMAKE_BUILD_TYPE is not set, set to default = RELWITHDEBINFO")
set (CMAKE_BUILD_TYPE "RELWITHDEBINFO")
endif ()
@ -134,8 +134,7 @@ endif (TEST_COVERAGE)
if (ENABLE_TESTS)
message (STATUS "Tests are enabled")
enable_testing()
add_subdirectory (dbms/tests)
endif (ENABLE_TESTS)
endif ()
# when installing to /usr - place configs to /etc but for /usr/local place to /usr/local/etc
if (CMAKE_INSTALL_PREFIX MATCHES "/usr")
@ -153,6 +152,8 @@ endif ()
message (STATUS "Building for: ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_PROCESSOR} ${CMAKE_LIBRARY_ARCHITECTURE} ; USE_STATIC_LIBRARIES=${USE_STATIC_LIBRARIES} MAKE_STATIC_LIBRARIES=${MAKE_STATIC_LIBRARIES} UNBUNDLED=${UNBUNDLED}")
include(GNUInstallDirs)
include (cmake/find_openssl.cmake)
include (cmake/find_icu4c.cmake)
include (cmake/find_boost.cmake)

View File

@ -93,7 +93,7 @@ if (MAKE_STATIC_LIBRARIES)
else ()
add_library(dbms SHARED ${dbms_headers} ${dbms_sources})
set_target_properties (dbms PROPERTIES SOVERSION ${VERSION_MAJOR} VERSION ${VERSION_SO} OUTPUT_NAME clickhouse)
install (TARGETS dbms LIBRARY DESTINATION lib COMPONENT clickhouse)
install (TARGETS dbms LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT clickhouse)
endif ()
@ -187,9 +187,10 @@ target_include_directories (dbms
)
if (ENABLE_TESTS)
add_subdirectory (tests)
# attach all dbms gtest sources
grep_gtest_sources(${ClickHouse_SOURCE_DIR}/dbms dbms_gtest_sources)
add_executable(unit_tests_dbms ${dbms_gtest_sources})
target_link_libraries(unit_tests_dbms gtest_main dbms)
add_check(unit_tests_dbms)
endif()
endif ()

View File

@ -1 +1,3 @@
add_subdirectory(tests)
if(ENABLE_TESTS)
add_subdirectory(tests)
endif()

View File

@ -7,4 +7,4 @@ target_link_libraries (clickhouse-benchmark dbms ${Boost_PROGRAM_OPTIONS_LIBRARY
if (ENABLE_TESTS)
add_subdirectory (tests)
endif (ENABLE_TESTS)
endif ()

View File

@ -1,3 +1,3 @@
if (ENABLE_TESTS)
add_subdirectory (tests)
endif (ENABLE_TESTS)
endif ()

View File

@ -1,3 +1,3 @@
if (ENABLE_TESTS)
add_subdirectory (tests)
endif (ENABLE_TESTS)
endif ()

View File

@ -1,3 +1,3 @@
if (ENABLE_TESTS)
add_subdirectory (tests)
endif (ENABLE_TESTS)
endif ()

View File

@ -1,3 +1,3 @@
if (ENABLE_TESTS)
add_subdirectory (tests)
endif (ENABLE_TESTS)
endif ()

View File

@ -1,3 +1,3 @@
if (ENABLE_TESTS)
add_subdirectory (tests)
endif (ENABLE_TESTS)
endif ()

View File

@ -1,3 +1,3 @@
if (ENABLE_TESTS)
add_subdirectory (tests)
endif (ENABLE_TESTS)
endif ()

View File

@ -40,4 +40,4 @@ configure_file (${ClickHouse_SOURCE_DIR}/dbms/src/Interpreters/config_compile.h.
if (ENABLE_TESTS)
add_subdirectory (tests)
endif (ENABLE_TESTS)
endif ()

View File

@ -1,3 +1,3 @@
if (ENABLE_TESTS)
add_subdirectory (tests)
endif (ENABLE_TESTS)
endif ()

View File

@ -23,11 +23,11 @@ target_link_libraries(clickhouse
clickhouse-local
clickhouse-benchmark
clickhouse-extract-from-config)
INSTALL(TARGETS clickhouse RUNTIME DESTINATION bin COMPONENT clickhouse)
INSTALL(TARGETS clickhouse RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse)
# make symbolic links to concrete clickhouse applications
macro(install_symlink_to_clickhouse app)
INSTALL(CODE "execute_process(COMMAND ln -sf clickhouse ${app} WORKING_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin\" )" COMPONENT ${app})
INSTALL(CODE "execute_process(COMMAND ln -sf clickhouse ${app} WORKING_DIRECTORY \"${CMAKE_INSTALL_FULL_BINDIR}\" )" COMPONENT ${app})
endmacro(install_symlink_to_clickhouse)
install_symlink_to_clickhouse(clickhouse-server)

View File

@ -2,4 +2,4 @@ add_subdirectory (System)
if (ENABLE_TESTS)
add_subdirectory (tests)
endif (ENABLE_TESTS)
endif ()

2
debian/clickhouse-client.postinst vendored Normal file
View File

@ -0,0 +1,2 @@
mkdir -p /etc/clickhouse-client/conf.d
chown -R clickhouse: /etc/clickhouse-client

View File

@ -1,5 +1,4 @@
/usr/bin/clickhouse
/usr/bin/clickhouse-server
/etc/init.d/clickhouse-server
/etc/cron.d/clickhouse-server
/usr/share/clickhouse/*

1
debian/clickhouse-server-base.links vendored Normal file
View File

@ -0,0 +1 @@
/usr/bin/clickhouse /usr/bin/clickhouse-server

2
debian/compat vendored
View File

@ -1 +1 @@
5
9

56
debian/control vendored Normal file
View File

@ -0,0 +1,56 @@
Source: clickhouse
Priority: optional
Maintainer: Alexey Milovidov <milovidov@yandex-team.ru>
Build-Depends: debhelper (>= 9), cmake, gcc-6, g++-6,
libicu-dev, libreadline-dev, default-libmysqlclient-dev | libmysqlclient-dev, unixodbc-dev,
libglib2.0-dev, libltdl-dev, libssl-dev
Standards-Version: 3.8.0
Section: libs
Package: clickhouse-compressor
Section: libdevel
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: clickhouse-compressor
Package: clickhouse-client
Section: libdevel
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, clickhouse-server-base (= ${binary:Version})
Description: Client binary for clickhouse
Yandex ClickHouse is a column-oriented database management system
that allows generating analytical data reports in real time.
.
This package provides clickhouse-client , clickhouse-local and clickhouse-benchmark
Package: clickhouse-server-base
Section: libdevel
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
Description: Server binary for clickhouse
Yandex ClickHouse is a column-oriented database management system
that allows generating analytical data reports in real time.
.
This package provides clickhouse common configuration files
Package: clickhouse-server-common
Section: libdevel
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, clickhouse-server-base (= ${binary:Version})
Description: clickhouse-server-common
Common configuration files for clickhouse-server-base package
Package: clickhouse-common-dbg
Architecture: any
Section: debug
Priority: extra
Depends: ${misc:Depends}, clickhouse-server-base (= ${binary:Version})
Description: debugging symbols for clickhouse-server-base
This package contains the debugging symbols for clickhouse-server-base.
Package: clickhouse-server-metrika
Section: libdevel
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, clickhouse-server-base (= ${binary:Version})
Description: clickhouse-server-metrika
Configuration files specific for Metrika project for clickhouse-server-base package

8
debian/control.in vendored
View File

@ -1,8 +0,0 @@
Source: clickhouse
Priority: optional
Maintainer: Alexey Milovidov <milovidov@yandex-team.ru>
Build-Depends: debhelper (>= 5), cmake, gcc-6, g++-6,
libicu-dev, libreadline-dev, libmysqlclient-dev, unixodbc-dev,
libglib2.0-dev, libltdl-dev, libssl-dev
Standards-Version: 3.8.0
Section: libs

3
debian/daemons vendored
View File

@ -1,3 +0,0 @@
clickhouse-compressor
clickhouse-client
clickhouse-server

201
debian/rules vendored
View File

@ -2,172 +2,83 @@
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
ifndef THREADS_COUNT
THREADS_COUNT=`nproc || grep -c ^processor /proc/cpuinfo`
endif
export DH_VERBOSE=1
BUILD_TARGETS=clickhouse $(DAEMONS)
# -pie only for static mode
export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie
DEB_COMPILER_VERSION ?= -6
DEB_CC ?= gcc
DEB_CXX ?= g++
# because copy_headers.sh have hardcoded path to build/include_directories.txt
BUILDDIR = build
DESTDIR = debian/tmp
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
#TODO: why it not working? (maybe works in debhelper 10+)
#ifndef THREADS_COUNT
# THREADS_COUNT:=$(shell nproc || grep -c ^processor /proc/cpuinfo)
#endif
#DEB_BUILD_OPTIONS+=parallel=$(THREADS_COUNT)
DEB_CC ?= gcc-6
DEB_CXX ?= g++-6
DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
CC := $(DEB_CC)$(DEB_COMPILER_VERSION)
CXX := $(DEB_CXX)$(DEB_COMPILER_VERSION)
CC := $(DEB_CC)
CXX := $(DEB_CXX)
else
CC := $(DEB_HOST_GNU_TYPE)-$(DEB_CC)$(DEB_COMPILER_VERSION)
CXX := $(DEB_HOST_GNU_TYPE)-$(DEB_CXX)$(DEB_COMPILER_VERSION)
CC := $(DEB_HOST_GNU_TYPE)-$(DEB_CC)
CXX := $(DEB_HOST_GNU_TYPE)-$(DEB_CXX)
endif
CMAKE_FLAGS ?= -DCMAKE_CXX_COMPILER=`which $(CXX)` -DCMAKE_C_COMPILER=`which $(CC)` -DCMAKE_INSTALL_PREFIX=/usr $(CMAKE_FLAGS_ADD)
CMAKE_FLAGS ?= -DCMAKE_CXX_COMPILER=`which $(CXX)` -DCMAKE_C_COMPILER=`which $(CC)` -DENABLE_TESTS=0 $(CMAKE_FLAGS_ADD)
ifdef CMAKE_BUILD_TYPE
CMAKE_FLAGS += -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
endif
%:
dh $@ --parallel --buildsystem=cmake --builddirectory=$(BUILDDIR)
ifdef USE_STATIC_LIBRARIES
CMAKE_FLAGS += -DUSE_STATIC_LIBRARIES=$(USE_STATIC_LIBRARIES)
endif
override_dh_auto_configure:
dh_auto_configure -- $(CMAKE_FLAGS)
configure-stamp:
dh_testdir
rm -rf build
make clean 1> /dev/null 2>&1 || echo "Nothing to clean"
rm -f CMakeCache.txt
mkdir -p build
touch configure-stamp
override_dh_auto_test:
#TODO, use ENABLE_TESTS=1
#./debian/tests_wrapper.sh
build: build-stamp
build-stamp: configure-stamp
dh_testdir
# если не задан тип сборки запускаем cmake без указания типа, если задан - передаём его
# for building Debug run: debuild -e CMAKE_BUILD_TYPE=Debug
# for building with shared libs run: debuild -e USE_STATIC_LIBRARIES=0
cd build && pwd && cmake .. $(CMAKE_FLAGS)
# TODO: возможно надо исправить
# последовательно запускаем make для каждой из целей.
# т.к. при параллельном запуске (make target1 target2) несколько раз одновременно создаются бинарники
# и возникает raise с custom_command, использующие эти бинарники
for target in ${BUILD_TARGETS}; do $(MAKE) -j$(THREADS_COUNT) -C build $$target || exit $$?; done
touch $@
clean:
dh_testdir
dh_testroot
rm -f configure-stamp build-stamp
rm -rf build
# Удалим созданные для dh_installinit файлы
find ./debian/ -name "*.init" -type l -delete
# Удалим созданные для dh_installcron файлы
find ./debian/ -name "*.cron.d" -type f -delete
# Удалим созданные ссылки на файлы документации
find ./debian/ -name "*.docs" -type l -delete
rm -f ./debian/copyright
# Удалим созданные *.install файлы
for DAEMON_PKG in ${DAEMONS}; do AUTO=`grep "# automatically created" debian/$$DAEMON_PKG.install`; if [ "x$$AUTO" != "x" ]; then rm -f debian/$$DAEMON_PKG.install; fi; done
override_dh_clean:
rm -rf $(BUILDDIR)
rm -rf $(DESTDIR)
rm -rf debian/copyright debian/clickhouse-server-base.docs debian/clickhouse-server-common.docs
dh_clean
install: build
dh_testdir
dh_testroot
dh_prep
cd build && \
for target in ${BUILD_TARGETS}; do DESTDIR=../debian/tmp cmake -DCOMPONENT=$$target -P cmake_install.cmake; done
# Создаём нужные файлы для dh_installinit, т.к. он их понимает только внутри debian/
for I in debian/tmp/etc/init.d/*; do echo $$I; ln -s tmp/etc/init.d/`basename $$I` debian/`basename $$I`.init; done
# Хотим, чтобы для пакета clickhouse-server-base init file назывался clickhouse-server
if [ -e debian/tmp/etc/init.d/clickhouse-server ]; then ln -s tmp/etc/init.d/clickhouse-server debian/clickhouse-server-base.clickhouse-server.init; fi
# создаем дефолтный cron, если нет крон-файла созданного пользователем
# cron_name имеет вид daemonname
# Для ClickHouse не должно быть лишних зависимостей.
# Making necessary *.install files
for DAEMON_PKG in ${DAEMONS}; do \
if [ ! -e "debian/$$DAEMON_PKG.install" ]; then \
echo "# automatically created" > debian/$$DAEMON_PKG.install; \
echo "/etc/$$DAEMON_PKG/config.xml" >> debian/$$DAEMON_PKG.install; \
echo "/usr/bin/$$DAEMON_PKG" >> debian/$$DAEMON_PKG.install; \
echo "/etc/cron.d/$$DAEMON_PKG" >> debian/$$DAEMON_PKG.install; \
if [ -e "debian/tmp/etc/monrun/conf.d/$$DAEMON_PKG.conf" ]; then \
echo "/etc/monrun/conf.d/$$DAEMON_PKG.conf" >> debian/$$DAEMON_PKG.install; \
fi;\
fi; \
done
# Making necessary *.postinst files
for DAEMON_PKG in ${DAEMONS}; do \
if [ ! -e "debian/$$DAEMON_PKG.postinst" ]; then \
echo "# automatically created" > debian/$$DAEMON_PKG.postinst; \
echo "mkdir -p /etc/$$DAEMON_PKG/conf.d" >> debian/$$DAEMON_PKG.postinst; \
echo "chown -R clickhouse: /etc/$$DAEMON_PKG" >> debian/$$DAEMON_PKG.postinst; \
if [ -e "debian/tmp/etc/init.d/$$DAEMON_PKG" ]; then \
if echo $$DAEMON_PKG | grep server > /dev/null; then\
echo "update-rc.d $$DAEMON_PKG defaults > /dev/null || exit \$$?" >> debian/$$DAEMON_PKG.postinst; \
else\
echo "update-rc.d $$DAEMON_PKG start 30 2 3 4 5 . stop 70 0 1 6 . > /dev/null || exit \$$?" >> debian/$$DAEMON_PKG.postinst; \
fi\
fi\
\
else \
echo >> debian/$$DAEMON_PKG.postinst; \
echo "mkdir -p /etc/$$DAEMON_PKG/conf.d; chown -R clickhouse: /etc/$$DAEMON_PKG" >> debian/$$DAEMON_PKG.postinst; \
fi; \
done
# In case building clickhouse-server, adding to package binary of clang, ld and header files - for dynamic compilation.
mkdir -p debian/tmp/usr/share/clickhouse/bin debian/tmp/usr/share/clickhouse/headers
debian/copy_clang_binaries.sh debian/tmp/usr/share/clickhouse/bin/
./copy_headers.sh . debian/tmp/usr/share/clickhouse/headers
override_dh_strip:
dh_strip -pclickhouse-server-base --dbg-package=clickhouse-common-dbg
override_dh_install:
# Making docs
cp LICENSE debian/copyright
for DAEMON_PKG in ${DAEMONS}; do \
echo "LICENSE" > debian/$$DAEMON_PKG.docs; \
echo "AUTHORS" >> debian/$$DAEMON_PKG.docs; \
echo "README.md" >> debian/$$DAEMON_PKG.docs; \
done
ln -sf clickhouse-server-base.docs debian/clickhouse-client.docs
ln -sf clickhouse-server-base.docs debian/clickhouse-server-common.docs
ln -sf clickhouse-server-base.docs debian/clickhouse-server-metrika.docs
ln -s clickhouse-server.docs debian/clickhouse-server-base.docs
ln -s clickhouse-server.docs debian/clickhouse-server-common.docs
ln -s clickhouse-server.docs debian/clickhouse-server-metrika.docs
mkdir -p $(DESTDIR)/etc/security/limits.d
cp debian/clickhouse.limits $(DESTDIR)/etc/security/limits.d/clickhouse.conf
mkdir -p debian/tmp/etc/security/limits.d
cp tools/etc/security/limits.d/clickhouse.conf debian/tmp/etc/security/limits.d
mkdir -p debian/tmp/etc/init.d
cp tools/etc/init.d/clickhouse-server debian/tmp/etc/init.d
mkdir -p debian/tmp/etc/cron.d
cp tools/etc/cron.d/clickhouse-server debian/tmp/etc/cron.d
# todo: remove after renaming package:
mkdir -p $(DESTDIR)/etc/init.d
cp debian/clickhouse-server.init $(DESTDIR)/etc/init.d/clickhouse-server
mkdir -p $(DESTDIR)/etc/cron.d
cp debian/clickhouse-server.cron.d $(DESTDIR)/etc/cron.d/clickhouse-server
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# In case building clickhouse-server, adding to package binary of clang, ld and header files - for dynamic compilation.
mkdir -p $(DESTDIR)/usr/share/clickhouse/bin $(DESTDIR)/usr/share/clickhouse/headers
debian/copy_clang_binaries.sh $(DESTDIR)/usr/share/clickhouse/bin/
./copy_headers.sh . $(DESTDIR)/usr/share/clickhouse/headers
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installdocs
dh_installinit --no-start --no-package=clickhouse-server-base
dh_installinit --no-start --package=clickhouse-server-base --name=clickhouse-server
dh_installcron
dh_installdirs
dh_installchangelogs
dh_install --sourcedir=debian/tmp
dh_link
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps --exclude=clang --exclude=stdc --exclude=ld
dh_gencontrol
dh_md5sums
dh_builddeb -- -Zgzip -z3
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
# fake metrika files when private dir is empty
mkdir -p debian/tmp/etc/clickhouse-server/metrika
touch debian/tmp/etc/clickhouse-server/metrika/config.xml
touch debian/tmp/etc/clickhouse-server/metrika/users.xml
dh_install --list-missing --sourcedir=$(DESTDIR)

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)

30
debian/tests_wrapper.sh vendored Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
set -o errexit
set -o pipefail
ln -sf clickhouse build/dbms/src/Server/clickhouse-server
ln -sf clickhouse build/dbms/src/Server/clickhouse-client
ln -sf clickhouse build/dbms/src/Server/clickhouse-local
# Start a local clickhouse server which will be used to run tests
PWD=$(pwd)
echo ${PWD}
PATH=$PATH:./build/dbms/src/Server \
./build/dbms/src/Server/clickhouse-server --config-file=./debian/clickhouse-server-config-tests.xml 2>/dev/null &
CH_PID=$!
# Define needed stuff to kill test clickhouse server after tests completion
function finish {
kill $CH_PID
wait
rm -rf /tmp/clickhouse
rm -f build/dbms/src/Server/clickhouse-local
rm -f build/dbms/src/Server/clickhouse-client
rm -f build/dbms/src/Server/clickhouse-server
}
trap finish EXIT
# Do tests
cd dbms/tests
PATH=$PATH:../../build/dbms/src/Server \
./clickhouse-test -c ../../build/dbms/src/Server/clickhouse-client

6
debian/watch vendored Normal file
View File

@ -0,0 +1,6 @@
version=4
opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)-stable\.tar\.gz%clickhouse-$1.tar.gz%" \
https://github.com/yandex/clickhouse/tags \
(?:.*?/)?v?(\d[\d.]*)-stable\.tar\.gz debian uupdate

View File

@ -87,4 +87,4 @@ target_link_libraries (
if (ENABLE_TESTS)
add_subdirectory (src/tests)
endif (ENABLE_TESTS)
endif ()

View File

@ -1,3 +1,5 @@
include (${ClickHouse_SOURCE_DIR}/cmake/add_check.cmake)
include_directories (${CMAKE_CURRENT_BINARY_DIR})
add_executable (date_lut_init date_lut_init.cpp)

View File

@ -51,4 +51,4 @@ target_link_libraries (mysqlxx common ${MYSQLCLIENT_LIB} ${OPENSSL_LIBRARIES} ${
if (ENABLE_TESTS)
add_subdirectory (src/tests)
endif (ENABLE_TESTS)
endif ()

View File

@ -1,3 +1,3 @@
if (ENABLE_TESTS)
add_subdirectory (tests)
endif (ENABLE_TESTS)
endif ()

16
release
View File

@ -38,14 +38,6 @@ do
fi
done
# List of daemons to build could be specified in command line arguments.
if [ $# -gt 0 ]
then
DAEMONS="$@"
else
DAEMONS="$(echo `cat debian/daemons`)"
fi
if [[ $TEST != 'yes' ]]
then
# now incrementing done in external release scripts via --version
@ -56,14 +48,12 @@ fi
echo -e "\nCurrent revision is $REVISION"
make_control "$CONTROL" "$DAEMONS"
gen_changelog "$REVISION" "$CHDATE" "$AUTHOR" "$CHLOG" "$DAEMONS"
gen_changelog "$REVISION" "$CHDATE" "$AUTHOR" "$CHLOG"
# Build (only binary packages).
debuild -e DAEMONS="${DAEMONS}" -e DEB_CC -e DEB_CXX -e DEB_COMPILER_VERSION -e CMAKE_FLAGS_ADD -b ${DEBUILD_NOSIGN_OPTIONS} ${DEBUILD_NODEPS_OPTIONS}
debuild -eDEB_BUILD_OPTIONS=parallel=`nproc || grep -c ^processor /proc/cpuinfo` -e DEB_CC -e DEB_CXX -e CMAKE_FLAGS_ADD -b ${DEBUILD_NOSIGN_OPTIONS} ${DEBUILD_NODEPS_OPTIONS}
if [[ $STANDALONE != 'yes' ]]
then
upload_debs "$REVISION" "$DAEMONS"
upload_debs "$REVISION"
fi

View File

@ -3,58 +3,9 @@ function get_revision {
grep "set(VERSION_REVISION" ${BASEDIR}/dbms/cmake/version.cmake | sed 's/^.*VERSION_REVISION \(.*\))$/\1/'
}
function add_daemon_impl {
local daemon=$1
local control=$CONTROL
local dependencies=$2
local description_short="${daemon%/ daemon}"
local description_full=$3
echo -e "\n\n" >> $control;
echo "Package: $daemon" >> $control;
echo "Section: libdevel" >> $control;
echo "Architecture: any" >> $control;
echo -n "Depends: \${shlibs:Depends}, \${misc:Depends}" >> $control;
for dependency in $dependencies
do
echo -n ", $dependency" >> $control
done
echo >> $control
echo "Description: $description_short" >> $control;
echo " $description_full" >> $control;
}
# Создаём файл control из control.in.
# добавляет в файл CONTROL секции для демонов из DAEMONS
# remove me after fixing all testing-building scripts
function make_control {
local CONTROL="$1"
local DAEMONS="$2"
rm -f $CONTROL
cp -f $CONTROL.in $CONTROL
for DAEMON_PKG in $DAEMONS
do
case "$DAEMON_PKG" in
'clickhouse-server' )
add_daemon_impl clickhouse-server-base 'adduser' 'clickhouse-server binary'
[ -n "$BUILD_PACKAGE_FOR_METRIKA" ] && add_daemon_impl clickhouse-server-metrika "clickhouse-server-base(=1.1.$REVISION)" 'Configuration files specific for Metrika project for clickhouse-server-base package'
add_daemon_impl clickhouse-server-common "clickhouse-server-base(=1.1.$REVISION)" 'Common configuration files for clickhouse-server-base package'
;;
'clickhouse-client' )
add_daemon_impl clickhouse-client "clickhouse-server-base(=1.1.$REVISION)" "ClickHouse client and additional tools such as clickhouse-local and clickhouse-benchmark."
;;
'clickhouse-benchmark' )
#skip it explicitly
;;
'clickhouse-local' )
#skip it explicitly
;;
* )
add_daemon_impl "${DAEMON_PKG}"
;;
esac
done
true
}
# Генерируем номер ревизии.
@ -133,7 +84,6 @@ function gen_changelog {
CHDATE="$2"
AUTHOR="$3"
CHLOG="$4"
DAEMONS="$5"
sed \
-e "s/[@]REVISION[@]/$REVISION/g" \
@ -147,7 +97,6 @@ function gen_changelog {
# рабочая директория - где лежит сам скрипт
function upload_debs {
REVISION="$1"
DAEMONS="$2"
# Определим репозиторий, в который надо загружать пакеты. Он соответствует версии Ubuntu.
source /etc/lsb-release

View File

@ -2,7 +2,7 @@
add_executable (clickhouse-compressor main.cpp)
target_link_libraries (clickhouse-compressor dbms ${Boost_PROGRAM_OPTIONS_LIBRARY})
install (TARGETS clickhouse-compressor RUNTIME DESTINATION bin COMPONENT clickhouse-compressor)
install (TARGETS clickhouse-compressor RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse-compressor)
add_executable (zstd_test zstd_test.cpp)
target_link_libraries (zstd_test ${ZSTD_LIBRARY})

View File

@ -1,4 +1,4 @@
add_executable (config-processor config-processor.cpp)
target_link_libraries (config-processor dbms zkutil dbms)
INSTALL(TARGETS config-processor RUNTIME DESTINATION bin COMPONENT config-processor)
INSTALL(TARGETS config-processor RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT config-processor)

View File

@ -6,4 +6,4 @@ add_executable(corrector_utf8 corrector_utf8.cpp)
target_link_libraries (corrector_utf8 dbms)
add_dependencies(corrector_utf8 dbms)
INSTALL( TARGETS corrector_utf8 RUNTIME DESTINATION bin COMPONENT corrector_utf8)
install( TARGETS corrector_utf8 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT corrector_utf8)