File: rules

package info (click to toggle)
pyparsing 1.5.6%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 8,220 kB
  • sloc: python: 13,752; makefile: 33; sh: 17
file content (48 lines) | stat: -rwxr-xr-x 1,521 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
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2002,2003 Colin Walters <walters@debian.org>
# Copyright © 2012 Jan Dittberner <jandd@debian.org>

override_dh_auto_clean:
	find -name '*.py[co]' -print0 | xargs -0 --no-run-if-empty rm -f --
	rm -rf build
	rm -f pyparsing.py

override_dh_auto_install:
	python setup.py install --install-layout=deb \
	    --root=$(CURDIR)/debian/python-pyparsing
	rm -f pyparsing.py
	python3 setup.py install --install-layout=deb \
	    --root=$(CURDIR)/debian/python3-pyparsing
	find $(CURDIR)/debian/python{,3}-pyparsing \
	    \( -name '*.html' -o -name '*.css' -o -name '*.py' \
	                      -o -name 'README' \) \
	    -type f -print0 \
	| xargs -0 --no-run-if-empty fromdos -p --

override_dh_installexamples:
	dh_installexamples -i -ppython-pyparsing-doc

override_dh_python2:
	dh_python2 -ppython-pyparsing

override_dh_python3:
	dh_python3 -ppython3-pyparsing

override_dh_compress:
	dh_compress -i -X.py

%:
	dh $@ --with=python2,python3 --buildsystem=python_distutils

# the following rule gets the original source and creates a dfsg free
# tarball
get-orig-source:
	DFSGVER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p'); \
	VER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^+]+).*,\1,p'); \
	TMPDIR=`mktemp --directory`; \
	uscan --force-download --download-version=$$VER --destdir="$$TMPDIR"; \
	cd "$(CURDIR)"; mv "$$TMPDIR/pyparsing_$$DFSGVER.orig.tar.gz" .; \
	rm -rf "$$TMPDIR"

.PHONY: get-orig-source