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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
|
#!/usr/bin/make -f
export CARGO_HOME=$(shell pwd)/debian/cargo_home
export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/pkg-info.mk
# Get the default Python version
PY3VERSION = $(shell py3versions -d -v)
export PYBUILD_NAME=breezy
%:
dh $@ --with python3,sphinxdoc,bash_completion --buildsystem=pybuild
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
CONCURRENCY = BRZ_CONCURRENCY=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
override_dh_auto_test:
[ -d debian/brzhome ] || mkdir debian/brzhome
$(CONCURRENCY) \
BRZ_HOME=debian/brzhome \
BRZ_PLUGIN_PATH=-site:-user \
LC_ALL=C.UTF-8 \
PYTHONWARNINGS=ignore::ResourceWarning \
PYTHONPATH=$(CURDIR)/.pybuild/cpython3_$(PY3VERSION)_breezy/build \
python$(PY3VERSION) -m breezy selftest -v \
-Oselftest.timeout=6000 -x bash_completion -x zsh_completion \
-x breezy.tests.test_script.TestExecution \
-x breezy.tests.test_transport.TestSSHConnections.test_bzr_connect_to_bzr_ssh -x test_export_pot \
-x breezy.tests.blackbox.test_branch.TestRemoteBranch.test_branch_local_remote \
-x breezy.tests.blackbox.test_branch.TestRemoteBranch.test_branch_remote_remote \
-x breezy.tests.test_gpg \
-x breezy.tests.test_plugins \
-x test_build_and_install
override_dh_auto_clean:
dh_auto_clean
rm -rf debian/brzhome
rm -f brzlib/*_pyx.c
# It also doesn't really clean every thing...
ls doc/en/user-reference/*txt | grep -v readme.txt | xargs rm -rf
rm -rf doc/developers/make.bat \
doc/developers/Makefile \
doc/*/_build/ \
doc/en/release-notes/index.txt
-mv Cargo.lock.bak Cargo.lock
override_dh_install:
dh_install
for py in $(shell py3versions -r); do \
mkdir -p debian/python3-breezy.tests/usr/lib/$$py/dist-packages/breezy; \
mv debian/python3-breezy/usr/lib/$$py/dist-packages/breezy/tests \
debian/python3-breezy.tests/usr/lib/$$py/dist-packages/breezy/tests; \
done
# Install the documentation; since html and txt and intermixed
# under doc/, this is handier than trying to do it from brz-doc.install.
( cd doc && find -name "*.txt" -not -wholename "*/_build/*" -print0 ) | \
xargs -r0 -i'{}' -n1 install -D -m 644 'doc/{}' \
"debian/brz-doc/usr/share/doc/brz/txt/{}"
rm debian/python3-breezy/usr/man/man1/brz.1 \
debian/python3-breezy/usr/man/man1/git-remote-bzr.1 \
debian/python3-breezy/usr/bin/bzr-receive-pack \
debian/python3-breezy/usr/bin/brz \
debian/python3-breezy/usr/bin/bzr-upload-pack \
debian/python3-breezy/usr/bin/git-remote-bzr
rmdir debian/python3-breezy/usr/man/man1 \
debian/python3-breezy/usr/man
rm debian/python3-breezy-dbg/usr/man/man1/brz.1 \
debian/python3-breezy-dbg/usr/man/man1/git-remote-bzr.1 \
debian/python3-breezy-dbg/usr/bin/bzr-receive-pack \
debian/python3-breezy-dbg/usr/bin/brz \
debian/python3-breezy-dbg/usr/bin/bzr-upload-pack \
debian/python3-breezy-dbg/usr/bin/git-remote-bzr
rmdir debian/python3-breezy-dbg/usr/man/man1 \
debian/python3-breezy-dbg/usr/man
override_dh_auto_build:
-mv Cargo.lock Cargo.lock.bak
dh_auto_build
PYTHONHASHSEED=0 $(MAKE) docs-sphinx
override_dh_compress:
dh_compress -X.xvg -X.pdf
override_dh_strip:
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
dh_strip -ppython3-breezy
endif
override_dh_link:
# symlink identical resources.
( cd debian/brz-doc/usr/share/doc && fdupes -o name -r1q . | while read s; do \
set -- $$(echo $$s | tr ' ' '\n' | sort); \
f=$$1; shift; \
for d; do \
ln -sf /usr/share/doc/"$$d" "$$f"; \
done; \
done )
dh_link
override_dh_sphinxdoc:
ifneq "$(shell dh_listpackages | grep -- -doc)" ""
dh_sphinxdoc -X searchtools.js
endif
# dh_sphinxdoc chokes if we delete the extra licence files before it runs.
find debian/brz-doc/usr/share/doc/brz -name "licence.txt" -print | xargs rm -f
|