commit 17515ad1edb677676a657759cc37e84edd32a8ad Author: Björn Esser bjoern.esser@gmail.com Date: Mon Feb 24 12:19:29 2014 +0100
split-off scrubber-script
light-scrubber.sh | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++ shogun.spec | 73 +++-------------------------------------------------- 2 files changed, 73 insertions(+), 69 deletions(-) --- diff --git a/light-scrubber.sh b/light-scrubber.sh new file mode 100755 index 0000000..295adb5 --- /dev/null +++ b/light-scrubber.sh @@ -0,0 +1,69 @@ +#!/bin/bash +# +# light-scrubber.sh +# +# Scrub stuff that depends or links against SVM^light, which we can't ship in +# tarballs used for several linux-distros. 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. +# +# 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*,*_domainadaptationsvm_*} \ + 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 diff --git a/shogun.spec b/shogun.spec index 6f25f4e..e35c940 100644 --- a/shogun.spec +++ b/shogun.spec @@ -147,6 +147,7 @@ URL: http://%%7Bname%7D-toolbox.org %{?rel_build:Source0: %{url}/archives/%{name}/releases/%{branch}/sources/%{name}-%{version}.tar.bz2} # Sources for snapshot-builds. %{!?rel_build:Source0: https://github.com/%%7Bname%7D-toolbox/%%7Bname%7D/archive/%%7Bcommit%7D.tar... +Source98: light-scrubber.sh Source99: http://googlemock.googlecode.com/files/gmock-1.7.0.zip
BuildRequires: arpack-devel @@ -577,75 +578,9 @@ This package contains the Ruby-plugin for %{name}. %prep %setup -q%{!?rel_build:n %{name}-%{commit}}
-# 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> +# Scrub SVMlight. +install -pm0755 %{SOURCE99} ./scripts/ +./scripts/light-scrubber.sh
# Remove cluttering stuff and create some needed dirs. rm -rf build data doc/tutorial py3_build third_party