#!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 UVERSION := $(shell dpkg-parsechangelog | sed -n -e's/^Version: \(.*\)-[^-]\+/\1/p' | cut -d ":" -f 2) PACKAGE_NAME := $(shell dpkg-parsechangelog | sed -n -e's/^Source: \(.*\)\+/\1/p') export PYBUILD_NAME=$(PACKAGE_NAME) export ROOT_PATH=$(CURDIR) %: dh $@ --with python2,bash-completion --buildsystem=pybuild override_dh_clean: dh_clean rm -rf cache rm -f .doit.db rm -f _nikola_zsh rm -f _nikola_bash rm -rf debian/dpackaging_site rm -f debian/source/include-binaries override_dh_bash-completion: ./debian/nikola.sh init -q debian/dpackaging_site cd debian/dpackaging_site/ && ../nikola.sh tabcompletion --shell bash --hardcode-tasks > ../../_nikola_bash cd debian/dpackaging_site/ && ../nikola.sh tabcompletion --shell zsh --hardcode-tasks > ../../_nikola_zsh dh_bash-completion cp _nikola_zsh debian/nikola/usr/share/zsh/functions/Completion/Linux/_nikola override_dh_auto_install: dh_auto_install # Remove copy of licenses find debian/nikola/usr/lib -name "MIT-LICENSE.txt" -type f -exec rm {} + find debian/nikola -name "LICENSE.txt" -type f -exec rm {} + # Drop wrong permission find debian/nikola/usr/lib -perm /a+x -type f -exec chmod -x {} + override_dh_installdocs: rst2html docs/manual.txt debian/nikola/usr/share/doc/nikola/manual.html rst2html docs/theming.txt debian/nikola/usr/share/doc/nikola/theming.html rst2html docs/creating-a-theme.txt debian/nikola/usr/share/doc/nikola/creating-a-theme.html rst2html docs/extending.txt debian/nikola/usr/share/doc/nikola/extending.html dh_installdocs override_dh_auto_test: get-orig-source: @if [ ! -d "debian" ] ; then \ echo 'Run this from the top directory of the Debian source' >&2; \ exit 1; \ fi mkdir -p ../tmp/nikola_$(UVERSION) wget https://github.com/getnikola/nikola/archive/v$(UVERSION).tar.gz \ -O ../tmp/nikola_$(UVERSION).tar.gz; tar xf ../tmp/nikola_$(UVERSION).tar.gz \ -C ../tmp/nikola_$(UVERSION) \ '--exclude=*min.*' \ '--exclude=*bootstrap3*' \ '--exclude=*bootstrap.js' \ '--exclude=*bootstrap.css' \ '--exclude=*bootstrap-responsive.css' \ '--exclude=*glyphicons-halflings*.png'; tar -C ../tmp/nikola_$(UVERSION) nikola-$(UVERSION) -c --xz -f ../nikola_$(UVERSION).orig.tar.xz