Skip to content

Commit

Permalink
Debian package build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
proller committed Jan 10, 2017
1 parent 8b96fbd commit 2dc2bc5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
4 changes: 3 additions & 1 deletion debian/control.in
@@ -1,6 +1,8 @@
Source: clickhouse
Priority: optional
Maintainer: Alexey Milovidov <milovidov@yandex-team.ru>
Build-Depends: debhelper (>= 5)
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
29 changes: 26 additions & 3 deletions debian/rules
Expand Up @@ -4,11 +4,33 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
ifndef THREADS_COUNT
THREADS_COUNT=`grep -c ^processor /proc/cpuinfo`
THREADS_COUNT=`nproc || grep -c ^processor /proc/cpuinfo`
endif

BUILD_TARGETS=clickhouse $(DAEMONS)

DEB_GCC_VERSION ?= -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 := gcc$(DEB_GCC_VERSION)
CXX := g++$(DEB_GCC_VERSION)
else
CC := $(DEB_HOST_GNU_TYPE)-gcc$(DEB_GCC_VERSION)
CXX := $(DEB_HOST_GNU_TYPE)-g++$(DEB_GCC_VERSION)
endif

CMAKE_FLAGS ?= -DCMAKE_CXX_COMPILER=`which $(CXX)` -DCMAKE_C_COMPILER=`which $(CC)`

ifdef CMAKE_BUILD_TYPE
CMAKE_FLAGS += -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
endif

ifdef USE_STATIC_LIBRARIES
CMAKE_FLAGS += -DUSE_STATIC_LIBRARIES=$(USE_STATIC_LIBRARIES)
endif

configure-stamp:
dh_testdir
rm -rf build
Expand All @@ -21,8 +43,9 @@ build: build-stamp
build-stamp: configure-stamp
dh_testdir
# если не задан тип сборки запускаем cmake без указания типа, если задан - передаём его
# для сборки в Debug нужно запустить так: debuild -e CMAKE_BUILD_TYPE=Debug
cd build && pwd && if [ -z CMAKE_BUILD_TYPE ]; then cmake ..; else cmake -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) ..; fi
# 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) несколько раз одновременно создаются бинарники
Expand Down

0 comments on commit 2dc2bc5

Please sign in to comment.