From a9b80f1c5944d5b446c28342c1fed8187b2aad33 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Fri, 18 Sep 2009 01:30:36 +0000 Subject: [PATCH 01/10] Add libsvm to EL-5 --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..42f697a --- /dev/null +++ b/branch @@ -0,0 +1 @@ +EL-5 From 35fc752c1ab164981e806e0ba07637b2faf80246 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Fri, 18 Sep 2009 01:56:12 +0000 Subject: [PATCH 02/10] Fixed [Bug 524108] --- Makefile | 21 +++ import.log | 1 + libsvm-2.89.patch | 352 +++++++++++++++++++++++++++++++++++ libsvm-svm-toy-gtk.desktop | 10 + libsvm-svm-toy-qt.desktop | 10 + libsvm.spec | 370 +++++++++++++++++++++++++++++++++++++ log | 160 ++++++++++++++++ sources | 2 + 8 files changed, 926 insertions(+) create mode 100644 Makefile create mode 100644 import.log create mode 100644 libsvm-2.89.patch create mode 100644 libsvm-svm-toy-gtk.desktop create mode 100644 libsvm-svm-toy-qt.desktop create mode 100644 libsvm.spec create mode 100644 log create mode 100644 sources diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..70ef916 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Makefile for source rpm: libsvm +# $Id$ +NAME := libsvm +SPECFILE = $(firstword $(wildcard *.spec)) + +define find-makefile-common +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +endef + +MAKEFILE_COMMON := $(shell $(find-makefile-common)) + +ifeq ($(MAKEFILE_COMMON),) +# attept a checkout +define checkout-makefile-common +test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 +endef + +MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) +endif + +include $(MAKEFILE_COMMON) diff --git a/import.log b/import.log new file mode 100644 index 0000000..78cb32b --- /dev/null +++ b/import.log @@ -0,0 +1 @@ +libsvm-2_89-4_fc11:EL-5:libsvm-2.89-4.fc11.src.rpm:1253237689 diff --git a/libsvm-2.89.patch b/libsvm-2.89.patch new file mode 100644 index 0000000..5673758 --- /dev/null +++ b/libsvm-2.89.patch @@ -0,0 +1,352 @@ +diff -up ./java/Makefile.orig ./java/Makefile +--- ./java/Makefile.orig 2009-02-18 10:41:04.000000000 +1000 ++++ ./java/Makefile 2009-09-18 10:13:04.000000000 +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.orig ./java/test_applet.html +--- ./java/test_applet.html.orig 2003-07-12 14:07:32.000000000 +1000 ++++ ./java/test_applet.html 2009-09-18 10:10:34.000000000 +1000 +@@ -1 +1,3 @@ +- ++ ++ ++ +diff -up ./Makefile.orig ./Makefile +--- ./Makefile.orig 2008-09-15 14:36:48.000000000 +1000 ++++ ./Makefile 2009-09-18 10:10:34.000000000 +1000 +@@ -1,11 +1,40 @@ + CXX? = g++ +-CFLAGS = -Wall -Wconversion -O3 -fPIC ++CFLAGS = ${RPM_CFLAGS} -Wall -Wconversion -O3 -fPIC + SHVER = 1 ++MAKE = make ++DOT_LIBS=.libs ++LIBS= -L${DOT_LIBS} -lsvm ++export LIBSVM_VER + +-all: svm-train svm-predict svm-scale ++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 + + lib: svm.o +- $(CXX) -shared 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 ++ 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 ++ ++ +diff -up ./python/Makefile.orig ./python/Makefile +--- ./python/Makefile.orig 2008-12-10 09:05:08.000000000 +1000 ++++ ./python/Makefile 2009-09-18 10:10:34.000000000 +1000 +@@ -2,9 +2,11 @@ CXX? = g++ + SWIG ?= swig + + #Windows: see ../README ../Makefile.win +-PYTHON_INCLUDEDIR ?= /usr/include/python2.5 ++PYTHON_INCLUDEDIR ?= /usr/include/python${PYTHON_VERSION} ++PYTHON_TARGETDIR=${LIB_INSTDIR}/python${PYTHON_VERSION}/site-packages/libsvm + + CFLAGS = -O3 -I$(PYTHON_INCLUDEDIR) -I.. ++CFLAGS_PYTHON = ${CFLAGS} -O3 -I$(PYTHON_INCLUDEDIR) -I.. + LDFLAGS = -shared + # Mac OS + # LDFLAGS = -framework Python -bundle +@@ -15,16 +17,31 @@ svmc.so: svmc_wrap.o svm.o + $(CXX) $(LDFLAGS) -o svmc.so svmc_wrap.o svm.o + + svmc_wrap.o: svmc_wrap.c ../svm.h +- $(CXX) $(CFLAGS) -fPIC -c svmc_wrap.c ++ $(CXX) $(CFLAGS_PYTHON) -fPIC -c svmc_wrap.c + + svmc_wrap.c: svmc.i + $(SWIG) -python -noproxy svmc.i + + svm.o: ../svm.cpp ../svm.h +- $(CXX) $(CFLAGS) -fPIC -c ../svm.cpp ++ $(CXX) $(CFLAGS_PYTHON) -fPIC -c ../svm.cpp + + clean: + rm -f *~ *.o *.so *.pyc *.pyo svm.o + + moreclean: clean + rm -f svmc_wrap.c ++ ++ ++install: all ++ mkdir -p ${PYTHON_TARGETDIR} ++ install -m 755 cross_validation.py ${PYTHON_TARGETDIR} ++ install -m 644 svm.py ${PYTHON_TARGETDIR} ++ install -m 755 svm_test.py ${PYTHON_TARGETDIR} ++ install -m 755 test_cross_validation.py ${PYTHON_TARGETDIR} ++ install -m 644 *.i ${PYTHON_TARGETDIR} ++ install -m 755 *.so ${PYTHON_TARGETDIR} ++ install -m 755 ../tools/*.py ${PYTHON_TARGETDIR} ++ ++uninstall: ++ rm -fr ${LIBDIR}/python${PYTHON_VERSION}/site-packages/libsvm ++ +diff -up ./svm-toy/gtk/callbacks.cpp.orig ./svm-toy/gtk/callbacks.cpp +--- ./svm-toy/gtk/callbacks.cpp.orig 2006-03-04 17:40:12.000000000 +1000 ++++ ./svm-toy/gtk/callbacks.cpp 2009-09-18 10:10:34.000000000 +1000 +@@ -2,6 +2,7 @@ + #include + #include + #include ++#include + #include "callbacks.h" + #include "interface.h" + #include "../../svm.h" +diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile +--- ./svm-toy/gtk/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 ++++ ./svm-toy/gtk/Makefile 2009-09-18 10:10:34.000000000 +1000 +@@ -2,21 +2,27 @@ CC? = gcc + CXX? = g++ + CFLAGS = -Wall -O3 -g `gtk-config --cflags` + LIBS = `gtk-config --libs` ++COPT = -Wall -O3 -g `pkg-config --cflags --libs gtk+-2.0` ++LOCAL_LIBDIR=../../ ++LIBS= -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) ++ ++all: svm-toy-gtk ++ ++svm-toy-gtk: main.o interface.o callbacks.o ++ $(CXX) $(COPT) main.o interface.o callbacks.o ${LIBS} -o svm-toy-gtk + + main.o: main.c +- $(CC) $(CFLAGS) -c main.c ++ $(CC) $(COPT) -c main.c + + interface.o: interface.c interface.h +- $(CC) $(CFLAGS) -c interface.c ++ $(CC) $(COPT) -c interface.c + + callbacks.o: callbacks.cpp callbacks.h +- $(CXX) $(CFLAGS) -c callbacks.cpp ++ $(CXX) $(COPT) -c callbacks.cpp + +-../../svm.o: +- cd ../..; make svm.o ++#../../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-gtk main.o interface.o callbacks.o +diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile +--- ./svm-toy/qt/Makefile.orig 2008-12-19 16:42:05.000000000 +1000 ++++ ./svm-toy/qt/Makefile 2009-09-18 10:10:34.000000000 +1000 +@@ -1,17 +1,21 @@ + CXX? = g++ +-CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtGui -lQtGui ++CFLAGS = -Wall -O3 ++FLAGS:=${CFLAGS} `pkg-config --cflags --libs QtGui` ++LOCAL_LIBDIR=../../ ++LIBS= -L${LOCAL_LIBDIR} -lsvm ++ + INCLUDE = /usr/include/qt4 +-MOC = /usr/bin/moc-qt4 + +-svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o +- $(CXX) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy ++MOC=${MOC_PATH} ++ ++all: svm-toy-qt ++ ++svm-toy-qt: svm-toy.cpp svm-toy.moc ++ $(CXX) $(FLAGS) svm-toy.cpp ${LIBS} -o svm-toy-qt + + 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-qt svm-toy.moc ../../svm.o + +diff -up ./tools/easy.py.orig ./tools/easy.py +--- ./tools/easy.py.orig 2009-01-14 07:13:26.000000000 +1000 ++++ ./tools/easy.py 2009-09-18 10:10:34.000000000 +1000 +@@ -2,6 +2,7 @@ + + import sys + import os ++from distutils.sysconfig import get_python_lib + from subprocess import * + + if len(sys.argv) <= 1: +@@ -12,10 +13,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 = get_python_lib(1)+"/libsvm/grid.py" + gnuplot_exe = "/usr/bin/gnuplot" + else: + # example for windows +diff -up ./tools/grid.py.orig ./tools/grid.py +--- ./tools/grid.py.orig 2008-08-08 20:41:11.000000000 +1000 ++++ ./tools/grid.py 2009-09-18 10:10:34.000000000 +1000 +@@ -11,7 +11,7 @@ from subprocess import * + + 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 +@@ -88,6 +88,7 @@ Usage: grid.py [-log2c begin,end,step] [ + i = i + 1 + + pass_through_string = join(pass_through_options," ") ++ print 'dataset_pathname=%s' % dataset_pathname + assert os.path.exists(svmtrain_exe),"svm-train executable not found" + assert os.path.exists(gnuplot_exe),"gnuplot executable not found" + assert os.path.exists(dataset_pathname),"dataset not found" diff --git a/libsvm-svm-toy-gtk.desktop b/libsvm-svm-toy-gtk.desktop new file mode 100644 index 0000000..3b8613d --- /dev/null +++ b/libsvm-svm-toy-gtk.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=svm-toy-gtk +GenericName=svm-toy GTK version +Comment=GTK version of svm-toy (libsvm demostration program) +Exec=svm-toy-gtk +Icon=libsvm-svm-toy-gtk-48 +StartupNotify=true +Terminal=false +Type=Application +Categories=GTK;Education;Science;Math;DataVisualization diff --git a/libsvm-svm-toy-qt.desktop b/libsvm-svm-toy-qt.desktop new file mode 100644 index 0000000..5c7fd2f --- /dev/null +++ b/libsvm-svm-toy-qt.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=svm-toy-qt +GenericName=svm-toy QT version +Comment=QT version of svm-toy (libsvm demostration program) +Exec=svm-toy-qt +Icon=libsvm-svm-toy-qt-48 +StartupNotify=true +Terminal=false +Type=Application +Categories=KDE;Education;Science;Math;DataVisualization diff --git a/libsvm.spec b/libsvm.spec new file mode 100644 index 0000000..6d6705f --- /dev/null +++ b/libsvm.spec @@ -0,0 +1,370 @@ +Name: libsvm +Version: 2.89 +Release: 4%{?dist} +Summary: A Library for Support Vector Machines + +Group: Development/Libraries +License: BSD +URL: http://www.csie.ntu.edu.tw/~cjlin/libsvm/ +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 +Source1: http://www.csie.ntu.edu.tw/~cjlin/libsvm/log +Source2: http://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf +Source3: libsvm-svm-toy-gtk.desktop +Source4: libsvm-svm-toy-qt.desktop +Source5: LibSVM-svm-toy-48.png +Patch0: %{name}-%{version}.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root + +%{!?pyver: %define pyver %(python -c 'import sys; print(sys.version[0:3])')} +%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +%define libsvm_python_dir %{python_sitearch}/libsvm + +%define javac javac +%define jar jar +%define libdir_libsvm %{_libdir}/libsvm +%if 0%{?fedora} >= 9 +%define moc_path %{_bindir}/moc-qt4 +%else +%define moc_path %{_libdir}/qt4/bin/moc +%endif + +%ifnarch ppc ppc64 +%define no_java FALSE +%else +%define no_java NO_JAVA +%endif + +%description +LIBSVM is an integrated software for support vector classification, +(C-SVC, nu-SVC ), regression (epsilon-SVR, nu-SVR) and distribution +estimation (one-class SVM ). It supports multi-class classification. + +%package devel +Summary: Header file, object file, and source files of libsvm in C, C++ and Java +Group: Development/Libraries +BuildRequires: glibc-devel gawk +Requires: %{name} = %{version}-%{release} + +%description devel +Header file, object file of libsvm in C, C++ and Java. +Install this package if you want to develop programs with libsvm. + + +%package python +Summary: Python tools and interfaces for libsvm +Group: Development/Libraries +BuildRequires: python-devel >= 2.4 gawk +#gnuplot is required by easy.py +Requires: %{name} = %{version}-%{release} +Requires: gnuplot + +%description python +Python tools and interfaces for libsvm. +Install this package if you want to develop +programs with libsvm in Python. + +%ifnarch ppc ppc64 +%package java +Summary: Java tools and interfaces for libsvm +Group: Development/Libraries +BuildRequires: java-devel >= 1.5.0 +BuildRequires: jpackage-utils + +Requires: java >= 1.5.0 +Requires: jpackage-utils +Requires: %{name} = %{version}-%{release} + +%description java +Java tools and interfaces for libsvm. +Install this package if you want to develop +programs with libsvm in Java. +%endif + +%package svm-toy-gtk +Summary: GTK version of svm-toy (libsvm demostration program) +Group: Development/Libraries +BuildRequires: gtk2-devel +BuildRequires: desktop-file-utils +Requires: gtk2 +Requires: %{name} = %{version}-%{release} + +%description svm-toy-gtk +svm-toy is a libsvm demostration program which has a gtk-GUI to +display the derived separating hyperplane. + +%package svm-toy-qt +Summary: QT version of svm-toy (libsvm demostration program) +Group: Development/Libraries +BuildRequires: desktop-file-utils +BuildRequires: pkgconfig + +BuildRequires: qt4-devel +Requires: qt4 +Requires: %{name} = %{version}-%{release} + +%description svm-toy-qt +svm-toy is a libsvm demostration program which has a qt-GUI to +display the derived separating hyperplane. + +%prep +%setup -q +%patch0 -p0 -b .orig +cp %{SOURCE1} ChangeLog +cp %{SOURCE2} . +cp %{SOURCE3} . +cp %{SOURCE4} . +cp %{SOURCE5} %{name}-svm-toy-gtk-48.png +cp %{SOURCE5} %{name}-svm-toy-qt-48.png + + + +%build +%{__sed} -i 's/\r//' FAQ.html +%{__sed} -i 's/\r//' ChangeLog +make all RPM_CFLAGS="$RPM_OPT_FLAGS" PYTHON_VERSION="%{pyver}" JAVAC="%{javac}" JAR="%{jar}" LIBDIR="%{_libdir}" MOC_PATH="%{moc_path}" NO_JAVA="%{no_java}" +mv python/README python/README-Python +mv tools/README tools/README-Tools +cp README java/README-Java +cp README svm-toy/gtk +cp README svm-toy/qt + + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} PYTHON_VERSION="%{pyver}" LIBSVM_VER="%{version}" NO_JAVA="%{no_java}" JAVA_TARGET_DIR="${RPM_BUILD_ROOT}/%{_javadir}" +ln -sf %{name}.so.1 ${RPM_BUILD_ROOT}%{_libdir}/%{name}.so +rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/src +mkdir -p $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/48x48/apps/ +cp %{name}-svm-toy-gtk-48.png $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/48x48/apps/ +cp %{name}-svm-toy-qt-48.png $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/48x48/apps/ +mkdir -p $RPM_BUILD_ROOT/%{_datadir}/applications +cp %{name}-svm-toy-gtk.desktop $RPM_BUILD_ROOT/%{_datadir}/applications +cp %{name}-svm-toy-qt.desktop $RPM_BUILD_ROOT/%{_datadir}/applications + +# [Bug 521194] Python: 'import libsvm' doesn't work +echo -e "# This file is not in the original libsvm tarball, but added for convenience of import libsvm.\n\ +# This file is released under BSD license, just like the rest of the package.\n"\ + > $RPM_BUILD_ROOT/%{libsvm_python_dir}/__init__.py + +desktop-file-install --delete-original --vendor=fedora \ + --dir=${RPM_BUILD_ROOT}%{_datadir}/applications \ + ${RPM_BUILD_ROOT}/%{_datadir}/applications/%{name}-svm-toy-gtk.desktop \ + ${RPM_BUILD_ROOT}/%{_datadir}/applications/%{name}-svm-toy-qt.desktop \ + + + +%post -p /sbin/ldconfig + +%post svm-toy-gtk +touch --no-create %{_datadir}/icons/hicolor +if [ -x %{_bindir}/gtk-update-icon-cache ]; then + %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : +fi + + +%postun -p /sbin/ldconfig + +%postun svm-toy-gtk +touch --no-create %{_datadir}/icons/hicolor +if [ -x %{_bindir}/gtk-update-icon-cache ]; then + %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : +fi + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%doc COPYRIGHT FAQ.html ChangeLog guide.pdf +%{_bindir}/svm-predict +%{_bindir}/svm-scale +%{_bindir}/svm-train +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/examples +%{_libdir}/%{name}.so.1 + + +%files devel +%defattr(-,root,root,-) +%doc README +%{_includedir}/%{name}/ +%{_libdir}/%{name}.so + +%files python +%defattr(-,root,root,-) +%doc python/README-Python tools/README-Tools +%{libsvm_python_dir} + +%ifnarch ppc ppc64 +%files java +%defattr(-,root,root,-) +%doc java/README-Java java/test_applet.html +%{_javadir}/%{name}.jar +#%{_datadir}/javadoc/%{name}-%{version} +%endif + +%files svm-toy-gtk +%defattr(-,root,root,-) +%doc svm-toy/gtk/README +%{_bindir}/svm-toy-gtk +%{_datadir}/icons/hicolor/48x48/apps/%{name}-svm-toy-gtk-48.png +%{_datadir}/applications/fedora-%{name}-svm-toy-gtk.desktop + +%files svm-toy-qt +%defattr(-,root,root,-) +%doc svm-toy/qt/README +%{_bindir}/svm-toy-qt +%{_datadir}/icons/hicolor/48x48/apps/%{name}-svm-toy-qt-48.png +%{_datadir}/applications/fedora-%{name}-svm-toy-qt.desktop + + +%changelog +* Fri Sep 18 2009 Ding-Yi Chen - 2.89-4 +- Fixed [Bug 524108] put libsvm.jar into _javadir + + Move livsvm.jar to _javadir + + Move test_applet.html to _datadir/doc/libsvm- +- Buildrequire changed to java-devel>=1.5.0, jpackage-utils +- Require changed to java>=1.5.0, jpackage-utils + +* Wed Sep 16 2009 Ding-Yi Chen - 2.89-3 +- Fix the building for EL-5 + Note that libsvm-java on ppc and ppc64 for EL-5 is excluded, + as java-1.6.0-openjdk-devel for them do not exist yet. +- Change the Java buildrequires from java-sdk to java-1.6.0-openjdk-devel +- Fix [Bug 521194] Python: 'import libsvm' doesn't work. + By adding __init__.py to libsvm_python_dir + +* Sat Jul 25 2009 Fedora Release Engineering - 2.89-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Fri Apr 03 2009 Ding-Yi Chen - 2.89-1 +- Upstream Update to 2.89: + + reduce input/loading time of svm-train/svm-predict by half + + pointer function so users can specify their own outputs + + remove info_flush() + + a extern variable libsvm_version + + svm-train -q option (disable outputs) + + svm-scale: warning if more nonzero produced + + easy.py: popel.communiate() to avoid some deadlock (if lots of + outputs when #classes is large) + +* Mon Nov 10 2008 Ding-Yi Chen - 2.88-2 +- Fix java BuildRequire and Build +- javadoc have been removed because ppc and ppc64 do not have a + suitable package to build javadoc in F-8, nor does javadoc + provide much useful information. + + +* Wed Nov 05 2008 Ding-Yi Chen - 2.88-0 +- Note: + + SO version now follows upstream, i.e. SHVER=1, as upstream start to build shared library now. + Be aware that previously SO version of libsvm.so is libsvm.so.2.86, which looks higher than + the current SO version libsvm.so.1. + + Replaced java-1.5.0-gcj-devel with java-1.6.0-openjdk-devel. + + java sub-package now have javadoc. +- Upstream update + + From 2.87: 2008/10/13 + * svm-toy/qt updated to qt4 from qt3 + * fix a bug in svm-scale.c + * max feature index of -r file is considered + * Makefile: add make lib; add -Wconversion and -fPIC in Makefile + * Add "rb" in load_model of svm.cpp + * Simplify do_shrinking of svm.cpp + * Change the order of loops in reconstrict_gradient of svm.cpp + * save the number of kernel evaluations + * Add python/setup.py + + From 2.88: 2008/10/30 + * better gradient reconstructions + * issue a warning when -h 0 may be faster + +* Thu Apr 29 2008 Ding-Yi Chen - 2.86-13 +- Fix svm-toy-qt clear button does not clear. + (from Hsiang-Fu Yu in National Taiwan University) + + +* Thu Apr 3 2008 Ding-Yi Chen - 2.86-12 +- Correct changelog date + +* Thu Apr 3 2008 Ding-Yi Chen - 2.86-11 +- Fix the Qt path problem + +* Wed Apr 2 2008 Ding-Yi Chen - 2.86-4 +- Support both Qt3 for F8 and earlier, and Qt4 for F9 + +* Tue Apr 1 2008 Ding-Yi Chen - 2.86-0 +- Upstream update to 2.86 + - svm-scale for java + - version number in svm.h and svm.m4 + - rename svmtrain.exe to svm-train.exe + - python: while 1 --> while True, Popen -> call + - show best parameters on the contour of grid.py +- LIBSVM_VER_MAJOR and LIBSVM_VER_MINOR are defined in libsvm.spec instead in + +* Tue Mar 11 2008 Ding-Yi Chen - 2.85-6 +- Fix build error. + +* Mon Mar 10 2008 Ding-Yi Chen - 2.85-5 +- [Bug 436392]: Fix by copy from right place. +- Add desktop files and icons for svm-toy-gtk and svm-toy-qt + +* Tue Feb 11 2008 Ding-Yi Chen - 2.85-4 +- Move gnuplot from BuildRequires to Requires + +* Thu Feb 07 2008 Ding-Yi Chen - 2.85-3 +- Fix linker name (libsvm.so) +- Linked to dynamic libraries + +* Tue Feb 05 2008 Ding-Yi Chen - 2.85-2 +- Fix svm-toy-qt build error + +* Tue Feb 05 2008 Ding-Yi Chen - 2.85-1 +- Fix svm-toy-gtk build error + +* Mon Feb 04 2008 Ding-Yi Chen - 2.85-0 +- Upgrade to 2.85 +- Include guide.pdf in main package +- Change the dependent from eclipse-ecj to java-1.5.0-gcj +- Add svm-toy-gtk +- Add svm-toy-qt + +* Wed Dec 20 2007 Ding-Yi Chen - 2.84-9 +- [Bug 254091] Comment 19 +- Fix python/Makefile + +* Thu Dec 13 2007 Ding-Yi Chen - 2.84-8 +- Fix improper sed. +- Change ldconfig to /sbin/ldconfig +- Add gnuplot dependency for libsvm-python, as tools/easy.py needs it. + +* Mon Dec 03 2007 Ding-Yi Chen - 2.84-7 +- [Bug 254091] Review Request: libsvm - A Library for Support Vector Machines (Comment #12) + +* Thu Sep 26 2007 Ding-Yi Chen - 2.84-6 +- Add defattr to each subpackage +- Move libsvm.so to libsvm + +* Thu Sep 24 2007 Ding-Yi Chen - 2.84-5 +- Split out libsvm-java +- Add libsvm.so + +* Thu Aug 30 2007 Ding-Yi Chen - 2.84-4 +- Refined description. +- Fix the /tmp/python.ver problem + +* Mon Aug 27 2007 Ding-Yi Chen - 2.84-3 +- Fix dependency problem + +* Mon Aug 27 2007 Ding-Yi Chen - 2.84-2 +- Fix mock error +- Support Python 2.4 and Python 2.5 + +* Mon Aug 27 2007 Ding-Yi Chen - 2.84-1 +- Fix rpmlint error +- Move python related files to libsvm-python + +* Fri Aug 17 2007 Ding-Yi Chen - 2.84-0 +- initial packaging + diff --git a/log b/log new file mode 100644 index 0000000..15da1b9 --- /dev/null +++ b/log @@ -0,0 +1,160 @@ +1.04: 2000/6/17, add "load" button to svm-toy. README +file updated. + +2.0: 2000/8, major updates. Include nu-svm, one-class svm, and svr + +2.01: 2000/9/22, correct the calculation of obj value and number of bounded support vectors + +2.02: 2000/9/29, replace b^2/2 newsvm to regular nu svm. + +2.03: 2000/10/24 some improvements on the computational speed + +2.1: 2000/12/19 Java version included, regression demonstrated in svm-toy + +2.2: 2001/1/16 multi-class classification, nu-SVR, remove epsilon_a + +2.3: 2001/3/15 c+-, cross validation, fix some minor bugs + +2.31: 2001/4/12 fix one bug on one-class SVM, use float for Cache + +2.32: 2001/9/23 + 1. max line number of svm-scale now dynamic + 2. gcc 3.0 problem: now g++ always used + 3. java code in a "libsvm" package + 4. avoid a problem when compiled with Borland C++ builder + +2.33: 2001/12/1 + Python interface added + +2.34: 2002/6/15 + Add the subroutine svm_check_parameter in svm.cpp + --> better error handling + fix bug of python interface for handling different weights + fix bug of cross validation in svm-train.c + +2.35: 2002/6/16 + libsvm.jar was not compiled correctly in 2.34 + +2.36: 2002/8/4 + grid.py added: contour plot of CV accuracy + fix several bugs + +2.4: 2003/4/1 + svm.cpp + non-psd kernel using max(...,0) in svm.cpp + python interface + python interface bug (nu-svm) + grid.py + -log2c and -log2c for grid.py + output current best + coarse grid as default (2) + ssh for grid.py + improvements of scaling + +2.5: 2003/11/13 + subroutines for accessing decision values and number of labels. + for svm.cpp, java, and python interface + fix bug of svm-scale.c (about -r and -s factors) + use fscanf but not sscanf in svm-predict.c (faster) + makefile for windows + add "using namespace std;" in some .java files + improve easy.py: output cv rate, error messages printed + better checking + better python interface example svm_test.py + and some minor updates + +2.6: 2004/04/01 + Probability estimates for classification/regression + Python interface: use swig 1.3 instead of 1.1 + Cross validation becomes a library subroutine + A few minor corrections: (not completely listed) + more interface functions such as getting svm_type + print nu only when Cp=Cn + floor division in python interface + +2.7: 2004/11/10 + Stratified cross validation + Better faq + Scaling: support storing the factor of y + A few minor updates: + class QMatrix added + improve the use of easy.py and grid.py on windows + grid.py: same CV and same g: use smaller C + sparse input for python interface + working set selection: < to <= + +2.71: 2004/11/20 + fix a java bug introduced from 2.6 to 2.7 + +2.8: 2005/04/01 + new working set selection via second order information + fix minor changes/corrections: + problem when cache size less than two kernel columns + -v #data -> stratified CV is not loo -> ensure loo is done + problem of typing "svm-train -c" only + problem of "svm-train -n 1 -s 3 ..." + python interface makefile: -fPIC for 32/64bit + color change in svmtoy + makefile in building QT svmtoy + +2.81: 2005/11/20 + add a python script subset.py for subsampling + slightly modify the working set so it's exact the same as the paper + default cache size to 100 MB + +2.82: 2006/04/01 + precomputed kernel + directly implement a fast powi() function + poly degree double to int + minor corrections: + java code for CV +2.83: 2006/11/17 + Fix the bug of -t 3 + better checking load/save in svm-train.c/svm-predict.c/svm.cpp + remove redundant var pos in svm_predict_values (thanks to Albert Strasheim) + Better descriptions in README for the precomputed kernel + +2.84: 2007/04/01 + Improve the shrinking code: faster for some cases + Code more 64-bit friendly: allow large -m + In Solver, b is replaced by p + Subroutine max_violating_pair removed. Things are directly + written in do_shrinking(). + Modify do_shrinking() so variable names are the same as libsvm + document + +2.85: 2007/11/6 + fix minor memory leak in svm-predict.c + add tools/checkdata.py + java to 1.5 + Makefile: CXX? + Makefile.win: avoid warning from .net 2005 + avoid warning of gcc 4.2 + sigma 0.001 to 1e-12; in Newton direction of prob output + 2 * (long int) l avoid warning of old Visual C++ + grid.py: avoid gnuplot problem on windows + +2.86: 2008/04/01 + svm-scale for java + version number in svm.h and svm.m4 + rename svmtrain.exe to svm-train.exe + python: while 1 --> while True, Popen -> call + show best parameters on the contour of grid.py + +2.87: 2008/10/13 + svm-toy/qt updated to qt4 from qt3 + fix a bug in svm-scale.c + max feature index of -r file is considered + Makefile: add make lib; add -Wconversion and -fPIC in Makefile + Add "rb" in load_model of svm.cpp + Simplify do_shrinking of svm.cpp + Change the order of loops in reconstrict_gradient of svm.cpp + save the number of kernel evaluations + Add python/setup.py + +2.88: 2008/10/30 + better gradient reconstructions + issue a warning when -h 0 may be faster + +2.89: 2009/04/01 + todo: python 2.6, java 1.6, openMP, fast input \ No newline at end of file diff --git a/sources b/sources new file mode 100644 index 0000000..3321f93 --- /dev/null +++ b/sources @@ -0,0 +1,2 @@ +aae7a8f7e357e86e1c893b706bb02a63 guide.pdf +71975f20d37b30eb13a3ec8897f4f546 libsvm-2.89.tar.gz From 4fad22ccdcbb66c398343b6ca81e52cf3328fd01 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 4 Nov 2009 07:14:33 +0000 Subject: [PATCH 03/10] Upstream update --- LibSVM-svm-toy-48.png | Bin 0 -> 566 bytes import.log | 1 + libsvm-2.89.patch => libsvm-2.90.patch | 158 +++++++++++++++++++++---- libsvm.spec | 15 ++- log | 15 ++- sources | 2 +- 6 files changed, 160 insertions(+), 31 deletions(-) create mode 100644 LibSVM-svm-toy-48.png rename libsvm-2.89.patch => libsvm-2.90.patch (66%) diff --git a/LibSVM-svm-toy-48.png b/LibSVM-svm-toy-48.png new file mode 100644 index 0000000000000000000000000000000000000000..f13d50a7971c30593a82a95e2dd7542543d9181d GIT binary patch literal 566 zcmV-60?GY}P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iOA& z1qdkN15Qr>00Fj1L_t(&-tCynO2a@DhQBoFMO&+BRjS0KnZ!tsn-(xloRrj{pXqyEZ9N>K{Nj+@(Rh;V&1; zW`6;oS^fbim%B93EQq}b58}}~;Q*5r;Q&+Re{cdrkAeX-3s&}oXX3>pm^l{=5Ng3j z5mt9WH{2hpCq<58!_ood58-YUt}|fhU=G4-6za+E&|izeR29^wM*!_FHh$wYsnuxm zb{h3PCKo`pq9}GqSPZnum^kTi5Vt~LE6(#v44x7{*ZA=Us7=o{K%=+;O%7Bj zZh~&48!&MNbEhzU(YNp4&H!h#J@5nFX(#hexv;(s!!@CQB`TA!wF#Cc6abv$w7)C^ zAVLHc_4~kKUIsvd1W`H!eLV@cWBv!IQpLpVJb0OPHFqZCbtb+~yD~RTuK^xLT$$JF zUIQ4q&};Nl?_uEpwPE1^Vl(mAd>|U&EfTm;0N`hR02EGTW4=#-J^%m!07*qoM6N<$ Eg38(7y#N3J literal 0 HcmV?d00001 diff --git a/import.log b/import.log index 78cb32b..983ad1f 100644 --- a/import.log +++ b/import.log @@ -1 +1,2 @@ libsvm-2_89-4_fc11:EL-5:libsvm-2.89-4.fc11.src.rpm:1253237689 +libsvm-2_90-1_fc11:EL-5:libsvm-2.90-1.fc11.src.rpm:1257318817 diff --git a/libsvm-2.89.patch b/libsvm-2.90.patch similarity index 66% rename from libsvm-2.89.patch rename to libsvm-2.90.patch index 5673758..7fe6126 100644 --- a/libsvm-2.89.patch +++ b/libsvm-2.90.patch @@ -1,6 +1,6 @@ diff -up ./java/Makefile.orig ./java/Makefile --- ./java/Makefile.orig 2009-02-18 10:41:04.000000000 +1000 -+++ ./java/Makefile 2009-09-18 10:13:04.000000000 +1000 ++++ ./java/Makefile 2009-11-04 14:13:41.000000000 +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 @@ -51,18 +51,19 @@ diff -up ./java/Makefile.orig ./java/Makefile rm *.class libsvm/*.class diff -up ./java/test_applet.html.orig ./java/test_applet.html --- ./java/test_applet.html.orig 2003-07-12 14:07:32.000000000 +1000 -+++ ./java/test_applet.html 2009-09-18 10:10:34.000000000 +1000 ++++ ./java/test_applet.html 2009-11-04 14:13:41.000000000 +1000 @@ -1 +1,3 @@ - + + + diff -up ./Makefile.orig ./Makefile ---- ./Makefile.orig 2008-09-15 14:36:48.000000000 +1000 -+++ ./Makefile 2009-09-18 10:10:34.000000000 +1000 +--- ./Makefile.orig 2009-07-01 07:13:50.000000000 +1000 ++++ ./Makefile 2009-11-04 14:13:41.000000000 +1000 @@ -1,11 +1,40 @@ - CXX? = g++ +-CXX ?= g++ -CFLAGS = -Wall -Wconversion -O3 -fPIC ++CXX ? = g++ +CFLAGS = ${RPM_CFLAGS} -Wall -Wconversion -O3 -fPIC SHVER = 1 +MAKE = make @@ -172,9 +173,11 @@ diff -up ./Makefile.orig ./Makefile + + diff -up ./python/Makefile.orig ./python/Makefile ---- ./python/Makefile.orig 2008-12-10 09:05:08.000000000 +1000 -+++ ./python/Makefile 2009-09-18 10:10:34.000000000 +1000 -@@ -2,9 +2,11 @@ CXX? = g++ +--- ./python/Makefile.orig 2009-09-16 23:37:45.000000000 +1000 ++++ ./python/Makefile 2009-11-04 14:15:06.000000000 +1000 +@@ -1,10 +1,12 @@ +-CXX ?= g++ ++CXX ? = g++ SWIG ?= swig #Windows: see ../README ../Makefile.win @@ -187,8 +190,8 @@ diff -up ./python/Makefile.orig ./python/Makefile LDFLAGS = -shared # Mac OS # LDFLAGS = -framework Python -bundle -@@ -15,16 +17,31 @@ svmc.so: svmc_wrap.o svm.o - $(CXX) $(LDFLAGS) -o svmc.so svmc_wrap.o svm.o +@@ -15,16 +17,31 @@ svmc.so: svmc_wrap.o ../svm.o + $(CXX) $(LDFLAGS) -o svmc.so svmc_wrap.o ../svm.o svmc_wrap.o: svmc_wrap.c ../svm.h - $(CXX) $(CFLAGS) -fPIC -c svmc_wrap.c @@ -197,14 +200,15 @@ diff -up ./python/Makefile.orig ./python/Makefile svmc_wrap.c: svmc.i $(SWIG) -python -noproxy svmc.i - svm.o: ../svm.cpp ../svm.h -- $(CXX) $(CFLAGS) -fPIC -c ../svm.cpp -+ $(CXX) $(CFLAGS_PYTHON) -fPIC -c ../svm.cpp + ../svm.o: ../svm.cpp ../svm.h +- cd ..; $(CXX) $(CFLAGS) -fPIC -c svm.cpp ++ cd ..; $(CXX) $(CFLAGS_PYTHON) -fPIC -c svm.cpp clean: - rm -f *~ *.o *.so *.pyc *.pyo svm.o + rm -f *~ *.o *.so *.pyc *.pyo - moreclean: clean +-cleaner: clean ++cleaner: clean rm -f svmc_wrap.c + + @@ -223,7 +227,7 @@ diff -up ./python/Makefile.orig ./python/Makefile + diff -up ./svm-toy/gtk/callbacks.cpp.orig ./svm-toy/gtk/callbacks.cpp --- ./svm-toy/gtk/callbacks.cpp.orig 2006-03-04 17:40:12.000000000 +1000 -+++ ./svm-toy/gtk/callbacks.cpp 2009-09-18 10:10:34.000000000 +1000 ++++ ./svm-toy/gtk/callbacks.cpp 2009-11-04 14:13:41.000000000 +1000 @@ -2,6 +2,7 @@ #include #include @@ -234,7 +238,7 @@ diff -up ./svm-toy/gtk/callbacks.cpp.orig ./svm-toy/gtk/callbacks.cpp #include "../../svm.h" diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile --- ./svm-toy/gtk/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./svm-toy/gtk/Makefile 2009-09-18 10:10:34.000000000 +1000 ++++ ./svm-toy/gtk/Makefile 2009-11-04 14:13:41.000000000 +1000 @@ -2,21 +2,27 @@ CC? = gcc CXX? = g++ CFLAGS = -Wall -O3 -g `gtk-config --cflags` @@ -273,7 +277,7 @@ diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile + rm -f *~ callbacks.o svm-toy-gtk main.o interface.o callbacks.o diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile --- ./svm-toy/qt/Makefile.orig 2008-12-19 16:42:05.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2009-09-18 10:10:34.000000000 +1000 ++++ ./svm-toy/qt/Makefile 2009-11-04 14:13:41.000000000 +1000 @@ -1,17 +1,21 @@ CXX? = g++ -CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtGui -lQtGui @@ -305,8 +309,8 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile + rm -f *~ svm-toy-qt svm-toy.moc ../../svm.o diff -up ./tools/easy.py.orig ./tools/easy.py ---- ./tools/easy.py.orig 2009-01-14 07:13:26.000000000 +1000 -+++ ./tools/easy.py 2009-09-18 10:10:34.000000000 +1000 +--- ./tools/easy.py.orig 2009-05-14 15:09:29.000000000 +1000 ++++ ./tools/easy.py 2009-11-04 14:13:41.000000000 +1000 @@ -2,6 +2,7 @@ import sys @@ -331,9 +335,17 @@ diff -up ./tools/easy.py.orig ./tools/easy.py else: # example for windows diff -up ./tools/grid.py.orig ./tools/grid.py ---- ./tools/grid.py.orig 2008-08-08 20:41:11.000000000 +1000 -+++ ./tools/grid.py 2009-09-18 10:10:34.000000000 +1000 -@@ -11,7 +11,7 @@ from subprocess import * +--- ./tools/grid.py.orig 2009-05-14 15:09:29.000000000 +1000 ++++ ./tools/grid.py 2009-11-04 14:13:41.000000000 +1000 +@@ -1,7 +1,5 @@ + #!/usr/bin/env python + +- +- + import os, sys, traceback + import getpass + from threading import Thread +@@ -17,7 +15,7 @@ else: is_win32 = (sys.platform == 'win32') if not is_win32: @@ -342,11 +354,107 @@ diff -up ./tools/grid.py.orig ./tools/grid.py gnuplot_exe = "/usr/bin/gnuplot" else: # example for windows -@@ -88,6 +88,7 @@ Usage: grid.py [-log2c begin,end,step] [ +@@ -74,7 +72,7 @@ Usage: grid.py [-log2c begin,end,step] [ + i = i + 1 + fold = argv[i] + elif argv[i] in ('-c','-g'): +- print("Option -c and -g are renamed.") ++ print "Option -c and -g are renamed." + print(usage) + sys.exit(1) + elif argv[i] == '-svmtrain': +@@ -93,7 +91,8 @@ Usage: grid.py [-log2c begin,end,step] [ + pass_through_options.append(argv[i]) i = i + 1 - pass_through_string = join(pass_through_options," ") +- pass_through_string = " ".join(pass_through_options) ++ pass_through_string = " ".join(pass_through_options," ") + print 'dataset_pathname=%s' % dataset_pathname assert os.path.exists(svmtrain_exe),"svm-train executable not found" assert os.path.exists(gnuplot_exe),"gnuplot executable not found" assert os.path.exists(dataset_pathname),"dataset not found" +@@ -127,7 +126,9 @@ def permute_sequence(seq): + + def redraw(db,best_param,tofile=False): + if len(db) == 0: return +- begin_level = round(max(x[2] for x in db)) - 3 ++ begin_level = round(max(x[2] for x in db)) - 3 ++ ++ begin_level = round(max(map(lambda(x):x[2],db))) - 3 + step_size = 0.5 + + best_log2c,best_log2g,best_rate = best_param +@@ -158,12 +159,12 @@ def redraw(db,best_param,tofile=False): + gnuplot.write(("set label \"C = %s gamma = %s\"" + " at screen 0.5,0.8 center\n" % (2**best_log2c, 2**best_log2g)).encode()) + gnuplot.write("splot \"-\" with lines\n".encode()) +- +- +- +- ++ ++ ++ ++ + db.sort(key = lambda x:(x[0], -x[1])) +- ++ + prevc = db[0][0] + for line in db: + if prevc != line[0]: +@@ -222,9 +223,7 @@ class Worker(Thread): + if rate is None: raise "get no rate" + except: + # we failed, let others do that and we just quit +- + traceback.print_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2]) +- + self.job_queue.put((cexp,gexp)) + print('worker %s quit.' % self.name) + break +@@ -251,8 +250,8 @@ class SSHWorker(Worker): + svmtrain_exe,c,g,fold,pass_through_string,dataset_pathname) + result = Popen(cmdline,shell=True,stdout=PIPE).stdout + for line in result.readlines(): +- if str(line).find("Cross") != -1: +- return float(line.split()[-1][0:-1]) ++ if find(line,"Cross") != -1: ++ return float(split(line)[-1][0:-1]) + + class TelnetWorker(Worker): + def __init__(self,name,job_queue,result_queue,host,username,password): +@@ -302,7 +301,6 @@ def main(): + + job_queue._put = job_queue.queue.appendleft + +- + # fire telnet workers + + if telnet_workers: +@@ -328,10 +326,8 @@ def main(): + + done_jobs = {} + +- + result_file = open(out_filename, 'w') + +- + db = [] + best_rate = -1 + best_c1,best_g1 = None,None +@@ -343,13 +339,14 @@ def main(): + done_jobs[(c1,g1)] = rate + result_file.write('%s %s %s\n' %(c1,g1,rate)) + result_file.flush() ++ print "[%s] %s %s %s" % (worker,c1,g1,rate), + if (rate > best_rate) or (rate==best_rate and g1==best_g1 and c1 - 2.90-1 +- Upstream update to 2.9, change to 2.90 for conveniently update. + + tools/*.py can be run under python 3.0 + + svm_set_quiet() in python interface to disable outputs + + check gamma < 0 + + internal functions to be static + * Fri Sep 18 2009 Ding-Yi Chen - 2.89-4 - Fixed [Bug 524108] put libsvm.jar into _javadir + Move livsvm.jar to _javadir diff --git a/log b/log index 15da1b9..330b6e3 100644 --- a/log +++ b/log @@ -157,4 +157,17 @@ file updated. issue a warning when -h 0 may be faster 2.89: 2009/04/01 - todo: python 2.6, java 1.6, openMP, fast input \ No newline at end of file + reduce input/loading time of svm-train/svm-predict by half + pointer function so users can specify their own outputs + remove info_flush() + a extern variable libsvm_version + svm-train -q option (disable outputs) + svm-scale: warning if more nonzero produced + easy.py: popel.communiate() to avoid some deadlock (if lots of + outputs when #classes is large) + +2.9: 2009/11/? + tools/*.py can be run under python 3.0 + svm_set_quiet() in python interface to disable outputs + check gamma < 0 + internal functions to be static \ No newline at end of file diff --git a/sources b/sources index 3321f93..ad1329e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ aae7a8f7e357e86e1c893b706bb02a63 guide.pdf -71975f20d37b30eb13a3ec8897f4f546 libsvm-2.89.tar.gz +c48109c825d8326d71c8c8564589736d libsvm-2.9.tar.gz From e75602c19a4b7e62a0b3e3f5e677151f16186513 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 5 Nov 2009 06:58:56 +0000 Subject: [PATCH 04/10] Obsoletes libsvm-java for ppc and ppc64 --- import.log | 1 + libsvm.spec | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/import.log b/import.log index 983ad1f..4e039a7 100644 --- a/import.log +++ b/import.log @@ -1,2 +1,3 @@ libsvm-2_89-4_fc11:EL-5:libsvm-2.89-4.fc11.src.rpm:1253237689 libsvm-2_90-1_fc11:EL-5:libsvm-2.90-1.fc11.src.rpm:1257318817 +libsvm-2_90-2_fc11:EL-5:libsvm-2.90-2.fc11.src.rpm:1257397446 diff --git a/libsvm.spec b/libsvm.spec index 6dbb355..a68004a 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.90 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -33,6 +33,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root %define no_java FALSE %else %define no_java NO_JAVA +Obsoletes: libsvm-java %endif %description @@ -222,6 +223,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Nov 05 2009 Ding-Yi Chen - 2.90-2 +- Obsoletes libsvm-java for ppc and ppc64. + * Wed Nov 04 2009 Ding-Yi Chen - 2.90-1 - Upstream update to 2.9, change to 2.90 for conveniently update. + tools/*.py can be run under python 3.0 From c816245a19379aefdfba93b19425e45da91b1940 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 26 Nov 2009 01:54:03 +0000 Subject: [PATCH 05/10] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 70ef916..e9227e1 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: libsvm -# $Id$ +# $Id: Makefile,v 1.1 2009/09/18 01:56:09 dchen Exp $ NAME := libsvm SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From e18686e91c039be48238524f3f46c76e43d98902 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 7 Apr 2010 05:30:40 +0000 Subject: [PATCH 06/10] Upstream update to 2.91 --- import.log | 1 + libsvm-2.90.patch => libsvm-2.91.patch | 193 +++++++------------------ libsvm.spec | 16 +- log | 18 ++- sources | 2 +- 5 files changed, 86 insertions(+), 144 deletions(-) rename libsvm-2.90.patch => libsvm-2.91.patch (67%) diff --git a/import.log b/import.log index 4e039a7..40264dd 100644 --- a/import.log +++ b/import.log @@ -1,3 +1,4 @@ libsvm-2_89-4_fc11:EL-5:libsvm-2.89-4.fc11.src.rpm:1253237689 libsvm-2_90-1_fc11:EL-5:libsvm-2.90-1.fc11.src.rpm:1257318817 libsvm-2_90-2_fc11:EL-5:libsvm-2.90-2.fc11.src.rpm:1257397446 +libsvm-2_91-1_el5:EL-5:libsvm-2.91-1.el5.src.rpm:1270618213 diff --git a/libsvm-2.90.patch b/libsvm-2.91.patch similarity index 67% rename from libsvm-2.90.patch rename to libsvm-2.91.patch index 7fe6126..9867ae9 100644 --- a/libsvm-2.90.patch +++ b/libsvm-2.91.patch @@ -1,6 +1,6 @@ diff -up ./java/Makefile.orig ./java/Makefile --- ./java/Makefile.orig 2009-02-18 10:41:04.000000000 +1000 -+++ ./java/Makefile 2009-11-04 14:13:41.000000000 +1000 ++++ ./java/Makefile 2010-04-07 11:28:04.000000000 +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 @@ -51,33 +51,32 @@ diff -up ./java/Makefile.orig ./java/Makefile rm *.class libsvm/*.class diff -up ./java/test_applet.html.orig ./java/test_applet.html --- ./java/test_applet.html.orig 2003-07-12 14:07:32.000000000 +1000 -+++ ./java/test_applet.html 2009-11-04 14:13:41.000000000 +1000 ++++ ./java/test_applet.html 2010-04-07 11:28:04.000000000 +1000 @@ -1 +1,3 @@ - + + + diff -up ./Makefile.orig ./Makefile ---- ./Makefile.orig 2009-07-01 07:13:50.000000000 +1000 -+++ ./Makefile 2009-11-04 14:13:41.000000000 +1000 -@@ -1,11 +1,40 @@ --CXX ?= g++ +--- ./Makefile.orig 2010-03-19 00:54:02.000000000 +1000 ++++ ./Makefile 2010-04-07 11:28:04.000000000 +1000 +@@ -1,11 +1,39 @@ + CXX ?= g++ -CFLAGS = -Wall -Wconversion -O3 -fPIC -+CXX ? = g++ +CFLAGS = ${RPM_CFLAGS} -Wall -Wconversion -O3 -fPIC SHVER = 1 +MAKE = make +DOT_LIBS=.libs +LIBS= -L${DOT_LIBS} -lsvm +export LIBSVM_VER - --all: svm-train svm-predict svm-scale ++ +ifndef DESTDIR +INSTDIR=/usr +else +INSTDIR=${DESTDIR}/usr +endif -+ + +-all: svm-train svm-predict svm-scale +export INSTDIR + +IS_64=$(shell /bin/uname -i | awk '/64/ {print 64}') @@ -95,32 +94,33 @@ diff -up ./Makefile.orig ./Makefile +export LIBDIR +export LIB_INSTDIR + -+ +all: lib svm-train svm-predict svm-scale svm-python svm-java svm-toy-gtk svm-toy-qt lib: svm.o -- $(CXX) -shared svm.o -o libsvm.so.$(SHVER) +- $(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 +@@ -16,4 +44,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 +- 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 + @@ -170,14 +170,30 @@ diff -up ./Makefile.orig ./Makefile +endif + rm -f ${INSTDIR}/bin/svm-toy-gtk + rm -f ${INSTDIR}/bin/svm-toy-qt +diff -up ./python/Makefile.orig ./python/Makefile +--- ./python/Makefile.orig 2010-03-19 01:57:28.000000000 +1000 ++++ ./python/Makefile 2010-04-07 11:28:04.000000000 +1000 +@@ -1,4 +1,15 @@ +-all = lib ++PYTHON_PATH ?= python${PYTHON_VERSION}/site-packages/libsvm ++PYTHON_TARGETDIR=${LIB_INSTDIR}/${PYTHON_PATH} + ++all: lib + + lib: ../svm.cpp ../svm.h + cd ..; make lib; cd - + -diff -up ./python/Makefile.orig ./python/Makefile ---- ./python/Makefile.orig 2009-09-16 23:37:45.000000000 +1000 -+++ ./python/Makefile 2009-11-04 14:15:06.000000000 +1000 -@@ -1,10 +1,12 @@ --CXX ?= g++ -+CXX ? = g++ ++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} +diff -up ./python_old/Makefile.orig ./python_old/Makefile +--- ./python_old/Makefile.orig 2009-09-16 23:37:45.000000000 +1000 ++++ ./python_old/Makefile 2010-04-07 11:28:04.000000000 +1000 +@@ -2,9 +2,11 @@ CXX ?= g++ SWIG ?= swig #Windows: see ../README ../Makefile.win @@ -186,32 +202,15 @@ diff -up ./python/Makefile.orig ./python/Makefile +PYTHON_TARGETDIR=${LIB_INSTDIR}/python${PYTHON_VERSION}/site-packages/libsvm CFLAGS = -O3 -I$(PYTHON_INCLUDEDIR) -I.. -+CFLAGS_PYTHON = ${CFLAGS} -O3 -I$(PYTHON_INCLUDEDIR) -I.. ++ LDFLAGS = -shared # Mac OS # LDFLAGS = -framework Python -bundle -@@ -15,16 +17,31 @@ svmc.so: svmc_wrap.o ../svm.o - $(CXX) $(LDFLAGS) -o svmc.so svmc_wrap.o ../svm.o - - svmc_wrap.o: svmc_wrap.c ../svm.h -- $(CXX) $(CFLAGS) -fPIC -c svmc_wrap.c -+ $(CXX) $(CFLAGS_PYTHON) -fPIC -c svmc_wrap.c - - svmc_wrap.c: svmc.i - $(SWIG) -python -noproxy svmc.i +@@ -28,3 +30,16 @@ clean: - ../svm.o: ../svm.cpp ../svm.h -- cd ..; $(CXX) $(CFLAGS) -fPIC -c svm.cpp -+ cd ..; $(CXX) $(CFLAGS_PYTHON) -fPIC -c svm.cpp - - clean: - rm -f *~ *.o *.so *.pyc *.pyo - --cleaner: clean -+cleaner: clean + cleaner: clean rm -f svmc_wrap.c + -+ +install: all + mkdir -p ${PYTHON_TARGETDIR} + install -m 755 cross_validation.py ${PYTHON_TARGETDIR} @@ -224,10 +223,9 @@ diff -up ./python/Makefile.orig ./python/Makefile + +uninstall: + rm -fr ${LIBDIR}/python${PYTHON_VERSION}/site-packages/libsvm -+ diff -up ./svm-toy/gtk/callbacks.cpp.orig ./svm-toy/gtk/callbacks.cpp --- ./svm-toy/gtk/callbacks.cpp.orig 2006-03-04 17:40:12.000000000 +1000 -+++ ./svm-toy/gtk/callbacks.cpp 2009-11-04 14:13:41.000000000 +1000 ++++ ./svm-toy/gtk/callbacks.cpp 2010-04-07 11:28:04.000000000 +1000 @@ -2,6 +2,7 @@ #include #include @@ -238,7 +236,7 @@ diff -up ./svm-toy/gtk/callbacks.cpp.orig ./svm-toy/gtk/callbacks.cpp #include "../../svm.h" diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile --- ./svm-toy/gtk/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./svm-toy/gtk/Makefile 2009-11-04 14:13:41.000000000 +1000 ++++ ./svm-toy/gtk/Makefile 2010-04-07 11:28:04.000000000 +1000 @@ -2,21 +2,27 @@ CC? = gcc CXX? = g++ CFLAGS = -Wall -O3 -g `gtk-config --cflags` @@ -277,7 +275,7 @@ diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile + rm -f *~ callbacks.o svm-toy-gtk main.o interface.o callbacks.o diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile --- ./svm-toy/qt/Makefile.orig 2008-12-19 16:42:05.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2009-11-04 14:13:41.000000000 +1000 ++++ ./svm-toy/qt/Makefile 2010-04-07 11:28:04.000000000 +1000 @@ -1,17 +1,21 @@ CXX? = g++ -CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtGui -lQtGui @@ -310,7 +308,7 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile diff -up ./tools/easy.py.orig ./tools/easy.py --- ./tools/easy.py.orig 2009-05-14 15:09:29.000000000 +1000 -+++ ./tools/easy.py 2009-11-04 14:13:41.000000000 +1000 ++++ ./tools/easy.py 2010-04-07 11:28:04.000000000 +1000 @@ -2,6 +2,7 @@ import sys @@ -335,17 +333,9 @@ diff -up ./tools/easy.py.orig ./tools/easy.py else: # example for windows diff -up ./tools/grid.py.orig ./tools/grid.py ---- ./tools/grid.py.orig 2009-05-14 15:09:29.000000000 +1000 -+++ ./tools/grid.py 2009-11-04 14:13:41.000000000 +1000 -@@ -1,7 +1,5 @@ - #!/usr/bin/env python - -- -- - import os, sys, traceback - import getpass - from threading import Thread -@@ -17,7 +15,7 @@ else: +--- ./tools/grid.py.orig 2009-11-20 22:29:46.000000000 +1000 ++++ ./tools/grid.py 2010-04-07 14:14:21.000000000 +1000 +@@ -17,7 +17,7 @@ else: is_win32 = (sys.platform == 'win32') if not is_win32: @@ -354,107 +344,36 @@ diff -up ./tools/grid.py.orig ./tools/grid.py gnuplot_exe = "/usr/bin/gnuplot" else: # example for windows -@@ -74,7 +72,7 @@ Usage: grid.py [-log2c begin,end,step] [ - i = i + 1 - fold = argv[i] - elif argv[i] in ('-c','-g'): -- print("Option -c and -g are renamed.") -+ print "Option -c and -g are renamed." - print(usage) - sys.exit(1) - elif argv[i] == '-svmtrain': -@@ -93,7 +91,8 @@ Usage: grid.py [-log2c begin,end,step] [ - pass_through_options.append(argv[i]) - i = i + 1 - -- pass_through_string = " ".join(pass_through_options) -+ pass_through_string = " ".join(pass_through_options," ") -+ print 'dataset_pathname=%s' % dataset_pathname - assert os.path.exists(svmtrain_exe),"svm-train executable not found" - assert os.path.exists(gnuplot_exe),"gnuplot executable not found" - assert os.path.exists(dataset_pathname),"dataset not found" -@@ -127,7 +126,9 @@ def permute_sequence(seq): - - def redraw(db,best_param,tofile=False): - if len(db) == 0: return -- begin_level = round(max(x[2] for x in db)) - 3 -+ begin_level = round(max(x[2] for x in db)) - 3 -+ -+ begin_level = round(max(map(lambda(x):x[2],db))) - 3 - step_size = 0.5 - - best_log2c,best_log2g,best_rate = best_param -@@ -158,12 +159,12 @@ def redraw(db,best_param,tofile=False): +@@ -158,10 +158,10 @@ def redraw(db,best_param,tofile=False): gnuplot.write(("set label \"C = %s gamma = %s\"" " at screen 0.5,0.8 center\n" % (2**best_log2c, 2**best_log2g)).encode()) gnuplot.write("splot \"-\" with lines\n".encode()) - -- -- + + - -+ -+ -+ -+ ++ ++ db.sort(key = lambda x:(x[0], -x[1])) -- -+ + prevc = db[0][0] - for line in db: - if prevc != line[0]: -@@ -222,9 +223,7 @@ class Worker(Thread): +@@ -222,9 +222,9 @@ class Worker(Thread): if rate is None: raise "get no rate" except: # we failed, let others do that and we just quit - ++ traceback.print_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2]) - ++ self.job_queue.put((cexp,gexp)) print('worker %s quit.' % self.name) break -@@ -251,8 +250,8 @@ class SSHWorker(Worker): - svmtrain_exe,c,g,fold,pass_through_string,dataset_pathname) - result = Popen(cmdline,shell=True,stdout=PIPE).stdout - for line in result.readlines(): -- if str(line).find("Cross") != -1: -- return float(line.split()[-1][0:-1]) -+ if find(line,"Cross") != -1: -+ return float(split(line)[-1][0:-1]) - - class TelnetWorker(Worker): - def __init__(self,name,job_queue,result_queue,host,username,password): -@@ -302,7 +301,6 @@ def main(): +@@ -331,7 +331,6 @@ def main(): - job_queue._put = job_queue.queue.appendleft - -- - # fire telnet workers - - if telnet_workers: -@@ -328,10 +326,8 @@ def main(): - - done_jobs = {} - -- result_file = open(out_filename, 'w') - db = [] best_rate = -1 best_c1,best_g1 = None,None -@@ -343,13 +339,14 @@ def main(): - done_jobs[(c1,g1)] = rate - result_file.write('%s %s %s\n' %(c1,g1,rate)) - result_file.flush() -+ print "[%s] %s %s %s" % (worker,c1,g1,rate), - if (rate > best_rate) or (rate==best_rate and g1==best_g1 and c1 - 2.91-1 +- Fixed Bug 564887 - FTBFS libsvm-2.90-3.fc13 +- Upstream update: + * completely new python interface using ctype + * new way to set the print_string function + * Java: able to load model from a BufferedReader directly + * fix grid.py so -log2c can be run under python 2.6 or after + * Thu Nov 05 2009 Ding-Yi Chen - 2.90-2 - Obsoletes libsvm-java for ppc and ppc64. diff --git a/log b/log index 330b6e3..607ab9d 100644 --- a/log +++ b/log @@ -166,8 +166,22 @@ file updated. easy.py: popel.communiate() to avoid some deadlock (if lots of outputs when #classes is large) -2.9: 2009/11/? +2.9: 2009/11/1 tools/*.py can be run under python 3.0 svm_set_quiet() in python interface to disable outputs check gamma < 0 - internal functions to be static \ No newline at end of file + internal functions to be static + +2.91: 2010/04/01 + completely new python interface using ctype + new way to set the print_string function + Java: able to load model from a BufferedReader directly + fix grid.py so -log2c can be run under python 2.6 or after + +------------------ + +Future plan: +?.?: + old python interface is removed + + update make.m of matlab interface to use max(...) \ No newline at end of file diff --git a/sources b/sources index ad1329e..d04a0f0 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ aae7a8f7e357e86e1c893b706bb02a63 guide.pdf -c48109c825d8326d71c8c8564589736d libsvm-2.9.tar.gz +aec07b9142ce585c95854ed379538154 libsvm-2.91.tar.gz From e60143e28f29dacefd4317d89a7e9eab8916e6a8 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 28 Jul 2010 21:42:56 +0000 Subject: [PATCH 07/10] dist-git conversion --- Makefile | 21 --------------------- branch | 1 - import.log | 4 ---- 3 files changed, 26 deletions(-) delete mode 100644 Makefile delete mode 100644 branch delete mode 100644 import.log diff --git a/Makefile b/Makefile deleted file mode 100644 index e9227e1..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: libsvm -# $Id: Makefile,v 1.1 2009/09/18 01:56:09 dchen Exp $ -NAME := libsvm -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/branch b/branch deleted file mode 100644 index 42f697a..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -EL-5 diff --git a/import.log b/import.log deleted file mode 100644 index 40264dd..0000000 --- a/import.log +++ /dev/null @@ -1,4 +0,0 @@ -libsvm-2_89-4_fc11:EL-5:libsvm-2.89-4.fc11.src.rpm:1253237689 -libsvm-2_90-1_fc11:EL-5:libsvm-2.90-1.fc11.src.rpm:1257318817 -libsvm-2_90-2_fc11:EL-5:libsvm-2.90-2.fc11.src.rpm:1257397446 -libsvm-2_91-1_el5:EL-5:libsvm-2.91-1.el5.src.rpm:1270618213 From 2d694e467c485b035a30c9cb3313aae0603cc0e8 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Fri, 17 Jun 2011 13:29:56 +1000 Subject: [PATCH 08/10] Fix the build error on EL-5 --- libsvm.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index f81c408..efaa12d 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm Version: 3.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -34,10 +34,10 @@ BuildRequires: grep %else %if 0%{?rhel} >= 6 %define moc_path %{_bindir}/moc-qt4 -%endif %else %define moc_path %{_libdir}/qt4/bin/moc %endif +%endif %ifnarch ppc ppc64 %define no_java FALSE @@ -239,6 +239,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Jun 17 2011 Ding-Yi Chen - 3.1-2 +- Fix the build error on EL-5 + * Tue Jun 14 2011 Ding-Yi Chen - 3.1-1 - svm tools is now installed in /usr/bin as svm-*.py i.e. tools/easy.py is linked as svm-easy.py. From 0b558eed957d5e45ea571a6414f9549fbc7e2cdf Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 8 Nov 2011 15:06:33 +1000 Subject: [PATCH 09/10] Upstream update:3.11 --- .gitignore | 1 + libsvm-2.91.patch | 379 ------------------ ...javaDir.patch => libsvm-3.11.javaDir.patch | 0 ...ain.patch => libsvm-3.11.packageMain.patch | 13 +- ...onDir.patch => libsvm-3.11.pythonDir.patch | 12 +- ...svm-toy.patch => libsvm-3.11.svm-toy.patch | 53 +-- ...olsDir.patch => libsvm-3.11.toolsDir.patch | 0 libsvm.spec | 12 +- log | 15 +- sources | 2 +- 10 files changed, 61 insertions(+), 426 deletions(-) delete mode 100644 libsvm-2.91.patch rename libsvm-3.1.javaDir.patch => libsvm-3.11.javaDir.patch (100%) rename libsvm-3.1.packageMain.patch => libsvm-3.11.packageMain.patch (93%) rename libsvm-3.1.pythonDir.patch => libsvm-3.11.pythonDir.patch (78%) rename libsvm-3.1.svm-toy.patch => libsvm-3.11.svm-toy.patch (50%) rename libsvm-3.1.toolsDir.patch => libsvm-3.11.toolsDir.patch (100%) diff --git a/.gitignore b/.gitignore index 2068ba3..4373f69 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ libsvm-2.91.tar.gz /guide.pdf /libsvm-3.0.tar.gz /libsvm-3.1.tar.gz +/libsvm-3.11.tar.gz diff --git a/libsvm-2.91.patch b/libsvm-2.91.patch deleted file mode 100644 index 9867ae9..0000000 --- a/libsvm-2.91.patch +++ /dev/null @@ -1,379 +0,0 @@ -diff -up ./java/Makefile.orig ./java/Makefile ---- ./java/Makefile.orig 2009-02-18 10:41:04.000000000 +1000 -+++ ./java/Makefile 2010-04-07 11:28:04.000000000 +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.orig ./java/test_applet.html ---- ./java/test_applet.html.orig 2003-07-12 14:07:32.000000000 +1000 -+++ ./java/test_applet.html 2010-04-07 11:28:04.000000000 +1000 -@@ -1 +1,3 @@ -- -+ -+ -+ -diff -up ./Makefile.orig ./Makefile ---- ./Makefile.orig 2010-03-19 00:54:02.000000000 +1000 -+++ ./Makefile 2010-04-07 11:28:04.000000000 +1000 -@@ -1,11 +1,39 @@ - CXX ?= g++ --CFLAGS = -Wall -Wconversion -O3 -fPIC -+CFLAGS = ${RPM_CFLAGS} -Wall -Wconversion -O3 -fPIC - SHVER = 1 -+MAKE = make -+DOT_LIBS=.libs -+LIBS= -L${DOT_LIBS} -lsvm -+export LIBSVM_VER -+ -+ifndef DESTDIR -+INSTDIR=/usr -+else -+INSTDIR=${DESTDIR}/usr -+endif - --all: svm-train svm-predict svm-scale -+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 - - 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 +44,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 -diff -up ./python/Makefile.orig ./python/Makefile ---- ./python/Makefile.orig 2010-03-19 01:57:28.000000000 +1000 -+++ ./python/Makefile 2010-04-07 11:28:04.000000000 +1000 -@@ -1,4 +1,15 @@ --all = lib -+PYTHON_PATH ?= python${PYTHON_VERSION}/site-packages/libsvm -+PYTHON_TARGETDIR=${LIB_INSTDIR}/${PYTHON_PATH} -+ -+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} -diff -up ./python_old/Makefile.orig ./python_old/Makefile ---- ./python_old/Makefile.orig 2009-09-16 23:37:45.000000000 +1000 -+++ ./python_old/Makefile 2010-04-07 11:28:04.000000000 +1000 -@@ -2,9 +2,11 @@ CXX ?= g++ - SWIG ?= swig - - #Windows: see ../README ../Makefile.win --PYTHON_INCLUDEDIR ?= /usr/include/python2.5 -+PYTHON_INCLUDEDIR ?= /usr/include/python${PYTHON_VERSION} -+PYTHON_TARGETDIR=${LIB_INSTDIR}/python${PYTHON_VERSION}/site-packages/libsvm - - CFLAGS = -O3 -I$(PYTHON_INCLUDEDIR) -I.. -+ - LDFLAGS = -shared - # Mac OS - # LDFLAGS = -framework Python -bundle -@@ -28,3 +30,16 @@ clean: - - cleaner: clean - rm -f svmc_wrap.c -+ -+install: all -+ mkdir -p ${PYTHON_TARGETDIR} -+ install -m 755 cross_validation.py ${PYTHON_TARGETDIR} -+ install -m 644 svm.py ${PYTHON_TARGETDIR} -+ install -m 755 svm_test.py ${PYTHON_TARGETDIR} -+ install -m 755 test_cross_validation.py ${PYTHON_TARGETDIR} -+ install -m 644 *.i ${PYTHON_TARGETDIR} -+ install -m 755 *.so ${PYTHON_TARGETDIR} -+ install -m 755 ../tools/*.py ${PYTHON_TARGETDIR} -+ -+uninstall: -+ rm -fr ${LIBDIR}/python${PYTHON_VERSION}/site-packages/libsvm -diff -up ./svm-toy/gtk/callbacks.cpp.orig ./svm-toy/gtk/callbacks.cpp ---- ./svm-toy/gtk/callbacks.cpp.orig 2006-03-04 17:40:12.000000000 +1000 -+++ ./svm-toy/gtk/callbacks.cpp 2010-04-07 11:28:04.000000000 +1000 -@@ -2,6 +2,7 @@ - #include - #include - #include -+#include - #include "callbacks.h" - #include "interface.h" - #include "../../svm.h" -diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile ---- ./svm-toy/gtk/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./svm-toy/gtk/Makefile 2010-04-07 11:28:04.000000000 +1000 -@@ -2,21 +2,27 @@ CC? = gcc - CXX? = g++ - CFLAGS = -Wall -O3 -g `gtk-config --cflags` - LIBS = `gtk-config --libs` -+COPT = -Wall -O3 -g `pkg-config --cflags --libs gtk+-2.0` -+LOCAL_LIBDIR=../../ -+LIBS= -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) -+ -+all: svm-toy-gtk -+ -+svm-toy-gtk: main.o interface.o callbacks.o -+ $(CXX) $(COPT) main.o interface.o callbacks.o ${LIBS} -o svm-toy-gtk - - main.o: main.c -- $(CC) $(CFLAGS) -c main.c -+ $(CC) $(COPT) -c main.c - - interface.o: interface.c interface.h -- $(CC) $(CFLAGS) -c interface.c -+ $(CC) $(COPT) -c interface.c - - callbacks.o: callbacks.cpp callbacks.h -- $(CXX) $(CFLAGS) -c callbacks.cpp -+ $(CXX) $(COPT) -c callbacks.cpp - --../../svm.o: -- cd ../..; make svm.o -+#../../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-gtk main.o interface.o callbacks.o -diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile ---- ./svm-toy/qt/Makefile.orig 2008-12-19 16:42:05.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2010-04-07 11:28:04.000000000 +1000 -@@ -1,17 +1,21 @@ - CXX? = g++ --CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtGui -lQtGui -+CFLAGS = -Wall -O3 -+FLAGS:=${CFLAGS} `pkg-config --cflags --libs QtGui` -+LOCAL_LIBDIR=../../ -+LIBS= -L${LOCAL_LIBDIR} -lsvm -+ - INCLUDE = /usr/include/qt4 --MOC = /usr/bin/moc-qt4 - --svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o -- $(CXX) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy -+MOC=${MOC_PATH} -+ -+all: svm-toy-qt -+ -+svm-toy-qt: svm-toy.cpp svm-toy.moc -+ $(CXX) $(FLAGS) svm-toy.cpp ${LIBS} -o svm-toy-qt - - 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-qt svm-toy.moc ../../svm.o - -diff -up ./tools/easy.py.orig ./tools/easy.py ---- ./tools/easy.py.orig 2009-05-14 15:09:29.000000000 +1000 -+++ ./tools/easy.py 2010-04-07 11:28:04.000000000 +1000 -@@ -2,6 +2,7 @@ - - import sys - import os -+from distutils.sysconfig import get_python_lib - from subprocess import * - - if len(sys.argv) <= 1: -@@ -12,10 +13,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 = get_python_lib(1)+"/libsvm/grid.py" - gnuplot_exe = "/usr/bin/gnuplot" - else: - # example for windows -diff -up ./tools/grid.py.orig ./tools/grid.py ---- ./tools/grid.py.orig 2009-11-20 22:29:46.000000000 +1000 -+++ ./tools/grid.py 2010-04-07 14:14:21.000000000 +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 -@@ -158,10 +158,10 @@ def redraw(db,best_param,tofile=False): - gnuplot.write(("set label \"C = %s gamma = %s\"" - " at screen 0.5,0.8 center\n" % (2**best_log2c, 2**best_log2g)).encode()) - gnuplot.write("splot \"-\" with lines\n".encode()) -- - - -- -+ -+ - db.sort(key = lambda x:(x[0], -x[1])) - - prevc = db[0][0] -@@ -222,9 +222,9 @@ class Worker(Thread): - if rate is None: raise "get no rate" - except: - # we failed, let others do that and we just quit -- -+ - traceback.print_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2]) -- -+ - self.job_queue.put((cexp,gexp)) - print('worker %s quit.' % self.name) - break -@@ -331,7 +331,6 @@ def main(): - - result_file = open(out_filename, 'w') - -- - db = [] - best_rate = -1 - best_c1,best_g1 = None,None diff --git a/libsvm-3.1.javaDir.patch b/libsvm-3.11.javaDir.patch similarity index 100% rename from libsvm-3.1.javaDir.patch rename to libsvm-3.11.javaDir.patch diff --git a/libsvm-3.1.packageMain.patch b/libsvm-3.11.packageMain.patch similarity index 93% rename from libsvm-3.1.packageMain.patch rename to libsvm-3.11.packageMain.patch index 87209e9..5fbadbe 100644 --- a/libsvm-3.1.packageMain.patch +++ b/libsvm-3.11.packageMain.patch @@ -1,6 +1,6 @@ diff -up ./Makefile.packageMain ./Makefile ---- ./Makefile.packageMain 2010-09-12 22:11:10.000000000 +1000 -+++ ./Makefile 2011-06-14 17:00:32.774749405 +1000 +--- ./Makefile.packageMain 2011-06-26 05:55:06.000000000 +1000 ++++ ./Makefile 2011-11-08 09:42:13.106501233 +1000 @@ -1,11 +1,44 @@ CXX ?= g++ -CFLAGS = -Wall -Wconversion -O3 -fPIC @@ -10,7 +10,8 @@ diff -up ./Makefile.packageMain ./Makefile +DOT_LIBS=.libs +LIBS= -L${DOT_LIBS} -lsvm +export LIBSVM_VER -+ + +-all: svm-train svm-predict svm-scale +IS_64:=$(shell /bin/uname -i | awk '/64/ {print 64}') + +PREFIXDIR?= /usr @@ -40,12 +41,10 @@ diff -up ./Makefile.packageMain ./Makefile + +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) + $(CXX) -shared -dynamiclib -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 diff --git a/libsvm-3.1.pythonDir.patch b/libsvm-3.11.pythonDir.patch similarity index 78% rename from libsvm-3.1.pythonDir.patch rename to libsvm-3.11.pythonDir.patch index 8d8d7ec..ff0991d 100644 --- a/libsvm-3.1.pythonDir.patch +++ b/libsvm-3.11.pythonDir.patch @@ -1,18 +1,19 @@ diff -up ./python/Makefile.pythonDir ./python/Makefile ---- ./python/Makefile.pythonDir 2010-06-16 14:04:46.000000000 +1000 -+++ ./python/Makefile 2011-06-14 16:53:39.365997401 +1000 -@@ -1,4 +1,19 @@ --all = lib +--- ./python/Makefile.pythonDir 2011-05-10 09:35:15.000000000 +1000 ++++ ./python/Makefile 2011-11-08 09:49:54.280501207 +1000 +@@ -1,4 +1,20 @@ +PYTHONDIR_NAME ?= python${PYTHON_VERSION}/site-packages/libsvm +PYTHONDIR?=${LIBDIR}/${PYTHONDIR_NAME} +PYTHONDIR_INSTALL=${DESTDIR}/${PYTHONDIR} +SVM_TOOLS:= $(notdir $(wildcard ../tools/*.py)) ++ + all = lib -lib: +all: lib + +lib: ../svm.cpp ../svm.h - cd ..; make lib; cd - + make -C .. lib + +install: all + mkdir -p ${PYTHONDIR_INSTALL} @@ -22,4 +23,3 @@ diff -up ./python/Makefile.pythonDir ./python/Makefile + +uninstall: + rm -fr ${LIBDIR}/${PYTHON_PATH} $(addprefix ${BINDIR_INSTALL}/svm-,$(SVM_TOOLS)) -+ diff --git a/libsvm-3.1.svm-toy.patch b/libsvm-3.11.svm-toy.patch similarity index 50% rename from libsvm-3.1.svm-toy.patch rename to libsvm-3.11.svm-toy.patch index baad72a..e8d4e69 100644 --- a/libsvm-3.1.svm-toy.patch +++ b/libsvm-3.11.svm-toy.patch @@ -1,6 +1,6 @@ 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 2011-06-14 13:36:25.726748304 +1000 ++++ ./svm-toy/gtk/callbacks.cpp 2011-11-08 09:57:01.782500360 +1000 @@ -3,6 +3,7 @@ #include #include @@ -10,61 +10,66 @@ diff -up ./svm-toy/gtk/callbacks.cpp.svm-toy ./svm-toy/gtk/callbacks.cpp #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-11-14 10:59:28.000000000 +1000 -+++ ./svm-toy/gtk/Makefile 2011-06-14 13:47:23.529749429 +1000 +--- ./svm-toy/gtk/Makefile.svm-toy 2011-05-11 12:15:45.000000000 +1000 ++++ ./svm-toy/gtk/Makefile 2011-11-08 10:06:35.686501266 +1000 @@ -1,10 +1,12 @@ CC? = gcc CXX? = g++ - CFLAGS = -Wall -O3 -g `pkg-config --cflags gtk+-2.0` +-CFLAGS = -Wall -O3 -g `pkg-config --cflags gtk+-2.0` -LIBS = `pkg-config --libs gtk+-2.0` -+LOCAL_LIBDIR=../../ -+LIBS = `pkg-config --libs gtk+-2.0` -L${LOCAL_LIBDIR} -lsvm ++CFLAGS = -Wall -O3 -g `pkg-config --cflags --libs gtk+-2.0` ++LOCAL_LIBDIR=../.. ++LIBS = -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 ++svm-toy-gtk: main.o interface.o callbacks.o ${LOCAL_LIBDIR}/svm.o + $(CXX) $(CFLAGS) main.o interface.o callbacks.o $(LIBS) -o $@ main.o: main.c $(CC) $(CFLAGS) -c main.c -@@ -15,8 +17,5 @@ interface.o: interface.c interface.h +@@ -15,8 +17,8 @@ interface.o: interface.c interface.h callbacks.o: callbacks.cpp callbacks.h $(CXX) $(CFLAGS) -c callbacks.cpp --../../svm.o: -- cd ../..; make svm.o -- +-../../svm.o: ../../svm.cpp ../../svm.h +- make -C ../.. svm.o ++${LOCAL_LIBDIR}/svm.o: ${LOCAL_LIBDIR}/svm.cpp ${LOCAL_LIBDIR}/svm.h ++ make -C ${LOCAL_LIBDIR} 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 ++ rm -f *~ callbacks.o svm-toy main.o interface.o callbacks.o ${LOCAL_LIBDIR}/svm.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 2011-06-14 13:50:02.634748539 +1000 -@@ -1,17 +1,18 @@ +--- ./svm-toy/qt/Makefile.svm-toy 2011-05-11 12:15:45.000000000 +1000 ++++ ./svm-toy/qt/Makefile 2011-11-08 10:06:11.702501216 +1000 +@@ -1,17 +1,20 @@ 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 +-INCLUDE = /usr/include/qt4 -MOC = /usr/bin/moc-qt4 ++CFLAGS = -Wall -O3 `pkg-config --cflags --libs QtGui` +MOC=${MOC_PATH} -+LOCAL_LIBDIR=../../ -+LIBS = `pkg-config --libs QtGui` -L${LOCAL_LIBDIR} -lsvm ++LOCAL_LIBDIR=../.. ++LIBS = -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 ++svm-toy-qt: svm-toy.cpp svm-toy.moc ${LOCAL_LIBDIR}/svm.o + $(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 -- +-../../svm.o: ../../svm.cpp ../../svm.h +- make -C ../.. svm.o ++${LOCAL_LIBDIR}/svm.o: ${LOCAL_LIBDIR}/svm.cpp ${LOCAL_LIBDIR}/svm.h ++ make -C ${LOCAL_LIBDIR} svm.o + clean: - rm -f *~ svm-toy svm-toy.moc ../../svm.o -+ rm -f *~ svm-toy svm-toy.moc ++ rm -f *~ svm-toy svm-toy.moc ${LOCAL_LIBDIR}/svm.o diff --git a/libsvm-3.1.toolsDir.patch b/libsvm-3.11.toolsDir.patch similarity index 100% rename from libsvm-3.1.toolsDir.patch rename to libsvm-3.11.toolsDir.patch diff --git a/libsvm.spec b/libsvm.spec index efaa12d..9fffb40 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm -Version: 3.1 -Release: 2%{?dist} +Version: 3.11 +Release: 1%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -239,6 +239,14 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Jun 17 2011 Ding-Yi Chen - 3.11-1 +- Upstream update: + + Set max number of iterations in the main loop of solvers + + matlab: + new make.m for unix/mac/windows and for matlab/octave + + matlab and python: + fix a problem that decision values returned by svmpredict is empty if number of classes = 1 + * Fri Jun 17 2011 Ding-Yi Chen - 3.1-2 - Fix the build error on EL-5 diff --git a/log b/log index ede03f3..dac608b 100644 --- a/log +++ b/log @@ -193,7 +193,7 @@ file updated. Java: Math.random is replaced by Random in java interface Python interface: - subroutines to get SVs +i subroutines to get SVs relative path to load *.dll and *.so svm.cpp: null pointer check before release memory in svm_free_model_content() @@ -206,9 +206,10 @@ file updated. Using new string formatting/encoding in tools/*.py clearer png output, fix grid.py legend ------------------- - -Future plan: -?.?: - - update make.m of matlab interface to use max(...) \ No newline at end of file +3.11: 2011/11/5 + Set max number of iterations in the main loop of solvers + matlab: + new make.m for unix/mac/windows and for matlab/octave + matlab and python: + fix a problem that decision values returned by svmpredict is empty if number of classes = 1 + \ No newline at end of file diff --git a/sources b/sources index 045b743..3a815ba 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ aae7a8f7e357e86e1c893b706bb02a63 guide.pdf -a157c1edfdb290fe8081d6a011022055 libsvm-3.1.tar.gz +44d2a3a611280ecd0d66aafe0d52233e libsvm-3.11.tar.gz From 628f6b50b17bfba95e1a2e5299727f9226c2cbe6 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 12 Jan 2012 10:52:20 +1000 Subject: [PATCH 10/10] Fixed Bug 646154 - libsvm-python's pth is not set correctly --- libsvm.spec | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index 9fffb40..02d8e86 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm Version: 3.11 -Release: 1%{?dist} +Release: 3%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -168,7 +168,8 @@ desktop-file-install --delete-original --vendor=fedora \ ${RPM_BUILD_ROOT}/%{_datadir}/applications/%{name}-svm-toy-gtk.desktop \ ${RPM_BUILD_ROOT}/%{_datadir}/applications/%{name}-svm-toy-qt.desktop \ - +# Fix Bug 646154 - libsvm-python's pth is not set correctly +echo 'libsvm' > $RPM_BUILD_ROOT/%{python_sitearch}/libsvm.pth %post -p /sbin/ldconfig @@ -214,6 +215,7 @@ rm -rf $RPM_BUILD_ROOT %doc python/README-Python tools/README-Tools %{libsvm_python_dir} %{_bindir}/svm-*.py +%{python_sitearch}/libsvm.pth %ifnarch ppc ppc64 %files java @@ -239,13 +241,16 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Jan 12 2012 Ding-Yi Chen - 3.11-3 +- Fixed Bug 646154 - libsvm-python's pth is not set correctly + * Fri Jun 17 2011 Ding-Yi Chen - 3.11-1 - Upstream update: - + Set max number of iterations in the main loop of solvers - + matlab: - new make.m for unix/mac/windows and for matlab/octave - + matlab and python: - fix a problem that decision values returned by svmpredict is empty if number of classes = 1 + + Set max number of iterations in the main loop of solvers + + matlab: + new make.m for unix/mac/windows and for matlab/octave + + matlab and python: + fix a problem that decision values returned by svmpredict is empty if number of classes = 1 * Fri Jun 17 2011 Ding-Yi Chen - 3.1-2 - Fix the build error on EL-5