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 55 56 57 58 59
|
#!/usr/bin/make -f
# -*- makefile -*-
PYTHON3S:=$(shell py3versions -vr)
# Run tests only while building for neurodebian (~nd version suffix)
docheck = $(shell LC_ALL=C dpkg-parsechangelog | grep '^Version:' | cut -d ' ' -f 2,2 | grep -q -e '~nd' && echo "docheck" || echo "nocheck" )
export HOME=$(CURDIR)/build/test
%:
dh $@ --buildsystem=pybuild --with python3,sphinxdoc
override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
PYTHONPATH=. python3 -m sphinx -b html doc/source debian/python-git-doc/usr/share/doc/python-git-doc/html
dh_sphinxdoc
endif
override_dh_auto_install:
set -e ; for pyvers in $(PYTHON3S); do \
python$$pyvers setup.py install --install-layout=deb \
--root $(CURDIR)/debian/python3-git ; \
done
rm -f $(CURDIR)/debian/python*/usr/lib/python*/dist-packages/*.pth
ifeq ($(docheck),docheck)
# unset possibly set fake proxies
export http_proxy=
export https_proxy=
override_dh_auto_test:
: # run tests only if we can fetch original sources repository
-mkdir -p build/test; cd build/test; \
git config --global http.sslVerify false; git config --global user.name "TESTING"; git config --global user.email "TESTING@example.com"; \
git clone git://github.com/gitpython-developers/GitPython; \
cd GitPython; git submodule update --init --recursive; \
for i in `seq 4`; do git reset --hard HEAD~1; done; git reset --hard origin/master; touch ../go
[ ! -e build/test/go ] || \
LC_ALL=C.UTF-8 \
GIT_PYTHON_TEST_GIT_REPO_BASE=$(CURDIR)/build/test/GitPython \
nosetests -s -v git/test
else
override_dh_auto_test:
true
endif
override_dh_auto_clean:
dh_auto_clean
rm -rf build
DOC_VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p' | sed 's/~.*//')
UPSTREAM=$(shell dpkg-parsechangelog | sed -nr 's/Version: (.*)-[^-]*/\1/p')
get-orig-source:
uscan --download-current-version
wget -P get-orig-source http://packages.python.org/GitPython/$(DOC_VERSION)/docs_$(DOC_VERSION).zip
mkdir get-orig-source/doc
unzip -d get-orig-source/doc get-orig-source/docs_$(DOC_VERSION).zip
tar -C get-orig-source -czvf python-git_$(UPSTREAM).orig-doc.tar.gz doc/
rm -rf get-orig-source
|