File: rules

package info (click to toggle)
python-pygraphviz 1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 560 kB
  • sloc: ansic: 4,365; python: 1,672; makefile: 114
file content (68 lines) | stat: -rwxr-xr-x 2,443 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
#!/usr/bin/make -f

# Commodity variables
DOC_INSTDIR=$(CURDIR)/debian/python-pygraphviz/usr/share/doc/python-pygraphviz

# Needed before including python-distutils.mk
DEB_PYTHON_SYSTEM = pysupport


include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk


# Some variables
DEB_PYTHON_MODULE_PACKAGE   = pygraphviz
DEB_PYTHON_CLEAN_ARGS       = --all
DEB_PYTHON_INSTALL_ARGS_ALL = --no-compile --force

# Install egg-info directories, using setup_egg.py instead of setup.py
DEB_PYTHON_SETUP_CMD         = setup_egg.py
DEB_PYTHON_INSTALL_ARGS_ALL += --single-version-externally-managed \
				--prefix=/usr --root $(CURDIR)/debian/python-pygraphviz

install/python-pygraphviz::
	# Fix test.py permissions (not an upstream problem):
	for i in `pyversions -s`; do \
		chmod +x debian/*/usr/lib/$$i/*-packages/pygraphviz/tests/test.py; \
	done

binary-install/python-pygraphviz::
	# Remove extraneous license file, and rename the README file
	rm $(DOC_INSTDIR)/INSTALL.txt
	mv -f $(DOC_INSTDIR)/README.txt $(DOC_INSTDIR)/README

	# Fix example permissions, until upstream fixes it
	chmod a+x $(DOC_INSTDIR)/examples/*.py

# BUILD_ARGS should contain --build-base but it's:
#  - neither supported by the setup.py script
#  - nor needed
DEB_PYTHON_BUILD_ARGS =


# CDBS doesn't allow separate build steps for module and extension, let's hack it:
#  - copied the following target from the python-distutils.mk (CDBS Makefile)
#  - deleted arch=all test since we _do_ have an extension => arch=any
python-build-stamp-%::
	cd $(DEB_SRCDIR) && python$* $(DEB_PYTHON_SETUP_CMD) build_ext $(DEB_PYTHON_BUILD_ARGS) $(DEB_PYTHON_BUILD_EXTENSION_ARGS)
	cd $(DEB_SRCDIR) && python$* $(DEB_PYTHON_SETUP_CMD) build_py $(DEB_PYTHON_BUILD_ARGS)
	touch $@

install/python-pygraphviz-dbg::
	for i in $(cdbs_python_build_versions); do \
		python$$i-dbg $(DEB_PYTHON_SETUP_CMD) install --root $(CURDIR)/debian/python-pygraphviz-dbg; \
	done
	find debian/python-pygraphviz-dbg \
	! -type d ! -name '*_d.so' | xargs rm -f
	find debian/python-pygraphviz-dbg -depth -empty -exec rmdir {} \;

binary-predeb/python-pygraphviz-dbg::
	rm -rf debian/python-pygraphviz-dbg/usr/share/doc/python-pygraphviz-dbg
	ln -s python-pygraphviz debian/python-pygraphviz-dbg/usr/share/doc/python-pygraphviz-dbg


clean::
	# Shipped in the source tarball, generated again during the build
	rm -rf pygraphviz.egg-info
	rm -rf python-build-stamp build