[libfann] 25/133: Include example data from upstream, and add examples for python
Christian Kastner
chrisk-guest at moszumanska.debian.org
Sat Oct 4 21:07:45 UTC 2014
This is an automated email from the git hooks/post-receive script.
chrisk-guest pushed a commit to branch master
in repository libfann.
commit ce27ceff15f51d1e510eee92a876e2c7c2d90ecd
Author: Christian Kastner <debian at kvr.at>
Date: Mon Jun 7 15:28:03 2010 +0200
Include example data from upstream, and add examples for python
The paths within the examples have to be modified on-the-fly because they are
relative to upstream's source dir, not the locations within Debian.
Documentation was included on how to run them.
---
debian/README-libfann2-examples | 8 ++++++++
debian/README-pyfann-examples-data | 2 ++
debian/changelog | 4 ++++
debian/example-paths.sed | 7 +++++++
debian/libfann2-dev.examples | 1 +
debian/python-pyfann.examples | 1 +
debian/rules | 16 ++++++++++++++++
7 files changed, 39 insertions(+)
diff --git a/debian/README-libfann2-examples b/debian/README-libfann2-examples
new file mode 100644
index 0000000..8f42a64
--- /dev/null
+++ b/debian/README-libfann2-examples
@@ -0,0 +1,8 @@
+To compile and run these tests, execute the following commands within a
+directory for which you have write permission:
+
+ $ gcc -o <example> -lm -lfann <example>.c
+ $ ./example
+
+Note that some of these tests have interdependencies. Specifically, for all
+tests NAME_test.c, you have to run NAME_train.c first.
diff --git a/debian/README-pyfann-examples-data b/debian/README-pyfann-examples-data
new file mode 100644
index 0000000..00622f4
--- /dev/null
+++ b/debian/README-pyfann-examples-data
@@ -0,0 +1,2 @@
+IMPORTANT NOTE: package libfann2-dev must be installed for the examples in this
+directory to work!
diff --git a/debian/changelog b/debian/changelog
index c7e8b09..c420189 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -28,9 +28,13 @@ libfann2 (2.1.0~beta~dfsg-1) UNRELEASED; urgency=low
* libfann2-py:
- Rename package to Python Policy-conform python-pyfann
- Removed debhelper helper files no longer needed because of python-support
+ - Modify example paths and include instructions on how to run them
* libfann2-doc:
- New package
- Add doc-base entry for documentation. Closes: #297951
+ * libfann2-dev:
+ - Include training data for examples, modify their paths and include
+ instructions on how to run them. Closes: #498227
* debian/patches:
- Added 0001-Link-python-pyfann-dynamically-instead-of-statically.patch
- Added 0002-Link-against-libm.patch (Closes: #558887)
diff --git a/debian/example-paths.sed b/debian/example-paths.sed
new file mode 100644
index 0000000..346d8a0
--- /dev/null
+++ b/debian/example-paths.sed
@@ -0,0 +1,7 @@
+s/\(\.\.\/\)\+benchmarks/\/usr\/share\/doc\/libfann2-dev\/examples/
+s/("\.\.","\.\.","benchmarks"/("\/","usr","share","doc","libfann2-dev", "examples"/
+s/\.\.\/\.\.\/examples/\/usr\/share\/doc\/libfann2-dev\/examples/
+s/"xor.data"/"\/usr\/share\/doc\/libfann2-dev\/examples\/xor.data"/
+s/"scaling.data"/"\/usr\/share\/doc\/libfann2-dev\/examples\/scaling.data"/
+s/("nets",/(/
+s/("nets\//("/
diff --git a/debian/libfann2-dev.examples b/debian/libfann2-dev.examples
index 67a8248..3215afc 100644
--- a/debian/libfann2-dev.examples
+++ b/debian/libfann2-dev.examples
@@ -1,3 +1,4 @@
+benchmarks/datasets
examples/*.c
examples/*.cpp
examples/*.data
diff --git a/debian/python-pyfann.examples b/debian/python-pyfann.examples
new file mode 100644
index 0000000..c885c15
--- /dev/null
+++ b/debian/python-pyfann.examples
@@ -0,0 +1 @@
+python/examples/*
diff --git a/debian/rules b/debian/rules
index 4bf7953..81c88b0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -64,6 +64,22 @@ override_dh_installexamples:
# Remove unnecessary executable bits from training data sets
chmod 644 debian/libfann2-dev/usr/share/doc/libfann2-dev/examples/datasets/*
+
+ # Modify dataset paths in examples to point to libfann2-dev datasets. This
+ # was not implemented as a patch to upstream to preserve the ability to
+ # run upstream's own tests within the source dir.
+ sed -i -f debian/example-paths.sed \
+ debian/libfann2-dev/usr/share/doc/libfann2-dev/examples/*.c \
+ debian/python-pyfann/usr/share/doc/python-pyfann/examples/*.py
+
+ # Add compile/run instructions for the examples
+ cp debian/README-libfann2-examples \
+ debian/libfann2-dev/usr/share/doc/libfann2-dev/examples/README
+
+ # Add a warning to the python examples that they require data from
+ # libfann2-dev
+ cp debian/README-pyfann-examples-data \
+ debian/python-pyfann/usr/share/doc/python-pyfann/examples/README
override_dh_compress:
# Don't compress example files and datasets
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/libfann.git
More information about the debian-science-commits
mailing list