From a27d7fecda6ce76d3edf6680fb37f5842156baf7 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 4 Nov 2009 06:43:40 +0000 Subject: [PATCH 1/8] Upstream update --- .cvsignore | 2 +- import.log | 1 + libsvm-2.89.patch => libsvm-2.90.patch | 158 +++++++++++++++++++++---- libsvm.spec | 15 ++- log | 15 ++- sources | 2 +- 6 files changed, 161 insertions(+), 32 deletions(-) rename libsvm-2.89.patch => libsvm-2.90.patch (66%) diff --git a/.cvsignore b/.cvsignore index 0b08845..bd505ff 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1,2 @@ guide.pdf -libsvm-2.89.tar.gz +libsvm-2.9.tar.gz diff --git a/import.log b/import.log index cdc99e7..4cfddaf 100644 --- a/import.log +++ b/import.log @@ -4,3 +4,4 @@ libsvm-2_88-2_fc9:HEAD:libsvm-2.88-2.fc9.src.rpm:1226365469 libsvm-2_89-1_fc10:HEAD:libsvm-2.89-1.fc10.src.rpm:1238738697 libsvm-2_89-3_fc11:HEAD:libsvm-2.89-3.fc11.src.rpm:1253083141 libsvm-2_89-4_fc11:HEAD:libsvm-2.89-4.fc11.src.rpm:1253235532 +libsvm-2_90-1_fc11:HEAD:libsvm-2.90-1.fc11.src.rpm:1257316908 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 c3790ba7f04ae24d4544ca07a5331b84e85d6e7a Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 5 Nov 2009 03:35:21 +0000 Subject: [PATCH 2/8] 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 4cfddaf..674b766 100644 --- a/import.log +++ b/import.log @@ -5,3 +5,4 @@ libsvm-2_89-1_fc10:HEAD:libsvm-2.89-1.fc10.src.rpm:1238738697 libsvm-2_89-3_fc11:HEAD:libsvm-2.89-3.fc11.src.rpm:1253083141 libsvm-2_89-4_fc11:HEAD:libsvm-2.89-4.fc11.src.rpm:1253235532 libsvm-2_90-1_fc11:HEAD:libsvm-2.90-1.fc11.src.rpm:1257316908 +libsvm-2_90-2_fc11:HEAD:libsvm-2.90-2.fc11.src.rpm:1257392051 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 843d3a875a8ae2fde3c43dda9040359d2e5d9378 Mon Sep 17 00:00:00 2001 From: Kevin Kofler Date: Wed, 25 Nov 2009 00:16:46 +0000 Subject: [PATCH 3/8] - Rebuild for Qt 4.6.0 RC1 in F13 (was built against Beta 1 with unstable ABI) NOTE: Your package needs to be rebuilt IF AND ONLY IF it was built against Qt 4.6.0 Beta 1. This was in the buildroot ONLY for dist-f13 after F12 branched. Packages built against Qt 4.5.x or older do NOT need a rebuild for 4.6.x (backwards binary compatibility). I have a list of packages needing a rebuild and am going through it. This package is in my list, so I am rebuilding it. --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index a68004a..b07e55d 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.90 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -223,6 +223,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Nov 25 2009 Kevin Kofler - 2.90-3 +- Rebuild for Qt 4.6.0 RC1 in F13 (was built against Beta 1 with unstable ABI) + * Thu Nov 05 2009 Ding-Yi Chen - 2.90-2 - Obsoletes libsvm-java for ppc and ppc64. From 0fe7ea3433bdab435e1473a6236aa169283fa038 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Wed, 25 Nov 2009 23:51:19 +0000 Subject: [PATCH 4/8] 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..4810975 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: libsvm -# $Id$ +# $Id: Makefile,v 1.1 2007/08/29 01:27:43 kevin 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 fc43a236acd8dcf36cc1a7359a95630e87cb2ec5 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 7 Apr 2010 05:22:47 +0000 Subject: [PATCH 5/8] Upstream update to 2.91 --- .cvsignore | 2 +- import.log | 1 + libsvm-2.90.patch => libsvm-2.91.patch | 193 +++++++------------------ libsvm.spec | 17 ++- log | 18 ++- sources | 2 +- 6 files changed, 86 insertions(+), 147 deletions(-) rename libsvm-2.90.patch => libsvm-2.91.patch (67%) diff --git a/.cvsignore b/.cvsignore index bd505ff..ce11a88 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1,2 @@ guide.pdf -libsvm-2.9.tar.gz +libsvm-2.91.tar.gz diff --git a/import.log b/import.log index 674b766..c1cc792 100644 --- a/import.log +++ b/import.log @@ -6,3 +6,4 @@ libsvm-2_89-3_fc11:HEAD:libsvm-2.89-3.fc11.src.rpm:1253083141 libsvm-2_89-4_fc11:HEAD:libsvm-2.89-4.fc11.src.rpm:1253235532 libsvm-2_90-1_fc11:HEAD:libsvm-2.90-1.fc11.src.rpm:1257316908 libsvm-2_90-2_fc11:HEAD:libsvm-2.90-2.fc11.src.rpm:1257392051 +libsvm-2_91-1_el5:HEAD:libsvm-2.91-1.el5.src.rpm:1270617507 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.90-3 -- Rebuild for Qt 4.6.0 RC1 in F13 (was built against Beta 1 with unstable ABI) +* Wed Apr 07 2010 Ding-Yi Chen - 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 dc4fc9b7dd6b7cbb075456c94607e9eefeb63cd0 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Thu, 22 Jul 2010 02:20:57 +0000 Subject: [PATCH 6/8] - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index de2b2d0..c2072fe 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.91 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -223,6 +223,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Jul 21 2010 David Malcolm - 2.91-2 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + * Wed Apr 07 2010 Ding-Yi Chen - 2.91-1 - Fixed Bug 564887 - FTBFS libsvm-2.90-3.fc13 - Upstream update: From 2b5e349397be08788575ad45011aa60ac7b8f789 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 28 Jul 2010 21:42:59 +0000 Subject: [PATCH 7/8] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- import.log | 9 --------- 3 files changed, 30 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 import.log diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 4810975..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: libsvm -# $Id: Makefile,v 1.1 2007/08/29 01:27:43 kevin 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/import.log b/import.log deleted file mode 100644 index c1cc792..0000000 --- a/import.log +++ /dev/null @@ -1,9 +0,0 @@ -libsvm-2_88-0_fc9:HEAD:libsvm-2.88-0.fc9.src.rpm:1226043285 -libsvm-2_88-1_fc9:HEAD:libsvm-2.88-1.fc9.src.rpm:1226296273 -libsvm-2_88-2_fc9:HEAD:libsvm-2.88-2.fc9.src.rpm:1226365469 -libsvm-2_89-1_fc10:HEAD:libsvm-2.89-1.fc10.src.rpm:1238738697 -libsvm-2_89-3_fc11:HEAD:libsvm-2.89-3.fc11.src.rpm:1253083141 -libsvm-2_89-4_fc11:HEAD:libsvm-2.89-4.fc11.src.rpm:1253235532 -libsvm-2_90-1_fc11:HEAD:libsvm-2.90-1.fc11.src.rpm:1257316908 -libsvm-2_90-2_fc11:HEAD:libsvm-2.90-2.fc11.src.rpm:1257392051 -libsvm-2_91-1_el5:HEAD:libsvm-2.91-1.el5.src.rpm:1270617507 From 56c74599e4875a980bb04f9897b6df864a569d60 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Mon, 8 Nov 2010 12:17:50 +1000 Subject: [PATCH 8/8] Upstream update to 3.0 --- .gitignore | 2 + libsvm-2.91.patch | 379 ----------------------------------- libsvm-3.0.javaDir.patch | 59 ++++++ libsvm-3.0.packageMain.patch | 114 +++++++++++ libsvm-3.0.pythonDir.patch | 22 ++ libsvm-3.0.svm-toy.patch | 70 +++++++ libsvm-3.0.toolsDir.patch | 30 +++ libsvm.spec | 39 +++- log | 9 +- sources | 2 +- 10 files changed, 333 insertions(+), 393 deletions(-) delete mode 100644 libsvm-2.91.patch create mode 100644 libsvm-3.0.javaDir.patch create mode 100644 libsvm-3.0.packageMain.patch create mode 100644 libsvm-3.0.pythonDir.patch create mode 100644 libsvm-3.0.svm-toy.patch create mode 100644 libsvm-3.0.toolsDir.patch diff --git a/.gitignore b/.gitignore index ce11a88..1ad2fca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ guide.pdf libsvm-2.91.tar.gz +/guide.pdf +/libsvm-3.0.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.0.javaDir.patch b/libsvm-3.0.javaDir.patch new file mode 100644 index 0000000..056374b --- /dev/null +++ b/libsvm-3.0.javaDir.patch @@ -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 @@ +- ++ ++ ++ diff --git a/libsvm-3.0.packageMain.patch b/libsvm-3.0.packageMain.patch new file mode 100644 index 0000000..fb6a009 --- /dev/null +++ b/libsvm-3.0.packageMain.patch @@ -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 diff --git a/libsvm-3.0.pythonDir.patch b/libsvm-3.0.pythonDir.patch new file mode 100644 index 0000000..2471a06 --- /dev/null +++ b/libsvm-3.0.pythonDir.patch @@ -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 ++ diff --git a/libsvm-3.0.svm-toy.patch b/libsvm-3.0.svm-toy.patch new file mode 100644 index 0000000..5faade5 --- /dev/null +++ b/libsvm-3.0.svm-toy.patch @@ -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 + #include + #include ++#include + #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 + diff --git a/libsvm-3.0.toolsDir.patch b/libsvm-3.0.toolsDir.patch new file mode 100644 index 0000000..1d3d69f --- /dev/null +++ b/libsvm-3.0.toolsDir.patch @@ -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 diff --git a/libsvm.spec b/libsvm.spec index c2072fe..7f4cc8d 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,19 +1,23 @@ Name: libsvm -Version: 2.91 -Release: 2%{?dist} +Version: 3.0 +Release: 1%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries License: BSD 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 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 +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 %{!?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 %else %define no_java NO_JAVA -Obsoletes: libsvm-java +Obsoletes: libsvm-java < 2.88-1 %endif %description @@ -83,7 +87,7 @@ programs with libsvm in Java. %endif %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 BuildRequires: gtk2-devel BuildRequires: desktop-file-utils @@ -91,11 +95,11 @@ Requires: gtk2 Requires: %{name} = %{version}-%{release} %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. %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 BuildRequires: desktop-file-utils BuildRequires: pkgconfig @@ -105,12 +109,16 @@ Requires: qt4 Requires: %{name} = %{version}-%{release} %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. %prep %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 %{SOURCE2} . cp %{SOURCE3} . @@ -185,7 +193,7 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/svm-train %dir %{_datadir}/%{name} %{_datadir}/%{name}/examples -%{_libdir}/%{name}.so.1 +%{_libdir}/%{name}.so.2 %files devel @@ -223,6 +231,15 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Nov 08 2010 Ding-Yi Chen - 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 - 2.91-2 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild diff --git a/log b/log index 607ab9d..9d41631 100644 --- a/log +++ b/log @@ -178,10 +178,15 @@ file updated. Java: able to load model from a BufferedReader directly 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: ?.?: - old python interface is removed - + merge matlab interface to core libsvm update make.m of matlab interface to use max(...) \ No newline at end of file diff --git a/sources b/sources index d04a0f0..f04e60f 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ aae7a8f7e357e86e1c893b706bb02a63 guide.pdf -aec07b9142ce585c95854ed379538154 libsvm-2.91.tar.gz +016e29668aae8aa6eaeb125c9e23d834 libsvm-3.0.tar.gz