File: rules

package info (click to toggle)
python-psutil 0.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 740 kB
  • sloc: ansic: 5,959; python: 5,194; makefile: 31
file content (42 lines) | stat: -rwxr-xr-x 1,307 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
#!/usr/bin/make -f

PYVERS:=$(shell pyversions -s)

%:
	dh $@

build:
	dh build

	# run tests
	-for test in test_memory_leaks.py test_psutil.py ;\
	do \
	    for python in $(PYVERS) ; do \
  	        echo "running "test/$$test" on "$$python ; \
		LIB=$$($$python -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print b.build_platlib") ; \
	        PYTHONPATH=$$LIB $$python test/$$test ; \
	    done \
	done

override_dh_installchangelogs:
	dh_installchangelogs HISTORY

override_dh_installdocs:
	dh_installdocs -X.DS_Store

override_dh_compress:
	dh_compress -X.py

PACKAGE = python-psutil
SRC_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | sed 's/^Version: \(.*\)-.*/\1/')
SVN_REVISION := $(shell echo $(SRC_VERSION) | awk -F"+" '{ print $$2 }' | sed 's/svn//' )
TARBALL = $(PACKAGE)_$(SRC_VERSION).orig.tar.gz

.PHONY: get-orig-source
get-orig-source:
	rm -rf get-orig-source $(TARBALL)
	mkdir get-orig-source
	svn export -r $(SVN_REVISION) http://psutil.googlecode.com/svn/trunk get-orig-source/$(PACKAGE)-$(SRC_VERSION)
	tar czf $(TARBALL) -C get-orig-source $(PACKAGE)-$(SRC_VERSION)
	rm -rf get-orig-source
	echo "  "$(TARBALL)" created; move it to the right destination to build the package"