diff options
Diffstat (limited to '')
-rwxr-xr-x | debian/rules | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..5cfde13 --- /dev/null +++ b/debian/rules @@ -0,0 +1,66 @@ +#!/usr/bin/make -f + +export PYBUILD_NAME=powerline + +include /usr/share/dpkg/default.mk + +export DEB_BUILD_MAINT_OPTIONS = hardening=+all +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk +include /usr/share/dpkg/pkg-info.mk + +BUILD_DATE=$(shell LC_ALL=C date -u "+%B %d, %Y" -d "@$(SOURCE_DATE_EPOCH)") + +%: + dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild + +update-changelog: + curl -s "https://api.github.com/repos/powerline/powerline/releases" | jq -r '.[] | .tag_name, .body' - > debian/changelog.upstream + +# Use the builtin test script +override_dh_auto_test: + # Tests systematically fail for unknown reasons, hence are disabled + # temporarily while the situation is investigated. + # See https://github.com/powerline/powerline/issues/1104 + #dh_auto_test -- --system=custom --test-args='env PYTHON={interpreter} PYTHONPATH={build_dir} {dir}/tests/test.sh' + +# Build sphinx HTML documentation +override_dh_installdocs: + PYTHONPATH=. sphinx-build -b html -N docs/source docs/build/html + dh_installdocs -ppowerline-doc docs/build/html + dh_installdocs -A + +override_dh_installchangelogs: + dh_installchangelogs -ppowerline debian/changelog.upstream + dh_installchangelogs -A + +override_dh_installman: + PYTHONPATH=. sphinx-build -D today="$(BUILD_DATE)" -b man -N docs/source docs/build/man + ln -s powerline.1 docs/build/man/powerline-render.1 + dh_installman -p powerline docs/build/man/* + +# Remove scripts and bindings from library packages +override_dh_install: + dh_install -Xscripts/powerline-release.py + rm -rf debian/python*-powerline/usr/bin + rm -rf debian/python*-powerline/usr/lib/*/dist-packages/powerline/bindings/awesome + rm -rf debian/python*-powerline/usr/lib/*/dist-packages/powerline/bindings/bash + rm -rf debian/python*-powerline/usr/lib/*/dist-packages/powerline/bindings/bar + rm -rf debian/python*-powerline/usr/lib/*/dist-packages/powerline/bindings/fish + rm -rf debian/python*-powerline/usr/lib/*/dist-packages/powerline/bindings/i3 + rm -rf debian/python*-powerline/usr/lib/*/dist-packages/powerline/bindings/lemonbar + rm -rf debian/python*-powerline/usr/lib/*/dist-packages/powerline/bindings/qtile + rm -rf debian/python*-powerline/usr/lib/*/dist-packages/powerline/bindings/rc + rm -rf debian/python*-powerline/usr/lib/*/dist-packages/powerline/bindings/shell + rm -rf debian/python*-powerline/usr/lib/*/dist-packages/powerline/bindings/tcsh + rm -rf debian/python*-powerline/usr/lib/*/dist-packages/powerline/bindings/tmux/*.conf + rm -rf debian/python*-powerline/usr/lib/*/dist-packages/powerline/bindings/vim/plugin + rm -rf debian/python*-powerline/usr/lib/*/dist-packages/powerline/bindings/vim/autoload + rm -f debian/python*-powerline/usr/lib/*/dist-packages/powerline/bindings/zsh/powerline.zsh + rm -rf debian/python*-powerline/usr/lib/*/dist-packages/powerline/config_files + +# Remove files generated during build +override_dh_auto_clean: + dh_auto_clean + find . -name "*.pyc" -delete + rm -rf build docs/build .pybuild Powerline.egg-info powerline_status.egg-info scripts/powerline tests/shell |