[Python-modules-commits] [python-mpld3] 01/07: more package preparation: add Python 3 support, fix nodejs usage etc.

Wolfgang Borgert debacle at moszumanska.debian.org
Tue Sep 30 23:37:21 UTC 2014


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to branch master
in repository python-mpld3.

commit c3bf61af7cf9d602685b92156c18925c4c38a9ca
Author: W. Martin Borgert <debacle at debian.org>
Date:   Tue Sep 30 23:45:17 2014 +0200

    more package preparation: add Python 3 support, fix nodejs usage etc.
---
 debian/control                             | 23 +++++++++++++++++++++--
 debian/patches/1000_disable_submodule.diff | 30 ++++++++++++++++++++++++++++++
 debian/patches/2000_nodejs.diff            | 29 +++++++++++++++++++++++++++++
 debian/patches/series                      |  2 ++
 debian/{docs => python-mpld3.docs}         |  0
 debian/{docs => python3-mpld3.docs}        |  0
 debian/rules                               | 14 +++++++++++++-
 7 files changed, 95 insertions(+), 3 deletions(-)

diff --git a/debian/control b/debian/control
index 2f66b40..14e1d70 100644
--- a/debian/control
+++ b/debian/control
@@ -1,9 +1,9 @@
 Source: python-mpld3
 Section: python
 Priority: extra
-Maintainer: Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
+Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
 Uploaders: W. Martin Borgert <debacle at debian.org>
-Build-Depends: python-all (>= 2.7~), python-setuptools, debhelper (>= 9)
+Build-Depends: python-all (>= 2.7~), python-setuptools, debhelper (>= 9), python3-all, python3-setuptools, python-mplexporter, python3-mplexporter, node-smash, node-uglify
 Standards-Version: 3.9.5
 Homepage: https://mpld3.github.io/
 Vcs-Git: git://anonscm.debian.org/python-modules/packages/python-mpld3.git
@@ -23,3 +23,22 @@ Description: a D3 viewer for matplotlib
  The result is a simple API for exporting your matplotlib graphics
  to HTML code which can be used within the browser, within standard
  web pages, blogs, or tools such as the IPython notebook.
+ .
+ This package provides the Python 2.x module.
+
+Package: python3-mpld3
+Architecture: all
+Depends: ${misc:Depends}
+ , ${python3:Depends}
+ , libjs-d3
+ , node-jsdom
+ , node-vows
+Description: a D3 viewer for matplotlib
+ The mpld3 project brings together Matplotlib, the popular
+ Python-based graphing library, and D3js, the popular Javascript
+ library for creating interactive data visualizations for the web.
+ The result is a simple API for exporting your matplotlib graphics
+ to HTML code which can be used within the browser, within standard
+ web pages, blogs, or tools such as the IPython notebook.
+ .
+ This package provides the Python 3.x module.
diff --git a/debian/patches/1000_disable_submodule.diff b/debian/patches/1000_disable_submodule.diff
new file mode 100644
index 0000000..a6ed62c
--- /dev/null
+++ b/debian/patches/1000_disable_submodule.diff
@@ -0,0 +1,30 @@
+Description: disable fetching of git submodule during build
+Author: W. Martin Borgert <debacle at debian.org>
+Origin: vendor
+Last-Update: 2014-09-30
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/setup.py
++++ b/setup.py
+@@ -23,7 +23,6 @@
+ 
+ # Make sure submodules are updated and synced
+ root_dir = os.path.abspath(os.path.dirname(__file__))
+-require_clean_submodules(root_dir, sys.argv)
+ 
+ # Warn if it looks like JS libs need to be built
+ if 'buildjs' not in sys.argv:
+@@ -41,11 +40,10 @@
+       url=URL,
+       download_url=DOWNLOAD_URL,
+       license=LICENSE,
+-      cmdclass={'submodule': UpdateSubmodules,
++      cmdclass={
+                 'buildjs': BuildJavascript},
+       packages=['mpld3',
+-                'mpld3/mplexporter',
+-                'mpld3/mplexporter/renderers'],
++                ],
+       package_data={'mpld3': ['js/*.js']},
+       classifiers=[
+           'Development Status :: 4 - Beta',
diff --git a/debian/patches/2000_nodejs.diff b/debian/patches/2000_nodejs.diff
new file mode 100644
index 0000000..d7e3214
--- /dev/null
+++ b/debian/patches/2000_nodejs.diff
@@ -0,0 +1,29 @@
+Description: use nodejs and node modules from Debian
+Author: W. Martin Borgert <debacle at debian.org>
+Origin: vendor
+Last-Update: 2014-09-30
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/Makefile
++++ b/Makefile
+@@ -13,16 +13,16 @@
+ 	@npm test
+ 
+ src/version.js: mpld3/__about__.py
+-	@node bin/version $(VERSION) > $@
++	@nodejs bin/version $(VERSION) > $@
+ 
+-mpld3/js/mpld3.v$(VERSION).js: $(shell node_modules/.bin/smash --ignore-missing --list src/mpld3.js) package.json
++mpld3/js/mpld3.v$(VERSION).js: $(shell smash --ignore-missing --list src/mpld3.js) package.json
+ 	@rm -f $@
+-	node_modules/.bin/smash src/mpld3.js | node_modules/.bin/uglifyjs - -b indent-level=2 -o $@
++	smash src/mpld3.js | uglifyjs -b --indent 2 -o $@
+ 	@chmod a-w $@
+ 
+ mpld3/js/mpld3.v$(VERSION).min.js: mpld3/js/mpld3.v$(VERSION).js bin/uglify
+ 	@rm -f $@
+-	bin/uglify $< > $@
++	uglifyjs $< > $@
+ 	@chmod a-w $@
+ 
+ clean:
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..e3fc015
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+1000_disable_submodule.diff
+2000_nodejs.diff
diff --git a/debian/docs b/debian/python-mpld3.docs
similarity index 100%
copy from debian/docs
copy to debian/python-mpld3.docs
diff --git a/debian/docs b/debian/python3-mpld3.docs
similarity index 100%
rename from debian/docs
rename to debian/python3-mpld3.docs
diff --git a/debian/rules b/debian/rules
index f3908b2..c653c6a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,6 +2,18 @@
 # -*- makefile -*-
 
 #export DH_VERBOSE=1
+export PYBUILD_NAME=mpld3
 
 %:
-	dh $@
+	dh $@ --buildsystem=pybuild --with python2,python3
+
+override_dh_auto_build:
+	# re-create smashed and minified JS files
+	$(MAKE) clean
+	$(MAKE) javascript
+	dh_auto_build
+
+override_dh_auto_install:
+	dh_auto_install
+	# remove D3, package depends on libjs-d3
+	rm -f ./debian/python*-mpld3/usr/lib/python*/dist-packages/mpld3/js/d3.v3.min.js

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-mpld3.git



More information about the Python-modules-commits mailing list