-
Notifications
You must be signed in to change notification settings - Fork 5
/
light-scrubber.sh
executable file
·69 lines (64 loc) · 2.65 KB
/
light-scrubber.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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/swig/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