[sasmodels] 01/04: Initial packaging

Stuart Prescott stuart at debian.org
Mon Oct 30 23:02:48 UTC 2017


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

stuart pushed a commit to branch master
in repository sasmodels.

commit 7dcb31458a0b2cb4f75aa10588ea16011e73915f
Author: Stuart Prescott <stuart at debian.org>
Date:   Tue Oct 31 09:40:57 2017 +1100

    Initial packaging
---
 debian/compat                             |  1 +
 debian/control                            | 79 +++++++++++++++++++++++++++++++
 debian/copyright                          | 48 +++++++++++++++++++
 debian/patches/python3-compat.patch       | 16 +++++++
 debian/patches/series                     |  2 +
 debian/patches/sphinx-loacl-mathjax.patch | 14 ++++++
 debian/python-sasmodels-doc.doc-base      | 10 ++++
 debian/python-sasmodels-doc.docs          |  1 +
 debian/rules                              | 36 ++++++++++++++
 debian/source/format                      |  1 +
 debian/watch                              |  5 ++
 11 files changed, 213 insertions(+)

diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+10
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..8b03d4a
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,79 @@
+Source: sasmodels
+Section: science
+Priority: optional
+Maintainer: Debian Science Maintainers <debian-science-maintainers at lists.alioth.debian.org>
+Uploaders:
+ Stuart Prescott <stuart at debian.org>,
+ Drew Parsons <dparsons at debian.org>
+Build-Depends:
+ debhelper (>= 10),
+ dh-python,
+ libjs-jquery,
+ libjs-mathjax,
+ python-all,
+ python-matplotlib,
+ python-setuptools,
+ python-numpy,
+ python-pyopencl,
+ python-scipy,
+ python-sphinx (>= 1.0.7+dfsg),
+ python3-all,
+ python3-matplotlib,
+ python3-setuptools,
+ python3-numpy,
+ python3-pyopencl,
+ python3-scipy,
+ python3-sphinx (>= 1.0.7+dfsg),
+Standards-Version: 4.1.1
+Homepage: http://www.sasview.org/
+Vcs-Git: https://anonscm.debian.org/git/debian-science/packages/sasmodels.git
+Vcs-Browser: https://anonscm.debian.org/cgit/debian-science/packages/sasmodels.git/
+
+Package: python-sasmodels
+Architecture: all
+Section: python
+Depends:
+ python-numpy,
+ python-pyopencl,
+ python-scipy,
+ ${misc:Depends},
+ ${python:Depends}
+Suggests: python-sasmodels-doc
+Description: Theoretical models for small angle scattering (Python 2)
+ sasmodels is a Python module for calculating theoretical Small Angle
+ Scattering patterns. The models provided are usable directly in the bumps
+ fitting package and in the sasview analysis package.
+ .
+ This package contains the Python 2 version of the module.
+
+Package: python3-sasmodels
+Architecture: all
+Section: python
+Depends:
+ python3-numpy,
+ python3-pyopencl,
+ python3-scipy,
+ ${misc:Depends},
+ ${python3:Depends}
+Suggests: python-sasmodels-doc
+Description: Theoretical models for small angle scattering (Python 3)
+ sasmodels is a Python module for calculating theoretical Small Angle
+ Scattering patterns. The models provided are usable directly in the bumps
+ fitting package and in the sasview analysis package.
+ .
+ This package contains the Python 3 version of the module.
+
+Package: python-sasmodels-doc
+Architecture: all
+Section: doc
+Depends:
+ libjs-jquery,
+ libjs-mathjax,
+ ${misc:Depends},
+ ${sphinxdoc:Depends}
+Description: Theoretical models for small angle scattering (documentation)
+ sasmodels is a Python module for calculating theoretical Small Angle
+ Scattering patterns. The models provided are usable directly in the bumps
+ fitting package and in the sasview analysis package.
+ .
+ This package contains the documentation for the module.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..e26720e
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,48 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: sasmodels
+Source: https://github.com/SasView/sasmodels
+
+Files: *
+Copyright:
+    2009-2017, SasView Developers
+License: BSD-3-clause
+License-Grant:
+ License text clarified to BSD-3-clause in upstream git;
+ see https://raw.githubusercontent.com/SasView/sasmodels/master/LICENSE.txt
+ .
+ Copyright (c) 2009-2017, SasView Developers
+ All rights reserved.
+
+Files: debian/*
+Copyright:
+    2017, Stuart Prescott <stuart at debian.org>
+License: BSD-3-clause
+
+License: BSD-3-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ .
+ 3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+ WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
diff --git a/debian/patches/python3-compat.patch b/debian/patches/python3-compat.patch
new file mode 100644
index 0000000..0ac5608
--- /dev/null
+++ b/debian/patches/python3-compat.patch
@@ -0,0 +1,16 @@
+Description: Fix Python 3 support
+Author: Paul Kienzle<pkienzle at nist.gov>
+Origin: Upstream commit 6db17bd
+--- a/sasmodels/generate.py
++++ b/sasmodels/generate.py
+@@ -362,6 +362,10 @@
+     Return a unique tag for the source code.
+     """
+     # Note: need 0xffffffff&val to force an unsigned 32-bit number
++    try:
++        source = source.encode('utf8')
++    except AttributeError: # bytes has no encode attribute in python 3
++        pass
+     return "%08X"%(0xffffffff&crc32(source))
+ 
+ def convert_type(source, dtype):
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..0d9784c
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+sphinx-loacl-mathjax.patch
+python3-compat.patch
diff --git a/debian/patches/sphinx-loacl-mathjax.patch b/debian/patches/sphinx-loacl-mathjax.patch
new file mode 100644
index 0000000..dd947c6
--- /dev/null
+++ b/debian/patches/sphinx-loacl-mathjax.patch
@@ -0,0 +1,14 @@
+Description: Switch to local mathjax for documentation
+Author: Stuart Prescott <stuart at debian.org>
+
+--- a/doc/conf.py
++++ b/doc/conf.py
+@@ -180,6 +180,8 @@
+ # Output file base name for HTML help builder.
+ htmlhelp_basename = 'sasmodelsdoc'
+ 
++# Use the packaged copy of MathJax
++mathjax_path = 'mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
+ 
+ # -- Options for LaTeX output --------------------------------------------------
+ 
diff --git a/debian/python-sasmodels-doc.doc-base b/debian/python-sasmodels-doc.doc-base
new file mode 100644
index 0000000..8919702
--- /dev/null
+++ b/debian/python-sasmodels-doc.doc-base
@@ -0,0 +1,10 @@
+Document: python-sasmodels
+Title: Small Angle Scattering sasmodels documentation
+Author: SasView project
+Abstract: sasmodels is a set of Python modules to calculate small angle
+ scatering patterns
+Section: Science/Data Analysis
+
+Format: HTML
+Index: /usr/share/doc/python-sasmodels-doc/html/index.html
+Files: /usr/share/doc/python-sasmodels-doc/html/*.html
diff --git a/debian/python-sasmodels-doc.docs b/debian/python-sasmodels-doc.docs
new file mode 100644
index 0000000..7123782
--- /dev/null
+++ b/debian/python-sasmodels-doc.docs
@@ -0,0 +1 @@
+doc/_build/html
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..7f4db04
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,36 @@
+#!/usr/bin/make -f
+
+#export DH_VERBOSE = 1
+
+export PYBUILD_NAME=sasmodels
+
+# opencl needs somewhere to cache compiled objects
+export POCL_CACHE_DIR=$(CURDIR)/.cache/
+# and also tell pyopencl not to cache
+export PYOPENCL_NO_CACHE=1
+
+%:
+	dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild
+
+override_dh_clean:
+	dh_clean
+	make -C doc clean
+	rm -rf $(POCL_CACHE_DIR)
+
+override_dh_auto_build:
+	dh_auto_build
+	mkdir -p $(POCL_CACHE_DIR)
+	MPLBACKEND=Agg make -C doc html
+	ln -sf /usr/share/javascript/mathjax/ doc/_build/html/_static/mathjax
+
+override_dh_auto_test:
+	# don't run the tests if suppressed with DEB_BUILD_OPTIONS=nocheck
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+	mkdir -p $(POCL_CACHE_DIR)
+	PYBUILD_SYSTEM=custom \
+	  PYBUILD_TEST_ARGS='cd {build_dir}; \
+	    {interpreter} -m sasmodels.model_test opencl all; \
+	    {interpreter} -m unittest -v sasmodels.resolution; \
+	    ' \
+          dh_auto_test --buildsystem=pybuild
+endif
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..7709fd9
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,5 @@
+version=4
+
+opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%sasmodels-$1.tar.gz%" \
+   https://github.com/SasView/sasmodels/releases \
+   (?:.*?/)?v?(\d[\d.]*)\.tar\.gz

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sasmodels.git



More information about the debian-science-commits mailing list