File: rules

package info (click to toggle)
python-coverage 5.1%2Bdfsg.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,048 kB
  • sloc: python: 21,288; ansic: 1,212; javascript: 1,077; makefile: 217; sh: 106; xml: 42
file content (144 lines) | stat: -rwxr-xr-x 4,411 bytes parent folder | download
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#! /usr/bin/make -f
#
# debian/rules
# Part of the Debian ‘python-coverage’ package.
#
# This is free software, and you are welcome to redistribute it under
# certain conditions; see the end of this file for copyright
# information, grant of license, and disclaimer of warranty.

export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

export PYBUILD_NAME = coverage
export PYBUILD_DISABLE = test
export PYBUILD_SYSTEM = distutils

PYTHON3_PACKAGE_NAME = python3-${PYBUILD_NAME}
PYPY_PACKAGE_NAME = pypy-${PYBUILD_NAME}
package_working_root = debian
package_install_root = debian/{package}

DISTRIBUTION_NAME = coverage

HTMLFILES_DIR = ${DISTRIBUTION_NAME}/htmlfiles
htmlfiles_dirname = $(notdir ${HTMLFILES_DIR})
bundled_libraries += $(addprefix ${HTMLFILES_DIR}/, \
	jquery.isonscreen.js \
	)

RESOURCES_DIR = usr/share/{package}
package_install_resources_root = ${package_install_root}/${RESOURCES_DIR}

DOCUMENTATION_DIR = doc
MANPAGE_SUFFIX = .1
manpage_tempfile_suffix = ${MANPAGE_SUFFIX}.tmp
default_manpage_name = python-coverage${MANPAGE_SUFFIX}
python3_command_names = $(sort $(notdir $(wildcard \
	${package_working_root}/*/usr/bin/python3*-coverage)))
versioned_command_names = ${python3_command_names}
versioned_manpage_names = $(addsuffix ${MANPAGE_SUFFIX}, \
	${versioned_command_names})
versioned_manpage_paths = $(addprefix ${DOCUMENTATION_DIR}/, \
	${versioned_manpage_names})
GENERATED_FILES += ${DOCUMENTATION_DIR}/*${MANPAGE_SUFFIX}
GENERATED_FILES += ${DOCUMENTATION_DIR}/*${manpage_tempfile_suffix}

DOCUMENTATION_BUILD_DIR = ${DOCUMENTATION_DIR}/_build
DOCUMENTATION_BUILD_HTML_DIR = ${DOCUMENTATION_BUILD_DIR}/html
GENERATED_FILES += ${DOCUMENTATION_BUILD_DIR}

INSTALL = install
MV = mv

# Send HTTP traffic to the “discard” service during packaging actions.
export http_proxy = http://127.0.1.1:9/
export https_proxy = ${http_proxy}

RST_SUFFIX = .txt

RST2MAN = rst2man

SPHINX = python3 -m sphinx
SPHINX_OPTS = -N

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


.PHONY: remove-bundled-libraries
remove-bundled-libraries:
	$(RM) ${bundled_libraries}

.PHONY: manpage-aliases
manpage-aliases: ${versioned_manpage_paths}

${DOCUMENTATION_DIR}:
	$(INSTALL) --directory "$@"

${DOCUMENTATION_DIR}/${default_manpage_name}: ${DOCUMENTATION_DIR}
${DOCUMENTATION_DIR}/${default_manpage_name}: ${package_working_root}/${default_manpage_name}
	$(INSTALL) --mode=u=rw,go=r "$<" "$@"

${DOCUMENTATION_DIR}/%${MANPAGE_SUFFIX}: ${DOCUMENTATION_DIR}/${default_manpage_name}
	$(INSTALL) --mode=u=rw,go=r "$<" "$@"

%.1: %.1${RST_SUFFIX}
	$(RST2MAN) "$<" > "$@".tmp
	cat debian/manpage_encoding_declaration.UTF-8 "$@".tmp > "$@"


override_dh_auto_build: remove-bundled-libraries
override_dh_auto_build:
	dh_auto_build --buildsystem=pybuild
	$(SPHINX) ${SPHINX_OPTS} -bhtml ${DOCUMENTATION_DIR}/ \
		${DOCUMENTATION_BUILD_HTML_DIR}/

# Upstream test suite doesn't currently run in our build environment.
override_dh_auto_test:

override_dh_auto_install:
	dh_auto_install --buildsystem=pybuild
	$(RM) $(addprefix ${package_working_root}/${PYTHON3_PACKAGE_NAME}/, \
	    usr/bin/python-coverage usr/bin/pypy-coverage)
	$(RM) $(addprefix ${package_working_root}/${PYPY_PACKAGE_NAME}/, \
	    usr/bin/python*-coverage)

export PYBUILD_AFTER_INSTALL = \
	$(INSTALL) --mode=u=rwx,go=rx --directory \
	    "${package_install_resources_root}" ; \
	$(INSTALL) --mode=u=rwx,go=rx --directory \
	    "${package_install_resources_root}/${htmlfiles_dirname}" ; \
	$(INSTALL) --mode=u=rw,go=r "${HTMLFILES_DIR}"/* \
	    "${package_install_resources_root}/${htmlfiles_dirname}" ; \
	dh_link \
	    --package={package} \
	    "/${RESOURCES_DIR}/${htmlfiles_dirname}" \
	    {install_dir}/${HTMLFILES_DIR}

override_dh_installchangelogs:
	dh_installchangelogs CHANGES.rst

override_dh_installman: manpage-aliases
	dh_installman

override_dh_auto_clean:
	dh_auto_clean
	$(RM) -r ${GENERATED_FILES}


# Copyright © 2010–2020 Ben Finney <bignose@debian.org>
#
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; version 3 of that license or any later version.
# No warranty expressed or implied.


# Local variables:
# mode: makefile
# coding: utf-8
# End:
# vim: filetype=make fileencoding=utf-8 :