[libmpikmeans] 03/29: Initial packaging

Christian Kastner chrisk-guest at moszumanska.debian.org
Mon Aug 25 21:19:59 UTC 2014


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

chrisk-guest pushed a commit to branch master
in repository libmpikmeans.

commit 4bd9be9cd8979ea1dc925c8cf9592fc0ad537963
Author: Christian Kastner <debian at kvr.at>
Date:   Wed Apr 13 00:33:22 2011 +0200

    Initial packaging
---
 debian/changelog                                   |   9 ++
 debian/compat                                      |   1 +
 debian/control                                     | 101 ++++++++++++
 debian/copyright                                   |  59 +++++++
 debian/libmpikmeans-dev.dirs                       |   2 +
 debian/libmpikmeans-dev.install                    |   3 +
 debian/libmpikmeans1.dirs                          |   1 +
 debian/libmpikmeans1.docs                          |   1 +
 debian/libmpikmeans1.examples                      |   1 +
 debian/libmpikmeans1.install                       |   1 +
 debian/libmpikmeans1.symbols                       |  15 ++
 debian/mpi_assign.1                                |  35 +++++
 debian/mpi_kmeans.1                                |  44 ++++++
 debian/mpikmeans-tools.dirs                        |   1 +
 debian/mpikmeans-tools.install                     |   2 +
 debian/mpikmeans-tools.manpages                    |   2 +
 ...uild-shared-and-static-libraries-programs.patch | 170 +++++++++++++++++++++
 debian/patches/0002-Drop-unused-option.patch       |  52 +++++++
 .../0003-Correct-command-name-in-help.patch        |  49 ++++++
 debian/patches/series                              |   3 +
 debian/python-mpikmeans.install                    |   2 +
 debian/pyversions                                  |   1 +
 debian/rules                                       |  36 +++++
 debian/source/format                               |   1 +
 24 files changed, 592 insertions(+)

diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..6e81260
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,9 @@
+libmpikmeans (1.5-1) unstable; urgency=low
+
+  * Initial release (Closes: #622275)
+  * debian/patches:
+    - 0001-Properly-build-shared-and-static-libraries-programs
+    - 0002-Drop-unused-option
+    - 0003-Correct-command-name-in-help
+
+ -- Christian Kastner <debian at kvr.at>  Wed, 13 Apr 2011 00:07:57 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..6edd5a1
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,101 @@
+Source: libmpikmeans
+Section: libs
+Priority: extra
+Maintainer: Christian Kastner <debian at kvr.at>
+Build-Depends:
+    debhelper (>= 7.0.50~),
+    python-support (>= 0.90),
+    python-all-dev,
+    cython,
+    python-numpy,
+    libboost-dev,
+    libboost-filesystem-dev,
+    libboost-program-options-dev
+Standards-Version: 3.9.2
+Homepage: http://mloss.org/software/view/48/
+Vcs-Git: git://scm.kvr.at/git/pkg-libmpikmeans.git
+Vcs-Browser: http://scm.kvr.at/git//?p=pkg-libmpikmeans.git;a=summary
+
+Package: libmpikmeans-dev
+Section: libdevel
+Architecture: any
+Depends:
+    ${misc:Depends},
+    libmpikmeans1 (= ${binary:Version})
+Description: Development libraries and header files for MPIKmeans
+ This library uses an algorithm that yields the very same solution as standard
+ k-means, even after each iteration. However, it uses triangle inequalities, and
+ is much faster.
+ .
+ Note: MPI here does not refer to the Message Passing Interface; rather, it is
+ an acronym for Max Planck Institute, where this algorithm was developed.
+ .
+ This package contains the header files and static libraries.
+
+Package: libmpikmeans1
+Architecture: any
+Depends:
+    ${shlibs:Depends},
+    ${misc:Depends}
+Description: Fast Library for k-means Clustering
+ This library uses an algorithm that yields the very same solution as standard
+ k-means, even after each iteration. However, it uses triangle inequalities, and
+ is much faster.
+ .
+ Note: MPI here does not refer to the Message Passing Interface; rather, it is
+ an acronym for Max Planck Institute, where this algorithm was developed.
+ .
+ This package contains the shared libraries.
+
+Package: libmpikmeans-dbg
+Section: debug
+Architecture: any
+Depends:
+    ${misc:Depends},
+    libmpikmeans1 (= ${binary:Version})
+Description: Debugging symbols for MPIKmeans
+ This library uses an algorithm that yields the very same solution as standard
+ k-means, even after each iteration. However, it uses triangle inequalities, and
+ is much faster.
+ .
+ Note: MPI here does not refer to the Message Passing Interface; rather, it is
+ an acronym for Max Planck Institute, where this algorithm was developed.
+ .
+ This package contains the debugging symbols.
+
+Package: mpikmeans-tools
+Architecture: any
+Depends:
+    ${shlibs:Depends},
+    ${misc:Depends},
+    libmpikmeans1 (= ${binary:Version})
+Description: Standalone applications for MPIKmeans
+ This library uses an algorithm that yields the very same solution as standard
+ k-means, even after each iteration. However, it uses triangle inequalities, and
+ is much faster.
+ .
+ Note: MPI here does not refer to the Message Passing Interface; rather, it is
+ an acronym for Max Planck Institute, where this algorithm was developed.
+ .
+ This package contains the standalone applications.
+
+Package: python-mpikmeans
+Section: python
+Architecture: any
+Depends:
+    ${python:Depends},
+    ${shlibs:Depends},
+    ${misc:Depends},
+    libmpikmeans1 (= ${binary:Version}),
+    python-numpy
+Description: Python bindings for MPIKmeans
+ This library uses an algorithm that yields the very same solution as standard
+ k-means, even after each iteration. However, it uses triangle inequalities, and
+ is much faster.
+ .
+ Note: MPI here does not refer to the Message Passing Interface; rather, it is
+ an acronym for Max Planck Institute, where this algorithm was developed.
+ .
+ This package contains the Python bindings. Both the old, ctypes-based and the
+ new, Cython-based interfaces are provided.
+
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..39c850b
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,59 @@
+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=166
+Upstream-Name: MPIKmeans
+Upstream-Contact: Peter Gehler <pgehler at tuebingen.mpg.de>
+Source: http://mloss.org/software/view/48/
+Disclaimer:
+ For DFSG purposes, some of the files have been removed from the upstream
+ source. Specifically, those files were: 
+    Precompiled binaries: *.o, *.so, *.mexa64, *.mexglx, mpi_kmeans,
+                          mpi_kmeans64, mpi_assign, mpi_assign64 
+    Cython auto-generated code: py_kmeans.pyx
+
+Files: *    
+Copyright: 2008-2009, Peter Gehler <pgehler at tuebingen.mpg.de>
+License: Apache-2
+
+Files: py_kmeans.pyx
+Copyright: 2008, Thomas Wiecki <wiecki at tuebingen.mpg.de>
+           2008, Christoph Lampert <christoph.lampert at tuebingen.mpg.de>
+License: GPL-2+
+
+Files: debian/*
+Copyright: 2011, Christian Kastner <debian at kvr.at>
+License: GPL-2+
+
+Files: debian/patches/*
+Copyright: 2011, Christian Kastner <debian at kvr.at>
+License: Apache-2
+
+License: Apache-2
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ .
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ .
+ On Debian systems, the complete text of the Apache version 2.0 license
+ can be found in "/usr/share/common-licenses/Apache-2.0".
+
+License: GPL-2+
+ This program 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 2 of the License, or
+ (at your option) any later version.
+ .
+ This program 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 program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ .
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file
+ "/usr/share/common-licenses/GPL-2".
diff --git a/debian/libmpikmeans-dev.dirs b/debian/libmpikmeans-dev.dirs
new file mode 100644
index 0000000..4418816
--- /dev/null
+++ b/debian/libmpikmeans-dev.dirs
@@ -0,0 +1,2 @@
+usr/lib
+usr/include
diff --git a/debian/libmpikmeans-dev.install b/debian/libmpikmeans-dev.install
new file mode 100644
index 0000000..f1bdeb3
--- /dev/null
+++ b/debian/libmpikmeans-dev.install
@@ -0,0 +1,3 @@
+mpi_kmeans.h usr/include
+lib*.a usr/lib
+lib*.so usr/lib
diff --git a/debian/libmpikmeans1.dirs b/debian/libmpikmeans1.dirs
new file mode 100644
index 0000000..6845771
--- /dev/null
+++ b/debian/libmpikmeans1.dirs
@@ -0,0 +1 @@
+usr/lib
diff --git a/debian/libmpikmeans1.docs b/debian/libmpikmeans1.docs
new file mode 100644
index 0000000..e845566
--- /dev/null
+++ b/debian/libmpikmeans1.docs
@@ -0,0 +1 @@
+README
diff --git a/debian/libmpikmeans1.examples b/debian/libmpikmeans1.examples
new file mode 100644
index 0000000..3ee2488
--- /dev/null
+++ b/debian/libmpikmeans1.examples
@@ -0,0 +1 @@
+example.txt
diff --git a/debian/libmpikmeans1.install b/debian/libmpikmeans1.install
new file mode 100644
index 0000000..0f787b1
--- /dev/null
+++ b/debian/libmpikmeans1.install
@@ -0,0 +1 @@
+lib*.so.* usr/lib
diff --git a/debian/libmpikmeans1.symbols b/debian/libmpikmeans1.symbols
new file mode 100644
index 0000000..85151bf
--- /dev/null
+++ b/debian/libmpikmeans1.symbols
@@ -0,0 +1,15 @@
+libmpikmeans.so.1 libmpikmeans1 #MINVER#
+ (c++)"kmeans_run(double*, double const*, unsigned int*, unsigned int, unsigned int, unsigned int, unsigned int)@Base" 1.5
+ (c++)"kmeans_error(char*)@Base" 1.5
+ (c++)"comp_randperm(void const*, void const*)@Base" 1.5
+ (c++)"compute_sserror(double const*, double const*, unsigned int const*, unsigned int, unsigned int)@Base" 1.5
+ (c++)"compute_distance(double const*, double const*, unsigned int)@Base" 1.5
+ (c++)"add_point_to_cluster(unsigned int, double*, double const*, unsigned int*, unsigned int)@Base" 1.5
+ (c++)"init_point_to_cluster(unsigned int, double const*, double const*, unsigned int, unsigned int, double*, float*, float const*)@Base" 1.5
+ (c++)"assign_point_to_cluster(unsigned int, double const*, double const*, unsigned int, unsigned int, unsigned int, double*, float*, float*, float*)@Base" 1.5
+ (c++)"compute_cluster_distances(float*, float*, double const*, unsigned int, unsigned int, bool const*)@Base" 1.5
+ (c++)"remove_identical_clusters(double*, float*, double const*, unsigned int*, unsigned int*, unsigned int, unsigned int, unsigned int)@Base" 1.5
+ (c++)"remove_point_from_cluster(unsigned int, double*, double const*, unsigned int*, unsigned int)@Base" 1.5
+ (c++)"assign_point_to_cluster_ordinary(double const*, double const*, unsigned int, unsigned int)@Base" 1.5
+ (c++)"randperm(unsigned int*, unsigned int)@Base" 1.5
+ kmeans at Base 1.5
diff --git a/debian/mpi_assign.1 b/debian/mpi_assign.1
new file mode 100644
index 0000000..c506fae
--- /dev/null
+++ b/debian/mpi_assign.1
@@ -0,0 +1,35 @@
+.TH MPI_ASSIGN 1 "April 11, 2011"
+.SH NAME
+mpi_assign \- Assign points to cluster centers produced by mpi_kmeans
+.SH SYNOPSIS
+.B mpi_assign
+.RI [ options ]
+.SH DESCRIPTION
+\fBmpi_assign\fP is a program that assigns points to a list of cluster centers
+as generated by \fBmpi_kmeans\fR(1).
+.SH OPTIONS
+A summary of options is included below.
+.SS "Generic Options"
+.TP
+\fB\-\-help\fR
+Produce help message
+.SS "Input/Output Options"
+.TP
+\fB\-\-data\fR file
+Data file, one datum per line (default: "data.txt")
+.TP
+\fB\-\-cluster\fR file
+Cluster file, one cluster center per line (default: clustercenter.txt)
+.TP
+\fB\-\-assignment\fR file
+Output file, one cluster center per line (default: assignment.txt)
+.SS "Example:"
+.IP
+mpi_assign \fB\-\-data\fR example.txt \fB\-\-cluster\fR clusters.txt \fB\-\-assignment\fR assignment.txt
+.SH SEE ALSO
+.BR mpi_kmeans (1)
+.SH AUTHOR
+\fBmpi_assign\fR was written by Peter Gehler <pgehler at tuebingen.mpg.de>.
+.PP
+This manual page was written by Christian Kastner <debian at kvr.at>,
+for the Debian project (and may be used by others).
diff --git a/debian/mpi_kmeans.1 b/debian/mpi_kmeans.1
new file mode 100644
index 0000000..47adb2d
--- /dev/null
+++ b/debian/mpi_kmeans.1
@@ -0,0 +1,44 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.TH MPI_KMEANS 1 "April 11, 2011"
+.SH NAME
+mpi_kmeans \- K-Means clustering tool
+.SH SYNOPSIS
+.B mpi_kmeans
+.RI [ options ]
+.SH DESCRIPTION
+\fBmpi_kmeans\fP is a program that uses k-means clustering to produce a list of
+cluster centers. The resulting data can be used by \fBmpi_assign\fR(1) to assign
+points to those cluster centers.
+.SH OPTIONS
+A summary of options is included below.
+.SS "Generic Options:"
+.TP
+\fB\-\-help\fR
+Produce help message
+.SS "Input/Output Options:"
+.TP
+\fB\-\-data\fR \fIfile\fR
+Training file, one datum per line (default: "data.txt")
+.TP
+\fB\-\-output\fR \fIfile\fR
+Output file, one cluster center per line (default: "output.txt")
+.SS "K-Means Options:"
+.TP
+\fB\-\-k\fR \fInum\fR
+Number of clusters to generate (default: 100)
+.TP
+\fB\-\-restarts\fR \fInum\fR
+Number of k\-means restarts (default: 0 = single run)
+.TP
+\fB\-\-maxiter\fR \fInum\fR
+Maximum number of k\-means iterations (default: 0 = infinity)
+.SH EXAMPLES
+.IP
+mpi_kmeans \-\-k 2 \-\-data example.txt \-\-output clusters.txt
+.SH SEE ALSO
+.BR mpi_assign (1)
+.SH AUTHOR
+\fBmpi_kmeans\fR was written by Peter Gehler <peter.gehler at tuebingen.mpg.de>.
+.PP
+This manual page was written by Christian Kastner <debian at kvr.at>,
+for the Debian project (and may be used by others).
diff --git a/debian/mpikmeans-tools.dirs b/debian/mpikmeans-tools.dirs
new file mode 100644
index 0000000..e772481
--- /dev/null
+++ b/debian/mpikmeans-tools.dirs
@@ -0,0 +1 @@
+usr/bin
diff --git a/debian/mpikmeans-tools.install b/debian/mpikmeans-tools.install
new file mode 100644
index 0000000..0e1e16e
--- /dev/null
+++ b/debian/mpikmeans-tools.install
@@ -0,0 +1,2 @@
+mpi_kmeans usr/bin
+mpi_assign usr/bin
diff --git a/debian/mpikmeans-tools.manpages b/debian/mpikmeans-tools.manpages
new file mode 100644
index 0000000..0b2b0f0
--- /dev/null
+++ b/debian/mpikmeans-tools.manpages
@@ -0,0 +1,2 @@
+debian/mpi_kmeans.1
+debian/mpi_assign.1
diff --git a/debian/patches/0001-Properly-build-shared-and-static-libraries-programs.patch b/debian/patches/0001-Properly-build-shared-and-static-libraries-programs.patch
new file mode 100644
index 0000000..c05989d
--- /dev/null
+++ b/debian/patches/0001-Properly-build-shared-and-static-libraries-programs.patch
@@ -0,0 +1,170 @@
+From: Christian Kastner <debian at kvr.at>
+Date: Mon, 11 Apr 2011 19:26:09 +0200
+Subject: [PATCH] Properly build shared and static libraries, programs
+
+Modify upstream's Makefile to 1) properly build shared and static libraries,
+2) link upstream's programs to the shared libraries and 3) build Python
+extensions for all supported Python versions.
+
+Forwarded: not-needed
+Last-Update: 2011-04-11
+
+Index: mpikmeans-1.5/Makefile
+===================================================================
+--- mpikmeans-1.5.orig/Makefile	2011-04-11 19:49:33.004001563 +0200
++++ mpikmeans-1.5/Makefile	2011-04-11 19:57:56.312002046 +0200
+@@ -1,16 +1,33 @@
+-#
+-# Choose your compiler
+-#
+-# 
++#!/usr/bin/make -f
++
++CC = gcc
++CXX = g++
++PYTHON = python
++
++CFLAGS +=
++LDFLAGS +=
++LIBS +=
+ 
+-#CC = gcc-4.2
+-#CPP = g++-4.2
+-#CFLAGS=-O3 -ffast-math -fomit-frame-pointer -fPIC -mtune=k8 -march=k8 -Werror
+-CC = gcc-4.1
+-CPP = g++-4.1
+-CFLAGS=-O3 -ffast-math -fomit-frame-pointer -fPIC -Werror
+-#CC=/agbs/share/sw/icc/bin/icc
+-#CFLAGS= -fast -DCOMPILE_WITH_ICC -Werror
++LIB_CFLAGS = $(CFLAGS) -fPIC
++LIB_LDFLAGS = $(LDFLAGS)
++LIB_LIBS = $(LIBS)
++
++PROG_CFLAGS = $(CFLAGS)
++PROG_LDFLAGS = $(LDFLAGS) -L. -Wl,--as-needed
++PROG_LIBS = $(LIBS) -lmpikmeans -lboost_system -lboost_program_options -lboost_filesystem
++
++
++# The real LVER/LSUBVER should be passed on by debian/rules
++LVER ?= 0
++LSUBVER ?= 0
++LIBFILE = libmpikmeans.so.$(LVER).$(LSUBVER)
++
++# Without PYVER present, use the default Python version.
++#
++# It is expected that the 'python' target -- where this var is used -- will be
++# called once for every supported Python version. IOW, we don't iterated here,
++# we assume our caller (usually: debian/rules) is iterating.
++PYVER ?= $(shell pyversions -d -v)
+ 
+ #
+ # MPI KMEANS FLAGS
+@@ -25,19 +42,6 @@
+ MATLAB_INCLUDE=-I$(MATLABDIR)/extern/include
+ 
+ #
+-# BOOST LIBS (for standalone only)
+-#
+-BOOST_LIB=-L/kyb/agbs/pgehler/lib -lboost_program_options-gcc41-mt -lboost_filesystem-gcc41-mt -lboost_system-gcc41-mt
+-BOOST_INCLUDE=-I/kyb/agbs/pgehler/include/boost-1_36/
+-
+-#
+-# PYTHON
+-#
+-PYTHON_INCLUDE=-I/usr/include/python2.5
+-PYTHON_LIB=-lpython2.5
+-NUMPY_INCLUDE=-I/usr/lib/python2.5/site-packages/numpy/core/include
+-
+-#
+ # ARCHITECURE
+ # 
+ 
+@@ -49,34 +53,31 @@
+ #SUFFIX=mexa64
+ #MATLAB_LIB=-L$(MATLABDIR)/bin/glnxa64 -lmex
+ 
+-LIBS=/usr/lib/gcc/i486-linux-gnu/4.1/libstdc++.a /usr/lib/libm.a
+ 
+-all: standalone matlab libmpikmeans python
++all: 		lib standalone python
++lib:		$(LIBFILE) libmpikmeans.a
++standalone:	mpi_kmeans mpi_assign
++python:		cython_wrapper
++
+ matlab: 	mpi_kmeans_mex.$(SUFFIX) mpi_assign_mex.$(SUFFIX)
+-standalone:	mpi_kmeans_main mpi_assign_main
+-python:	cython_wrapper
+ 
+-mpi_kmeans.o:	mpi_kmeans.cxx mpi_kmeans.h
+-	$(CC) $(CFLAGS) $(VERBOSEFLAG) $(PRECISION) -c -o $@ mpi_kmeans.cxx
++libmpikmeans.a:
++	$(CXX) $(CFLAGS) $(LDFLAGS) -c -o libmpikmeans-static.o mpi_kmeans.cxx
++	ar cru libmpikmeans.a libmpikmeans-static.o
++
++$(LIBFILE): 	mpi_kmeans.cxx mpi_kmeans.h
++	$(CXX) $(LIB_CFLAGS) $(LIB_LDFLAGS) -shared \
++		 -Wl,-soname=libmpikmeans.so.$(LVER) \
++		-o $@ $(VERBOSEFLAGS) $(PRECISION) \
++		mpi_kmeans.cxx $(LIB_LIBS)
++	ln -s $@ libmpikmeans.so.$(LVER)
++	ln -s libmpikmeans.so.$(LVER) libmpikmeans.so
+ 
+-libmpikmeans:	mpi_kmeans.o
+-	ar rc libmpikmeans.a mpi_kmeans.o
+-	ranlib libmpikmeans.a
+-	$(CC) -shared -Wl,-soname=libmpikmeans.so -fPIC $(CFLAGS) -o libmpikmeans.so $(VERBOSEFLAGS) $(PRECISION) mpi_kmeans.cxx
+-
+-mpi_kmeans_main.o:	mpi_kmeans_main.cxx
+-	$(CC) $(CFLAGS) $(BOOST_INCLUDE) -c -o mpi_kmeans_main.o mpi_kmeans_main.cxx 
+-
+-mpi_assign_main.o:	mpi_assign_main.cxx
+-	$(CC) $(CFLAGS) $(BOOST_INCLUDE) -c -o mpi_assign_main.o mpi_assign_main.cxx 
+-
+-mpi_kmeans_main:	libmpikmeans mpi_kmeans_main.o
+-	$(CC) mpi_kmeans_main.o  $(CFLAGS) -L/usr/lib/ -static -o mpi_kmeans -lm libmpikmeans.a \
+-		$(BOOST_LIB) $(LIBS)
+-
+-mpi_assign_main:	libmpikmeans mpi_assign_main.o
+-	$(CC) mpi_assign_main.o  $(CFLAGS) -L/usr/lib/ -static -o mpi_assign -lm libmpikmeans.a \
+-		$(BOOST_LIB) $(LIBS)
++mpi_kmeans:	mpi_kmeans_main.cxx $(LIBFILE)
++	$(CXX) $(PROG_CFLAGS) $(PROG_LDFLAGS) -o $@ mpi_kmeans_main.cxx $(PROG_LIBS)
++
++mpi_assign:	mpi_assign_main.cxx $(LIBFILE)
++	$(CXX) $(PROG_CFLAGS) $(PROG_LDFLAGS) -o $@ mpi_assign_main.cxx $(PROG_LIBS)
+ 
+ %_mex.o:	%_mex.cxx
+ 	$(CC) $(CFLAGS) $(MATLAB_INCLUDE) $(VERBOSEFLAG) $(PRECISION) -c $^ -o $@
+@@ -87,18 +88,27 @@
+ mpi_assign_mex.$(SUFFIX):	libmpikmeans mpi_assign_mex.o
+ 	$(CC) mpi_assign_mex.o -shared -o mpi_assign_mex.$(SUFFIX) libmpikmeans.a $(MATLAB_LIB)
+ 
+-cython_wrapper:	py_kmeans.c mpi_kmeans.o
+-	$(CPP) $(CFLAGS) $(PYTHON_INCLUDE) $(NUMPY_INCLUDE) -c -o py_kmeans.o py_kmeans.c
+-	$(CPP) $(CFLAGS) $(PYTHON_LIB) -lm -pthread -shared py_kmeans.o mpi_kmeans.o  -o py_kmeans.so 
++py_kmeans.c: py_kmeans.pyx
++	cython py_kmeans.pyx
++
++# See note regarding PYVER above
++cython_wrapper:	py_kmeans.c
++	mkdir -p python-build/python$(PYVER)
++	$(CXX) $(CFLAGS) -c -I/usr/include/python$(PYVER) \
++		-pthread -fPIC -o py_kmeans.o py_kmeans.c
++	$(CXX) $(CFLAGS) $(PYTHON_LDFLAGS) -pthread -shared -Wl,--as-needed \
++		-lpython$(PYVER) -L. -lmpikmeans \
++		-o python-build/python$(PYVER)/py_kmeans.so py_kmeans.o
+ 
+-test:	
++matlab-test:
+ 	matlab -nojvm -r "test_code;exit"
+ 
+ clean:	
+ 	rm -f *.o
+ 	rm -f *.mexglx
+ 	rm -f *.mexa64
+-	rm -f libmpikmeans.so
++	rm -f libmpikmeans.so*
+ 	rm -f libmpikmeans.a
++	rm -rf py_kmeans.c python-build
+ 	rm -f mpi_assign mpi_kmeans
+ 
diff --git a/debian/patches/0002-Drop-unused-option.patch b/debian/patches/0002-Drop-unused-option.patch
new file mode 100644
index 0000000..15dee41
--- /dev/null
+++ b/debian/patches/0002-Drop-unused-option.patch
@@ -0,0 +1,52 @@
+From: Christian Kastner <debian at kvr.at>
+Date: Mon, 11 Apr 2011 19:31:14 +0200
+Subject: [PATCH] Drop unused option
+
+Upstream's binaries say they support a run-time "verbose" option, but they
+don't -- it's a compile-time option. Drop these to avoid confusion.
+
+Forwarded: no
+Last-Update: 2011-04-11
+
+Index: mpikmeans-1.5/mpi_assign_main.cxx
+===================================================================
+--- mpikmeans-1.5.orig/mpi_assign_main.cxx	2011-04-11 19:49:28.420001563 +0200
++++ mpikmeans-1.5/mpi_assign_main.cxx	2011-04-11 19:49:36.180001563 +0200
+@@ -102,7 +102,6 @@
+ 	po::options_description generic("Generic Options");
+ 	generic.add_options()
+ 		("help","Produce help message")
+-		("verbose","Verbose output")
+ 		;
+ 
+ 	po::options_description input_options("Input/Output Options");
+@@ -124,8 +123,6 @@
+ 	po::store(po::command_line_parser(argc,argv).options(all_options).run(), vm);
+ 	po::notify(vm);
+ 
+-	bool verbose = vm.count("verbose");
+-
+ 	if (vm.count("help")) {
+ 		std::cerr << "Assigning points to cluster center" << std::endl;
+ 		std::cerr << all_options << std::endl;
+Index: mpikmeans-1.5/mpi_kmeans_main.cxx
+===================================================================
+--- mpikmeans-1.5.orig/mpi_kmeans_main.cxx	2011-04-11 19:49:28.468001563 +0200
++++ mpikmeans-1.5/mpi_kmeans_main.cxx	2011-04-11 19:49:36.180001563 +0200
+@@ -212,7 +212,6 @@
+ 	po::options_description generic("Generic Options");
+ 	generic.add_options()
+ 		("help","Produce help message")
+-		("verbose","Verbose output")
+ 		;
+ 
+ 	po::options_description input_options("Input/Output Options");
+@@ -241,8 +240,6 @@
+ 	po::store(po::command_line_parser(argc,argv).options(all_options).run(), vm);
+ 	po::notify(vm);
+ 
+-	bool verbose = vm.count("verbose");
+-
+ 	if (vm.count("help")) {
+ 		std::cerr << "K-Means clustering" << std::endl;
+ 		std::cerr << all_options << std::endl;
diff --git a/debian/patches/0003-Correct-command-name-in-help.patch b/debian/patches/0003-Correct-command-name-in-help.patch
new file mode 100644
index 0000000..d7c5b2d
--- /dev/null
+++ b/debian/patches/0003-Correct-command-name-in-help.patch
@@ -0,0 +1,49 @@
+From: Christian Kastner <debian at kvr.at>
+Date: Mon, 11 Apr 2011 21:04:23 +0200
+Subject: [PATCH] Correct command name in help
+
+mpi_kmeans accidentally speaks about mpi_assign a few times
+
+Forwarded: no
+Last-Update: 2011-04-11
+
+Index: mpikmeans-1.5/mpi_kmeans_main.cxx
+===================================================================
+--- mpikmeans-1.5.orig/mpi_kmeans_main.cxx	2011-04-11 21:02:39.596001579 +0200
++++ mpikmeans-1.5/mpi_kmeans_main.cxx	2011-04-11 21:03:22.824011767 +0200
+@@ -101,7 +101,7 @@
+ 	if (in.fail()) {
+ 		std::cerr << "Failed to open file \""
+ 				  << train_filename << "\" for reading." << std::endl;
+-		std::cerr << "Try mpi_assign --help" << std::endl;
++		std::cerr << "Try mpi_kmeans --help" << std::endl;
+ 		exit(EXIT_FAILURE);
+ 	}
+ 
+@@ -134,7 +134,7 @@
+ 	if (data_X.size() == 0) {
+ 		std::cerr << "No points read from file \"" << train_filename
+ 				  << "\"" << std::endl;
+-		std::cerr << "Try mpi_assign --help" << std::endl;
++		std::cerr << "Try mpi_kmeans --help" << std::endl;
+ 		exit(EXIT_FAILURE);
+ 	}
+ 
+@@ -149,7 +149,7 @@
+ 	if (in.fail()) {
+ 		std::cerr << "Failed to open file \""
+ 				  << train_filename << "\" for reading." << std::endl;
+-		std::cerr << "Try mpi_assign --help" << std::endl;
++		std::cerr << "Try mpi_kmeans --help" << std::endl;
+ 		exit(EXIT_FAILURE);
+ 	}
+ 
+@@ -157,7 +157,7 @@
+ 	if (nof_points == 0) {
+ 		std::cerr << "No points read from file \"" << train_filename
+ 				  << "\"" << std::endl;
+-		std::cerr << "Try mpi_assign --help" << std::endl;
++		std::cerr << "Try mpi_kmeans --help" << std::endl;
+ 		exit(EXIT_FAILURE);
+ 	}
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..e39112f
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,3 @@
+0001-Properly-build-shared-and-static-libraries-programs.patch
+0002-Drop-unused-option.patch
+0003-Correct-command-name-in-help.patch
diff --git a/debian/python-mpikmeans.install b/debian/python-mpikmeans.install
new file mode 100644
index 0000000..6071434
--- /dev/null
+++ b/debian/python-mpikmeans.install
@@ -0,0 +1,2 @@
+python-build/* usr/lib/pyshared
+mpi_kmeans.py usr/share/pyshared
diff --git a/debian/pyversions b/debian/pyversions
new file mode 100644
index 0000000..b3dc41e
--- /dev/null
+++ b/debian/pyversions
@@ -0,0 +1 @@
+2.5-
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..2eefd25
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,36 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# Get version numbers for SONAME from changelog
+DVER = $(shell dpkg-parsechangelog | grep '^Version')
+LVER = $(shell echo $(DVER) | sed -e 's/Version: \([0-9]*\)\..*/\1/')
+LSUBVER = $(shell echo $(DVER) | sed -e 's/Version: .*\.\([0-9]*\).*/\1/')
+export LVER
+export LSUBVER
+
+# Python versions supported by this package
+PYVERS = $(shell pyversions -r -v)
+export PYVERS
+
+CFLAGS += -Wall -Wno-unused
+
+
+%:
+	dh $@ 
+
+override_dh_auto_build:
+	make lib
+	make standalone
+	for py in $(PYVERS); do \
+		PYVER=$$py make python; \
+	done
+
+override_dh_strip:
+	dh_strip --dbg-package=libmpikmeans-dbg
+	
+	# Rename pyshared to pymodules
+	cd debian/libmpikmeans-dbg/usr/lib/debug/usr/lib && mv pyshared pymodules
+
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)

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



More information about the debian-science-commits mailing list