Conflict merge

epel8
Ding-Yi Chen 14 years ago
commit 8ff8d1ae3f

4
.gitignore vendored

@ -0,0 +1,4 @@
guide.pdf
libsvm-2.91.tar.gz
/guide.pdf
/libsvm-3.0.tar.gz

@ -0,0 +1,59 @@
diff -up ./java/Makefile.javaDir ./java/Makefile
--- ./java/Makefile.javaDir 2009-02-18 10:41:04.000000000 +1000
+++ ./java/Makefile 2010-11-08 10:59:11.229518442 +1000
@@ -4,13 +4,21 @@ FILES = libsvm/svm.class libsvm/svm_mode
libsvm/svm_print_interface.class \
svm_train.class svm_predict.class svm_toy.class svm_scale.class
+JAVA_DOC_DIR=${INSTDIR}/share/javadoc/libsvm-${LIBSVM_VER}
+CLASSPATH = .
#JAVAC = jikes
-JAVAC_FLAGS = -target 1.5 -source 1.5
+JAVAC_FLAGS = -target 1.5 -source 1.5 -classpath ${CLASSPATH}
+ifndef JAVAC
JAVAC = javac
+endif
# JAVAC_FLAGS =
+ifndef JAR
+JAR=jar
+endif
+
all: $(FILES)
- jar cvf libsvm.jar *.class libsvm/*.class
+ ${JAR} cvf libsvm.jar *.class libsvm/*.class
.java.class:
$(JAVAC) $(JAVAC_FLAGS) $<
@@ -18,8 +26,23 @@ all: $(FILES)
libsvm/svm.java: libsvm/svm.m4
m4 libsvm/svm.m4 > libsvm/svm.java
+javadoc: docs/index.html
+
+docs/index.html: $(FILES)
+ javadoc -d docs *.java libsvm/*.java
+
+install:
+ mkdir -p ${JAVA_TARGET_DIR}
+ install -m 644 libsvm.jar ${JAVA_TARGET_DIR}
+# mkdir -p ${JAVA_DOC_DIR}
+# cd docs; cp -R * ${JAVA_DOC_DIR}
+uninstall:
+ rm -fr ${JAVA_TARGETDIR}
+# rm -fr ${JAVA_DOC_DIR}
+
clean:
rm -f libsvm/*.class *.class *.jar libsvm/*~ *~ libsvm/svm.java
+ rm -rf docs
dist: clean all
rm *.class libsvm/*.class
diff -up ./java/test_applet.html.javaDir ./java/test_applet.html
--- ./java/test_applet.html.javaDir 2003-07-12 14:07:32.000000000 +1000
+++ ./java/test_applet.html 2010-11-08 10:59:11.229518442 +1000
@@ -1 +1,3 @@
-<APPLET code="svm_toy.class" archive="libsvm.jar" width=300 height=350></APPLET>
+<html>
+<applet code="svm_toy.class" archive="libsvm.jar" width=300 height=350></applet>
+</html>

@ -0,0 +1,114 @@
diff -up ./Makefile.packageMain ./Makefile
--- ./Makefile.packageMain 2010-09-12 22:11:10.000000000 +1000
+++ ./Makefile 2010-11-08 11:04:38.423570586 +1000
@@ -1,11 +1,40 @@
CXX ?= g++
-CFLAGS = -Wall -Wconversion -O3 -fPIC
+CFLAGS = ${RPM_CFLAGS} -Wall -Wconversion -O3 -fPIC
SHVER = 2
+MAKE = make
+DOT_LIBS=.libs
+LIBS= -L${DOT_LIBS} -lsvm
+export LIBSVM_VER
+
+ifndef DESTDIR
+ INSTDIR=/usr
+else
+ INSTDIR=${DESTDIR}/usr
+endif
+
+export INSTDIR
+
+IS_64=$(shell /bin/uname -i | awk '/64/ {print 64}')
+
+ifndef LIBDIR
+ LIB_INSTDIR=${INSTDIR}/lib${IS_64}
+else
+ LIB_INSTDIR=${INSTDIR}/..${LIBDIR}
+endif
+
+ifndef LIBDIR
+ LIBDIR=/usr/lib${IS_64}
+endif
+
+export LIBDIR
+export LIB_INSTDIR
+
+all: lib svm-train svm-predict svm-scale svm-python svm-java svm-toy-gtk svm-toy-qt
-all: svm-train svm-predict svm-scale
lib: svm.o
- $(CXX) -shared -dynamiclib svm.o -o libsvm.so.$(SHVER)
+ $(CXX) -shared -Wl,-soname,libsvm.so.$(SHVER) svm.o -o libsvm.so.$(SHVER)
+ ln -sf libsvm.so.$(SHVER) libsvm.so
svm-predict: svm-predict.c svm.o
$(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm
@@ -16,4 +45,65 @@ svm-scale: svm-scale.c
svm.o: svm.cpp svm.h
$(CXX) $(CFLAGS) -c svm.cpp
clean:
- rm -f *~ svm.o svm-train svm-predict svm-scale libsvm.so.$(SHVER)
+ rm -f *~ svm.o svm-train svm-predict svm-scale svm-toy/gtk/svm-toy-gtk svm-toy/qt/svm-toy-qt
+ ${MAKE} -C python clean
+ ${MAKE} -C java clean
+svm-python:
+ ${MAKE} -C python
+
+svm-java:
+ifneq ("${NO_JAVA}","NO_JAVA")
+ ${MAKE} -C java
+endif
+svm-toy-gtk:
+ ${MAKE} -C svm-toy/gtk
+
+svm-toy-qt:
+ ${MAKE} -C svm-toy/qt
+
+install: all
+ mkdir -p ${INSTDIR}/bin
+ install -m 755 svm-train ${INSTDIR}/bin
+ install -m 755 svm-predict ${INSTDIR}/bin
+ install -m 755 svm-scale ${INSTDIR}/bin
+ mkdir -p ${LIB_INSTDIR}
+ install -m 755 libsvm.so.$(SHVER) ${LIB_INSTDIR}
+# install package libsvm-devel
+ mkdir -p ${INSTDIR}/include/libsvm
+ install -m 644 svm.h ${INSTDIR}/include/libsvm
+ mkdir -p ${INSTDIR}/share/libsvm/src/java/libsvm
+ install -m 644 *.h ${INSTDIR}/share/libsvm/src
+ install -m 644 *.c ${INSTDIR}/share/libsvm/src
+ install -m 644 *.cpp ${INSTDIR}/share/libsvm/src
+ install -m 644 Makefile ${INSTDIR}/share/libsvm/src
+ifneq ("${NO_JAVA}","NO_JAVA")
+ install -m 644 java/*.java ${INSTDIR}/share/libsvm/src/java
+ install -m 644 java/Makefile ${INSTDIR}/share/libsvm/src/java
+ install -m 644 java/libsvm/*.java ${INSTDIR}/share/libsvm/src/java/libsvm
+ install -m 644 java/libsvm/*.m4 ${INSTDIR}/share/libsvm/src/java/libsvm
+# install package libsvm-java
+ ${MAKE} -C java install
+endif
+# install package libsvm-python
+ ${MAKE} -C python install
+# install package svm-toy
+ install -m 755 svm-toy/gtk/svm-toy-gtk ${INSTDIR}/bin
+ install -m 755 svm-toy/qt/svm-toy-qt ${INSTDIR}/bin
+# install examples
+ mkdir -p ${INSTDIR}/share/libsvm/examples
+ install -m 644 heart_scale ${INSTDIR}/share/libsvm/examples
+uninstall:
+ rm -f ${INSTDIR}/bin/svm-train
+ rm -f ${INSTDIR}/bin/svm-predict
+ rm -f ${INSTDIR}/bin/svm-scale
+ rm -fr ${INSTDIR}/libsvm/examples
+ rm -f ${INSTDIR}/include/libsvm/svm.h
+ rm -f ${LIB_INSTDIR}/libsvm/svm.o
+ rm -fr ${INSTDIR}/libsvm/src
+ rm -fr ${INSTDIR}/libsvm
+ ${MAKE} -C python uninstall
+ifneq ("${NO_JAVA}","NO_JAVA")
+ ${MAKE} -C java uninstall
+endif
+ rm -f ${INSTDIR}/bin/svm-toy-gtk
+ rm -f ${INSTDIR}/bin/svm-toy-qt

@ -0,0 +1,22 @@
diff -up ./python/Makefile.pythonDir ./python/Makefile
--- ./python/Makefile.pythonDir 2010-06-16 14:04:46.000000000 +1000
+++ ./python/Makefile 2010-11-08 11:07:55.950510378 +1000
@@ -1,4 +1,16 @@
-all = lib
+PYTHON_PATH ?= python${PYTHON_VERSION}/site-packages/libsvm
+PYTHON_TARGETDIR=${LIB_INSTDIR}/${PYTHON_PATH}
-lib:
+all: lib
+
+lib: ../svm.cpp ../svm.h
cd ..; make lib; cd -
+
+install: all
+ mkdir -p ${PYTHON_TARGETDIR}
+ install -m 755 *.py ${PYTHON_TARGETDIR}
+ install -m 755 ../tools/*.py ${PYTHON_TARGETDIR}
+
+uninstall:
+ rm -fr ${LIBDIR}/${PYTHON_PATH}all = lib
+

@ -0,0 +1,70 @@
diff -up ./svm-toy/gtk/callbacks.cpp.svm-toy ./svm-toy/gtk/callbacks.cpp
--- ./svm-toy/gtk/callbacks.cpp.svm-toy 2010-09-12 22:11:10.000000000 +1000
+++ ./svm-toy/gtk/callbacks.cpp 2010-11-08 12:04:22.564509303 +1000
@@ -3,6 +3,7 @@
#include <stdlib.h>
#include <ctype.h>
#include <list>
+#include <cstdlib>
#include "callbacks.h"
#include "interface.h"
#include "../../svm.h"
diff -up ./svm-toy/gtk/Makefile.svm-toy ./svm-toy/gtk/Makefile
--- ./svm-toy/gtk/Makefile.svm-toy 2010-09-12 22:11:10.000000000 +1000
+++ ./svm-toy/gtk/Makefile 2010-11-08 12:05:58.925509978 +1000
@@ -1,10 +1,11 @@
CC? = gcc
CXX? = g++
-CFLAGS = -Wall -O3 -g `pkg-config --libs gtk+-2.0`
-LIBS = `pkg-config --libs gtk+-2.0`
+CFLAGS = -Wall -O3 -g `pkg-config --cflags --libs gtk+-2.0`
+LOCAL_LIBDIR=../../
+LIBS = `pkg-config --libs gtk+-2.0` -L${LOCAL_LIBDIR} -lsvm
-svm-toy: main.o interface.o callbacks.o ../../svm.o
- $(CXX) $(CFLAGS) main.o interface.o callbacks.o ../../svm.o -o svm-toy $(LIBS)
+svm-toy-gtk: main.o interface.o callbacks.o
+ $(CXX) $(CFLAGS) main.o interface.o callbacks.o $(LIBS) -o $@
main.o: main.c
$(CC) $(CFLAGS) -c main.c
@@ -15,8 +16,5 @@ interface.o: interface.c interface.h
callbacks.o: callbacks.cpp callbacks.h
$(CXX) $(CFLAGS) -c callbacks.cpp
-../../svm.o:
- cd ../..; make svm.o
-
clean:
- rm -f *~ callbacks.o svm-toy main.o interface.o callbacks.o ../../svm.o
+ rm -f *~ callbacks.o svm-toy main.o interface.o callbacks.o
diff -up ./svm-toy/qt/Makefile.svm-toy ./svm-toy/qt/Makefile
--- ./svm-toy/qt/Makefile.svm-toy 2008-12-19 16:42:05.000000000 +1000
+++ ./svm-toy/qt/Makefile 2010-11-08 12:05:43.978510797 +1000
@@ -1,17 +1,18 @@
CXX? = g++
-CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtGui -lQtGui
+CFLAGS = -Wall -O3 -I$(INCLUDE) `pkg-config --cflags --libs QtGui`
INCLUDE = /usr/include/qt4
-MOC = /usr/bin/moc-qt4
+MOC=${MOC_PATH}
+LOCAL_LIBDIR=../../
+LIBS = `pkg-config --libs gtk+-2.0` -L${LOCAL_LIBDIR} -lsvm
-svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o
- $(CXX) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy
+all: svm-toy-qt
+
+svm-toy-qt: svm-toy.cpp svm-toy.moc
+ $(CXX) $(CFLAGS) svm-toy.cpp ${LIBS} -o $@
svm-toy.moc: svm-toy.cpp
$(MOC) svm-toy.cpp -o svm-toy.moc
-../../svm.o:
- cd ../..; make svm.o
-
clean:
- rm -f *~ svm-toy svm-toy.moc ../../svm.o
+ rm -f *~ svm-toy svm-toy.moc

@ -0,0 +1,30 @@
diff -up ./tools/easy.py.toolsDir ./tools/easy.py
--- ./tools/easy.py.toolsDir 2010-11-08 11:42:36.754570359 +1000
+++ ./tools/easy.py 2010-11-08 11:53:23.724570788 +1000
@@ -12,10 +12,10 @@ if len(sys.argv) <= 1:
is_win32 = (sys.platform == 'win32')
if not is_win32:
- svmscale_exe = "../svm-scale"
- svmtrain_exe = "../svm-train"
- svmpredict_exe = "../svm-predict"
- grid_py = "./grid.py"
+ svmscale_exe = "/usr/bin/svm-scale"
+ svmtrain_exe = "/usr/bin/svm-train"
+ svmpredict_exe = "/usr/bin/svm-predict"
+ grid_py = "/usr/bin/grid.py"
gnuplot_exe = "/usr/bin/gnuplot"
else:
# example for windows
diff -up ./tools/grid.py.toolsDir ./tools/grid.py
--- ./tools/grid.py.toolsDir 2010-11-08 11:42:36.756570467 +1000
+++ ./tools/grid.py 2010-11-08 11:52:59.144511925 +1000
@@ -17,7 +17,7 @@ else:
is_win32 = (sys.platform == 'win32')
if not is_win32:
- svmtrain_exe = "../svm-train"
+ svmtrain_exe = "/usr/bin/svm-train"
gnuplot_exe = "/usr/bin/gnuplot"
else:
# example for windows

@ -1,19 +1,23 @@
Name: libsvm Name: libsvm
Version: 2.91 Version: 3.0
Release: 1%{?dist} Release: 1%{?dist}
Summary: A Library for Support Vector Machines Summary: A Library for Support Vector Machines
Group: Development/Libraries Group: Development/Libraries
License: BSD License: BSD
URL: http://www.csie.ntu.edu.tw/~cjlin/libsvm/ URL: http://www.csie.ntu.edu.tw/~cjlin/libsvm/
Source0: %{name}-2.91.tar.gz Source0: %{name}-%{version}.tar.gz
#Source0: http://www.csie.ntu.edu.tw/~cjlin/cgi-bin/libsvm.cgi?+http://www.csie.ntu.edu.tw/~cjlin/%{name}+tar.gz #Source0: http://www.csie.ntu.edu.tw/~cjlin/cgi-bin/libsvm.cgi?+http://www.csie.ntu.edu.tw/~cjlin/%{name}+tar.gz
Source1: http://www.csie.ntu.edu.tw/~cjlin/libsvm/log Source1: http://www.csie.ntu.edu.tw/~cjlin/libsvm/log
Source2: http://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf Source2: http://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf
Source3: libsvm-svm-toy-gtk.desktop Source3: libsvm-svm-toy-gtk.desktop
Source4: libsvm-svm-toy-qt.desktop Source4: libsvm-svm-toy-qt.desktop
Source5: LibSVM-svm-toy-48.png Source5: LibSVM-svm-toy-48.png
Patch0: %{name}-%{version}.patch Patch0: %{name}-%{version}.packageMain.patch
Patch1: %{name}-%{version}.pythonDir.patch
Patch2: %{name}-%{version}.javaDir.patch
Patch3: %{name}-%{version}.svm-toy.patch
Patch4: %{name}-%{version}.toolsDir.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%{!?pyver: %define pyver %(python -c 'import sys; print(sys.version[0:3])')} %{!?pyver: %define pyver %(python -c 'import sys; print(sys.version[0:3])')}
@ -33,7 +37,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%define no_java FALSE %define no_java FALSE
%else %else
%define no_java NO_JAVA %define no_java NO_JAVA
Obsoletes: libsvm-java Obsoletes: libsvm-java < 2.88-1
%endif %endif
%description %description
@ -83,7 +87,7 @@ programs with libsvm in Java.
%endif %endif
%package svm-toy-gtk %package svm-toy-gtk
Summary: GTK version of svm-toy (libsvm demostration program) Summary: GTK version of svm-toy (libsvm demonstration program)
Group: Development/Libraries Group: Development/Libraries
BuildRequires: gtk2-devel BuildRequires: gtk2-devel
BuildRequires: desktop-file-utils BuildRequires: desktop-file-utils
@ -91,11 +95,11 @@ Requires: gtk2
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
%description svm-toy-gtk %description svm-toy-gtk
svm-toy is a libsvm demostration program which has a gtk-GUI to svm-toy is a libsvm demonstration program which has a gtk-GUI to
display the derived separating hyperplane. display the derived separating hyperplane.
%package svm-toy-qt %package svm-toy-qt
Summary: QT version of svm-toy (libsvm demostration program) Summary: QT version of svm-toy (libsvm demonstration program)
Group: Development/Libraries Group: Development/Libraries
BuildRequires: desktop-file-utils BuildRequires: desktop-file-utils
BuildRequires: pkgconfig BuildRequires: pkgconfig
@ -105,12 +109,16 @@ Requires: qt4
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
%description svm-toy-qt %description svm-toy-qt
svm-toy is a libsvm demostration program which has a qt-GUI to svm-toy is a libsvm demonstration program which has a qt-GUI to
display the derived separating hyperplane. display the derived separating hyperplane.
%prep %prep
%setup -q %setup -q
%patch0 -p0 -b .orig %patch0 -p0 -b .packageMain
%patch1 -p0 -b .pythonDir
%patch2 -p0 -b .javaDir
%patch3 -p0 -b .svm-toy
%patch4 -p0 -b .toolsDir
cp %{SOURCE1} ChangeLog cp %{SOURCE1} ChangeLog
cp %{SOURCE2} . cp %{SOURCE2} .
cp %{SOURCE3} . cp %{SOURCE3} .
@ -185,7 +193,7 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/svm-train %{_bindir}/svm-train
%dir %{_datadir}/%{name} %dir %{_datadir}/%{name}
%{_datadir}/%{name}/examples %{_datadir}/%{name}/examples
%{_libdir}/%{name}.so.1 %{_libdir}/%{name}.so.2
%files devel %files devel
@ -223,6 +231,18 @@ rm -rf $RPM_BUILD_ROOT
%changelog %changelog
* Mon Nov 08 2010 Ding-Yi Chen <dchen@redhat.com> - 3.0-1
- Fixed the spelling errors of svm-toy-gtk and svm-toy-qt
- Upstream update:
* Move model structure to svm.h
* Two functions for freeing a model (content or the whole model)
* QD from Qfloat to double (better precision because SSE on 64-bit machines less accurate than i387 on 32-bit
* exit status for checkdata.py
* old python interface (swig) is removed
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 2.91-2
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
* Wed Apr 07 2010 Ding-Yi Chen <dchen@redhat.com> - 2.91-1 * Wed Apr 07 2010 Ding-Yi Chen <dchen@redhat.com> - 2.91-1
- Fixed Bug 564887 - FTBFS libsvm-2.90-3.fc13 - Fixed Bug 564887 - FTBFS libsvm-2.90-3.fc13
- Upstream update: - Upstream update:

9
log

@ -178,10 +178,15 @@ file updated.
Java: able to load model from a BufferedReader directly Java: able to load model from a BufferedReader directly
fix grid.py so -log2c can be run under python 2.6 or after fix grid.py so -log2c can be run under python 2.6 or after
3.0: 2010/09/13
Move model structure to svm.h
Two functions for freeing a model (content or the whole model)
QD from Qfloat to double (better precision because SSE on 64-bit machines less accurate than i387 on 32-bit
exit status for checkdata.py
old python interface (swig) is removed
------------------ ------------------
Future plan: Future plan:
?.?: ?.?:
old python interface is removed merge matlab interface to core libsvm
update make.m of matlab interface to use max(...) update make.m of matlab interface to use max(...)

@ -1,2 +1,2 @@
aae7a8f7e357e86e1c893b706bb02a63 guide.pdf aae7a8f7e357e86e1c893b706bb02a63 guide.pdf
aec07b9142ce585c95854ed379538154 libsvm-2.91.tar.gz 016e29668aae8aa6eaeb125c9e23d834 libsvm-3.0.tar.gz

Loading…
Cancel
Save