File: rules

package info (click to toggle)
foolscap 0.5.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,372 kB
  • ctags: 3,585
  • sloc: python: 19,756; makefile: 172; sh: 5
file content (70 lines) | stat: -rwxr-xr-x 2,053 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
#!/usr/bin/make -f
# -*- makefile -*-

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

DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p' | sed -rne 's,(.*)\+dfsg,\1,p')
PYVERS=$(shell pyversions -vr)

# if $py_setup_install_args will contain "--install-layout=deb" dist-packages
# will be used instead of site-packages for Python >= 2.6;
# --install-layout=deb and python.mk are available since python >= 2.5.4-1~,
# here's backwards compatible code:
-include /usr/share/python/python.mk
ifeq (,$(py_libdir))
    py_libdir = /usr/lib/python$(subst python,,$(1))/site-packages
endif

get-orig-source:
	uscan --force-download --destdir=. --rename \
		--download-version=$(DEB_UPSTREAM_VERSION)

	tar xzf foolscap_$(DEB_UPSTREAM_VERSION).orig.tar.gz

	# Remove unused misc/testutils directory.
	rm -rf foolscap-$(DEB_UPSTREAM_VERSION)/misc/testutils/

	tar czf foolscap_$(DEB_UPSTREAM_VERSION)+dfsg.orig.tar.gz foolscap-$(DEB_UPSTREAM_VERSION)
	rm -rf foolscap-$(DEB_UPSTREAM_VERSION)
	rm -f foolscap_$(DEB_UPSTREAM_VERSION).orig.tar.gz

clean:
	dh_testdir
	dh_testroot
	rm -rf $(CURDIR)/build
	find $(CURDIR) -name '*\.py[co]' -delete
	dh_clean $(PYVERS:%=install-python%)

build:

install: build $(PYVERS:%=install-python%)

install-python%:
	python$* setup.py install --root $(CURDIR)/debian/python-foolscap \
		--single-version-externally-managed $(py_setup_install_args)
	# No need to include the unit tests in the deb file.
	rm -rf $(CURDIR)/debian/python-foolscap/$(call py_libdir,$*)/foolscap/test
	touch $@

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_install -i
	dh_installchangelogs -i NEWS
	dh_installdocs -i README
	dh_installman -i
	dh_pysupport -i
	dh_compress -i -X.py -X.xhtml -X.txt
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch:
# We have nothing to do by default.

binary: binary-indep binary-arch
.PHONY: get-orig-source build clean binary-indep binary-arch install