File: rules

package info (click to toggle)
python-networkx 1.7~rc1-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,128 kB
  • sloc: python: 44,557; makefile: 135
file content (78 lines) | stat: -rwxr-xr-x 2,979 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
71
72
73
74
75
76
77
78
#!/usr/bin/make -f

DEBIANDOC_DIR=$(CURDIR)/debian/python-networkx/usr/share/doc/python-networkx
PYLIBPATH := $(shell python -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print b.build_platlib")

%:
	dh $@ --with sphinxdoc

override_dh_auto_clean:
	dh_auto_clean

	# Add here commands to clean up after the build process.
	rm -fr build
	# Remove built doc too
	$(MAKE) -C doc clean
	rm -rf doc/source/*.pdf doc/source/*.zip examples/*/*.png doc/fontList.cache

	# Make sure that there's no .pyc left
	find . -name '*.pyc' -exec rm {} ';'

	# This directory is generated during the build
	rm -rf networkx.egg-info

build: build-arch build-indep ;

build-arch:
	dh build

	# running tests
	for py in $(shell pyversions -r) ; do\
		PYTHONPATH=$(PYLIBPATH) $$py setup_egg.py nosetests ; \
	done

build-indep:
	# build doc, run in a separate shell, so we can export MPLCONFIGDIR
	(export MPLCONFIGDIR=. ; make -C doc dist PYTHONPATH=../$(PYLIBPATH))

override_dh_install:
	# Install w/o compiling *.pyc files
	# Install egg-info directories (--single-... option)
	python setup_egg.py install --no-compile --root=$(CURDIR)/debian/python-networkx \
		--single-version-externally-managed --install-layout=deb

	# Fix executable bits:
	chmod +x debian/python-networkx/usr/lib/`pyversions -d`/*-packages/networkx/tests/test.py
	find debian/python-networkx -name '*.bz2' -exec chmod a-x {} ';'

	# Do some cleanup: delete unneeded files:
	rm $(DEBIANDOC_DIR)/INSTALL.txt $(DEBIANDOC_DIR)/LICENSE.txt

	# Rename the README file.
	mv $(DEBIANDOC_DIR)/README.txt $(DEBIANDOC_DIR)/README

	dh_install

	# install doc from dir 'dist', but rename it to 'html', better name
	mv debian/python-networkx-doc/usr/share/doc/python-networkx-doc/dist \
		debian/python-networkx-doc/usr/share/doc/python-networkx-doc/html

	rm -rf debian/python-networkx-doc/usr/share/doc/python-networkx-doc/html/_static/jquery.js
	dh_link -ppython-networkx-doc /usr/share/javascript/jquery/jquery.js /usr/share/doc/python-networkx-doc/html/_static/jquery.js

	# link the pdf files also at the top level dir
	dh_link -ppython-networkx-doc /usr/share/doc/python-networkx-doc/html/_downloads/networkx_reference.pdf /usr/share/doc/python-networkx-doc/networkx_reference.pdf
	dh_link -ppython-networkx-doc /usr/share/doc/python-networkx-doc/html/_downloads/networkx_tutorial.pdf /usr/share/doc/python-networkx-doc/networkx_tutorial.pdf

	# remove full doc zip file
	rm -f debian/python-networkx-doc/usr/share/doc/python-networkx-doc/html/_downloads/networkx-documentation.zip

update_intersphinx_mapping:
	wget http://docs.python.org/dev/objects.inv -O debian/python.org_objects.inv
	wget http://docs.scipy.org/doc/numpy/objects.inv -O debian/scipy.org_numpy_objects.inv

override_dh_compress:
	dh_compress -Xexamples/ -X.js -X.pdf -Xobjects.inv

override_dh_installchangelogs:
	dh_installchangelogs doc/source/reference/news.rst