| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
include /usr/share/dpkg/pkg-info.mk |
| 4 |
|
| 5 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 6 |
|
| 7 |
export PYBUILD_AFTER_BUILD=chmod +x {build_dir}/beancount/tools/treeify.py |
| 8 |
|
| 9 |
# Failing tests, need to be solved later |
| 10 |
export PYBUILD_TEST_ARGS=-v -k "not test_export_basic" |
| 11 |
export PYBUILD_BEFORE_TEST=cp -r $(CURDIR)/beancount {build_dir}/beancount; |
| 12 |
export PYBUILD_AFTER_TEST=:; |
| 13 |
|
| 14 |
ifeq ($(PYBUILD_AUTOPKGTEST),1) |
| 15 |
export PYBUILD_TEST_ARGS=-v -k "not test_export_basic and not test_example_files" --pyargs beancount |
| 16 |
export PYBUILD_BEFORE_TEST= |
| 17 |
export PYBUILD_AFTER_TEST= |
| 18 |
endif |
| 19 |
|
| 20 |
%: |
| 21 |
dh $@ --buildsystem pybuild |
| 22 |
|
| 23 |
override_dh_python3: |
| 24 |
dh_python3 --recommends bottle --suggests google-api-python-client --suggests beautifulsoup4 --suggests requests |
| 25 |
|
| 26 |
# Skip generation of specific tools for now, need to be solved later |
| 27 |
execute_after_dh_auto_build: |
| 28 |
ifeq ($(filter nodoc,$(DEB_BUILD_PROFILES)),) |
| 29 |
cd $(CURDIR)/bin; \ |
| 30 |
for binary in *; do \ |
| 31 |
if [ "X$$binary" = "XBUILD" ]; then continue; fi ; \ |
| 32 |
if [ "X$$binary" = "Xbean-check" ]; then continue; fi ; \ |
| 33 |
if [ "X$$binary" = "Xbean-doctor" ]; then continue; fi ; \ |
| 34 |
if [ "X$$binary" = "Xbean-example" ]; then continue; fi ; \ |
| 35 |
if [ "X$$binary" = "Xbean-format" ]; then continue; fi ; \ |
| 36 |
PYTHONPATH=$$(cd $(CURDIR); pybuild --print build_dir --interpreter python3) \ |
| 37 |
help2man \ |
| 38 |
--name "$$(grep $$binary $(CURDIR)/debian/manpages/whatis.txt | cut -f 2)" \ |
| 39 |
--no-info \ |
| 40 |
--help-option=-h \ |
| 41 |
--version-string=$(DEB_VERSION_UPSTREAM) \ |
| 42 |
./$$binary > $(CURDIR)/debian/manpages/$$binary.1 ; \ |
| 43 |
done |
| 44 |
endif |
| 45 |
|
| 46 |
execute_after_dh_auto_clean: |
| 47 |
rm -f debian/manpages/*.1 |
| 48 |
|
| 49 |
override_dh_installexamples: |
| 50 |
dh_installexamples -X __pycache__ -X .picklecache |
| 51 |
|
| 52 |
execute_after_dh_fixperms: |
| 53 |
find debian/*/usr/lib/python*/*-packages/beancount/* -type f -name '*.py' -exec chmod -x {} + |