[shogun/f19] Initial import (#1043283)
Björn Esser
besser82 at fedoraproject.org
Mon Dec 16 22:29:52 UTC 2013
commit ee8ad6efafb684d98d325bae3867d928a20fb540
Author: Björn Esser <bjoern.esser at gmail.com>
Date: Mon Dec 16 23:27:42 2013 +0100
Initial import (#1043283)
.gitignore | 5 +
shogun.spec | 938 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sources | 3 +
3 files changed, 946 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..090749b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,5 @@
+*~
+*.rpm
+*.tar*
+*.zip
+results_*/
diff --git a/shogun.spec b/shogun.spec
new file mode 100644
index 0000000..eb6b020
--- /dev/null
+++ b/shogun.spec
@@ -0,0 +1,938 @@
+# Conditional for release and snapshot builds. Uncomment for release-builds.
+# %%global rel_build 1
+
+# Settings used for build from snapshots.
+%{!?rel_build:%global commit_src 70e774d7432051e56b0b79554376194c3bf21b12}
+%{!?rel_build:%global commit_src_date 20131212}
+%{!?rel_build:%global shortcommit_src %(c=%{commit_src};echo ${c:0:7})}
+%{!?rel_build:%global gitver_src git%{commit_src_date}-%{shortcommit_src}}
+%{!?rel_build:%global gitrel_src .git%{commit_src_date}.%{shortcommit_src}}
+%{!?rel_build:%global gittar_src %{name}-%{version}-%{gitver_src}.tar.gz}
+
+# We need the data-files for the testsuite, too.
+%{!?rel_build:%global commit_data 39f2ac8143ed6b2018ce5b420b9deb6935b7eb78}
+%{!?rel_build:%global commit_data_date 20131210}
+%{!?rel_build:%global shortcommit_data %(c=%{commit_data};echo ${c:0:7})}
+%{!?rel_build:%global gitver_data git%{commit_data_date}-%{shortcommit_data}}
+%{!?rel_build:%global gitrel_data .git%{commit_data_date}.%{shortcommit_data}}
+%{!?rel_build:%global gittar_data %{name}-data-%{version}-%{gitver_data}.tar.gz}
+
+# This is needed, because src-url contains branched part of versioning-scheme.
+%global branch 3.1
+
+# Filter all provides from bindings and private libs.
+%global __provides_exclude_from ^(%{_libdir}/.*/.*%{name}\\.so|%{_libdir}/libmod%{name}.so)
+
+# There's no Python3 on older distributions.
+%if (0%{?fedora} && 0%{?fedora} <= 12) || (0%{?rhel} && 0%{?rhel} <= 6)
+%global without_python3 1
+%endif
+
+# Some bindings are globally disabled by default, because they either FTBFS
+# or testsuite fails for them. We disable them here until they will build.
+%global without_java 1 # needs Oracle's binary-JDK, unfortunately.
+%global without_mono 1 # Mono-bindings are currently segfaulting.
+%global without_perl 1 # not fully implemented by upstream,yet.
+%global without_python3 1 # not fully ported by upstream, yet.
+%global without_r 1 # Testsuite chokes, build broken for R >= 3.0.0.
+
+# Some switches to control build of SWIGed-bindings and testsuite. You still
+# can pass overriding defines `-D 'with_XXX 1'` or `-D 'without_XXX 1'` to
+# rpmbuild.
+%{!?without_cli: %global with_cli 1}
+%{!?without_java: %global with_java 1}
+%{!?without_lua: %global with_lua 1}
+%{!?without_mono: %global with_mono 1}
+%{!?without_octave: %global with_octave 1}
+%{!?without_perl: %global with_perl 1}
+%{!?without_python: %global with_python 1}
+%{!?without_python3: %global with_python3 1}
+%{!?without_r: %global with_r 1}
+%{!?without_ruby: %global with_ruby 1}
+%{!?without_tests: %global with_tests 1}
+
+# The description commonly used by all (sub-)packages.
+%global common_description \
+The SHOGUN machine learning toolbox's focus is on large scale kernel methods \
+and especially on Support Vector Machines (SVM). It provides a generic SVM \
+object interfacing to several different SVM implementations, among them the \
+state of the art LibSVM. Each of the SVMs can be combined with a variety of \
+kernels. The toolbox not only provides efficient implementations of the most \
+common kernels, like the Linear, Polynomial, Gaussian and Sigmoid Kernel but \
+also comes with a number of recent string kernels as e.g. the Locality \
+Improved, Fischer, TOP, Spectrum, Weighted Degree Kernel (with shifts). For \
+the latter the efficient LINADD optimizations are implemented. Also SHOGUN \
+offers the freedom of working with custom pre-computed kernels. One of its \
+key features is the "combined kernel" which can be constructed by a weighted \
+linear combination of a number of sub-kernels, each of which not necessarily \
+working on the same domain. An optimal sub-kernel weighting can be learned \
+using Multiple Kernel Learning. Currently SVM 2-class classification and \
+regression problems can be dealt with. However SHOGUN also implements a \
+number of linear methods like Linear Discriminant Analysis (LDA), Linear \
+Programming Machine (LPM), (Kernel) Perceptrons and features algorithms to \
+train hidden Markov-models. The input feature-objects can be dense, sparse \
+or strings and of type int/short/double/char and can be converted into \
+different feature types. Chains of "pre-processors" (e.g. subtracting the \
+mean) can be attached to each feature object allowing for on-the-fly \
+pre-processing.
+
+###############################################################################
+
+Name: shogun
+Version: %{branch}.0
+Release: 0.1%{?gitrel_src}%{?dist}
+Summary: Large Scale Machine Learning Toolbox
+
+# ===== License-breakdown =====
+#
+#
+# GPLv3+
+# ------
+# * except the files explicitly named below
+#
+#
+# BSD (2 clause)
+# --------------
+# src/shogun/lib/external/shogun_libsvm.cpp
+# src/shogun/lib/external/shogun_libsvm.h
+# src/shogun/optimization/liblinear/shogun_liblinear.cpp
+# src/shogun/optimization/liblinear/shogun_liblinear.h
+# src/shogun/optimization/liblinear/tron.cpp
+# src/shogun/optimization/liblinear/tron.h
+#
+#
+# BSD (3 clause)
+# --------------
+# src/shogun/lib/external/SFMT/* src/shogun/lib/external/dSFMT/*
+#
+#
+# GPLv2+
+# ------
+# src/shogun/lib/external/ssl.cpp src/shogun/lib/external/ssl.h
+# src/shogun/mathematics/munkres.cpp src/shogun/mathematics/munkres.h
+# src/shogun/structure/DynProg.cpp
+# src/shogun/transfer/multitask/MultitaskKernelMaskNormalizer.h
+# src/shogun/transfer/multitask/MultitaskKernelMaskPairNormalizer.h
+# src/shogun/transfer/multitask/MultitaskKernelPlifNormalizer.h
+# src/shogun/transfer/multitask/MultitaskKernelTreeNormalizer.h
+#
+#
+# GPLv2+ or LGPLv2+
+# -----------------
+# src/shogun/multiclass/LaRank.cpp src/shogun/multiclass/LaRank.h
+#
+#
+# LGPLv2+
+# -------
+# src/shogun/classifier/svm/OnlineSVMSGD.cpp
+# src/shogun/classifier/svm/OnlineSVMSGD.h
+# src/shogun/classifier/svm/SGDQN.cpp src/shogun/classifier/svm/SGDQN.h
+# src/shogun/classifier/svm/SVMSGD.cpp src/shogun/classifier/svm/SVMSGD.h
+# src/shogun/lib/external/brent.cpp src/shogun/lib/external/brent.h
+#
+#
+# MIT/X11 (BSD like)
+# ------------------
+# src/shogun/optimization/lbfgs/lbfgs.cpp
+# src/shogun/optimization/lbfgs/lbfgs.h
+#
+#
+License: GPLv3+ and BSD and GPLv2+ and (GPLv2+ or LGPLv2+) and GPLv3 and LGPLv2+ and MIT and (Public Domain or GPLv3+)
+URL: http://%{name}-toolbox.org
+# Sources for release-builds.
+%{?rel_build:Source0: %{url}/archives/%{name}/releases/%{branch}/sources/%{name}-%{version}.tar.bz2}
+%{?rel_build:Source1: %{url}/archives/%{name}/data/%{name}-data-%{version}.tar.bz2}
+# Sources for snapshot-builds.
+%{!?rel_build:Source0: https://github.com/%{name}-toolbox/%{name}/archive/%{commit_src}.tar.gz#/%{gittar_src}}
+%{!?rel_build:Source1: https://github.com/%{name}-toolbox/%{name}-data/archive/%{commit_data}.tar.gz#/%{gittar_data}}
+Source99: http://googlemock.googlecode.com/files/gmock-1.7.0.zip
+
+BuildRequires: arpack-devel
+BuildRequires: arprec-devel
+BuildRequires: atlas-devel
+BuildRequires: blas-devel
+BuildRequires: bzip2-devel
+BuildRequires: chrpath
+BuildRequires: ColPack-devel
+BuildRequires: glpk-devel
+BuildRequires: hdf5-devel
+BuildRequires: iputils
+BuildRequires: json-c-devel
+%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8
+BuildRequires: lapack-devel
+%endif
+BuildRequires: libcurl-devel
+BuildRequires: libxml2-devel
+BuildRequires: lpsolve-devel
+BuildRequires: lzo-devel
+BuildRequires: NLopt-devel
+BuildRequires: protobuf-devel
+BuildRequires: qd-devel
+BuildRequires: snappy-devel
+BuildRequires: tapkee-devel
+BuildRequires: xz-devel
+BuildRequires: zlib-devel
+
+%if 0%{?fedora} || 0%{?rhel} >= 7
+BuildRequires: cmake
+BuildRequires: eigen3-devel
+BuildRequires: swig
+%else
+BuildRequires: cmake28
+BuildRequires: eigen32-devel
+BuildRequires: swig2
+%endif
+
+# testsuite
+BuildRequires: gdb
+BuildRequires: valgrind
+
+# copylib - Wildcard-exception granted by FPC.
+# See: https://fedorahosted.org/fpc/ticket/174
+Provides: bundled(dSFMT)
+Provides: bundled(gnulib)
+Provides: bundled(liblinear)
+Provides: bundled(libsvm)
+Provides: bundled(SFMT)
+Provides: bundled(SVMlin)
+
+%description
+%{?common_description}
+
+SHOGUN is implemented in C++ and offers interfaces for
+%{?with_cli:CLI}
+%{?with_java:, Java}
+%{?with_lua:, Lua}
+%{?with_mono:, Mono (C#)}
+%{?with_octave:, Octave}
+%{?with_perl:, Perl}
+%{?with_python:, Python}
+%{?with_python3:, Python3}
+%{?with_r:, R}
+%{?with_ruby:, Ruby}.
+
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%doc README.md doc/md/LICENSE*
+%{_libdir}/lib%{name}.so.*
+
+###############################################################################
+
+%if 0%{?with_cli}
+%package cli
+
+Summary: CLI-interface for %{name}
+
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description cli
+%{?common_description}
+
+This package contains the CLI-interface for %{name}.
+
+%files cli
+%{_bindir}/%{name}
+%endif #0%{?with_cli}
+
+###############################################################################
+
+%package devel
+
+Summary: Development files for %{name}
+
+Requires: arpack-devel%{?_isa}
+Requires: arprec-devel%{?_isa}
+Requires: atlas-devel%{?_isa}
+Requires: blas-devel%{?_isa}
+Requires: bzip2-devel%{?_isa}
+Requires: ColPack-devel%{?_isa}
+Requires: eigen3-devel
+Requires: glpk-devel%{?_isa}
+Requires: hdf5-devel%{?_isa}
+Requires: json-c-devel%{?_isa}
+%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8
+BuildRequires: lapack-devel%{?_isa}
+%endif
+Requires: libcurl-devel%{?_isa}
+Requires: libxml2-devel%{?_isa}
+Requires: lpsolve-devel%{?_isa}
+Requires: lzo-devel%{?_isa}
+Requires: NLopt-devel%{?_isa}
+Requires: qd-devel%{?_isa}
+Requires: snappy-devel%{?_isa}
+Requires: tapkee-devel
+Requires: xz-devel%{?_isa}
+Requires: zlib-devel%{?_isa}
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description devel
+%{?common_description}
+
+This package contains files needed for development with %{name}.
+
+%files devel
+%doc doc/md/README_developer.md doc/md/README_soname.md
+%{_includedir}/%{name}
+%{_libdir}/lib%{name}.so
+
+###############################################################################
+
+%package doc
+# Do not check any files in docdir for Requires.
+%global __requires_exclude_from ^%{_docdir}/.*$
+
+Summary: Documentation files for %{name}
+
+%{!?el5:BuildArch: noarch}
+
+%if 0%{?fedora} || 0%{?rhel} >= 7
+BuildRequires: doxygen-latex
+BuildRequires: fdupes
+%else
+BuildRequires: doxygen
+BuildRequires: ghostscript
+BuildRequires: tex(latex)
+%endif
+BuildRequires: graphviz
+BuildRequires: texlive-appendix
+BuildRequires: texlive-lastpage
+BuildRequires: texlive-todonotes
+
+%description doc
+%{?common_description}
+
+This package contains the ChangeLog, a very detailed documentation,
+and some great examples for %{name}.
+
+%files doc
+%doc ChangeLog NEWS README* build/unittest*.log doc/md/AUTHORS*
+%doc doc/md/CONTRIBUTIONS* doc/md/LICENSE* doc/md/README* doc/html* doc/images
+%doc doc/ipython-notebooks examples
+
+###############################################################################
+
+%if 0%{?with_java}
+%package -n java-%{name}
+Summary: Java-plugin for %{name}
+
+BuildRequires: java-devel
+BuildRequires: jblas
+
+Requires: java%{?_isa}
+Requires: jblas%{?_isa}
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description -n java-%{name}
+%{?common_description}
+
+This package contains the Java-plugin for %{name}.
+
+%files -n java-%{name}
+%endif #0%{?with_java}
+
+###############################################################################
+
+%if 0%{?with_lua}
+%package -n lua-%{name}
+# http://fedoraproject.org/wiki/PackagingDrafts/Lua
+%{!?lua_ver: %global lua_ver %(lua -e 'print(string.sub(_VERSION, 5))' || echo 0)}
+%global lualibdir %{_libdir}/lua/%{lua_ver}
+%global luanext 5.2
+
+Summary: LUA-plugin for %{name}
+
+BuildRequires: lua-devel
+
+Requires: lua%{?_isa}
+%if 0%{?fedora} || 0%{?rhel} >= 7
+Requires: lua(abi) = %{lua_ver}
+%else
+Requires: lua >= %{lua_ver}
+Requires: lua < %{luanext}
+%endif
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description -n lua-%{name}
+%{?common_description}
+
+This package contains the LUA-plugin for %{name}.
+
+%files -n lua-%{name}
+%{lualibdir}/libmod%{name}.so
+%endif #0%{?with_lua}
+
+###############################################################################
+
+%if 0%{?with_mono}
+%package -n mono-%{name}
+Summary: Mono(C#)-plugin for %{name}
+
+BuildRequires: mono-devel
+
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description -n mono-%{name}
+%{?common_description}
+
+This package contains the Mono(C#)-plugin for %{name}.
+
+%files -n mono-%{name}
+%{_libdir}/%{name}
+%endif #0%{?with_mono}
+
+###############################################################################
+
+%if 0%{?with_octave}
+%package -n octave-%{name}
+# https://fedoraproject.org/wiki/Packaging:Octave
+%{!?octave_api: %global octave_api %(octave-config -p API_VERSION || echo 0)}
+%global octave_octdir %(octave-config -p LOCALAPIOCTFILEDIR || echo '')
+
+Summary: Octave-plugin for %{name}
+
+BuildRequires: octave-devel
+
+Requires: octave%{?_isa} >= 3.6
+Requires: octave(api) = %{octave_api}
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description -n octave-%{name}
+%{?common_description}
+
+This package contains the Octave-plugin for %{name}.
+
+%files -n octave-%{name}
+%{octave_octdir}/%{name}
+%endif #0%{?with_octave}
+
+###############################################################################
+
+%if 0%{?with_perl}
+%package -n perl-%{name}
+Summary: Perl-plugin for %{name}
+
+BuildRequires: perl-devel
+
+Requires: perl%{?_isa}
+Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description -n perl-%{name}
+%{?common_description}
+
+This package contains the Perl-plugin for %{name}.
+
+%files -n perl-%{name}
+%{perl_vendorarch}/*
+%exclude %dir %{perl_vendorarch}/auto
+%endif #0%{?with_perl}
+
+###############################################################################
+
+%if 0%{?with_python}
+%package -n python-%{name}
+%{!?__python2: %global __python2 %{__python27}}
+%{!?python2_sitearch: %global python2_sitearch %{python27_sitearch}}
+%{!?python2_ver: %global python2_ver %(%{__python2} -c 'import platform; print platform.python_version();' || echo 0)}
+
+Summary: Python-plugin for %{name}
+
+%if 0%{?fedora} || 0%{?rhel} >= 7
+BuildRequires: numpy
+BuildRequires: python-docutils
+BuildRequires: python-jinja2
+BuildRequires: python2-devel
+BuildRequires: scipy
+
+Requires: numpy%{?_isa}
+Requires: python%{?_isa}
+Requires: scipy%{?_isa}
+%else
+BuildRequires: python27-numpy
+BuildRequires: python27-docutils
+BuildRequires: python27-jinja2
+BuildRequires: python27-devel
+
+Requires: python27%{?_isa}
+Requires: python27-numpy%{?_isa}
+Requires: python27-scipy%{?_isa}
+%endif
+
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+
+%description -n python-%{name}
+%{?common_description}
+
+This package contains the Python-plugin for %{name}.
+
+%files -n python-%{name}
+%{python2_sitearch}/*
+%endif #0%{?with_python}
+
+###############################################################################
+
+%if 0%{?with_python3}
+%package -n python3-%{name}
+Summary: Python-plugin for %{name}
+
+BuildRequires: python3-devel
+BuildRequires: python3-docutils
+BuildRequires: python3-jinja2
+BuildRequires: python3-numpy
+BuildRequires: python3-scipy
+
+Requires: python3%{?_isa}
+Requires: python3-numpy%{?_isa}
+Requires: python3-scipy%{?_isa}
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description -n python3-%{name}
+%{?common_description}
+
+This package contains the Python3-plugin for %{name}.
+
+%files -n python3-%{name}
+%{python3_sitearch}/*
+%endif #0%{?with_python3}
+
+###############################################################################
+
+%if 0%{?with_r}
+%package -n R-%{name}
+Summary: R-plugin for %{name}
+
+BuildRequires: R-core-devel
+
+Requires: R-core%{?_isa}
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description -n R-%{name}
+%{?common_description}
+
+This package contains the R-plugin for %{name}.
+
+%files -n R-%{name}
+%dir %{_libdir}/R/library/%{name}
+%doc %{_libdir}/R/library/%{name}/DESCRIPTION
+%doc %{_libdir}/R/library/%{name}/demo
+%{_libdir}/R/library/%{name}/libs
+%{_libdir}/R/library/%{name}/Meta
+%{_libdir}/R/library/%{name}/NAMESPACE
+%{_libdir}/R/library/%{name}/R
+%endif #0%{?with_r}
+
+###############################################################################
+
+%if 0%{?with_ruby}
+%package -n ruby-%{name}
+# For compatibility with RHEL <= 6.
+%{!?ruby_vendorlibdir: %global ruby_vendorlibdir %(ruby -rrbconfig -e "puts RbConfig::CONFIG['sitelibdir']")}
+%{!?ruby_vendorarchdir: %global ruby_vendorarchdir %(ruby -rrbconfig -e "puts RbConfig::CONFIG['sitearchdir']")}
+
+# We need to pass the path for rubygem(narray) to CMake, so it can find it.
+%global narray_gem %(gem list narray | grep narray | sed -e's! .!-!' -e 's!.$!!')
+%global narray_include %{_datadir}/gems/gems/%{narray_gem}
+%if 0%{?fedora} || 0%{?rhel} >= 7
+%global narray_lib %{_libdir}/gems/ruby/%{narray_gem}/narray.so
+%else
+%global narray_lib %{ruby_vendorarchdir}/narray.so
+%endif
+
+Summary: Ruby-plugin for %{name}
+
+BuildRequires: ruby-devel
+BuildRequires: rubygem-narray-devel
+
+%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
+Requires: ruby(release)
+%else
+Requires: ruby(abi) = %{?rhel:1.8}%{!?rhel:1.9.1}
+%endif
+Requires: rubygem(narray)%{?_isa}
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description -n ruby-%{name}
+%{?common_description}
+
+This package contains the Ruby-plugin for %{name}.
+
+%files -n ruby-%{name}
+%{ruby_vendorarchdir}/mod%{name}.so
+%endif #0%{?with_ruby}
+
+###############################################################################
+
+%prep
+%setup -q%{!?rel_build:n %{name}-%{commit_src}}
+
+# Scrub stuff that needs linking to license encumbered libs, which we can't
+# ship. Thanks to Dr. Sören Sonnenburg (sonney2k), the upstream author, for
+# this. The scriptlets have been slightly modified by me to preserve the
+# original timestamps.
+#
+# TODO: Some next release or git-snapshot ships GPL'ed replacement of SVMlight
+# called SVMbright. The scriptlet isn't needed anymore when this will be.
+#
+# <LICENSE>
+#
+# The following scriptlet is Copyright (C) 1999 - 2013 Dr. Sören Sonnenburg
+# Modifications are Copyright (C) 2013 Björn Esser
+#
+# 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 3 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, see <http://www.gnu.org/licenses/>.
+#
+rm -rf examples/*/*/*light* \
+ examples/undocumented/matlab_and_octave/tests/*light* \
+ src/shogun/classifier/svm/SVMLight.* \
+ src/shogun/classifier/svm/SVMLightOneClass.* \
+ src/shogun/regression/svr/SVRLight.* \
+ doc/md/LICENSE_SVMlight*
+
+for _file in `grep -rl USE_SVMLIGHT .`
+do
+ sed -i.orig -e \
+ '/\#ifdef USE_SVMLIGHT/,/\#endif \/\/USE_SVMLIGHT/c \\' ${_file} && \
+ touch -r ${_file}.orig ${_file} && \
+ rm -rf ${_file}.orig
+done
+
+for _file in `find . -depth -name 'CMakeLists.txt'`
+do
+ sed -i.orig -e 's!.*_sv[mr]light_.*!!g' ${_file} && \
+ touch -r ${_file}.orig ${_file} && \
+ rm -rf ${_file}.orig
+done
+
+for _file in src/shogun/kernel/Kernel.{cpp,h}
+do
+ sed -i.orig -e '/^ \* EXCEPT FOR THE KERNEL CACHING FUNCTIONS WHICH ARE (W) THORSTEN JOACHIMS/,/ \* this program is free software/c\ * This program is free software; you can redistribute it and/or modify' \
+ ${_file} && \
+ touch -r ${_file}.orig ${_file} && \
+ rm -rf ${_file}.orig
+done
+
+_file="src/interfaces/modular/Transfer_includes.i" && \
+cp -a ${_file} ${_file}.orig && \
+echo '%}' >> ${_file} && \
+touch -r ${_file}.orig ${_file} && \
+rm -rf ${_file}.orig
+
+_file="examples/undocumented/libshogun/" && \
+_file="${_file}evaluation_cross_validation_locked_comparison.cpp" && \
+sed -i.orig -e '/.*SVMLight.h>$/d' ${_file} && \
+touch -r ${_file}.orig ${_file} && \
+rm -rf ${_file}.orig
+#
+# </LICENSE>
+
+# Remove cluttering stuff and create some needed dirs.
+rm -rf applications build data doc/tutorial py3_build third_party
+mkdir -p build py3_build third_party/GoogleMock
+
+# Unbundle Tapkee. This is pretty the same as we have in our repos.
+rm -rf doc/md/LICENSE_tapkee.md
+pushd src/shogun/lib/tapkee
+for _needed_sources in tapkee_shogun.*
+do
+ sed -e 's!<shogun/lib/!<!g' \
+ -e 's!tapkee/tapkee_shogun.hpp>$!shogun/lib/&!g' \
+ < ${_needed_sources} > ${_needed_sources}.mod && \
+ touch -r ${_needed_sources} ${_needed_sources}.mod
+done
+
+rm -rf */ *.{cpp,h,hpp}
+
+for _needed_sources in tapkee_shogun.*
+do
+ mv ${_needed_sources} `echo ${_needed_sources} | sed -e 's!\.mod$!!g'`
+done
+popd
+
+# Disable unwanted / overriding compiler-flags in release-mode, which would
+# set such stuff like "-march=native" or "-O3 -g0".
+sed -i -e 's!^[ \t]*[sS][eE][tT].*.*_FLAGS_RELEASE!#&!g' \
+ -e 's!^[ \t]*[sS][eE][tT].*-march=native!#&!g' \
+ CMakeLists.txt
+
+# Fix testsuite invocation for C#/Mono plugin.
+sed -i -e 's!\${CSHARP_INTERPRETER}!%(which mono)!g' \
+ examples/undocumented/csharp_modular/CMakeLists.txt
+
+# Fix finding PerlLibs and linking against HDF5.
+sed -i -e 's!FindPerlLibs REQUIRED!PerlLibs REQUIRED!' \
+ -e '/SET.HDF5_LIBRARIES/d' \
+ CMakeLists.txt
+
+# Fix install path for R-plugins.
+sed -i -e "s~\${R_COMPONENT_LIB_PATH}/shogun/Meta~`pwd`/test_install/&~g" \
+ -e "s~\.r-install.sh ~&`pwd`/test_install/~g" \
+ src/interfaces/r_modular/CMakeLists.txt
+
+# Fix testsuite environment for R.
+sed -i -e "s~^ENDFOREACH~\tset_property\\(TEST r_modular-\${EXAMPLE_NAME} PROPERTY\n\t\t\t\tENVIRONMENT \\\"R_LIBS_USER=\\\\\\\"`pwd`/test_install%{_libdir}/R/library\\\\\\\"\\\"\\)\n&~" \
+ examples/undocumented/r_modular/CMakeLists.txt
+
+# Ruby-plugins go to %%{ruby_vendorarchdir}, but on <= el6.
+%if 0%{?fedora} || 0%{?rhel} >= 7
+sed -i -e 's!\${RUBY_SITE_ARCH_DIR}!\${RUBY_VENDORARCH_DIR}!g' \
+ src/interfaces/ruby_modular/CMakeLists.txt
+%endif
+
+# Fix testsuite environment for Ruby.
+sed -i -e "s!\${NARRAY_PATH}!%{narray_include}:&!" \
+ examples/undocumented/ruby_modular/CMakeLists.txt
+
+# Patch the Ruby-files to `require 'rubygems'` asap.
+for _file in `find . -depth -type f -name '*.rb'`
+do
+ sed -i.orig -e "0,/^require/s//require \'rubygems\'\n&/" ${_file} && \
+ touch -r ${_file}.orig ${_file} && \
+ rm -rf ${_file}.orig
+done
+
+# This is needed for testsuite not to fail on some tests.
+echo "# noop" > examples/undocumented/python_modular/tools/__init__.py
+
+# Copy the other sources into tree.
+%setup -TDqa 1 %{!?rel_build:-n %{name}-%{commit_src}}
+install -pm 0644 %{SOURCE99} third_party/GoogleMock
+
+# Move data into proper location.
+mv %{name}-data-%{?commit_data}* data
+
+# Add data to examples, because they need it to be run.
+mkdir -p examples/data
+mv -f data/toy/* examples/data
+for _dir in 'documented' 'undocumented'
+do
+ unlink examples/${_dir}/data
+ ln -fs ../data examples/${_dir}/
+done
+
+###############################################################################
+
+%build
+# These will be used for creation of CTest-files, only. There's no impact on
+# the built binaries caused by them. They are needed to be defined on %%build,
+# because CMake hardcodes them when creating the Makefiles and it's cache.
+
+# We need to export a customized PYTHONPATH.
+export PYTHONPATH="`pwd`/test_install/%{python2_sitearch}/%{name}"
+export PYTHONPATH="${PYTHONPATH}:`pwd`/test_install/%{python2_sitearch}"
+export PYTHONPATH="${PYTHONPATH}:$(pwd)/examples/undocumented/python_modular"
+export PYTHONPATH="${PYTHONPATH}:%{python2_sitearch}:%{python2_sitelib}"
+
+# We need to export some custom LD_LIBRARY_PATH for the tests, too.
+export LD_LIBRARY_PATH="`pwd`/test_install/%{_libdir}"
+export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:%{_libdir}/atlas"
+export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:%{_libdir}"
+
+pushd build
+%cmake \
+ -DCMAKE_BUILD_TYPE=Release \
+%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8
+ -DATLAS_LIBRARIES=%{_libdir}/atlas/libtatlas.so \
+%endif
+%{?with_tests: -DBUILD_DASHBOARD_REPORTS=ON } \
+ -DBUNDLE_EIGEN=OFF \
+ -DBUNDLE_NLOPT=OFF \
+ -DBUNDLE_JSON=OFF \
+ -DENABLE_CCACHE=OFF \
+%{?with_tests: -DENABLE_TESTING=ON } \
+ -DUSE_SVMLIGHT=OFF \
+%{?with_cli: -DCmdLineStatic=ON } \
+%{?with_mono: -DCSharpModular=ON } \
+%{?with_java: -DJavaModular=ON } \
+%{?with_lua: -DLuaModular=ON } \
+%{?with_ruby: -DRUBY_NARRAY_INCLUDE_DIR="%{narray_include}" } \
+%{?with_ruby: -DRUBY_NARRAY_LIBRARY="%{narray_lib}" } \
+%{?with_octave: -DOctaveModular=ON } \
+%{?with_perl: -DPerlModular=ON } \
+%{?with_python: -DPythonModular=ON } \
+%{?with_python: -DPYTHON_EXECUTABLE="%{__python2}" } \
+%{?with_r: -DRModular=ON } \
+%{?with_ruby: -DRubyModular=ON } \
+ ..
+# Because of memory-limits (4 GBytes RAM / 4 GBytes swap) on Koji-workers we
+# cannot use `make %%{?_smp_mflags}`. A single make-thread needs to have
+# ~1.5 GBytes of RAM or swap avail. 5 * 1.5 = 7.5 is hard on the limit, so
+# we limit parallel-make to 3 threads = 4.5 GBytes. The actual thing consuming
+# these amounts of memory is not the build itself, but SWIG, which eats RAM
+# like chocolate, when creating cpp-src from those *.i
+ping -c1 mldata.org && \
+make %{?_smp_mflags} || make -j3
+popd
+
+# Build the Python3-version.
+%if 0%{?with_python3}
+export PYTHONPATH="`pwd`/test_install/%{python3_sitearch}/%{name}"
+export PYTHONPATH="${PYTHONPATH}:`pwd`/test_install/%{python3_sitearch}"
+export PYTHONPATH="${PYTHONPATH}:$(pwd)/examples/undocumented/python_modular"
+export PYTHONPATH="${PYTHONPATH}:%{python3_sitearch}:%{python3_sitelib}"
+
+pushd py3_build
+%cmake \
+ -DCMAKE_BUILD_TYPE=Distribution \
+%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8
+ -DATLAS_LIBRARIES=%{_libdir}/atlas/libtatlas.so \
+%endif
+%{?with_tests: -DBUILD_DASHBOARD_REPORTS=ON } \
+ -DBUNDLE_EIGEN=OFF \
+ -DBUNDLE_NLOPT=OFF \
+ -DBUNDLE_JSON=OFF \
+ -DENABLE_CCACHE=OFF \
+%{?with_tests: -DENABLE_TESTING=ON } \
+ -DUSE_SVMLIGHT=OFF \
+ -DPythonModular=ON \
+ -DPYTHON_EXECUTABLE=%{__python3} \
+ ..
+# Because of memory-limits (4 GBytes RAM / 4 GBytes swap) on Koji-workers we
+# cannot use `make %%{?_smp_mflags}`. A single make-thread needs to have
+# ~1.5 GBytes of RAM or swap avail. 5 * 1.5 = 7.5 is hard on the limit, so
+# we limit parallel-make to 3 threads = 4.5 GBytes. The actual thing consuming
+# these amounts of memory is not the build itself, but SWIG, which eats RAM
+# like chocolate, when creating cpp-src from those *.i
+ping -c1 mldata.org && \
+make %{?_smp_mflags} || make -j3
+popd
+%endif #0%{?with_python3}
+
+# Building the autodocs.
+pushd doc
+make %{?_smp_mflags}
+%if 0%{?fedora} || 0%{?rhel} >= 7
+%fdupes .
+%endif
+popd
+
+###############################################################################
+
+%install
+%{?el5:rm -rf %{buildroot}}
+
+# We install to custom location first. This will be needed by testsuite, too.
+export CUSTOM_INSTALL_DIR="`pwd`/test_install/"
+# Install the Python3-version first.
+%if 0%{?with_python3}
+pushd py3_build
+make install DESTDIR=${CUSTOM_INSTALL_DIR}
+popd
+%endif #0%{?with_python3}
+
+pushd build
+make install DESTDIR=${CUSTOM_INSTALL_DIR}
+popd
+
+%if 0%{?with_mono}
+# Move Mono(C#)-bindings to the proper location.
+mv ${CUSTOM_INSTALL_DIR}/%{_prefix}/lib/cli/%{name} ${CUSTOM_INSTALL_DIR}%{_libdir}
+%endif
+
+# Fix-up the permissions for some plugins.
+find ${CUSTOM_INSTALL_DIR} -depth -type f -name '*.so' -print0 | \
+ xargs -0 chmod -f 0755
+
+# Copy the custom installation to %%{buildroot} for having an installed
+# version with rpaths preserved for the testsuite.
+cp -a ${CUSTOM_INSTALL_DIR}/. %{buildroot}
+
+# Kill rpath from binaries.
+find %{buildroot}%{_libdir} -depth -type f -perm 0755 -print0 | \
+ xargs -0 chrpath -d -k
+find %{buildroot}%{_bindir} -depth -type f -perm 0755 -print0 | \
+ xargs -0 chrpath -d -k
+
+# Remove unneeded stuff, e.g. compiled examples in %%{buildroot}%%{_datadir},
+# build-system files in examples and 0-size files in %%{buildroot}.
+rm -rf %{buildroot}%{_datadir}/%{name}/examples \
+ examples/generate_documented.sh \
+ examples/missing.log
+
+for _del in '%{buildroot}' 'examples'
+do
+ find "${_del}" -depth -type f -size 0 -print0 | xargs -0 rm -rf
+done
+
+for _del in 'CMake*' 'Makefile*'
+do
+ find examples -depth -type f -name "${_del}" -print0 | xargs -0 rm -rf
+done
+
+###############################################################################
+
+%check
+%if 0%{?with_tests}
+# Disabled tests:
+#
+# * everything based on SVMlight
+EXCLUDE_FROM_TESTS=".*sv[mr]light.*"
+EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|.*-classifier_domainadaptationsvm_modular"
+EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|.*-mkl_binclass_modular"
+EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|python_modular-serialization_string_kernels_modular"
+EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|unit-TDistributedStochasticNeighborEmbeddingTest"
+
+# * tests failing on 32-Bit arches because of misallignments
+EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|unit-MMDKernelSelectionOpt"
+EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|unit-LinearTimeMMD"
+EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|unit-MMDKernelSelectionCombOpt"
+EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|unit-MMDKernelSelectionCombMaxL2"
+EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|unit-CMath"
+EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|unit-SparseMatrixOperator"
+EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|unit-CGMShiftedFamilySolver"
+EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|libshogun-converter_multidimensionalscaling"
+EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|python_modular-structure_mutliclass_bmrm"
+
+# * tests needing internet-connectivity
+# ping -c1 mldata.org || \
+EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|.*mldata.*"
+
+export EXCLUDE_FROM_TESTS
+
+pushd build
+# Unit && integration tests -- usual testsuite.
+ctest \
+ --exclude-regex "${EXCLUDE_FROM_TESTS}" \
+ --output-log unittest.log \
+ --output-on-failure
+popd
+
+%if 0%{?with_python3}
+pushd py3_build
+# Unit && integration tests -- usual testsuite.
+ctest \
+ --exclude-regex "${EXCLUDE_FROM_TESTS}" \
+ --output-log unittest.py3.log \
+ --output-on-failure
+popd
+%endif #0%{?with_python3}
+%endif #0%{?with_tests}
+
+###############################################################################
+
+%{?el5:%clean}
+%{?el5:rm -rf %{buildroot}}
+
+###############################################################################
+
+%changelog
+* Mon Dec 16 2013 Björn Esser <bjoern.esser at gmail.com> - 3.1.0-0.1.git20131212.70e774d
+- updated to latest git-snapshot (#1043283)
+- disabled shogun-mono, because it segfaults currently and has some severe
+ problems on ARMv7hl
+
+* Sun Dec 15 2013 Björn Esser <bjoern.esser at gmail.com> - 3.0.0-1
+- Initial rpm release (#1043283)
diff --git a/sources b/sources
index e69de29..7371f4a 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,3 @@
+073b984d8798ea1594f5e44d85b20d66 gmock-1.7.0.zip
+36043e28dace63e9ddfaf3938e8cae41 shogun-3.1.0-git20131212-70e774d.tar.gz
+11272dc96fb0cba211f7ac59e53f7de7 shogun-data-3.1.0-git20131210-39f2ac8.tar.gz
More information about the scm-commits
mailing list