summaryrefslogtreecommitdiffstats
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules54
1 files changed, 54 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..ee68b32
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,54 @@
+#!/usr/bin/make -f
+
+export PYBUILD_NAME=powerline
+
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
+BUILD_DATE=$(shell LC_ALL=C date -u "+%B %d, %Y" -d "@$(SOURCE_DATE_EPOCH)")
+
+%:
+ dh $@ --with python3,sphinxdoc --buildsystem=pybuild
+
+update-changelog:
+ curl -s "https://api.github.com/repos/powerline/powerline/releases" | jq -r '.[] | .tag_name, .body' - > debian/changelog.upstream
+
+# 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