summaryrefslogtreecommitdiffstats
path: root/debian/rules
blob: ee68b32bdd359cba70f132627d164e8be3671792 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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