#!/usr/bin/make -f
# -*- makefile -*-

#export DH_VERBOSE=1
export PYBUILD_NAME=pydicom

export PYBUILD_AFTER_INSTALL=rm -fr {destdir}/usr/lib/python3*/dist-packages/${PYBUILD_NAME}/data/charset_files/FileInfo.txt; \
                     find {destdir}/usr/lib/python3*/dist-packages/${PYBUILD_NAME} -name 'README*' -delete

%:
	dh $@ --buildsystem=pybuild

execute_before_dh_sphinxdoc:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	cd doc; PYTHONPATH=$(CURDIR)/src sphinx-build -N -b html . $(CURDIR)/debian/python-$(PYBUILD_NAME)-doc/usr/share/doc/python-$(PYBUILD_NAME)-doc/html
	find  $(CURDIR)/debian/python-$(PYBUILD_NAME)-doc/usr/share/doc/python-$(PYBUILD_NAME)-doc/html -type f -exec sed -i 's,$(CURDIR),,g' {} +
endif
