[Python-modules-commits] [cysignals] 03/03: Initial packaging

Jerome Benoit calculus-guest at moszumanska.debian.org
Fri Sep 23 14:19:29 UTC 2016


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

calculus-guest pushed a commit to branch experimental-sage
in repository cysignals.

commit 49c2329e38423bf6222c635a214dd49948cdf9bc
Author: Jerome Benoit <calculus at rezozer.net>
Date:   Sat Sep 17 03:51:53 2016 +0100

    Initial packaging
---
 debian/README.Debian                               |  33 ++
 debian/README.source                               |  19 ++
 debian/adhoc/examples/doctest/Makefile             |  36 +++
 debian/adhoc/examples/example/Makefile             |  42 +++
 debian/adhoc/tests/check-doctest                   |  14 +
 debian/adhoc/tests/check-example                   |  17 +
 debian/adhoc/wrappers/cysignals-CSI                |   8 +
 debian/changelog                                   |   5 +
 debian/clean                                       |   4 +
 debian/compat                                      |   1 +
 debian/control                                     |  83 +++++
 debian/copyright                                   |  51 +++
 debian/cysignals-tools.install                     |   2 +
 debian/cysignals-tools.lintian-overrides           |   2 +
 debian/cysignals-tools.manpages                    |   1 +
 debian/patches/debianization.patch                 |  28 ++
 debian/patches/series                              |   6 +
 .../upstream-autotoolization-harden-generic.patch  |  41 +++
 .../upstream-autotoolization-harden-pari_gp.patch  | 357 +++++++++++++++++++++
 ...tion_pytoolization-harden-build_directory.patch |  79 +++++
 .../upstream-lintian-spelling-error-silence.patch  |  69 ++++
 ...eam-source-tools-gdb-handling_enhancement.patch |  54 ++++
 debian/python-cysignals-bare.lintian-overrides     |   2 +
 debian/python-cysignals-bare.pyinstall             |   2 +
 debian/python-cysignals-doc.doc-base               |  19 ++
 debian/python-cysignals-doc.docs                   |   4 +
 debian/python-cysignals-doc.examples               |   3 +
 debian/python-cysignals-doc.lintian-overrides      |   2 +
 debian/python-cysignals-pari.lintian-overrides     |   2 +
 debian/python-cysignals-pari.pyinstall             |   2 +
 debian/rules                                       | 135 ++++++++
 debian/source/lintian-overrides                    |   3 +
 debian/tests/check-doctest-bare                    |  11 +
 debian/tests/check-doctest-pari                    |   1 +
 debian/tests/check-example-bare                    |  11 +
 debian/tests/check-example-pari                    |   1 +
 debian/tests/control                               |  11 +
 debian/watch                                       |   3 +
 38 files changed, 1164 insertions(+)

diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..f59da31
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,33 @@
+Debian specific setup
+=====================
+
+The core part of the `cysignals' Cython package comes in different flavours
+that can not coexist.
+
+Each flavour being distributed within a distinct Debian package. At the time of
+writing, there are 2 flavours: the `bare' flavour is built against no specific
+library and is meant for generic usage; the `pari' flavour is specifically
+built against the PARI/GP library (version 2.8 or higher) and it is meant to
+be used within the Sage[Math] umbrella software (from where `cysignals' has
+been extracted). The `pari' flavour brings extra features, namely support for
+the PARI/GP library. So, in this sense, the `pari' flavour contains the `bare'
+flavour. Their respective Debian packages are both a concretization of the
+virtual Debian package `python-cysignals', their respective flavour being
+appended as suffix (with a dash) to their package name, as expected:
+`python-cysignals-bare' and `python-cysignals-pari'.
+
+Concerning their usage to avoid any coexistence conflicts: Debian packages
+involving the `cysignals' Cython package without involving the PARI/GP
+Computer Algebra System (CAS) must depend on the virtual Debian package
+`python-cysignals'; otherwise, they must explicitly depend on the concrete
+Debian package `python-cysignals-pari'. This approach may avoid to install
+a full CAS whenever such a big (not to say Huge) machinery is not necessary.
+
+The suite of tests and the simple example furnished by the upstream team are
+distributed `as-is' within the Debian package `python-cysignals-doc'. At the
+time of writing, this material does not involved the PARI/GP CAS, even so the
+tests require the debugging tool `cysignals-CSI' as distributed in the Debian
+package `cysignals-tools' to be performed properly; straightforward Makefile
+scripts to run them are provided.
+
+ -- Jerome Benoit <calculus at rezozer.net>  Thu, 15 Sep 2016 01:11:37 +0000
diff --git a/debian/README.source b/debian/README.source
new file mode 100644
index 0000000..46cd35a
--- /dev/null
+++ b/debian/README.source
@@ -0,0 +1,19 @@
+Beside the required branches, the Git repository for cysignals possesses an
+experimental-sage branch which contains the full material. The master branch
+is meant to be the experimental-sage minus the support for the PARI/GP library
+(cf debian/README.Debian): at the time of packaging, the involved PARI/GP
+material is not supported in Debian.
+
+Basically the experimental-sage branch is maintained first, then the new stuff
+is merged into the master branch, and finally the `pari' flavour material (cf
+debian/README.Debian) is commented out with the comment `##EXPERIMENTAL##' in
+such a way that the following command may restore the experimental stuff:
+	$ find debian -type f -exec sed -i -e 's|^##EXPERIMENTAL##||g' \{\} \;
+
+This approach allows us (the Debain Sage[Math] Team) to expose the cysignal
+Debian package to the unstable and testing distributions and to step forward
+in the packaging of Sage [1].
+
+[1] https://wiki.debian.org/DebianScience/Sage
+
+ -- Jerome Benoit <calculus at rezozer.net>  Fri, 23 Sep 2016 13:26:48 +0000
diff --git a/debian/adhoc/examples/doctest/Makefile b/debian/adhoc/examples/doctest/Makefile
new file mode 100644
index 0000000..52df4bd
--- /dev/null
+++ b/debian/adhoc/examples/doctest/Makefile
@@ -0,0 +1,36 @@
+# /usr/share/doc/python-cysignals-doc/examples/doctest/Makefile
+#
+# Ad hoc Makefile for building and playing with the sample sources
+# distributed within the debian package python-cysignals-doc.
+#
+# Recommended usage:
+#  create a dedicated folder somewhere in your HOME directory;
+#  link all the files in /usr/share/doc/python-cysignals-doc/examples/doctest
+#  in the dedicated folder; launch this Makefile in the dedicated folder:
+#  $ make ;
+#  for a basic cleanup, consider the clean target:
+#  $ make clean ;
+#  for an entire cleanup, the maintainer-clean target:
+#  $ make maintainer-clean ;
+#  for other targets, just read the Makefile.
+#
+# written for Debian by Jerome Benoit <calculus at rezozer.net>
+# on behalf of the Debian Python Modules Team
+# copyright: 2016 Jerome Benoit <calculus at rezozer.net>
+# distributed under the terms and conditions of GPL version 3 or later
+#
+
+DOCTESTS = $(sort $(wildcard *.pyx))
+
+default: all
+
+all: check
+
+check:
+	@$(foreach tst, $(DOCTESTS), echo "*** $(tst) ***" ; $(PYTHON) -m doctest $(tst) ; )
+
+clean:
+
+maintainer-clean: clean
+
+PYTHON ?= python
diff --git a/debian/adhoc/examples/example/Makefile b/debian/adhoc/examples/example/Makefile
new file mode 100644
index 0000000..663ce99
--- /dev/null
+++ b/debian/adhoc/examples/example/Makefile
@@ -0,0 +1,42 @@
+# /usr/share/doc/python-cysignals-doc/examples/example/Makefile
+#
+# Ad hoc Makefile for building and playing with the sample sources
+# distributed within the debian package python-cysignals-doc.
+#
+# Recommended usage:
+#  create a dedicated folder somewhere in your HOME directory;
+#  link all the files in /usr/share/doc/python-cysignals-doc/examples/example
+#  in the dedicated folder; launch this Makefile in the dedicated folder:
+#  $ make ;
+#  for a basic cleanup, consider the clean target:
+#  $ make clean ;
+#  for an entire cleanup, the maintainer-clean target:
+#  $ make maintainer-clean ;
+#  for other targets, just read the Makefile.
+#
+# written for Debian by Jerome Benoit <calculus at rezozer.net>
+# on behalf of the Debian Python Modules Team
+# copyright: 2016 Jerome Benoit <calculus at rezozer.net>
+# distributed under the terms and conditions of GPL version 3 or later
+#
+
+DOCTESTS = $(sort $(wildcard *.pyx))
+
+default: all
+
+export CFLAGS = -Wno-unused-variable -Wno-unused-function
+
+all: build
+
+build: setup.py cysignals_example.pyx
+	$(PYTHON) $< build
+
+check: build
+
+clean:
+	$(RM) cysignals_example.c
+	$(RM) -rf build
+
+maintainer-clean: clean
+
+PYTHON ?= python
diff --git a/debian/adhoc/tests/check-doctest b/debian/adhoc/tests/check-doctest
new file mode 100755
index 0000000..fe4e4d0
--- /dev/null
+++ b/debian/adhoc/tests/check-doctest
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -e
+FLAVOUR=${1:-bare}
+[ -f build/dh-test-auto_build-${FLAVOUR}.sh ] || exit 4
+. build/dh-test-auto_build-${FLAVOUR}.sh
+PYTHON=${PYBUILD_interpreter}
+export PYTHONPATH=$(realpath -m ${PYBUILD_build_dir})
+[ -d ${PYTHONPATH} ] || exit 3
+SCRIPTPATH=$(realpath ./src/scripts)
+[ -d ${SCRIPTPATH} ] || exit 2
+export PATH=${SCRIPTPATH}:/usr/bin:/bin
+exec $PYTHON -m doctest src/cysignals/*.pyx
+exit 1
+#eos
diff --git a/debian/adhoc/tests/check-example b/debian/adhoc/tests/check-example
new file mode 100755
index 0000000..40416aa
--- /dev/null
+++ b/debian/adhoc/tests/check-example
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -e
+FLAVOUR=${1:-bare}
+[ -f build/dh-test-auto_build-${FLAVOUR}.sh ] || exit 6
+. build/dh-test-auto_build-${FLAVOUR}.sh
+PYTHON=${PYBUILD_interpreter}
+export PYTHONPATH=$(realpath -m ${PYBUILD_build_dir})
+[ -d ${PYTHONPATH} ] || exit 5
+export PATH=${SCRIPTPATH}:/usr/bin:/bin
+export CPPFLAGS=-I${PYTHONPATH}/cysignals
+CHECKDIR=build/${FLAVOUR}/${0##*/}
+[ ! -d ${CHECKDIR} ] || exit 4
+cp -pr example ${CHECKDIR} || exit 3
+cd ${CHECKDIR} || exit 2
+exec $PYTHON setup.py build
+exit 1
+#eos
diff --git a/debian/adhoc/wrappers/cysignals-CSI b/debian/adhoc/wrappers/cysignals-CSI
new file mode 100755
index 0000000..1a4a1e0
--- /dev/null
+++ b/debian/adhoc/wrappers/cysignals-CSI
@@ -0,0 +1,8 @@
+#!/bin/sh
+## ad hoc wrapper to feed help2man(1)
+set -e
+WRAPPEE=src/scripts/cysignals-CSI
+[ -x $WRAPPEE ] || exit 1
+$WRAPPEE $@ | sed -e 's|usage\:|Usage\:|;s|optional arguments\:|Options\:|'
+exit 0
+## eow
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..31282ba
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+cysignals (1.1.1+ds-1) UNRELEASED-experimental; urgency=medium
+
+  * Initial release (Closes: #834232).
+
+ -- Jerome Benoit <calculus at rezozer.net>  Fri, 23 Sep 2016 13:41:55 +0000
diff --git a/debian/clean b/debian/clean
new file mode 100644
index 0000000..5c69975
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1,4 @@
+.pybuild/
+src/config.h.in
+configure
+cysignals-CSI.1
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..e311371
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,83 @@
+Source: cysignals
+Section: python
+Priority: optional
+Maintainer: Jerome Benoit <calculus at rezozer.net>
+Uploaders: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
+Build-Depends:
+ debhelper (>= 10),
+ dh-python,
+ python-setuptools,
+ python-all,
+ libpython-dev,
+ libpari-dev (>= 2.8),
+ cython (>= 0.24),
+ gdb
+Build-Depends-Indep:
+ help2man,
+ python-docutils,
+ python-sphinx,
+ texlive-latex-base,
+ texlive-latex-recommended,
+ texlive-fonts-recommended,
+ texlive-generic-extra,
+ texlive-latex-extra
+Standards-Version: 3.9.8
+X-Python-Version: >= 2.7
+Homepage: https://github.com/sagemath/cysignals
+Vcs-Git: https://anonscm.debian.org/git/python-modules/packages/cysignals.git
+Vcs-Browser: https://anonscm.debian.org/git/python-modules/packages/cysignals.git
+
+Package: python-cysignals-pari
+Provides: python-cysignals
+Conflicts: python-cysignals-bare
+Architecture: any
+Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}
+Recommends: cysignals-tools
+Suggests: python-cysignals-doc (= ${source:Version})
+Description: interrupt and signal handling for Cython -- Python - PARI/GP
+ Since Cython optimizes for speed, Cython normally does not check
+ for interrupts. The cysignals package provides mechanisms to handle
+ interrupts (and other signals and errors) in Cython code.
+ .
+ This package installs the library for Python 2; this very library
+ was built against the PARI/GP library.
+
+Package: python-cysignals-bare
+Provides: python-cysignals
+Conflicts: python-cysignals-pari
+Architecture: any
+Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}
+Recommends: cysignals-tools
+Suggests: python-cysignals-doc (= ${source:Version})
+Description: interrupt and signal handling for Cython -- Python - bare
+ Since Cython optimizes for speed, Cython normally does not check
+ for interrupts. The cysignals package provides mechanisms to handle
+ interrupts (and other signals and errors) in Cython code.
+ .
+ This package installs the library for Python 2; this very library
+ was not built against the PARI/GP library.
+
+Package: cysignals-tools
+Section: devel
+Architecture: all
+Depends: gdb, ${python:Depends}, ${misc:Depends}
+Suggests: python-cysignals-doc (= ${source:Version})
+Description: interrupt and signal handling for Cython -- tools
+ Since Cython optimizes for speed, Cython normally does not check
+ for interrupts. The cysignals package provides mechanisms to handle
+ interrupts (and other signals and errors) in Cython code.
+ .
+ This package provides debugging tools.
+
+Package: python-cysignals-doc
+Section: doc
+Architecture: all
+Depends: ${misc:Depends}
+Suggests: pdf-viewer, www-browser
+Enhances: python-cysignals (= ${source:Version})
+Description: interrupt and signal handling for Cython -- doc
+ Since Cython optimizes for speed, Cython normally does not check
+ for interrupts. The cysignals package provides mechanisms to handle
+ interrupts (and other signals and errors) in Cython code.
+ .
+ This is the common documentation package.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..bffb352
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,51 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0
+Upstream-Name: cysignals
+Upstream-Contact: The Sage Development Team <sage-devel at googlegroups.com>
+Source: https://github.com/sagemath/cysignals
+Files-Excluded:
+ src/config.h.in
+ configure
+
+Files: *
+Copyright:
+ 2016 The Sage Development Team <sage-devel at googlegroups.com>
+License: LGPL-3+
+
+Files: debian/*
+Copyright:
+ 2016 Jerome Benoit <calculus at rezozer.net>
+License: GPL-3+
+
+License: LGPL-3+
+ This package is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 3 of the License, or (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU Lesser General
+ Public License can be found in `/usr/share/common-licenses/LGPL-3'.
+
+License: GPL-3+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this package. If not, see <http://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General Public License
+ version 3 can be found in `/usr/share/common-licenses/GPL-3'.
diff --git a/debian/cysignals-tools.install b/debian/cysignals-tools.install
new file mode 100644
index 0000000..3eeecea
--- /dev/null
+++ b/debian/cysignals-tools.install
@@ -0,0 +1,2 @@
+usr/lib/python2*/dist-packages/cysignals_gdb/*
+usr/bin/cysignals-CSI
diff --git a/debian/cysignals-tools.lintian-overrides b/debian/cysignals-tools.lintian-overrides
new file mode 100644
index 0000000..a16cbb7
--- /dev/null
+++ b/debian/cysignals-tools.lintian-overrides
@@ -0,0 +1,2 @@
+# The upstream source tarball contains no ChangeLog file.
+cysignals-tools: no-upstream-changelog
diff --git a/debian/cysignals-tools.manpages b/debian/cysignals-tools.manpages
new file mode 100644
index 0000000..972c6d9
--- /dev/null
+++ b/debian/cysignals-tools.manpages
@@ -0,0 +1 @@
+cysignals-CSI.1
diff --git a/debian/patches/debianization.patch b/debian/patches/debianization.patch
new file mode 100644
index 0000000..54ec571
--- /dev/null
+++ b/debian/patches/debianization.patch
@@ -0,0 +1,28 @@
+Description: debianization
+ Meant to maintain a minimal debian/rules, to fix warnings, to address
+ Debian specific stuff in general. This is a Debian centric patch.
+Origin: debian
+Forwarded: not-needed
+Author: Jerome Benoit <calculus at rezozer.net>
+Last-Update: 2015-09-14
+
+--- a/setup.py
++++ b/setup.py
+@@ -62,6 +62,7 @@
+ # The variable "init_pxd" is the string which should be written to
+ # __init__.pxd
+ init_pxd = "# distutils: include_dirs = {0}\n".format(install_dir)
++init_pxd = init_pxd.replace("/usr/local/","/usr/")
+ # Append config.pxd
+ with open(config_pxd_file) as c:
+     init_pxd += c.read()
+--- a/src/scripts/cysignals-CSI
++++ b/src/scripts/cysignals-CSI
+@@ -86,6 +86,7 @@
+     """
+     # Preload the right Python library
+     libpython = os.path.join(sysconfig.get_config_var('exec_prefix'), 'lib',
++                             sysconfig.get_config_var('MULTIARCH'),
+                              sysconfig.get_config_var('INSTSONAME'))
+     env = dict(os.environ)
+     if sys.platform == 'macosx':
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..0c8bbb2
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,6 @@
+upstream-lintian-spelling-error-silence.patch
+upstream-autotoolization-harden-generic.patch
+upstream-autotoolization-harden-pari_gp.patch
+upstream-autotoolization_pytoolization-harden-build_directory.patch
+upstream-source-tools-gdb-handling_enhancement.patch
+debianization.patch
diff --git a/debian/patches/upstream-autotoolization-harden-generic.patch b/debian/patches/upstream-autotoolization-harden-generic.patch
new file mode 100644
index 0000000..8672c31
--- /dev/null
+++ b/debian/patches/upstream-autotoolization-harden-generic.patch
@@ -0,0 +1,41 @@
+Description: autotoolization: harden: generic
+ Attempt to slightly harden the autotools machinery by providing to
+ AC_CONFIG_SRCDIR a more specific source; along the way, support for
+ the custom m4 folder is added. Meant to be submitted to the upstream
+ maintainer team.
+Origin: debian
+Forwarded: https://github.com/sagemath/cysignals/pull/38
+Author: Jerome Benoit <calculus at rezozer.net>
+Last-Update: 2016-09-14
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -1,12 +1,13 @@
+ dnl Not sure which autoconf version we need, but 2.69 (from 2012)
+ dnl is widely available.
+ AC_PREREQ([2.69])
++AC_COPYRIGHT([GPL version 2 or later])
+ 
+ AC_DEFUN([VERSION], m4_esyscmd_s(cat VERSION))
+ 
+ AC_INIT([cysignals], VERSION, [https://github.com/sagemath/cysignals/issues])
+-AC_COPYRIGHT([GPL version 2 or later])
+-AC_CONFIG_SRCDIR([configure.ac])
++AC_CONFIG_MACRO_DIR([m4])
++AC_CONFIG_SRCDIR([src/cysignals/pxi.h])
+ AC_CONFIG_HEADERS([build/src/config.h:src/config.h.in])
+ 
+ AC_LANG(C)
+--- a/Makefile
++++ b/Makefile
+@@ -46,8 +46,8 @@
+ test: check
+ 
+ configure: configure.ac
+-	autoconf
+-	autoheader
++	autoconf -i -f -I m4
++	autoheader -f
+ 	@rm -f src/config.h.in~
+ 
+ .PHONY: all build doc install dist doc clean clean-build clean-doc \
diff --git a/debian/patches/upstream-autotoolization-harden-pari_gp.patch b/debian/patches/upstream-autotoolization-harden-pari_gp.patch
new file mode 100644
index 0000000..78d3fb7
--- /dev/null
+++ b/debian/patches/upstream-autotoolization-harden-pari_gp.patch
@@ -0,0 +1,357 @@
+Description: autotoolization: harden: PARI/GP
+ Provide suitable material to build or not against the PARI/GP library;
+ by default, a bare build is assumed. Along the way, the material passed
+ to `distutils' is refined: `extra_compile_args' is no more implicitly
+ merged with `extra_link_args'; the dummy C macro literally named `dummy'
+ is renamed `CYSIGNALS_DUMMY' to avoid possible name collision. Meant to
+ be submitted to the upstream maintainer team.
+Origin: debian
+Forwarded: https://github.com/sagemath/cysignals/pull/38
+Author: Jerome Benoit <calculus at rezozer.net>
+Last-Update: 2016-09-14
+
+--- /dev/null
++++ b/m4/pari.m4
+@@ -0,0 +1,263 @@
++# pari.m4 serial 1
++dnl m4/pari.m4 -- M4 macro processor include script
++dnl
++dnl Copyright (C) 2016 Jerome Benoit <jgmbenoit at rezozer.net>
++dnl
++dnl Based on macros by Owen Taylor, modified by:
++dnl Hans Petter Jansson, 2001-04-09;
++dnl Allin Cottrell, April 2003;
++dnl and certainly others.
++dnl
++dnl Copying and distribution of this file, with or without modification, are
++dnl permitted in any medium without royalty provided the copyright notice and
++dnl this notice are preserved. This file is offered as-is, without any warranty.
++dnl
++
++dnl AM_PATH_PARI([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
++dnl Test for the PARI/GP library, and define PARI_CPPFLAGS, PARI_CFLAGS,
++dnl PARI_LDFLAGS, PARI_LIBS, and WITH_PARI_IS_YES .
++dnl
++AC_DEFUN([AM_PATH_PARI],[dnl
++AC_REQUIRE([AC_PROG_SED])dnl
++dnl AC_REQUIRE([AM_CONDITIONAL])dnl
++
++	AC_ARG_WITH([pari],
++	[AS_HELP_STRING([--with-pari],[enable support for PARI])],
++	[],[with_pari=no])
++
++	AC_MSG_CHECKING(whether PARI is enabled)
++	if test x"$with_pari" != xno ; then
++
++		AC_MSG_RESULT(yes)
++
++		AC_ARG_WITH([pari-prefix],
++			[AS_HELP_STRING([--with-pari-prefix=PREFIX],
++				[specify prefix for the installed PARI [standard search prefixes]])],
++			[pari_config_prefix="$withval"],[pari_config_prefix=""])
++		AC_ARG_WITH([pari-include],
++			[AS_HELP_STRING([--with-pari-include=PATH],
++				[specify directory for the installed PARI header file [standard search paths]])],
++			[pari_config_include_prefix="$withval"],[pari_config_include_prefix=""])
++		AC_ARG_WITH([pari-lib],
++			[AS_HELP_STRING([--with-pari-lib=PATH],
++				[specify directory for the installed PARI library [standard search paths]])],
++			[pari_config_lib_prefix="$withval"],[pari_config_lib_prefix=""])
++
++		if test "x$pari_config_include_prefix" = "x" ; then
++			if test "x$pari_config_prefix" != "x" ; then
++				pari_config_include_prefix="$pari_config_prefix/include"
++			fi
++		fi
++		if test "x$pari_config_lib_prefix" = "x" ; then
++			if test "x$pari_config_prefix" != "x" ; then
++				pari_config_lib_prefix="$pari_config_prefix/lib"
++			fi
++		fi
++
++		PARI_CPPFLAGS=
++		if test "x$pari_config_include_prefix" != "x" ; then
++			PARI_CPPFLAGS="-I$pari_config_include_prefix"
++		fi
++
++		PARI_LDFLAGS=
++		if test "x$pari_config_lib_prefix" != "x" ; then
++			PARI_LDFLAGS="-L$pari_config_lib_prefix"
++		fi
++
++		PARI_CFLAGS=""
++		PARI_LIBS="-lpari"
++
++dnl WIP_COMMENTED_OUT		min_pari_version=ifelse([$1], ,2.8.0,$1)
++		min_pari_version=ifelse([$1], ,2.7.6,$1)
++		min_pari_version_0_0_0="$min_pari_version.0.0.0"
++
++		min_pari_version_major=`echo $min_pari_version_0_0_0 | \
++			$SED 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)\(.*\)/\1/'`
++		min_pari_version_minor=`echo $min_pari_version_0_0_0 | \
++			$SED 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)\(.*\)/\2/'`
++		min_pari_version_micro=`echo $min_pari_version_0_0_0 | \
++			$SED 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)\(.*\)/\3/'`
++
++		min_pari_dotted_version="$min_pari_version_major.$min_pari_version_minor.$min_pari_version_micro"
++
++		AC_MSG_CHECKING(for PARI - version >= $min_pari_dotted_version )
++
++		ac_save_CPPFLAGS="$CPPFLAGS"
++		ac_save_CFLAGS="$CFLAGS"
++		ac_save_LDFLAGS="$LDFLAGS"
++		ac_save_LIBS="$LIBS"
++
++		CPPFLAGS="$CPPFLAGS $PARI_CPPFLAGS"
++		CFLAGS="$CFLAGS $PARI_CFLAGS"
++		LDFLAGS="$LDFLAGS $PARI_LDFLAGS"
++		LIBS="$LIBS $PARI_LIBS"
++
++		rm -f conf.paritest
++		AC_RUN_IFELSE([AC_LANG_SOURCE(
++[[
++#include <pari/pari.h>
++#include <stdio.h>
++
++#define PRINTF_MSG_ERROR_MISMATCH_HEADER_LIBRARY \
++	printf("*** This likely indicates either a bad configuration or some\n"); \
++	printf("*** other inconsistency in the development environment. If the\n"); \
++	printf("*** expected PARI library cannot be found, it may be sufficient\n"); \
++	printf("*** either to set properly the LD_LIBRARY_PATH environment variable\n"); \
++	printf("*** or to configure ldconfig(8) to consider the installed location.\n"); \
++	printf("*** Otherwise a bad configuration or an inconsistency in the\n"); \
++	printf("*** include/library search paths may be investigated; adjustments\n"); \
++	printf("*** through the use of --with-pari-(include|lib) configure option\n"); \
++	printf("*** may help.\n"); \
++	printf("***\n"); \
++	printf("*** If an old version is installed, it may be best to remove it and to\n"); \
++	printf("*** reinstall a more recent one; although modifying LD_LIBRARY_PATH\n"); \
++	printf("*** may also get things to work. The latest version of PARI is always\n"); \
++	printf("*** available from http://pari.math.u-bordeaux.fr/.\n"); \
++	printf("***\n");
++
++int main ()
++{
++	long pari_hdr_version_major = 255 & PARI_VERSION_CODE >> 16 ;
++	long pari_hdr_version_minor = 255 & PARI_VERSION_CODE >> 8 ;
++	long pari_hdr_version_micro = 255 & PARI_VERSION_CODE ;
++	long pari_lib_version_major = 255 & paricfg_version_code >> 16 ;
++	long pari_lib_version_minor = 255 & paricfg_version_code >> 8 ;
++	long pari_lib_version_micro = 255 & paricfg_version_code ;
++	long deduced_pari_hdr_version_code = PARI_VERSION(pari_hdr_version_major,pari_hdr_version_minor,pari_hdr_version_micro) ;
++	long deduced_pari_lib_version_code = PARI_VERSION(pari_lib_version_major,pari_lib_version_minor,pari_lib_version_micro) ;
++	GEN M;
++
++	pari_init(1000000,50000);
++	M = mathilbert(80);
++
++	fclose (fopen ("conf.paritest", "w"));
++
++#if 1
++	if (
++			(deduced_pari_hdr_version_code != PARI_VERSION_CODE) ||
++			(deduced_pari_lib_version_code != paricfg_version_code)
++		) {
++		printf("\n***\n");
++		printf("*** PARI version numbers cannot be computed properly.\n");
++		printf("*** This likely indicates either that the code on which is based the M4 macro\n");
++		printf("*** needs to be refreshed or that the installed PARI library is obsolete.\n");
++		printf("*** If you have an obsolete version installed, it may be best to remove it and to\n");
++		printf("*** reinstall a more recent one; otherwise, feel free to correct the involved M4 code.\n");
++		printf("*** The latest version of PARI is always available from http://pari.math.u-bordeaux.fr/.\n");
++		printf("***\n");
++		}
++	else
++#endif
++	if (PARI_VERSION_CODE != paricfg_version_code) {
++		printf("\n***\n");
++		printf("*** PARI header  version code number (%ld) and\n", PARI_VERSION_CODE );
++		printf("*** PARI library version code number (%ld) do not match.\n", paricfg_version_code );
++		printf("***\n");
++		PRINTF_MSG_ERROR_MISMATCH_HEADER_LIBRARY
++		}
++	else if (
++			($min_pari_version_major < pari_hdr_version_major) ||
++			(
++				($min_pari_version_major == pari_hdr_version_major) &&
++				($min_pari_version_minor < pari_hdr_version_minor)
++				) ||
++			(
++				($min_pari_version_major == pari_hdr_version_major) &&
++				($min_pari_version_minor == pari_hdr_version_minor) &&
++				($min_pari_version_micro <= pari_hdr_version_micro)
++				)
++		) {
++		return (0);
++		}
++	else {
++		printf("\n***\n");
++		printf("*** PARI version $min_pari_dotted_version or higher is required:\n");
++		printf("*** an older version of PARI (%ld.%ld.%ld) was found.\n",
++			pari_hdr_version_major, pari_hdr_version_minor, pari_hdr_version_micro);
++		printf("*** The latest version of PARI is always available\n");
++		printf("*** from http://pari.math.u-bordeaux.fr/.\n");
++		printf("***\n");
++		}
++
++	return (1);
++}
++]]
++)],[],[no_pari=yes],[AC_MSG_WARN([$ac_n "cross compiling; assumed OK... $ac_c])])
++
++		CPPFLAGS="$ac_save_CPPFLAGS"
++		CFLAGS="$ac_save_CFLAGS"
++		LDFLAGS="$ac_save_LDFLAGS"
++		LIBS="$ac_save_LIBS"
++
++		if test "x$no_pari" = "x" ; then
++			AC_MSG_RESULT([yes])
++			ifelse([$2], , :, [$2])
++		else
++			AC_MSG_RESULT([no])
++			if test -f conf.paritest ; then
++				:
++			else
++				echo "***"
++				echo "*** Could not run PARI test program, checking why..."
++				CPPFLAGS="$CPPFLAGS $PARI_CPPFLAGS"
++				CFLAGS="$CFLAGS $PARI_CFLAGS"
++				LDFLAGS="$CFLAGS $PARI_LDFLAGS"
++				LIBS="$LIBS $PARI_LIBS"
++			AC_LINK_IFELSE([AC_LANG_PROGRAM(
++[[
++#include <pari/pari.h>
++#include <stdio.h>
++]],
++[[ return (1); ]]
++)],
++[
++echo "***"
++echo "*** The test program compiled, but did not run. This usually means"
++echo "*** that the run-time linker is not finding PARI or finding the wrong"
++echo "*** version of PARI. If it is not finding PARI, you'll need to set your"
++echo "*** LD_LIBRARY_PATH environment variable, or configure ldconfig(8) to"
++echo "*** consider the installed location."
++echo "***"
++echo "*** If you have an old version installed, it is best to remove it; although"
++echo "*** modifying LD_LIBRARY_PATH may also get things to work. The latest version"
++echo "*** of PARI is always available from http://pari.math.u-bordeaux.fr/."
++echo "***"
++],
++[
++echo "***"
++echo "*** The test program failed to compile or link. See the file config.log for the"
++echo "*** exact error that occurred. This usually means PARI was incorrectly installed"
++echo "*** or that you have moved PARI since it was installed."
++echo "***"
++])
++
++				CPPFLAGS="$ac_save_CPPFLAGS"
++				CFLAGS="$ac_save_CFLAGS"
++				LDFLAGS="$ac_save_LDFLAGS"
++				LIBS="$ac_save_LIBS"
++			fi
++
++			PARI_CPPFLAGS=""
++			PARI_CFLAGS=""
++			PARI_LDFLAGS=""
++			PARI_LIBS=""
++			with_pari=no
++			m4_default([$3],[AC_MSG_ERROR([no suitable PARI library found])])
++			AC_MSG_WARN([PARI is forced to be disabled])
++		fi
++		rm -f conf.paritest
++
++	else
++
++		AC_MSG_RESULT(no)
++
++	fi
++
++	AC_SUBST(PARI_CPPFLAGS)
++	AC_SUBST(PARI_CFLAGS)
++	AC_SUBST(PARI_LDFLAGS)
++	AC_SUBST(PARI_LIBS)
++
++	AM_CONDITIONAL([WITH_PARI_IS_YES],[test x"$with_pari" != xno])
++
++])
+--- a/configure.ac
++++ b/configure.ac
+@@ -12,14 +12,12 @@
+ 
+ AC_LANG(C)
+ 
+-AC_SEARCH_LIBS([pari_init], [pari])
+-
+ AC_CHECK_HEADERS([execinfo.h sys/prctl.h])
+ AC_CHECK_FUNCS([backtrace])
+ 
+-AC_CHECK_DECL([PARI_SIGINT_block],
+-    [AC_DEFINE(HAVE_PARI, 1, [Define to 1 if PARI is fully supported.])],
+-    [], [[#include <pari/pari.h>]])
++AM_PATH_PARI([2.8],
++	[AC_DEFINE(HAVE_PARI, 1, [Define to 1 if PARI is fully supported.])],
++	[AC_MSG_WARN([no suitable PARI library found])])
+ 
+ AC_MSG_CHECKING([for emms instruction])
+ # We add the "leal" instruction to reduce false positives in case some
+@@ -37,9 +35,15 @@
+ AC_CONFIG_COMMANDS([build/src/config.pxd],
+     # Generate a file config.pxd whose contents will be copied to
+     # __init__.pxd to set correct compiler options.
+-    # The -Ddummy works around https://github.com/cython/cython/pull/485
+-    [[echo "# distutils: extra_link_args = $LIBS -Ddummy" >build/src/config.pxd]],
+-    [LIBS=$LIBS])
++    # The -DCYSIGNALS_DUMMY works around https://github.com/cython/cython/pull/485
++    [[
++			echo "# distutils: extra_compile_args = $EXTRACOMPILEARGS" >build/src/config.pxd
++			echo "# distutils: extra_link_args = -DCYSIGNALS_DUMMY $EXTRALINKARGS" >>build/src/config.pxd
++		]],
++    [
++			EXTRACOMPILEARGS="$PARI_CPPFLAGS $PARI_CFLAGS"
++			EXTRALINKARGS="$PARI_LDFLAGS $PARI_LIBS"
++		])
+ 
+ 
+ AC_OUTPUT()
+--- a/setup.py
++++ b/setup.py
+@@ -11,11 +11,22 @@
+ import os
+ from glob import glob
+ 
++import sys
++
+ opj = os.path.join
+ 
+ 
+ cythonize_dir = "build"
+ 
++ac_configure_flags = ""
++if "--without-pari" in sys.argv:
++	ac_configure_flags = "--without-pari"
++	sys.argv.remove("--without-pari")
++if "--with-pari" in sys.argv:
++	ac_configure_flags = "--with-pari"
++	sys.argv.remove("--with-pari")
++
++
+ kwds = dict(include_dirs=[opj("src", "cysignals"),
+                           opj(cythonize_dir, "src"),
+                           opj(cythonize_dir, "src", "cysignals")],
+@@ -27,13 +38,12 @@
+     Extension("cysignals.tests", ["src/cysignals/tests.pyx"], **kwds)
+ ]
+ 
+-
+ # Run configure if it wasn't run before. We check this by the presence
+ # of config.pxd
+ config_pxd_file = opj(cythonize_dir, "src", "config.pxd")
+ if not os.path.isfile(config_pxd_file):
+     import subprocess
+-    subprocess.check_call("make configure && ./configure", shell=True)
++    subprocess.check_call( "make configure && ./configure " + ac_configure_flags , shell=True)
+ 
+ 
+ # Determine installation directory from distutils
diff --git a/debian/patches/upstream-autotoolization_pytoolization-harden-build_directory.patch b/debian/patches/upstream-autotoolization_pytoolization-harden-build_directory.patch
new file mode 100644
index 0000000..5d8877d
--- /dev/null
+++ b/debian/patches/upstream-autotoolization_pytoolization-harden-build_directory.patch
@@ -0,0 +1,79 @@
+Description: autotoolization/pytoolization: harden: build directory
+ Attempt to harden the building machinery by (1) implementing a more
+ autotools way to perform external build, by (2) distinguishing the
+ build directory wrt to the PARI/GP support, and (3) by adding the
+ possibily to pass arguments to `configure' through a dedicated
+ environment variable, named `PYSETUP_CONFIGURE_FLAGS'. Meant to be
+ submitted to the upstream maintainer team.
+Origin: debian
+Forwarded: https://github.com/sagemath/cysignals/pull/38
+Author: Jerome Benoit <calculus at rezozer.net>
+Last-Update: 2016-09-14
+
+--- a/setup.py
++++ b/setup.py
+@@ -15,10 +15,7 @@
+ 
+ opj = os.path.join
+ 
+-
+-cythonize_dir = "build"
+-
+-ac_configure_flags = ""
++ac_configure_flags = os.environ.get("PYSETUP_CONFIGURE_FLAGS","--without-pari")
+ if "--without-pari" in sys.argv:
+ 	ac_configure_flags = "--without-pari"
+ 	sys.argv.remove("--without-pari")
+@@ -26,6 +23,11 @@
+ 	ac_configure_flags = "--with-pari"
+ 	sys.argv.remove("--with-pari")
+ 
++cythonize_dir = "build/XXXX"
++if "--without-pari" in ac_configure_flags:
++	cythonize_dir = "build/bare"
++elif "--with-pari" in ac_configure_flags:
++	cythonize_dir = "build/pari"
+ 
+ kwds = dict(include_dirs=[opj("src", "cysignals"),
+                           opj(cythonize_dir, "src"),
+@@ -43,7 +45,11 @@
+ config_pxd_file = opj(cythonize_dir, "src", "config.pxd")
+ if not os.path.isfile(config_pxd_file):
+     import subprocess
+-    subprocess.check_call( "make configure && ./configure " + ac_configure_flags , shell=True)
++    subprocess.check_call(
++				"make configure && mkdir -p " + cythonize_dir +
++				" && " +
++				"{ cd " + cythonize_dir + " ; ../../configure " + ac_configure_flags + " ; }" ,
++			shell=True)
+ 
+ 
+ # Determine installation directory from distutils
+--- a/configure.ac
++++ b/configure.ac
+@@ -8,7 +8,7 @@
+ AC_INIT([cysignals], VERSION, [https://github.com/sagemath/cysignals/issues])
+ AC_CONFIG_MACRO_DIR([m4])
+ AC_CONFIG_SRCDIR([src/cysignals/pxi.h])
+-AC_CONFIG_HEADERS([build/src/config.h:src/config.h.in])
++AC_CONFIG_HEADERS([src/config.h])
+ 
+ AC_LANG(C)
+ 
+@@ -32,13 +32,13 @@
+ )
+ 
+ 
+-AC_CONFIG_COMMANDS([build/src/config.pxd],
++AC_CONFIG_COMMANDS([src/config.pxd],
+     # Generate a file config.pxd whose contents will be copied to
+     # __init__.pxd to set correct compiler options.
+     # The -DCYSIGNALS_DUMMY works around https://github.com/cython/cython/pull/485
+     [[
+-			echo "# distutils: extra_compile_args = $EXTRACOMPILEARGS" >build/src/config.pxd
+-			echo "# distutils: extra_link_args = -DCYSIGNALS_DUMMY $EXTRALINKARGS" >>build/src/config.pxd
++			echo "# distutils: extra_compile_args = $EXTRACOMPILEARGS" > src/config.pxd
++			echo "# distutils: extra_link_args = -DCYSIGNALS_DUMMY $EXTRALINKARGS" >> src/config.pxd
+ 		]],
+     [
+ 			EXTRACOMPILEARGS="$PARI_CPPFLAGS $PARI_CFLAGS"
diff --git a/debian/patches/upstream-lintian-spelling-error-silence.patch b/debian/patches/upstream-lintian-spelling-error-silence.patch
new file mode 100644
index 0000000..98e1929
--- /dev/null
+++ b/debian/patches/upstream-lintian-spelling-error-silence.patch
... 440 lines suppressed ...

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



More information about the Python-modules-commits mailing list