[python-fann2] 02/06: Add initial packaging

Christian Kastner ckk at moszumanska.debian.org
Tue Sep 29 19:31:34 UTC 2015


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

ckk pushed a commit to branch master
in repository python-fann2.

commit 7d6eea86715aee5036e59b760741c36197f4c789
Author: Christian Kastner <ckk at kvr.at>
Date:   Tue Sep 29 13:51:07 2015 +0200

    Add initial packaging
---
 debian/changelog               |  5 ++++
 debian/compat                  |  1 +
 debian/control                 | 62 ++++++++++++++++++++++++++++++++++++++++++
 debian/copyright               | 46 +++++++++++++++++++++++++++++++
 debian/docs                    |  1 +
 debian/patches/series          |  0
 debian/rules                   | 47 ++++++++++++++++++++++++++++++++
 debian/source/format           |  1 +
 debian/tests/common            | 32 ++++++++++++++++++++++
 debian/tests/control           |  8 ++++++
 debian/tests/pyfann-deprecated |  5 ++++
 debian/tests/python2-basic     |  5 ++++
 debian/tests/python3-basic     |  5 ++++
 debian/watch                   |  4 +++
 14 files changed, 222 insertions(+)

diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..f716de2
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+python-fann2 (1:1.0.7-1) UNRELEASED; urgency=medium
+
+  * Initial release. (Closes: #800075)
+
+ -- Christian Kastner <ckk at debian.org>  Mon, 28 Sep 2015 23:25:37 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..8eb14fe
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,62 @@
+Source: python-fann2
+Section: python
+Priority: optional
+Maintainer: Christian Kastner <ckk at debian.org>
+Build-Depends:
+    debhelper (>= 9),
+    dh-python,
+    python-all-dev,
+    python-setuptools,
+    python3-all-dev,
+    python3-setuptools,
+    swig (>= 2.0.4-2),
+    libfann-dev,
+Standards-Version: 3.9.6
+Homepage: https://github.com/FutureLinkCorporation/fann2/
+Vcs-Git: git://anonscm.debian.org/debian-science/packages/python-fann2.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-science/packages/python-fann2.git
+X-Python-Version: >= 2.6
+X-Python3-Version: >= 3.0
+
+Package: python3-fann2
+Architecture: any
+Depends:
+    ${python3:Depends},
+    ${shlibs:Depends},
+    ${misc:Depends},
+Description: Python 3 bindings for FANN
+ Fast Artificial Neural Network Library is a free open source neural network
+ library, which implements multilayer artificial neural networks in C with
+ support for both fully connected and sparsely connected networks.
+ .
+ This package contains the Python 3 bindings for FANN.
+
+Package: python-fann2
+Architecture: any
+Depends:
+    ${python3:Depends},
+    ${shlibs:Depends},
+    ${misc:Depends},
+Description: Python bindings for FANN
+ Fast Artificial Neural Network Library is a free open source neural network
+ library, which implements multilayer artificial neural networks in C with
+ support for both fully connected and sparsely connected networks.
+ .
+ This package contains the Python bindings for FANN.
+
+Package: python-pyfann
+Section: oldlibs
+Priority: extra
+Architecture: any
+Depends:
+    ${python:Depends},
+    ${shlibs:Depends},
+    ${misc:Depends},
+Description: deprecated Python bindings for FANN
+ Fast Artificial Neural Network Library is a free open source neural network
+ library, which implements multilayer artificial neural networks in C with
+ support for both fully connected and sparsely connected networks.
+ .
+ This package provides the Python bindings for FANN under their former name
+ "pyfann". However, these are deprecated, and you should migrate your code
+ to use the bindings from python-fann2 instead.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..94ea08e
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,46 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: fann2
+Source: https://github.com/FutureLinkCorporation/fann2/
+Comment:
+ Until FANN-2.1.0, the Python bindings to FANN were provided by src:libfann
+ itself. These are now maintained by an external contributor, hence a separate
+ source package.
+
+Files: *
+Copyright: 2004-2007, Vincenzo Di Massa <hawk at hawk.linuxpratico.net>
+           2014-2015, FutureLinkCorporation
+License: LGPL-2.1+
+
+Files: include/*
+Copyright: 2004-2012, Steffen Nissen <sn at leenissen.dk>
+License: LGPL-2.1+
+
+Files: debian/*
+Copyright: 2015, Christian Kastner <ckk at debian.org>
+License: LGPL-2.1+
+
+Files: debian/patches/*
+Copyright: 2015, Christian Kastner <ckk at debian.org>
+License: LGPL-2.1+
+
+Files: debian/patches/Add-an-example.patch
+Copyright: 2004-2007, Vincenzo Di Massa <hawk at hawk.linuxpratico.net>
+           2015, Christian Kastner <ckk at debian.org>
+License: LGPL-2.1+
+
+License: LGPL-2.1+
+ 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 2.1 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-2.1".
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..a1320b1
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1 @@
+README.rst
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..e69de29
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..df05755
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,47 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+#
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+export PYBUILD_NAME=fann2
+
+
+%:
+	dh $@ --with python2,python3 --buildsystem=pybuild
+
+
+override_dh_auto_test:
+	mkdir -p test
+	
+	PYBUILD_SYSTEM=custom \
+	PYBUILD_TEST_ARGS="\
+		ADTTMP={dir}/test \
+		PYTHONPATH={build_dir} \
+		PYINTERPRETER={interpreter} \
+		/bin/sh $(CURDIR)/debian/tests/python{version.major}-basic" \
+	dh_auto_test
+
+
+override_dh_auto_install:
+	dh_auto_install
+	
+	# Package python-pyfann provides the "fann2" module under the
+	# former name "pyfann". It is sufficient to symlink the latter
+	# to the former.
+	PYBUILD_DISABLE_python3=1 \
+	PYBUILD_NAME=pyfann \
+	PYBUILD_SYSTEM=custom \
+	PYBUILD_BEFORE_INSTALL="mkdir -p debian/{package}/{install_dir}" \
+	PYBUILD_INSTALL_ARGS="cd debian/{package}/{install_dir} && ln -s ../fann2 pyfann" \
+	dh_auto_install
+
+
+override_dh_auto_clean:
+	dh_auto_clean
+	
+	rm -rf build
+	rm -rf test
+	rm -f fann2/fann2_wrap.cxx fann2/fann2_wrap.cpp
+	rm -f fann2/libfann.py
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/tests/common b/debian/tests/common
new file mode 100644
index 0000000..cfb9725
--- /dev/null
+++ b/debian/tests/common
@@ -0,0 +1,32 @@
+#!/bin/sh
+# Consolidates common code of the autopkgtests
+# Requires that ADTTMP and PYINTERPRETER are set
+
+set -e
+
+# Presence of $ADTTMP implies that someone will handle cleanup for us
+if [ -z "$ADTTMP" ]
+then
+	echo "Required envvar ADTTMP is not set" >&2
+	exit 1
+fi
+
+if [ -z "$PYINTERPRETER" ]
+then
+	echo "Python interpreter PYINTERPRETER is not set" >&2
+	exit 1
+fi
+
+# Copy the simple example and the training data to $ADTTMP, and execute it
+mkdir -p "$ADTTMP/$PYINTERPRETER"
+cp examples/simple_train.py "$ADTTMP/$PYINTERPRETER"
+cp examples/xor.data "$ADTTMP/$PYINTERPRETER"
+cd "$ADTTMP/$PYINTERPRETER"
+
+if [ "$1" = "pyfann" ]
+then
+	sed -i -r -e 's/from fann2/from pyfann/' simple_train.py
+fi
+
+$PYINTERPRETER simple_train.py
+echo "run: OK"
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..87469b9
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,8 @@
+Tests: python2-basic
+Depends: python-fann2
+
+Tests: python3-basic
+Depends: python3-fann2
+
+Tests: pyfann-deprecated
+Depends: python-pyfann
diff --git a/debian/tests/pyfann-deprecated b/debian/tests/pyfann-deprecated
new file mode 100755
index 0000000..804ea9a
--- /dev/null
+++ b/debian/tests/pyfann-deprecated
@@ -0,0 +1,5 @@
+#!/bin/sh
+# autopkgtest check: Python module successfully imported and executed
+
+# python2.Y at build time, python at CI time
+PYINTERPRETER=${PYINTERPRETER:-python} sh debian/tests/common pyfann
diff --git a/debian/tests/python2-basic b/debian/tests/python2-basic
new file mode 100755
index 0000000..157f85b
--- /dev/null
+++ b/debian/tests/python2-basic
@@ -0,0 +1,5 @@
+#!/bin/sh
+# autopkgtest check: Python module successfully imported and executed
+
+# python2.Y at build time, python at CI time
+PYINTERPRETER=${PYINTERPRETER:-python} sh debian/tests/common
diff --git a/debian/tests/python3-basic b/debian/tests/python3-basic
new file mode 100755
index 0000000..c970498
--- /dev/null
+++ b/debian/tests/python3-basic
@@ -0,0 +1,5 @@
+#!/bin/sh
+# autopkgtest check: Python module successfully imported and executed
+
+# python3.Y at build time, python3 at CI time
+PYINTERPRETER=${PYINTERPRETER:-python3} sh debian/tests/common
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..c39ce22
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,4 @@
+version=3
+
+opts="filenamemangle=s/.+\/(\d\S*)\.tar\.gz/python-fann2-$1\.tar\.gz/" \
+  https://github.com/FutureLinkCorporation/fann2/releases .*/(\d\S*)\.tar\.gz

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



More information about the debian-science-commits mailing list