File: rules

package info (click to toggle)
pybit 1.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 1,512 kB
  • sloc: python: 5,088; xml: 497; sh: 411; perl: 349; sql: 197; makefile: 82
file content (105 lines) | stat: -rwxr-xr-x 3,280 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
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
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

ifneq (,$(findstring verbose,$(DEB_BUILD_OPTIONS)))
	VERBOSE="VERBOSE=1"
endif

# get upstream version for get-orig-source target
VERSION:= $(shell dpkg-parsechangelog | grep '^Version: ' | sed -e 's/^Version: //' | sed -e 's/\-.*$$//')
# allow using whichever supported python is installed
PYTHON2:=$(shell pyversions -r debian/control|xargs which|xargs basename)
include /usr/share/python/python.mk
pyalldo=set -e; $(foreach py, $(PYTHON2) $(PYTHON3), PYTHONPATH=. $(py) $(1);)
install_dir=$(call py_libdir, $(PYTHON2))

configure: configure-stamp
configure-stamp: build-setup
	dh_testdir
	touch configure-stamp

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: configure-stamp
	dh_testdir
	$(call pyalldo , test/plugintest.py)
	$(call pyalldo , test/pybitclient-test.py)
	$(call pyalldo , test/webapi-test.py)
	touch $@

build-setup: setup.py
	dh_testdir
	python setup.py build
	xsltproc --nonet /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl debian/pybit-client.1.xml
	xsltproc --nonet /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl debian/pybit-watcher.1.xml
	xsltproc --nonet /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl debian/pybit-web.1.xml
	mv pybit-client.1 debian/
	mv pybit-web.1 debian/
	mv pybit-watcher.1 debian/

clean:
	dh_testdir
	dh_testroot
	$(RM) build-stamp configure-stamp
	$(RM) -r build pybit_client.egg-info pybit_common.egg-info pybit_web.egg-info
	$(RM) -r build dist pybit-client.1 pybit.egg-info pybit-web.1 pybit-watcher.1
	[ ! -f Makefile ] || $(MAKE) clean
	find . -name '*.pyc' -delete
	dh_clean
	debconf-updatepo

sdist-orig:
	python setup.py sdist
	mv -v dist/pybit-$(VERSION).tar.gz ../pybit_$(VERSION).orig.tar.gz
	$(RM) -r pybit.egg-info

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	python setup.py install --root="$(CURDIR)/debian/tmp" --no-compile $(py_setup_install_args)
	mkdir -p debian/pybit-common$(install_dir)
	mkdir -p debian/pybit-client$(install_dir)
	mkdir -p debian/pybit-web$(install_dir)
	mv debian/tmp$(install_dir)/pybit/ debian/pybit-common$(install_dir)
	mv debian/tmp$(install_dir)/pybitclient/ debian/pybit-client/$(install_dir)
	mv debian/tmp$(install_dir)/pybitweb/ debian/pybit-web$(install_dir)

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_installexamples
	dh_installinit
	dh_lintian
	dh_installdebconf
	dh_install $(exclusions) --exclude=.git
	dh_compress
	dh_python2
	dh_link
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch: build install

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure sdist-orig