#!/usr/bin/make -f include /usr/share/dpkg/pkg-info.mk export PYBUILD_NAME=nbsphinx export NBSPHINX_VERSION_RELEASE ?= "$(DEB_VERSION_UPSTREAM) (Debian $(DEB_VERSION))" export NBSPHINX_TODAY_DATETRIPLET ?= "$(shell date -u -d @$(SOURCE_DATE_EPOCH) +%Y-%m-%d)" default: @uscan --no-conf --dehs --report || true %: dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild DEB_SPHINXDOC_DOCHTMLDIR=$(CURDIR)/debian/python-nbsphinx-doc/usr/share/doc/python-nbsphinx/html DEB_SPHINXDOC_HTMLSEDDIR=$(CURDIR)/debian/adhoc/lintian/privacy-breach override_dh_sphinxdoc: ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS))) PYTHONPATH=$(CURDIR)/src python3 -m sphinx -b html doc $(DEB_SPHINXDOC_DOCHTMLDIR) ## lintian privacy-breach fix $(foreach htmlsed,$(wildcard $(DEB_SPHINXDOC_HTMLSEDDIR)/*.html.sed), \ sed -i -f $(htmlsed) $(DEB_SPHINXDOC_DOCHTMLDIR)/$(notdir $(patsubst %.sed,%,$(htmlsed))) $(NEWLINE)\ ) for html in $(DEB_SPHINXDOC_DOCHTMLDIR)/*.html $(DEB_SPHINXDOC_DOCHTMLDIR)/subdir/*.html ; do \ sed -i -f $(DEB_SPHINXDOC_HTMLSEDDIR)/common.sed $$html ;\ done cp -vpr -t $(DEB_SPHINXDOC_DOCHTMLDIR) $(CURDIR)/debian/adhoc/lintian/privacy-breach/www ## lintian duplicate-files fix rm -r -f -v $(DEB_SPHINXDOC_DOCHTMLDIR)/images rdfind -outputname /dev/null -makesymlinks true $(DEB_SPHINXDOC_DOCHTMLDIR) symlinks -r -c -s -v $(DEB_SPHINXDOC_DOCHTMLDIR) ## cf Debian Bug report #739300 ln -s /usr/share/javascript/mathjax $(DEB_SPHINXDOC_DOCHTMLDIR)/_static ## cf d/p/debianization-documentation.patch ln -r -s $(DEB_SPHINXDOC_DOCHTMLDIR)/_sources $(DEB_SPHINXDOC_DOCHTMLDIR)/doc dh_sphinxdoc -O--buildsystem=pybuild endif override_dh_compress: dh_compress -Xwww get-info: @echo "NBSPHINX_VERSION_RELEASE: "$(NBSPHINX_VERSION_RELEASE) @echo "NBSPHINX_TODAY_DATETRIPLET: "$(NBSPHINX_TODAY_DATETRIPLET) define NEWLINE endef