File: rules

package info (click to toggle)
python-stetl 2.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 90,156 kB
  • sloc: python: 5,103; xml: 707; sql: 430; makefile: 154; sh: 65
file content (51 lines) | stat: -rwxr-xr-x 1,177 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export PYBUILD_NAME=stetl
export PYBUILD_BEFORE_TEST=cp -r {dir}/tests {build_dir}
export PYBUILD_AFTER_TEST=rm -rf {build_dir}/tests
export PYBUILD_TEST_ARGS=--verbose

include /usr/share/dpkg/pkg-info.mk

BUILD_DATE=$(shell LC_ALL=C date -u "+%d %B %Y" -d "@$(SOURCE_DATE_EPOCH)")

MANPAGES := $(wildcard debian/man/*.*.xml)

%:
	dh $@ \
		--buildsystem=pybuild \
		--with python3,sphinxdoc

override_dh_clean:
	dh_clean debian/man/*.1

override_dh_auto_clean:
	dh_auto_clean
	(cd docs && make clean)

override_dh_auto_build:
	# Create man page from DocBook XML
	for x in $(MANPAGES) ; do \
	    docbook2x-man --string-param header-3="$(BUILD_DATE)" $$x ; \
	    mv `basename $$x | sed 's/.xml$$//'` `dirname $$x` ; \
	done

	dh_auto_build
	(cd docs && make html)

override_dh_auto_install:
	dh_auto_install

	# Move usr/bin/stetl to stetl package
	mkdir -p debian/stetl/usr
	mv debian/python3-stetl/usr/bin debian/stetl/usr

override_dh_installexamples:
	dh_installexamples

	# Remove executable bit
	find debian/*/usr/share/doc/*/examples/ -type f -exec chmod 644 {} \;