File: rules

package info (click to toggle)
ipython 0.13.1-2%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 15,752 kB
  • sloc: python: 69,537; makefile: 355; lisp: 272; sh: 80; objc: 37
file content (199 lines) | stat: -rwxr-xr-x 8,247 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
#!/usr/bin/make -f
#export DH_VERBOSE=1
PYVERS = $(shell pyversions -rv)
PY3VERS = $(shell py3versions -r)

%:
	dh $@ --with python2,python3,sphinxdoc

override_dh_auto_clean:
	rm -f test_hist.sqlite
	if cd $(CURDIR)/docs; then $(MAKE) clean; fi
	dh_auto_clean
	rm -rf $(CURDIR)/build
	# remove 0.13 generated files
	rm -f $(CURDIR)/docs/source/_static/hist_simple.png
	rm -f $(CURDIR)/docs/source/_static/hist_with_text.png
	rm -f $(CURDIR)/docs/source/_static/plot_simple.png
	rm -f $(CURDIR)/docs/source/_static/plot_simple_python.png

override_dh_auto_build:
	dh_auto_build -- --executable '/usr/bin/env python'
	# utf-8 due to https://github.com/ipython/ipython/issues/2057
	set -e && for pyvers in $(PY3VERS); do \
	  $$pyvers setup.py build --executable '/usr/bin/env python3'; \
	done

ifeq (,$(filter nodocs,$(DEB_BUILD_OPTIONS)))
	HOME=$(CURDIR)/build PYTHONPATH=$(CURDIR) $(MAKE) -C $(CURDIR)/docs html
endif

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	# IPython.frontend requires X
	set -e && for pyvers in $(PYVERS); do \
	  LC_ALL=C.UTF-8 HOME=$(CURDIR)/build \
	  PATH=$(CURDIR)/IPython/scripts/:$(PATH) PYTHONPATH=$(CURDIR) \
	  xvfb-run -s "-screen 0 1280x1024x24 -noreset" \
	  python$$pyvers $(CURDIR)/IPython/scripts/iptest -v -e test_not_writable_ipdir; \
	done
endif

override_dh_auto_install:
	dh_auto_install
	set -e && for pyvers in $(PY3VERS); do \
	  $$pyvers setup.py install --install-layout=deb \
		--force --no-compile -O0 --root=$(CURDIR)/debian/tmp; \
	done
	# py3 uses entrypoints where --excutable in build has no effect
	sed -i '1c#!/usr/bin/env python3' $(CURDIR)/debian/tmp/usr/bin/ipython3
	sed -i '1c#!/usr/bin/env python3' $(CURDIR)/debian/tmp/usr/bin/irunner3
	sed -i '1c#!/usr/bin/env python3' $(CURDIR)/debian/tmp/usr/bin/ipcluster3
	sed -i '1c#!/usr/bin/env python3' $(CURDIR)/debian/tmp/usr/bin/ipcontroller3
	sed -i '1c#!/usr/bin/env python3' $(CURDIR)/debian/tmp/usr/bin/ipengine3
	sed -i '1c#!/usr/bin/env python3' $(CURDIR)/debian/tmp/usr/bin/iplogger3

override_dh_install:
	dh_install -pipython \
		--exclude="IPython/frontend/qt/" \
		--exclude="IPython/frontend/html/" \
		--exclude="IPython/deathrow/" \
		--exclude="IPython/quarantine/" \
		--exclude="IPython/external/js/" \
		--exclude=tests
	dh_install -pipython-notebook --exclude="html/notebook/static/"
	dh_install -pipython3-notebook --exclude="html/notebook/static/"
	dh_install -pipython-notebook-common -XCOPYING -XLICENSE -XLICENSE.txt
	dh_install -pipython-qtconsole
	dh_install -pipython3 \
		--exclude="IPython/frontend/qt/" \
		--exclude="IPython/frontend/html/" \
		--exclude="IPython/deathrow/" \
		--exclude="IPython/quarantine/" \
		--exclude=tests
	dh_install -pipython3-qtconsole

	# jquery-ui-themes provides more in javascript/jquery-ui-themes (not available in 12.04)
	# disabled as long as the ui dev branch is used
	#dh_linktree -v -pipython-notebook-common replace usr/share/javascript/jquery-ui/themes \
	#  usr/share/ipython/notebook/static/jquery/css/themes

	mkdir -p $(CURDIR)/debian/ipython/usr/share/icons/hicolor/scalable/apps/
	cp IPython/frontend/qt/console/resources/icon/IPythonConsole.svg \
	  $(CURDIR)/debian/ipython/usr/share/icons/hicolor/scalable/apps/ipython.svg

	# remove embedded arparse
	find $(CURDIR)/debian/ipython/usr/ -name _argparse.py -delete
	find $(CURDIR)/debian/ipython3/usr/ -name _argparse.py -delete

	# remove embedded simplegeneric
	find $(CURDIR)/debian/ipython/usr/ -name _simplegeneric.py -delete
	find $(CURDIR)/debian/ipython3/usr/ -name _simplegeneric.py -delete

	# remove embedded decorator
	find $(CURDIR)/debian/ipython/usr/ -name _decorator.py -delete
	find $(CURDIR)/debian/ipython3/usr/ -name _decorator.py -delete

	# remove embedded pexpect
	find $(CURDIR)/debian/ipython/usr/ -name _pexpect.py -delete

	# add wrapper scripts for all python versions
	set -e ;\
	firstpyver="" ;\
	for pyvers in $(PYVERS); do \
	    if [ "$${firstpyver}" = "" ]; then \
	        install -m 755 debian/ipython.sh $(CURDIR)/debian/ipython/usr/bin/ipython$$pyvers ;\
	        firstpyver="$$pyvers" ;\
	    else \
	        dh_link -pipython /usr/bin/ipython$${firstpyver} /usr/bin/ipython$$pyvers ;\
	    fi ;\
	    dh_link -pipython /usr/share/man/man1/ipython.1.gz /usr/share/man/man1/ipython$$pyvers.1.gz ;\
	done

	# change permission on scripts
	chmod a-x $(CURDIR)/debian/ipython/usr/share/doc/ipython/examples/*
	find $(CURDIR)/debian/ipython-notebook-common/usr/share/ipython/notebook/static/codemirror/ \
	  -type f | xargs chmod a-x
	
override_dh_installdocs:
ifeq (,$(filter nodocs,$(DEB_BUILD_OPTIONS)))
	dh_installdocs -pipython
	dh_installdocs -pipython3
	dh_installdocs -pipython-qtconsole --link-doc=ipython
	dh_installdocs -pipython3-qtconsole --link-doc=ipython3
	dh_installdocs -pipython-notebook --link-doc=ipython
	dh_installdocs -pipython3-notebook --link-doc=ipython3
	dh_installdocs -pipython-notebook-common
	dh_installdocs -pipython-doc --link-doc=ipython
	find $(CURDIR)/debian/ipython -type d -empty -delete

	# remove all the duplicates to keep -doc small
	set -e && \
	for f in hist_simple.png hist_with_text.png ipy_013_dashboard_cluster.png ipy_013_dashboard.png \
	ipy_013_notebook_cythonmagic.png ipy_013_notebook_long_out.png ipy_013_notebook_octavemagic.png \
	ipy_013_notebook_rmagic.png ipy_013_notebook_script_cells.png ipy_013_notebook_spectrogram.png \
	ipy_013_notebook_tooltip.png ipy_013_par_tb.png ipy_013_qtconsole_completer.png plot_simple.png \
	plot_simple_python.png ms_visual_studio.png notebook_specgram.png \
	qtconsole.png qtconsole_tabbed.png; \
	do \
	  rm -f $(CURDIR)/debian/ipython-doc/usr/share/doc/ipython/html/_images/$$f; \
	  dh_link -pipython-doc usr/share/doc/ipython/html/_static/$$f usr/share/doc/ipython/html/_images/$$f; \
	done
	rm -f $(CURDIR)/debian/ipython-doc/usr/share/doc/ipython/html/_static/plot_simple.png
	dh_link -pipython-doc usr/share/doc/ipython/html/_static/plot_simple_python.png \
	  usr/share/doc/ipython/html/_static/plot_simple.png
	rm -f $(CURDIR)/debian/ipython-doc/usr/share/doc/ipython/html/_images/qtconsole1.png
	dh_link -pipython-doc usr/share/doc/ipython/html/_static/qtconsole.png \
	  usr/share/doc/ipython/html/_images/qtconsole1.png
endif

# work around #683108
override_dh_python2:
	dh_python2 -pipython
	dh_python2 -pipython-qtconsole
	dh_python2 -pipython-notebook

override_dh_python3:
	dh_python3 -pipython3
	dh_python3 -pipython3-qtconsole
	dh_python3 -pipython3-notebook

override_dh_installman:
	dh_installman
	mv debian/ipython3/usr/share/man/man1/ipython.1 \
	  debian/ipython3/usr/share/man/man1/ipython3.1
	mv debian/ipython3/usr/share/man/man1/irunner.1 \
	  debian/ipython3/usr/share/man/man1/irunner3.1
	mv debian/ipython3/usr/share/man/man1/ipcluster.1 \
	  debian/ipython3/usr/share/man/man1/ipcluster3.1
	mv debian/ipython3/usr/share/man/man1/ipcontroller.1 \
	  debian/ipython3/usr/share/man/man1/ipcontroller3.1
	mv debian/ipython3/usr/share/man/man1/ipengine.1 \
	  debian/ipython3/usr/share/man/man1/ipengine3.1
	mv debian/ipython3/usr/share/man/man1/iplogger.1 \
	  debian/ipython3/usr/share/man/man1/iplogger3.1

override_dh_sphinxdoc:
ifeq (,$(filter nodocs,$(DEB_BUILD_OPTIONS)))
	dh_sphinxdoc
endif

override_dh_compress:
	dh_compress -Xhtml/ -X.ipynb -X.py

VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-\+]+)+(\+dfsg)*.*,\1,p')
COMMIT = $(shell dpkg-parsechangelog | grep Commit | sed -e "s/^\s*Commit //")
get-orig-source:
	#git clone --depth 1 git://github.com/ipython/ipython ipython.git
	#cd ipython.git && git archive --format=tar --prefix=ipython/ $(COMMIT) | gzip -9 -c > ../ipython_$(VERSION).orig.tar.gz
	#rm -rf ipython.git
	#tar xfz ipython_$(VERSION).orig.tar.gz
	mkdir ipython
	uscan --force-download --destdir=. --download-version=$(VERSION)
	tar -C ipython -xz -f rel-$(VERSION).tar.gz --strip 1
	rm -f ipython/IPython/frontend/html/notebook/static/jquery/js/jquery-1.6.2.min.js
	rm -f ipython/IPython/frontend/html/notebook/static/jquery/js/jquery-ui-1.8.14.custom.min.js
	mv ipython/IPython/frontend/html/notebook/static/unminified/prettify.js \
	   ipython/IPython/frontend/html/notebook/static/prettify/prettify.js
	tar cfz ipython_$(VERSION)+dfsg.orig.tar.gz ipython
	rm -rf ipython