1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
#!/usr/bin/make -f
# -*- makefile -*-
BUILD_DIR = $(CURDIR)/ycm_build
GIT_URL = https://github.com/Valloric/YouCompleteMe.git
DEB_SOURCE = $(shell dpkg-parsechangelog | grep Source: | sed -e 's/Source: //')
DEB_VERSION = $(shell dpkg-parsechangelog | grep Version: | sed -e 's/Version: //')
DEB_UPSTREAM_COMMIT = $(shell echo $(DEB_VERSION) | sed -rn 's/.*git([^-]*).*/\1/p')
DEB_UPSTREAM_VERSION = $(shell echo $(DEB_VERSION) | sed -e 's/-[^-]*$$//')
DEB_INSTALL_DIR = $(CURDIR)/debian/$(DEB_SOURCE)
%:
dh $@ --with python2 --sourcedirectory=$(CURDIR)/cpp --builddirectory=$(BUILD_DIR) --parallel
override_dh_install:
dh_install
# This file is an executable and it shouldn't be. It's a upstream bug
chmod a-x $(DEB_INSTALL_DIR)/usr/lib/vim-youcompleteme/ycm/completers/cs/cs_completer.py
# No need to install tests
$(RM) -rv $(DEB_INSTALL_DIR)/usr/lib/vim-youcompleteme/ycm/completers/all/tests \
$(DEB_INSTALL_DIR)/usr/lib/vim-youcompleteme/ycm/completers/completer_utils_test.py \
$(DEB_INSTALL_DIR)/usr/lib/vim-youcompleteme/ycm/completers/cpp/tests \
$(DEB_INSTALL_DIR)/usr/lib/vim-youcompleteme/ycm/completers/general/tests \
$(DEB_INSTALL_DIR)/usr/lib/vim-youcompleteme/ycm/server/tests \
$(DEB_INSTALL_DIR)/usr/lib/vim-youcompleteme/ycm/tests \
$(DEB_INSTALL_DIR)/usr/lib/vim-youcompleteme/ycm/test_utils.py
override_dh_auto_test:
dh_auto_test
cd $(BUILD_DIR)/ycm/tests && ./ycm_core_tests
get-orig-source:
TMPDIR=`mktemp -d -t`; \
git clone --recursive $(GIT_URL) $$TMPDIR; \
cd $$TMPDIR; git checkout $(DEB_UPSTREAM_COMMIT); \
tar --exclude=.git \
--exclude=.gitignore \
--exclude=.gitmodules \
--exclude=.travis.yml \
--exclude=cpp/BoostParts \
--exclude=cpp/llvm \
--exclude=cpp/ycm/tests/gmock \
--exclude=python/clang_includes \
--exclude=python/ycm/completers/cs/OmniSharpServer \
--exclude=third_party/argparse \
--exclude=third_party/bottle \
--exclude=third_party/jedi \
--exclude=third_party/pythonfutures \
--exclude=third_party/requests \
--exclude=third_party/waitress \
-czvf $(CURDIR)/$(DEB_SOURCE)_$(DEB_UPSTREAM_VERSION).orig.tar.gz .; \
cd $(CURDIR); \
$(RM) -r $$TMPDIR
|