From fa71eaa240a858f5e7e8bfa20ebd8217170c02f3 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 29 Aug 2007 06:47:34 +0000 Subject: [PATCH 001/136] Commit to CVS --- .cvsignore | 1 + ChangeLog | 127 ++++++++++++++++++++++++++++++++++++ libsvm-2.84-2.patch | 153 ++++++++++++++++++++++++++++++++++++++++++++ libsvm.spec | 105 ++++++++++++++++++++++++++++++ sources | 1 + 5 files changed, 387 insertions(+) create mode 100644 ChangeLog create mode 100644 libsvm-2.84-2.patch create mode 100644 libsvm.spec diff --git a/.cvsignore b/.cvsignore index e69de29..9161481 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +libsvm-2.84.tar.gz diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..d0f9c71 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,127 @@ +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/? + fix minor memory leak in svm-predict.c \ No newline at end of file diff --git a/libsvm-2.84-2.patch b/libsvm-2.84-2.patch new file mode 100644 index 0000000..ef48c43 --- /dev/null +++ b/libsvm-2.84-2.patch @@ -0,0 +1,153 @@ +--- ./Makefile.orig 2007-08-22 15:23:34.000000000 +1000 ++++ ./Makefile 2007-08-27 15:48:58.000000000 +1000 +@@ -1,7 +1,31 @@ + CXXC = g++ + CFLAGS = -Wall -O3 ++MAKE = make + +-all: svm-train svm-predict svm-scale ++ifndef DESTDIR ++INSTDIR=/usr ++else ++INSTDIR=${DESTDIR}/usr ++endif ++ ++export INSTDIR ++ ++PROCESSOR=$(shell /bin/uname -p) ++ifeq "${PROCESSOR}" "x86_64" ++X86_64=64 ++else ++X86_64= ++endif ++ ++ifndef LIBDIR ++LIB_INSTDIR=${INSTDIR}/lib${X86_64} ++else ++LIB_INSTDIR=${INSTDIR}/..${LIBDIR} ++endif ++ ++export LIB_INSTDIR ++ ++all: svm-train svm-predict svm-scale svm-python + + svm-predict: svm-predict.c svm.o + $(CXXC) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm +@@ -11,5 +35,45 @@ + $(CXXC) $(CFLAGS) svm-scale.c -o svm-scale + svm.o: svm.cpp svm.h + $(CXXC) $(CFLAGS) -c svm.cpp ++svm-python: ++ ${MAKE} -C python ++ ++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}/libsvm ++# install package libsvm-devel ++ install -m 644 svm.o ${LIB_INSTDIR}/libsvm ++ mkdir -p ${INSTDIR}/include/libsvm ++ install -m 644 svm.h ${INSTDIR}/include/libsvm ++ mkdir -p ${INSTDIR}/share/libsvm/src ++ 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 ++ cp -R java ${INSTDIR}/share/libsvm/src ++ cp -R svm-toy ${INSTDIR}/share/libsvm/src ++# cp -R tools ${INSTDIR}/share/libsvm/src ++# cp -R windows ${INSTDIR}/share/libsvm/src ++ mkdir -p ${INSTDIR}/share/libsvm/examples ++ install -m 644 heart_scale ${INSTDIR}/share/libsvm/examples ++# install package libsvm-python ++ ${MAKE} -C python install ++ ++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 ++ + clean: + rm -f *~ svm.o svm-train svm-predict svm-scale ++ ${MAKE} -C python clean ++ +--- ./python/Makefile.orig 2007-08-27 11:11:38.000000000 +1000 ++++ ./python/Makefile 2007-08-28 11:15:18.000000000 +1000 +@@ -2,13 +2,19 @@ + SWIG ?= swig + + #Windows: see ../README ../Makefile.win +-PYTHON_INCLUDEDIR ?= /usr/include/python2.4 ++PYTHON_VERSION=${shell python -V 2> python.ver ; cat python.ver | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$$2,$$3)}'; rm -f python.ver} ++ ++ifndef PYTHON_INCLUDEDIR ++ ++PYTHON_INCLUDEDIR?= /usr/include/python${PYTHON_VERSION} ++ ++endif ++PYTHON_TARGETDIR=${LIB_INSTDIR}/python${PYTHON_VERSION}/site-packages/libsvm + + CFLAGS = -O3 -I$(PYTHON_INCLUDEDIR) -I.. + LDFLAGS = -shared + # Mac OS + # LDFLAGS = -framework Python -bundle +- + all: svmc.so + + svmc.so: svmc_wrap.o svm.o +@@ -28,3 +34,19 @@ + + 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 ++ ++ ++ +--- ./tools/grid.py.orig 2007-08-28 11:48:03.000000000 +1000 ++++ ./tools/grid.py 2007-08-28 11:58:22.000000000 +1000 +@@ -11,7 +11,7 @@ + + 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 +--- ./tools/easy.py.orig 2007-08-28 11:47:53.000000000 +1000 ++++ ./tools/easy.py 2007-08-28 12:13:58.000000000 +1000 +@@ -11,10 +11,10 @@ + + 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 = sys.argv[0].replace("easy.py","grid.py") + gnuplot_exe = "/usr/bin/gnuplot" + else: + # example for windows diff --git a/libsvm.spec b/libsvm.spec new file mode 100644 index 0000000..6239e20 --- /dev/null +++ b/libsvm.spec @@ -0,0 +1,105 @@ +Name: libsvm +Version: 2.84 +Release: 3%{?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: ChangeLog +#Source1: http://www.csie.ntu.edu.tw/~cjlin/libsvm/log +Patch0: libsvm-2.84-2.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildRequires: glibc-devel dos2unix +Requires: glibc + + +%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: A Library for Support Vector Machines +Group: Development/Libraries +BuildRequires: glibc-devel +Requires: glibc +Requires: %{name} = %{version}-%{release} + +%description devel +The libsvm-devel package includes the header file, object file, and +soucre in C and Java. +Install this package if you want to develop programs with libsvm. + +%package python +Summary: A Library for Support Vector Machines +Group: Development/Libraries +BuildRequires: python >= 2.4 python-devel >= 2.4 +Requires: python >= 2.4 +Requires: %{name} = %{version}-%{release} + +%description python +The libsvm-python provides tools and interface written in python, +as well as source code. Install this package if you want to develop +programs with libsvm in Python. + +%prep +%setup -q +%patch0 -p0 -b .bak +%define temp_file /tmp/python.ver +%define python_version %(python -V 2> %{temp_file} ; cat %{temp_file} | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$2,$3)}'; rm -f %{temp_file}) +%define libsvm_python_dir %{_libdir}/python%{python_version}/site-packages/libsvm + + +%build +make all DESTDIR=%{_builddir} LIBDIR=%{_libdir} +dos2unix -o %{_builddir}/%{name}-%{version}/FAQ.html +mv %{_builddir}/%{name}-%{version}/python/README %{_builddir}/%{name}-%{version}/python/README-Python +mv %{_builddir}/%{name}-%{version}/tools/README %{_builddir}/%{name}-%{version}/tools/README-Tools + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} + + + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%doc COPYRIGHT FAQ.html +%{_bindir}/svm-predict +%{_bindir}/svm-scale +%{_bindir}/svm-train +%{_datadir}/libsvm/examples + +%files devel +%doc README +%{_libdir}/libsvm +%{_includedir}/libsvm +%{_datadir}/libsvm/src + +%files python +%doc python/README-Python tools/README-Tools +%{libsvm_python_dir} + + +%changelog +* 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/sources b/sources index e69de29..502194e 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +a7bd21b21510e9634950715c2b4a4ce9 libsvm-2.84.tar.gz From 6089e94fa06f1b5f042e4c6a162da9c251b6194b Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 29 Aug 2007 07:16:36 +0000 Subject: [PATCH 002/136] fix the path of awk --- libsvm-2.84-2.patch | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/libsvm-2.84-2.patch b/libsvm-2.84-2.patch index ef48c43..dd46536 100644 --- a/libsvm-2.84-2.patch +++ b/libsvm-2.84-2.patch @@ -1,3 +1,4 @@ +diff -up ./Makefile.orig ./Makefile --- ./Makefile.orig 2007-08-22 15:23:34.000000000 +1000 +++ ./Makefile 2007-08-27 15:48:58.000000000 +1000 @@ -1,7 +1,31 @@ @@ -33,7 +34,7 @@ svm-predict: svm-predict.c svm.o $(CXXC) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm -@@ -11,5 +35,45 @@ +@@ -11,5 +35,45 @@ svm-scale: svm-scale.c $(CXXC) $(CFLAGS) svm-scale.c -o svm-scale svm.o: svm.cpp svm.h $(CXXC) $(CFLAGS) -c svm.cpp @@ -79,14 +80,15 @@ rm -f *~ svm.o svm-train svm-predict svm-scale + ${MAKE} -C python clean + +diff -up ./python/Makefile.orig ./python/Makefile --- ./python/Makefile.orig 2007-08-27 11:11:38.000000000 +1000 -+++ ./python/Makefile 2007-08-28 11:15:18.000000000 +1000 -@@ -2,13 +2,19 @@ ++++ ./python/Makefile 2007-08-29 17:10:28.000000000 +1000 +@@ -2,13 +2,19 @@ CC = g++ SWIG ?= swig #Windows: see ../README ../Makefile.win -PYTHON_INCLUDEDIR ?= /usr/include/python2.4 -+PYTHON_VERSION=${shell python -V 2> python.ver ; cat python.ver | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$$2,$$3)}'; rm -f python.ver} ++PYTHON_VERSION=${shell python -V 2> python.ver ; cat python.ver | /bin/awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$$2,$$3)}'; rm -f python.ver} + +ifndef PYTHON_INCLUDEDIR + @@ -103,7 +105,7 @@ all: svmc.so svmc.so: svmc_wrap.o svm.o -@@ -28,3 +34,19 @@ +@@ -28,3 +34,19 @@ clean: moreclean: clean rm -f svmc_wrap.c @@ -123,9 +125,10 @@ + + + +diff -up ./tools/grid.py.orig ./tools/grid.py --- ./tools/grid.py.orig 2007-08-28 11:48:03.000000000 +1000 +++ ./tools/grid.py 2007-08-28 11:58:22.000000000 +1000 -@@ -11,7 +11,7 @@ +@@ -11,7 +11,7 @@ from string import find, split, join, at is_win32 = (sys.platform == 'win32') if not is_win32: @@ -134,9 +137,10 @@ gnuplot_exe = "/usr/bin/gnuplot" else: # example for windows +diff -up ./tools/easy.py.orig ./tools/easy.py --- ./tools/easy.py.orig 2007-08-28 11:47:53.000000000 +1000 +++ ./tools/easy.py 2007-08-28 12:13:58.000000000 +1000 -@@ -11,10 +11,10 @@ +@@ -11,10 +11,10 @@ if len(sys.argv) <= 1: is_win32 = (sys.platform == 'win32') if not is_win32: @@ -151,3 +155,4 @@ gnuplot_exe = "/usr/bin/gnuplot" else: # example for windows +diff -up ./tools/subset.py.orig ./tools/subset.py From 3075d4973217bb1910f152c7a8bdec7775545806 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 29 Aug 2007 07:40:06 +0000 Subject: [PATCH 003/136] add gawk in buildrequire --- libsvm-2.84-2.patch | 4 ++-- libsvm.spec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libsvm-2.84-2.patch b/libsvm-2.84-2.patch index dd46536..b5062e3 100644 --- a/libsvm-2.84-2.patch +++ b/libsvm-2.84-2.patch @@ -82,13 +82,13 @@ diff -up ./Makefile.orig ./Makefile + diff -up ./python/Makefile.orig ./python/Makefile --- ./python/Makefile.orig 2007-08-27 11:11:38.000000000 +1000 -+++ ./python/Makefile 2007-08-29 17:10:28.000000000 +1000 ++++ ./python/Makefile 2007-08-29 17:38:14.000000000 +1000 @@ -2,13 +2,19 @@ CC = g++ SWIG ?= swig #Windows: see ../README ../Makefile.win -PYTHON_INCLUDEDIR ?= /usr/include/python2.4 -+PYTHON_VERSION=${shell python -V 2> python.ver ; cat python.ver | /bin/awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$$2,$$3)}'; rm -f python.ver} ++PYTHON_VERSION=${shell python -V 2> /tmp/python.ver ; cat /tmp/python.ver | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$$2,$$3)}'; rm -f /tmp/python.ver} + +ifndef PYTHON_INCLUDEDIR + diff --git a/libsvm.spec b/libsvm.spec index 6239e20..0ec43ea 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -37,7 +37,7 @@ Install this package if you want to develop programs with libsvm. %package python Summary: A Library for Support Vector Machines Group: Development/Libraries -BuildRequires: python >= 2.4 python-devel >= 2.4 +BuildRequires: python >= 2.4 python-devel >= 2.4 gawk Requires: python >= 2.4 Requires: %{name} = %{version}-%{release} From ce9dd6d383152bb4dee15c50e7f20fd330d33906 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 30 Aug 2007 01:31:35 +0000 Subject: [PATCH 004/136] Update description --- libsvm.spec | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index 0ec43ea..78be0b8 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.84 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -23,27 +23,26 @@ LIBSVM is an integrated software for support vector classification, estimation (one-class SVM ). It supports multi-class classification. %package devel -Summary: A Library for Support Vector Machines +Summary: Header file, object file, and source files of libsvm in C and Java. Group: Development/Libraries BuildRequires: glibc-devel Requires: glibc Requires: %{name} = %{version}-%{release} %description devel -The libsvm-devel package includes the header file, object file, and -soucre in C and Java. +Header file, object file, and source files of libsvm in C and Java. Install this package if you want to develop programs with libsvm. %package python -Summary: A Library for Support Vector Machines +Summary: Python tools and interfaces for libsvm. Group: Development/Libraries BuildRequires: python >= 2.4 python-devel >= 2.4 gawk Requires: python >= 2.4 Requires: %{name} = %{version}-%{release} %description python -The libsvm-python provides tools and interface written in python, -as well as source code. Install this package if you want to develop +Python tools and interfaces for libsvm. +Install this package if you want to develop programs with libsvm in Python. %prep @@ -89,6 +88,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Aug 30 2007 Ding-Yi Chen - 2.84-4 +- Refined description. + * Mon Aug 27 2007 Ding-Yi Chen - 2.84-3 - Fix dependency problem From 793c8549d5420c1dfc6c04a8bbaa725da47aa448 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 30 Aug 2007 01:53:29 +0000 Subject: [PATCH 005/136] Update tag --- libsvm.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index 78be0b8..02925e6 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.84 -Release: 4%{?dist} +Release: 3%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -88,7 +88,7 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Thu Aug 30 2007 Ding-Yi Chen - 2.84-4 +* Thu Aug 30 2007 Ding-Yi Chen - 2.84-3 - Refined description. * Mon Aug 27 2007 Ding-Yi Chen - 2.84-3 From a5205db2cb63dfff3acc2f67dd55e7b2387959a3 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 30 Aug 2007 06:09:57 +0000 Subject: [PATCH 006/136] /tmp/python.ver issue. --- libsvm-2.84-2.patch => libsvm-2.84-4.patch | 31 +++++++++------------- libsvm.spec | 9 ++++--- 2 files changed, 17 insertions(+), 23 deletions(-) rename libsvm-2.84-2.patch => libsvm-2.84-4.patch (82%) diff --git a/libsvm-2.84-2.patch b/libsvm-2.84-4.patch similarity index 82% rename from libsvm-2.84-2.patch rename to libsvm-2.84-4.patch index b5062e3..895770a 100644 --- a/libsvm-2.84-2.patch +++ b/libsvm-2.84-4.patch @@ -1,6 +1,6 @@ diff -up ./Makefile.orig ./Makefile ---- ./Makefile.orig 2007-08-22 15:23:34.000000000 +1000 -+++ ./Makefile 2007-08-27 15:48:58.000000000 +1000 +--- ./Makefile.orig 2007-08-30 15:29:42.000000000 +1000 ++++ ./Makefile 2007-08-30 15:30:25.000000000 +1000 @@ -1,7 +1,31 @@ CXXC = g++ CFLAGS = -Wall -O3 @@ -81,15 +81,15 @@ diff -up ./Makefile.orig ./Makefile + ${MAKE} -C python clean + diff -up ./python/Makefile.orig ./python/Makefile ---- ./python/Makefile.orig 2007-08-27 11:11:38.000000000 +1000 -+++ ./python/Makefile 2007-08-29 17:38:14.000000000 +1000 -@@ -2,13 +2,19 @@ CC = g++ +--- ./python/Makefile.orig 2007-08-30 15:29:49.000000000 +1000 ++++ ./python/Makefile 2007-08-30 16:03:46.000000000 +1000 +@@ -2,7 +2,14 @@ CC = g++ SWIG ?= swig #Windows: see ../README ../Makefile.win -PYTHON_INCLUDEDIR ?= /usr/include/python2.4 -+PYTHON_VERSION=${shell python -V 2> /tmp/python.ver ; cat /tmp/python.ver | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$$2,$$3)}'; rm -f /tmp/python.ver} -+ ++PYTHON_TEMP:=${shell mktemp} ++PYTHON_VERSION:=${shell python -V 2> ${PYTHON_TEMP} ; cat ${PYTHON_TEMP} | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$$2,$$3)}'; rm -f ${PYTHON_TEMP}} +ifndef PYTHON_INCLUDEDIR + +PYTHON_INCLUDEDIR?= /usr/include/python${PYTHON_VERSION} @@ -99,13 +99,7 @@ diff -up ./python/Makefile.orig ./python/Makefile CFLAGS = -O3 -I$(PYTHON_INCLUDEDIR) -I.. LDFLAGS = -shared - # Mac OS - # LDFLAGS = -framework Python -bundle -- - all: svmc.so - - svmc.so: svmc_wrap.o svm.o -@@ -28,3 +34,19 @@ clean: +@@ -28,3 +35,19 @@ clean: moreclean: clean rm -f svmc_wrap.c @@ -126,8 +120,8 @@ diff -up ./python/Makefile.orig ./python/Makefile + + diff -up ./tools/grid.py.orig ./tools/grid.py ---- ./tools/grid.py.orig 2007-08-28 11:48:03.000000000 +1000 -+++ ./tools/grid.py 2007-08-28 11:58:22.000000000 +1000 +--- ./tools/grid.py.orig 2007-08-30 15:30:17.000000000 +1000 ++++ ./tools/grid.py 2007-08-30 15:30:25.000000000 +1000 @@ -11,7 +11,7 @@ from string import find, split, join, at is_win32 = (sys.platform == 'win32') @@ -138,8 +132,8 @@ diff -up ./tools/grid.py.orig ./tools/grid.py else: # example for windows diff -up ./tools/easy.py.orig ./tools/easy.py ---- ./tools/easy.py.orig 2007-08-28 11:47:53.000000000 +1000 -+++ ./tools/easy.py 2007-08-28 12:13:58.000000000 +1000 +--- ./tools/easy.py.orig 2007-08-30 15:30:04.000000000 +1000 ++++ ./tools/easy.py 2007-08-30 15:30:25.000000000 +1000 @@ -11,10 +11,10 @@ if len(sys.argv) <= 1: is_win32 = (sys.platform == 'win32') @@ -155,4 +149,3 @@ diff -up ./tools/easy.py.orig ./tools/easy.py gnuplot_exe = "/usr/bin/gnuplot" else: # example for windows -diff -up ./tools/subset.py.orig ./tools/subset.py diff --git a/libsvm.spec b/libsvm.spec index 02925e6..e32609a 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.84 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -10,7 +10,7 @@ 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: ChangeLog #Source1: http://www.csie.ntu.edu.tw/~cjlin/libsvm/log -Patch0: libsvm-2.84-2.patch +Patch0: libsvm-2.84-4.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: glibc-devel dos2unix @@ -88,8 +88,9 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Thu Aug 30 2007 Ding-Yi Chen - 2.84-3 -- Refined description. +* 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 From 6f17cf8cf8f9c0cc6a6affb0a87a8ac730959379 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 26 Sep 2007 03:06:45 +0000 Subject: [PATCH 007/136] 1. Split libsvm-java out of libsvm package 2. Make libsvm.so --- libsvm-2.84-4.patch | 151 ---------------------------- libsvm-2.84-5.patch | 239 ++++++++++++++++++++++++++++++++++++++++++++ libsvm.spec | 29 +++++- 3 files changed, 265 insertions(+), 154 deletions(-) delete mode 100644 libsvm-2.84-4.patch create mode 100644 libsvm-2.84-5.patch diff --git a/libsvm-2.84-4.patch b/libsvm-2.84-4.patch deleted file mode 100644 index 895770a..0000000 --- a/libsvm-2.84-4.patch +++ /dev/null @@ -1,151 +0,0 @@ -diff -up ./Makefile.orig ./Makefile ---- ./Makefile.orig 2007-08-30 15:29:42.000000000 +1000 -+++ ./Makefile 2007-08-30 15:30:25.000000000 +1000 -@@ -1,7 +1,31 @@ - CXXC = g++ - CFLAGS = -Wall -O3 -+MAKE = make - --all: svm-train svm-predict svm-scale -+ifndef DESTDIR -+INSTDIR=/usr -+else -+INSTDIR=${DESTDIR}/usr -+endif -+ -+export INSTDIR -+ -+PROCESSOR=$(shell /bin/uname -p) -+ifeq "${PROCESSOR}" "x86_64" -+X86_64=64 -+else -+X86_64= -+endif -+ -+ifndef LIBDIR -+LIB_INSTDIR=${INSTDIR}/lib${X86_64} -+else -+LIB_INSTDIR=${INSTDIR}/..${LIBDIR} -+endif -+ -+export LIB_INSTDIR -+ -+all: svm-train svm-predict svm-scale svm-python - - svm-predict: svm-predict.c svm.o - $(CXXC) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm -@@ -11,5 +35,45 @@ svm-scale: svm-scale.c - $(CXXC) $(CFLAGS) svm-scale.c -o svm-scale - svm.o: svm.cpp svm.h - $(CXXC) $(CFLAGS) -c svm.cpp -+svm-python: -+ ${MAKE} -C python -+ -+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}/libsvm -+# install package libsvm-devel -+ install -m 644 svm.o ${LIB_INSTDIR}/libsvm -+ mkdir -p ${INSTDIR}/include/libsvm -+ install -m 644 svm.h ${INSTDIR}/include/libsvm -+ mkdir -p ${INSTDIR}/share/libsvm/src -+ 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 -+ cp -R java ${INSTDIR}/share/libsvm/src -+ cp -R svm-toy ${INSTDIR}/share/libsvm/src -+# cp -R tools ${INSTDIR}/share/libsvm/src -+# cp -R windows ${INSTDIR}/share/libsvm/src -+ mkdir -p ${INSTDIR}/share/libsvm/examples -+ install -m 644 heart_scale ${INSTDIR}/share/libsvm/examples -+# install package libsvm-python -+ ${MAKE} -C python install -+ -+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 -+ - clean: - rm -f *~ svm.o svm-train svm-predict svm-scale -+ ${MAKE} -C python clean -+ -diff -up ./python/Makefile.orig ./python/Makefile ---- ./python/Makefile.orig 2007-08-30 15:29:49.000000000 +1000 -+++ ./python/Makefile 2007-08-30 16:03:46.000000000 +1000 -@@ -2,7 +2,14 @@ CC = g++ - SWIG ?= swig - - #Windows: see ../README ../Makefile.win --PYTHON_INCLUDEDIR ?= /usr/include/python2.4 -+PYTHON_TEMP:=${shell mktemp} -+PYTHON_VERSION:=${shell python -V 2> ${PYTHON_TEMP} ; cat ${PYTHON_TEMP} | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$$2,$$3)}'; rm -f ${PYTHON_TEMP}} -+ifndef PYTHON_INCLUDEDIR -+ -+PYTHON_INCLUDEDIR?= /usr/include/python${PYTHON_VERSION} -+ -+endif -+PYTHON_TARGETDIR=${LIB_INSTDIR}/python${PYTHON_VERSION}/site-packages/libsvm - - CFLAGS = -O3 -I$(PYTHON_INCLUDEDIR) -I.. - LDFLAGS = -shared -@@ -28,3 +35,19 @@ clean: - - 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 ./tools/grid.py.orig ./tools/grid.py ---- ./tools/grid.py.orig 2007-08-30 15:30:17.000000000 +1000 -+++ ./tools/grid.py 2007-08-30 15:30:25.000000000 +1000 -@@ -11,7 +11,7 @@ from string import find, split, join, at - - 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 -up ./tools/easy.py.orig ./tools/easy.py ---- ./tools/easy.py.orig 2007-08-30 15:30:04.000000000 +1000 -+++ ./tools/easy.py 2007-08-30 15:30:25.000000000 +1000 -@@ -11,10 +11,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 = sys.argv[0].replace("easy.py","grid.py") - gnuplot_exe = "/usr/bin/gnuplot" - else: - # example for windows diff --git a/libsvm-2.84-5.patch b/libsvm-2.84-5.patch new file mode 100644 index 0000000..be92108 --- /dev/null +++ b/libsvm-2.84-5.patch @@ -0,0 +1,239 @@ +diff -up ./Makefile.orig ./Makefile +--- ./Makefile.orig 2007-09-25 10:07:29.000000000 +1000 ++++ ./Makefile 2007-09-25 14:30:10.000000000 +1000 +@@ -1,8 +1,39 @@ + CXXC = g++ + CFLAGS = -Wall -O3 ++MAKE = make ++LIBSVM_VER =2.84 ++export LIBSVM_VER + +-all: svm-train svm-predict svm-scale ++ifndef DESTDIR ++INSTDIR=/usr ++else ++INSTDIR=${DESTDIR}/usr ++endif + ++export INSTDIR ++ ++PROCESSOR=$(shell /bin/uname -p) ++ifeq "${PROCESSOR}" "x86_64" ++X86_64=64 ++else ++X86_64= ++endif ++ ++ifndef LIBDIR ++LIB_INSTDIR=${INSTDIR}/lib${X86_64} ++else ++LIB_INSTDIR=${INSTDIR}/..${LIBDIR} ++endif ++ ++export LIB_INSTDIR ++ ++all: svm-train svm-predict svm-scale svm-python svm-java svm-lib ++ ++svm-lib: svm-share.o ++ $(CXXC) -shared -Wl,-soname,libsvm.so \ ++ -o libsvm.so.${LIBSVM_VER} svm-share.o -lm ++svm-share.o: svm.cpp svm.h ++ $(CXXC) -g -fPIC $(CFLAGS) -c svm.cpp -o svm-share.o + svm-predict: svm-predict.c svm.o + $(CXXC) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm + svm-train: svm-train.c svm.o +@@ -11,5 +42,53 @@ svm-scale: svm-scale.c + $(CXXC) $(CFLAGS) svm-scale.c -o svm-scale + svm.o: svm.cpp svm.h + $(CXXC) $(CFLAGS) -c svm.cpp ++svm-python: ++ ${MAKE} -C python ++svm-java: ++ ${MAKE} -C java ++ ++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}/libsvm ++ install -m 644 libsvm.so.2.84 ${LIB_INSTDIR}/libsvm ++ cd ${LIB_INSTDIR}/libsvm; ln -s libsvm.so.${LIBSVM_VER} libsvm.so ++ ldconfig -n ${LIB_INSTDIR}/libsvm ++# install package libsvm-devel ++ install -m 644 svm.o ${LIB_INSTDIR}/libsvm ++ mkdir -p ${INSTDIR}/include/libsvm ++ install -m 644 svm.h ${INSTDIR}/include/libsvm ++ mkdir -p ${INSTDIR}/share/libsvm/src ++ 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 ++ cp -R java ${INSTDIR}/share/libsvm/src ++ cp -R svm-toy ${INSTDIR}/share/libsvm/src ++# cp -R tools ${INSTDIR}/share/libsvm/src ++# cp -R windows ${INSTDIR}/share/libsvm/src ++ mkdir -p ${INSTDIR}/share/libsvm/examples ++ install -m 644 heart_scale ${INSTDIR}/share/libsvm/examples ++# install package libsvm-python ++ ${MAKE} -C python install ++ ${MAKE} -C java install ++ ++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 ++ ${MAKE} -C java uninstall ++ + clean: + rm -f *~ svm.o svm-train svm-predict svm-scale ++ ${MAKE} -C python clean ++ ${MAKE} -C java clean ++ +diff -up ./java/libsvm/svm_model.java.orig ./java/libsvm/svm_model.java +--- ./java/libsvm/svm_model.java.orig 2007-09-26 10:19:43.000000000 +1000 ++++ ./java/libsvm/svm_model.java 2007-09-26 10:27:36.000000000 +1000 +@@ -4,6 +4,7 @@ + package libsvm; + public class svm_model implements java.io.Serializable + { ++ static final long serialVersionUID = 2709444323471798245L; + svm_parameter param; // parameter + int nr_class; // number of classes, = 2 in regression/one class svm + int l; // total #SV +diff -up ./java/libsvm/svm_node.java.orig ./java/libsvm/svm_node.java +--- ./java/libsvm/svm_node.java.orig 2007-09-26 10:19:51.000000000 +1000 ++++ ./java/libsvm/svm_node.java 2007-09-26 10:27:25.000000000 +1000 +@@ -1,6 +1,7 @@ + package libsvm; + public class svm_node implements java.io.Serializable + { ++ static final long serialVersionUID = 2709444323471798245L; + public int index; + public double value; + } +diff -up ./java/libsvm/svm_problem.java.orig ./java/libsvm/svm_problem.java +--- ./java/libsvm/svm_problem.java.orig 2007-09-26 10:20:42.000000000 +1000 ++++ ./java/libsvm/svm_problem.java 2007-09-26 10:26:05.000000000 +1000 +@@ -1,6 +1,7 @@ + package libsvm; + public class svm_problem implements java.io.Serializable + { ++ static final long serialVersionUID = -4451389443706847272L; + public int l; + public double[] y; + public svm_node[][] x; +diff -up ./java/libsvm/svm_parameter.java.orig ./java/libsvm/svm_parameter.java +--- ./java/libsvm/svm_parameter.java.orig 2007-09-26 10:20:23.000000000 +1000 ++++ ./java/libsvm/svm_parameter.java 2007-09-26 10:25:14.000000000 +1000 +@@ -1,6 +1,7 @@ + package libsvm; + public class svm_parameter implements Cloneable,java.io.Serializable + { ++ static final long serialVersionUID = 2709444323471798245L; + /* svm_type */ + public static final int C_SVC = 0; + public static final int NU_SVC = 1; +diff -up ./java/libsvm/svm.m4.orig ./java/libsvm/svm.m4 +diff -up ./java/Makefile.orig ./java/Makefile +--- ./java/Makefile.orig 2007-09-25 11:10:21.000000000 +1000 ++++ ./java/Makefile 2007-09-26 12:42:50.000000000 +1000 +@@ -1,15 +1,17 @@ + .SUFFIXES: .class .java +-FILES = libsvm/svm.class libsvm/svm_model.class libsvm/svm_node.class \ +- libsvm/svm_parameter.class libsvm/svm_problem.class \ ++FILES = libsvm/svm_node.class libsvm/svm_parameter.class \ ++ libsvm/svm_model.class libsvm/svm_problem.class libsvm/svm.class\ + svm_train.class svm_predict.class svm_toy.class + +-#JAVAC = jikes +-#JAVAC_FLAGS = -target 1.1 -source 1.3 +-JAVAC = javac +-JAVAC_FLAGS = ++JAVA_TARGETDIR=${LIB_INSTDIR}/java/libsvm ++JAVAC = ecj ++#JAVAC_FLAGS = -target 1.3 -source 1.3 ++CLASSPATH = . ++#JAVAC_FLAGS = --classpath=${CLASSPATH} ++JAVAC_FLAGS = -classpath ${CLASSPATH} + + all: $(FILES) +- jar cvf libsvm.jar *.class libsvm/*.class ++ gjar cvf libsvm.jar *.class libsvm/*.class + + .java.class: + $(JAVAC) $(JAVAC_FLAGS) $< +@@ -17,8 +19,20 @@ all: $(FILES) + libsvm/svm.java: libsvm/svm.m4 + m4 libsvm/svm.m4 > libsvm/svm.java + ++javadoc: ++ javadoc -d docs *.java libsvm/*.java ++ ++install: ++ mkdir -p ${JAVA_TARGETDIR} ++ install -m 644 libsvm.jar ${JAVA_TARGETDIR} ++ install -m 644 test_applet.html ${JAVA_TARGETDIR} ++# cp -R docs ${JAVA_TARGETDIR} ++uninstall: ++ rm -fr ${JAVA_TARGETDIR} ++ + 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 2007-09-25 11:08:29.000000000 +1000 ++++ ./java/test_applet.html 2007-09-25 11:42:29.000000000 +1000 +@@ -1 +1,3 @@ +- ++ ++ ++ +diff -up ./python/Makefile.orig ./python/Makefile +--- ./python/Makefile.orig 2007-09-25 10:07:34.000000000 +1000 ++++ ./python/Makefile 2007-09-25 11:10:43.000000000 +1000 +@@ -2,7 +2,14 @@ CC = g++ + SWIG ?= swig + + #Windows: see ../README ../Makefile.win +-PYTHON_INCLUDEDIR ?= /usr/include/python2.4 ++PYTHON_TEMP:=${shell mktemp} ++PYTHON_VERSION:=${shell python -V 2> ${PYTHON_TEMP} ; cat ${PYTHON_TEMP} | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$$2,$$3)}'; rm -f ${PYTHON_TEMP}} ++ifndef PYTHON_INCLUDEDIR ++ ++PYTHON_INCLUDEDIR?= /usr/include/python${PYTHON_VERSION} ++ ++endif ++PYTHON_TARGETDIR=${LIB_INSTDIR}/python${PYTHON_VERSION}/site-packages/libsvm + + CFLAGS = -O3 -I$(PYTHON_INCLUDEDIR) -I.. + LDFLAGS = -shared +@@ -28,3 +35,19 @@ clean: + + 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 --git a/libsvm.spec b/libsvm.spec index e32609a..50ef755 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.84 -Release: 4%{?dist} +Release: 5%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -10,7 +10,7 @@ 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: ChangeLog #Source1: http://www.csie.ntu.edu.tw/~cjlin/libsvm/log -Patch0: libsvm-2.84-4.patch +Patch0: libsvm-2.84-5.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: glibc-devel dos2unix @@ -45,6 +45,19 @@ Python tools and interfaces for libsvm. Install this package if you want to develop programs with libsvm in Python. +%package java +Summary: Java tools and interfaces for libsvm. +Group: Development/Libraries +BuildRequires: eclipse-ecj >= 3, libgcj >= 4 +Requires: eclipse-ecj >= 3 +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. + + %prep %setup -q %patch0 -p0 -b .bak @@ -58,13 +71,14 @@ make all DESTDIR=%{_builddir} LIBDIR=%{_libdir} dos2unix -o %{_builddir}/%{name}-%{version}/FAQ.html mv %{_builddir}/%{name}-%{version}/python/README %{_builddir}/%{name}-%{version}/python/README-Python mv %{_builddir}/%{name}-%{version}/tools/README %{_builddir}/%{name}-%{version}/tools/README-Tools +cp %{_builddir}/%{name}-%{version}/README %{_builddir}/%{name}-%{version}/java/README-Java + %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} - %clean rm -rf $RPM_BUILD_ROOT @@ -86,8 +100,17 @@ rm -rf $RPM_BUILD_ROOT %doc python/README-Python tools/README-Tools %{libsvm_python_dir} +%files java +%doc java/README-Java +#%{_libdir}/java/libsvm/docs +%{_libdir}/java/libsvm/libsvm.jar +%{_libdir}/java/libsvm/test_applet.html %changelog +* Thu Aug 30 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 From deebb602ab6e2aad7e31fb5373ce14ca5e1e860e Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 26 Sep 2007 08:55:40 +0000 Subject: [PATCH 008/136] - Add defattr to each subpackage - Move libsvm.so to libsvm --- libsvm-2.84-5.patch => libsvm-2.84-6.patch | 14 +++++++++----- libsvm.spec | 18 +++++++++++++++--- 2 files changed, 24 insertions(+), 8 deletions(-) rename libsvm-2.84-5.patch => libsvm-2.84-6.patch (93%) diff --git a/libsvm-2.84-5.patch b/libsvm-2.84-6.patch similarity index 93% rename from libsvm-2.84-5.patch rename to libsvm-2.84-6.patch index be92108..5da7e64 100644 --- a/libsvm-2.84-5.patch +++ b/libsvm-2.84-6.patch @@ -1,6 +1,6 @@ diff -up ./Makefile.orig ./Makefile --- ./Makefile.orig 2007-09-25 10:07:29.000000000 +1000 -+++ ./Makefile 2007-09-25 14:30:10.000000000 +1000 ++++ ./Makefile 2007-09-26 17:07:55.000000000 +1000 @@ -1,8 +1,39 @@ CXXC = g++ CFLAGS = -Wall -O3 @@ -42,7 +42,7 @@ diff -up ./Makefile.orig ./Makefile svm-predict: svm-predict.c svm.o $(CXXC) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm svm-train: svm-train.c svm.o -@@ -11,5 +42,53 @@ svm-scale: svm-scale.c +@@ -11,5 +42,57 @@ svm-scale: svm-scale.c $(CXXC) $(CFLAGS) svm-scale.c -o svm-scale svm.o: svm.cpp svm.h $(CXXC) $(CFLAGS) -c svm.cpp @@ -64,13 +64,17 @@ diff -up ./Makefile.orig ./Makefile + install -m 644 svm.o ${LIB_INSTDIR}/libsvm + mkdir -p ${INSTDIR}/include/libsvm + install -m 644 svm.h ${INSTDIR}/include/libsvm -+ mkdir -p ${INSTDIR}/share/libsvm/src ++ 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 -+ cp -R java ${INSTDIR}/share/libsvm/src -+ cp -R svm-toy ${INSTDIR}/share/libsvm/src ++ 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 ++# cp -R java ${INSTDIR}/share/libsvm/src ++# cp -R svm-toy ${INSTDIR}/share/libsvm/src +# cp -R tools ${INSTDIR}/share/libsvm/src +# cp -R windows ${INSTDIR}/share/libsvm/src + mkdir -p ${INSTDIR}/share/libsvm/examples diff --git a/libsvm.spec b/libsvm.spec index 50ef755..322e89f 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.84 -Release: 5%{?dist} +Release: 6%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -10,7 +10,7 @@ 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: ChangeLog #Source1: http://www.csie.ntu.edu.tw/~cjlin/libsvm/log -Patch0: libsvm-2.84-5.patch +Patch0: libsvm-2.84-6.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: glibc-devel dos2unix @@ -79,6 +79,9 @@ rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} + + + %clean rm -rf $RPM_BUILD_ROOT @@ -89,25 +92,34 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/svm-scale %{_bindir}/svm-train %{_datadir}/libsvm/examples +%{_libdir}/libsvm/libsvm.so +%{_libdir}/libsvm/libsvm.so.2.84 %files devel +%defattr(-,root,root,-) %doc README %{_libdir}/libsvm %{_includedir}/libsvm %{_datadir}/libsvm/src %files python +%defattr(-,root,root,-) %doc python/README-Python tools/README-Tools %{libsvm_python_dir} %files java +%defattr(-,root,root,-) %doc java/README-Java #%{_libdir}/java/libsvm/docs %{_libdir}/java/libsvm/libsvm.jar %{_libdir}/java/libsvm/test_applet.html %changelog -* Thu Aug 30 2007 Ding-Yi Chen - 2.84-5 +* 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 From 6dc1773da84157c695ca00b1d65c8fea93f7d4a6 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 4 Dec 2007 00:11:10 +0000 Subject: [PATCH 009/136] - [Bug 254091] Review Request: libsvm - A Library for Support Vector Machines (Comment #12) --- libsvm-2.84-6.patch => libsvm-2.84-7.patch | 249 ++++++++++++--------- libsvm.spec | 41 ++-- 2 files changed, 160 insertions(+), 130 deletions(-) rename libsvm-2.84-6.patch => libsvm-2.84-7.patch (73%) diff --git a/libsvm-2.84-6.patch b/libsvm-2.84-7.patch similarity index 73% rename from libsvm-2.84-6.patch rename to libsvm-2.84-7.patch index 5da7e64..ad974ff 100644 --- a/libsvm-2.84-6.patch +++ b/libsvm-2.84-7.patch @@ -1,6 +1,135 @@ +diff -up ./java/libsvm/svm_problem.java.orig ./java/libsvm/svm_problem.java +--- ./java/libsvm/svm_problem.java.orig 2007-12-03 09:36:06.000000000 +1000 ++++ ./java/libsvm/svm_problem.java 2007-12-03 10:00:40.000000000 +1000 +@@ -1,6 +1,7 @@ + package libsvm; + public class svm_problem implements java.io.Serializable + { ++ static final long serialVersionUID = -4451389443706847272L; + public int l; + public double[] y; + public svm_node[][] x; +diff -up ./java/libsvm/svm_node.java.orig ./java/libsvm/svm_node.java +--- ./java/libsvm/svm_node.java.orig 2007-12-03 09:35:56.000000000 +1000 ++++ ./java/libsvm/svm_node.java 2007-12-03 10:00:40.000000000 +1000 +@@ -1,6 +1,7 @@ + package libsvm; + public class svm_node implements java.io.Serializable + { ++ static final long serialVersionUID = 2709444323471798245L; + public int index; + public double value; + } +diff -up ./java/libsvm/svm_parameter.java.orig ./java/libsvm/svm_parameter.java +--- ./java/libsvm/svm_parameter.java.orig 2007-12-03 09:35:45.000000000 +1000 ++++ ./java/libsvm/svm_parameter.java 2007-12-03 10:00:40.000000000 +1000 +@@ -1,6 +1,7 @@ + package libsvm; + public class svm_parameter implements Cloneable,java.io.Serializable + { ++ static final long serialVersionUID = 2709444323471798245L; + /* svm_type */ + public static final int C_SVC = 0; + public static final int NU_SVC = 1; +diff -up ./java/libsvm/svm_model.java.orig ./java/libsvm/svm_model.java +--- ./java/libsvm/svm_model.java.orig 2007-12-03 09:35:34.000000000 +1000 ++++ ./java/libsvm/svm_model.java 2007-12-03 10:00:40.000000000 +1000 +@@ -4,6 +4,7 @@ + package libsvm; + public class svm_model implements java.io.Serializable + { ++ static final long serialVersionUID = 2709444323471798245L; + svm_parameter param; // parameter + int nr_class; // number of classes, = 2 in regression/one class svm + int l; // total #SV +diff -up ./java/libsvm/svm.java.orig ./java/libsvm/svm.java +diff -up ./java/libsvm/svm.m4.orig ./java/libsvm/svm.m4 +diff -up ./java/svm_toy.java.orig ./java/svm_toy.java +--- ./java/svm_toy.java.orig 2007-12-03 09:34:36.000000000 +1000 ++++ ./java/svm_toy.java 2007-12-03 10:31:03.000000000 +1000 +@@ -6,7 +6,7 @@ import java.awt.event.*; + import java.io.*; + + public class svm_toy extends Applet { +- ++ static final long serialVersionUID = -8325676470152687806L; + static final String DEFAULT_PARAM="-t 2 -c 100"; + int XLEN; + int YLEN; +@@ -453,6 +453,7 @@ public class svm_toy extends Applet { + } + + class AppletFrame extends Frame { ++ static final long serialVersionUID = -8428435143024670779L; + AppletFrame(String title, Applet applet, int width, int height) + { + super(title); +diff -up ./java/svm_predict.java.orig ./java/svm_predict.java +diff -up ./java/Makefile.orig ./java/Makefile +--- ./java/Makefile.orig 2007-12-03 09:33:44.000000000 +1000 ++++ ./java/Makefile 2007-12-04 09:38:06.000000000 +1000 +@@ -1,15 +1,18 @@ + .SUFFIXES: .class .java +-FILES = libsvm/svm.class libsvm/svm_model.class libsvm/svm_node.class \ +- libsvm/svm_parameter.class libsvm/svm_problem.class \ ++FILES = libsvm/svm_node.class libsvm/svm_parameter.class \ ++ libsvm/svm_model.class libsvm/svm_problem.class libsvm/svm.class\ + svm_train.class svm_predict.class svm_toy.class + +-#JAVAC = jikes +-#JAVAC_FLAGS = -target 1.1 -source 1.3 +-JAVAC = javac +-JAVAC_FLAGS = ++JAVA_TARGETDIR=${INSTDIR}/share/libsvm/java ++JAVA_DOCDIR=${INSTDIR}/share/javadoc/libsvm-${LIBSVM_VER} ++JAVAC = ecj ++#JAVAC_FLAGS = -target 1.3 -source 1.3 ++CLASSPATH = . ++#JAVAC_FLAGS = --classpath=${CLASSPATH} ++JAVAC_FLAGS = -classpath ${CLASSPATH} + +-all: $(FILES) +- jar cvf libsvm.jar *.class libsvm/*.class ++all: $(FILES) ++ gjar cvf libsvm.jar *.class libsvm/*.class + + .java.class: + $(JAVAC) $(JAVAC_FLAGS) $< +@@ -17,8 +20,22 @@ all: $(FILES) + libsvm/svm.java: libsvm/svm.m4 + m4 libsvm/svm.m4 > libsvm/svm.java + ++javadoc: ++ javadoc -d docs *.java libsvm/*.java ++ ++install: ++ mkdir -p ${JAVA_TARGETDIR} ++ install -m 644 libsvm.jar ${JAVA_TARGETDIR} ++ install -m 644 test_applet.html ${JAVA_TARGETDIR} ++ mkdir -p ${JAVA_DOCDIR} ++# cd docs; cp -R * ${JAVA_DOCDIR} ++uninstall: ++ rm -fr ${JAVA_TARGETDIR} ++ rm -fr ${JAVA_DOCDIR} ++ + 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 2007-12-03 09:35:06.000000000 +1000 ++++ ./java/test_applet.html 2007-12-03 10:00:40.000000000 +1000 +@@ -1 +1,3 @@ +- ++ ++ ++ +diff -up ./java/svm_train.java.orig ./java/svm_train.java diff -up ./Makefile.orig ./Makefile ---- ./Makefile.orig 2007-09-25 10:07:29.000000000 +1000 -+++ ./Makefile 2007-09-26 17:07:55.000000000 +1000 +--- ./Makefile.orig 2007-12-03 09:33:37.000000000 +1000 ++++ ./Makefile 2007-12-03 15:16:15.000000000 +1000 @@ -1,8 +1,39 @@ CXXC = g++ CFLAGS = -Wall -O3 @@ -35,14 +164,14 @@ diff -up ./Makefile.orig ./Makefile +all: svm-train svm-predict svm-scale svm-python svm-java svm-lib + +svm-lib: svm-share.o -+ $(CXXC) -shared -Wl,-soname,libsvm.so \ ++ $(CXXC) -shared -Wl,-soname,libsvm.so.${LIBSVM_VER}\ \ + -o libsvm.so.${LIBSVM_VER} svm-share.o -lm +svm-share.o: svm.cpp svm.h + $(CXXC) -g -fPIC $(CFLAGS) -c svm.cpp -o svm-share.o svm-predict: svm-predict.c svm.o $(CXXC) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm svm-train: svm-train.c svm.o -@@ -11,5 +42,57 @@ svm-scale: svm-scale.c +@@ -11,5 +42,56 @@ svm-scale: svm-scale.c $(CXXC) $(CFLAGS) svm-scale.c -o svm-scale svm.o: svm.cpp svm.h $(CXXC) $(CFLAGS) -c svm.cpp @@ -57,9 +186,8 @@ diff -up ./Makefile.orig ./Makefile + install -m 755 svm-predict ${INSTDIR}/bin + install -m 755 svm-scale ${INSTDIR}/bin + mkdir -p ${LIB_INSTDIR}/libsvm -+ install -m 644 libsvm.so.2.84 ${LIB_INSTDIR}/libsvm ++ install -m 755 libsvm.so.2.84 ${LIB_INSTDIR}/libsvm + cd ${LIB_INSTDIR}/libsvm; ln -s libsvm.so.${LIBSVM_VER} libsvm.so -+ ldconfig -n ${LIB_INSTDIR}/libsvm +# install package libsvm-devel + install -m 644 svm.o ${LIB_INSTDIR}/libsvm + mkdir -p ${INSTDIR}/include/libsvm @@ -100,111 +228,9 @@ diff -up ./Makefile.orig ./Makefile + ${MAKE} -C python clean + ${MAKE} -C java clean + -diff -up ./java/libsvm/svm_model.java.orig ./java/libsvm/svm_model.java ---- ./java/libsvm/svm_model.java.orig 2007-09-26 10:19:43.000000000 +1000 -+++ ./java/libsvm/svm_model.java 2007-09-26 10:27:36.000000000 +1000 -@@ -4,6 +4,7 @@ - package libsvm; - public class svm_model implements java.io.Serializable - { -+ static final long serialVersionUID = 2709444323471798245L; - svm_parameter param; // parameter - int nr_class; // number of classes, = 2 in regression/one class svm - int l; // total #SV -diff -up ./java/libsvm/svm_node.java.orig ./java/libsvm/svm_node.java ---- ./java/libsvm/svm_node.java.orig 2007-09-26 10:19:51.000000000 +1000 -+++ ./java/libsvm/svm_node.java 2007-09-26 10:27:25.000000000 +1000 -@@ -1,6 +1,7 @@ - package libsvm; - public class svm_node implements java.io.Serializable - { -+ static final long serialVersionUID = 2709444323471798245L; - public int index; - public double value; - } -diff -up ./java/libsvm/svm_problem.java.orig ./java/libsvm/svm_problem.java ---- ./java/libsvm/svm_problem.java.orig 2007-09-26 10:20:42.000000000 +1000 -+++ ./java/libsvm/svm_problem.java 2007-09-26 10:26:05.000000000 +1000 -@@ -1,6 +1,7 @@ - package libsvm; - public class svm_problem implements java.io.Serializable - { -+ static final long serialVersionUID = -4451389443706847272L; - public int l; - public double[] y; - public svm_node[][] x; -diff -up ./java/libsvm/svm_parameter.java.orig ./java/libsvm/svm_parameter.java ---- ./java/libsvm/svm_parameter.java.orig 2007-09-26 10:20:23.000000000 +1000 -+++ ./java/libsvm/svm_parameter.java 2007-09-26 10:25:14.000000000 +1000 -@@ -1,6 +1,7 @@ - package libsvm; - public class svm_parameter implements Cloneable,java.io.Serializable - { -+ static final long serialVersionUID = 2709444323471798245L; - /* svm_type */ - public static final int C_SVC = 0; - public static final int NU_SVC = 1; -diff -up ./java/libsvm/svm.m4.orig ./java/libsvm/svm.m4 -diff -up ./java/Makefile.orig ./java/Makefile ---- ./java/Makefile.orig 2007-09-25 11:10:21.000000000 +1000 -+++ ./java/Makefile 2007-09-26 12:42:50.000000000 +1000 -@@ -1,15 +1,17 @@ - .SUFFIXES: .class .java --FILES = libsvm/svm.class libsvm/svm_model.class libsvm/svm_node.class \ -- libsvm/svm_parameter.class libsvm/svm_problem.class \ -+FILES = libsvm/svm_node.class libsvm/svm_parameter.class \ -+ libsvm/svm_model.class libsvm/svm_problem.class libsvm/svm.class\ - svm_train.class svm_predict.class svm_toy.class - --#JAVAC = jikes --#JAVAC_FLAGS = -target 1.1 -source 1.3 --JAVAC = javac --JAVAC_FLAGS = -+JAVA_TARGETDIR=${LIB_INSTDIR}/java/libsvm -+JAVAC = ecj -+#JAVAC_FLAGS = -target 1.3 -source 1.3 -+CLASSPATH = . -+#JAVAC_FLAGS = --classpath=${CLASSPATH} -+JAVAC_FLAGS = -classpath ${CLASSPATH} - - all: $(FILES) -- jar cvf libsvm.jar *.class libsvm/*.class -+ gjar cvf libsvm.jar *.class libsvm/*.class - - .java.class: - $(JAVAC) $(JAVAC_FLAGS) $< -@@ -17,8 +19,20 @@ all: $(FILES) - libsvm/svm.java: libsvm/svm.m4 - m4 libsvm/svm.m4 > libsvm/svm.java - -+javadoc: -+ javadoc -d docs *.java libsvm/*.java -+ -+install: -+ mkdir -p ${JAVA_TARGETDIR} -+ install -m 644 libsvm.jar ${JAVA_TARGETDIR} -+ install -m 644 test_applet.html ${JAVA_TARGETDIR} -+# cp -R docs ${JAVA_TARGETDIR} -+uninstall: -+ rm -fr ${JAVA_TARGETDIR} -+ - 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 2007-09-25 11:08:29.000000000 +1000 -+++ ./java/test_applet.html 2007-09-25 11:42:29.000000000 +1000 -@@ -1 +1,3 @@ -- -+ -+ -+ diff -up ./python/Makefile.orig ./python/Makefile ---- ./python/Makefile.orig 2007-09-25 10:07:34.000000000 +1000 -+++ ./python/Makefile 2007-09-25 11:10:43.000000000 +1000 +--- ./python/Makefile.orig 2007-12-03 11:13:21.000000000 +1000 ++++ ./python/Makefile 2007-12-03 11:14:48.000000000 +1000 @@ -2,7 +2,14 @@ CC = g++ SWIG ?= swig @@ -241,3 +267,6 @@ diff -up ./python/Makefile.orig ./python/Makefile + + + +diff -up ./tools/easy.py.orig ./tools/easy.py +diff -up ./tools/grid.py.orig ./tools/grid.py +diff -up ./tools/subset.py.orig ./tools/subset.py diff --git a/libsvm.spec b/libsvm.spec index 322e89f..8f79940 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.84 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -10,12 +10,11 @@ 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: ChangeLog #Source1: http://www.csie.ntu.edu.tw/~cjlin/libsvm/log -Patch0: libsvm-2.84-6.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Patch0: libsvm-2.84-7.patch +#BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: glibc-devel dos2unix -Requires: glibc - %description LIBSVM is an integrated software for support vector classification, @@ -23,21 +22,20 @@ LIBSVM is an integrated software for support vector classification, estimation (one-class SVM ). It supports multi-class classification. %package devel -Summary: Header file, object file, and source files of libsvm in C and Java. +Summary: Header file, object file, and source files of libsvm in C, C++ and Java Group: Development/Libraries BuildRequires: glibc-devel -Requires: glibc Requires: %{name} = %{version}-%{release} %description devel -Header file, object file, and source files of libsvm in C and Java. +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. +Summary: Python tools and interfaces for libsvm Group: Development/Libraries -BuildRequires: python >= 2.4 python-devel >= 2.4 gawk -Requires: python >= 2.4 +BuildRequires: python-devel >= 2.4 gawk Requires: %{name} = %{version}-%{release} %description python @@ -46,9 +44,9 @@ Install this package if you want to develop programs with libsvm in Python. %package java -Summary: Java tools and interfaces for libsvm. +Summary: Java tools and interfaces for libsvm Group: Development/Libraries -BuildRequires: eclipse-ecj >= 3, libgcj >= 4 +BuildRequires: eclipse-ecj >= 3 Requires: eclipse-ecj >= 3 Requires: %{name} = %{version}-%{release} @@ -77,6 +75,7 @@ cp %{_builddir}/%{name}-%{version}/README %{_builddir}/%{name}-%{version}/java/R %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} +ldconfig -n %{_libdir}/libsvm @@ -91,15 +90,14 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/svm-predict %{_bindir}/svm-scale %{_bindir}/svm-train +%dir %{_datadir}/libsvm %{_datadir}/libsvm/examples -%{_libdir}/libsvm/libsvm.so -%{_libdir}/libsvm/libsvm.so.2.84 +%{_libdir}/libsvm/ %files devel %defattr(-,root,root,-) %doc README -%{_libdir}/libsvm -%{_includedir}/libsvm +%{_includedir}/libsvm/ %{_datadir}/libsvm/src %files python @@ -110,11 +108,14 @@ rm -rf $RPM_BUILD_ROOT %files java %defattr(-,root,root,-) %doc java/README-Java -#%{_libdir}/java/libsvm/docs -%{_libdir}/java/libsvm/libsvm.jar -%{_libdir}/java/libsvm/test_applet.html +%{_datadir}/libsvm/java +#%{_datadir}/javadoc/%{name}-%{version} %changelog +* Mon Dec 03 2007 Ding-Yi Chen - 2.84-7 +- [Bug 254091] Review Request: libsvm - A Library for Support Vector Machines (Comment #12) +- Move javadoc to proper place + * Thu Sep 26 2007 Ding-Yi Chen - 2.84-6 - Add defattr to each subpackage - Move libsvm.so to libsvm From eeaa2da16dd848708bcbbb36865b38abef36d162 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Fri, 14 Dec 2007 01:04:23 +0000 Subject: [PATCH 010/136] Add gnuplot dependency for libsvm-python, as tools/easy.py needs it. --- libsvm-2.84-7.patch => libsvm-2.84-8.patch | 64 ++++++++++++---------- libsvm.spec | 62 ++++++++++++++------- 2 files changed, 75 insertions(+), 51 deletions(-) rename libsvm-2.84-7.patch => libsvm-2.84-8.patch (79%) diff --git a/libsvm-2.84-7.patch b/libsvm-2.84-8.patch similarity index 79% rename from libsvm-2.84-7.patch rename to libsvm-2.84-8.patch index ad974ff..d63d686 100644 --- a/libsvm-2.84-7.patch +++ b/libsvm-2.84-8.patch @@ -1,6 +1,6 @@ diff -up ./java/libsvm/svm_problem.java.orig ./java/libsvm/svm_problem.java ---- ./java/libsvm/svm_problem.java.orig 2007-12-03 09:36:06.000000000 +1000 -+++ ./java/libsvm/svm_problem.java 2007-12-03 10:00:40.000000000 +1000 +--- ./java/libsvm/svm_problem.java.orig 2007-12-12 14:22:51.000000000 +1000 ++++ ./java/libsvm/svm_problem.java 2007-12-13 10:05:16.000000000 +1000 @@ -1,6 +1,7 @@ package libsvm; public class svm_problem implements java.io.Serializable @@ -10,8 +10,8 @@ diff -up ./java/libsvm/svm_problem.java.orig ./java/libsvm/svm_problem.java public double[] y; public svm_node[][] x; diff -up ./java/libsvm/svm_node.java.orig ./java/libsvm/svm_node.java ---- ./java/libsvm/svm_node.java.orig 2007-12-03 09:35:56.000000000 +1000 -+++ ./java/libsvm/svm_node.java 2007-12-03 10:00:40.000000000 +1000 +--- ./java/libsvm/svm_node.java.orig 2007-12-12 14:23:11.000000000 +1000 ++++ ./java/libsvm/svm_node.java 2007-12-13 10:05:16.000000000 +1000 @@ -1,6 +1,7 @@ package libsvm; public class svm_node implements java.io.Serializable @@ -21,8 +21,8 @@ diff -up ./java/libsvm/svm_node.java.orig ./java/libsvm/svm_node.java public double value; } diff -up ./java/libsvm/svm_parameter.java.orig ./java/libsvm/svm_parameter.java ---- ./java/libsvm/svm_parameter.java.orig 2007-12-03 09:35:45.000000000 +1000 -+++ ./java/libsvm/svm_parameter.java 2007-12-03 10:00:40.000000000 +1000 +--- ./java/libsvm/svm_parameter.java.orig 2007-12-12 14:25:43.000000000 +1000 ++++ ./java/libsvm/svm_parameter.java 2007-12-13 10:05:16.000000000 +1000 @@ -1,6 +1,7 @@ package libsvm; public class svm_parameter implements Cloneable,java.io.Serializable @@ -32,8 +32,8 @@ diff -up ./java/libsvm/svm_parameter.java.orig ./java/libsvm/svm_parameter.java public static final int C_SVC = 0; public static final int NU_SVC = 1; diff -up ./java/libsvm/svm_model.java.orig ./java/libsvm/svm_model.java ---- ./java/libsvm/svm_model.java.orig 2007-12-03 09:35:34.000000000 +1000 -+++ ./java/libsvm/svm_model.java 2007-12-03 10:00:40.000000000 +1000 +--- ./java/libsvm/svm_model.java.orig 2007-12-12 14:27:38.000000000 +1000 ++++ ./java/libsvm/svm_model.java 2007-12-13 10:05:16.000000000 +1000 @@ -4,6 +4,7 @@ package libsvm; public class svm_model implements java.io.Serializable @@ -42,11 +42,9 @@ diff -up ./java/libsvm/svm_model.java.orig ./java/libsvm/svm_model.java svm_parameter param; // parameter int nr_class; // number of classes, = 2 in regression/one class svm int l; // total #SV -diff -up ./java/libsvm/svm.java.orig ./java/libsvm/svm.java -diff -up ./java/libsvm/svm.m4.orig ./java/libsvm/svm.m4 diff -up ./java/svm_toy.java.orig ./java/svm_toy.java ---- ./java/svm_toy.java.orig 2007-12-03 09:34:36.000000000 +1000 -+++ ./java/svm_toy.java 2007-12-03 10:31:03.000000000 +1000 +--- ./java/svm_toy.java.orig 2007-12-12 14:28:14.000000000 +1000 ++++ ./java/svm_toy.java 2007-12-13 10:05:16.000000000 +1000 @@ -6,7 +6,7 @@ import java.awt.event.*; import java.io.*; @@ -66,8 +64,8 @@ diff -up ./java/svm_toy.java.orig ./java/svm_toy.java super(title); diff -up ./java/svm_predict.java.orig ./java/svm_predict.java diff -up ./java/Makefile.orig ./java/Makefile ---- ./java/Makefile.orig 2007-12-03 09:33:44.000000000 +1000 -+++ ./java/Makefile 2007-12-04 09:38:06.000000000 +1000 +--- ./java/Makefile.orig 2007-12-12 15:03:30.000000000 +1000 ++++ ./java/Makefile 2007-12-13 10:05:16.000000000 +1000 @@ -1,15 +1,18 @@ .SUFFIXES: .class .java -FILES = libsvm/svm.class libsvm/svm_model.class libsvm/svm_node.class \ @@ -106,7 +104,7 @@ diff -up ./java/Makefile.orig ./java/Makefile + mkdir -p ${JAVA_TARGETDIR} + install -m 644 libsvm.jar ${JAVA_TARGETDIR} + install -m 644 test_applet.html ${JAVA_TARGETDIR} -+ mkdir -p ${JAVA_DOCDIR} ++# mkdir -p ${JAVA_DOCDIR} +# cd docs; cp -R * ${JAVA_DOCDIR} +uninstall: + rm -fr ${JAVA_TARGETDIR} @@ -119,8 +117,8 @@ diff -up ./java/Makefile.orig ./java/Makefile dist: clean all rm *.class libsvm/*.class diff -up ./java/test_applet.html.orig ./java/test_applet.html ---- ./java/test_applet.html.orig 2007-12-03 09:35:06.000000000 +1000 -+++ ./java/test_applet.html 2007-12-03 10:00:40.000000000 +1000 +--- ./java/test_applet.html.orig 2007-12-12 14:49:48.000000000 +1000 ++++ ./java/test_applet.html 2007-12-13 10:05:16.000000000 +1000 @@ -1 +1,3 @@ - + @@ -128,13 +126,15 @@ diff -up ./java/test_applet.html.orig ./java/test_applet.html + diff -up ./java/svm_train.java.orig ./java/svm_train.java diff -up ./Makefile.orig ./Makefile ---- ./Makefile.orig 2007-12-03 09:33:37.000000000 +1000 -+++ ./Makefile 2007-12-03 15:16:15.000000000 +1000 -@@ -1,8 +1,39 @@ +--- ./Makefile.orig 2007-12-12 15:52:58.000000000 +1000 ++++ ./Makefile 2007-12-14 10:55:02.000000000 +1000 +@@ -1,8 +1,41 @@ CXXC = g++ CFLAGS = -Wall -O3 +MAKE = make -+LIBSVM_VER =2.84 ++LIBSVM_VER_MAJOR=2 ++LIBSVM_VER_MINOR=84 ++LIBSVM_VER =${LIBSVM_VER_MAJOR}.${LIBSVM_VER_MINOR} +export LIBSVM_VER -all: svm-train svm-predict svm-scale @@ -164,14 +164,14 @@ diff -up ./Makefile.orig ./Makefile +all: svm-train svm-predict svm-scale svm-python svm-java svm-lib + +svm-lib: svm-share.o -+ $(CXXC) -shared -Wl,-soname,libsvm.so.${LIBSVM_VER}\ \ ++ $(CXXC) -shared -Wl,-soname,libsvm.so.${LIBSVM_VER_MAJOR}\ + -o libsvm.so.${LIBSVM_VER} svm-share.o -lm +svm-share.o: svm.cpp svm.h + $(CXXC) -g -fPIC $(CFLAGS) -c svm.cpp -o svm-share.o svm-predict: svm-predict.c svm.o $(CXXC) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm svm-train: svm-train.c svm.o -@@ -11,5 +42,56 @@ svm-scale: svm-scale.c +@@ -11,5 +44,61 @@ svm-scale: svm-scale.c $(CXXC) $(CFLAGS) svm-scale.c -o svm-scale svm.o: svm.cpp svm.h $(CXXC) $(CFLAGS) -c svm.cpp @@ -185,11 +185,16 @@ diff -up ./Makefile.orig ./Makefile + 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}/libsvm -+ install -m 755 libsvm.so.2.84 ${LIB_INSTDIR}/libsvm -+ cd ${LIB_INSTDIR}/libsvm; ln -s libsvm.so.${LIBSVM_VER} libsvm.so ++# mkdir -p ${LIB_INSTDIR}/libsvm ++ mkdir -p ${LIB_INSTDIR} ++# install -m 755 libsvm.so.${LIBSVM_VER} ${LIB_INSTDIR}/libsvm ++ install -m 755 libsvm.so.${LIBSVM_VER} ${LIB_INSTDIR} ++# cd ${LIB_INSTDIR}/libsvm; ln -fs libsvm.so.${LIBSVM_VER_MAJOR} libsvm.so ++# cd ${LIB_INSTDIR}; ln -fs libsvm.so.${LIBSVM_VER} libsvm.so.${LIBSVM_VER_MAJOR} ;ln -fs libsvm.so.${LIBSVM_VER_MAJOR} libsvm.so ++ /sbin/ldconfig -n ${LIB_INSTDIR} ++ cd ${LIB_INSTDIR}; ln -fs libsvm.so.${LIBSVM_VER_MAJOR} libsvm.so +# install package libsvm-devel -+ install -m 644 svm.o ${LIB_INSTDIR}/libsvm ++# install -m 644 svm.o ${LIB_INSTDIR}/libsvm + mkdir -p ${INSTDIR}/include/libsvm + install -m 644 svm.h ${INSTDIR}/include/libsvm + mkdir -p ${INSTDIR}/share/libsvm/src/java/libsvm @@ -229,8 +234,8 @@ diff -up ./Makefile.orig ./Makefile + ${MAKE} -C java clean + diff -up ./python/Makefile.orig ./python/Makefile ---- ./python/Makefile.orig 2007-12-03 11:13:21.000000000 +1000 -+++ ./python/Makefile 2007-12-03 11:14:48.000000000 +1000 +--- ./python/Makefile.orig 2007-12-13 09:33:32.000000000 +1000 ++++ ./python/Makefile 2007-12-13 10:05:16.000000000 +1000 @@ -2,7 +2,14 @@ CC = g++ SWIG ?= swig @@ -269,4 +274,3 @@ diff -up ./python/Makefile.orig ./python/Makefile + diff -up ./tools/easy.py.orig ./tools/easy.py diff -up ./tools/grid.py.orig ./tools/grid.py -diff -up ./tools/subset.py.orig ./tools/subset.py diff --git a/libsvm.spec b/libsvm.spec index 8f79940..dd12fcf 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.84 -Release: 7%{?dist} +Release: 8%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -10,11 +10,15 @@ 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: ChangeLog #Source1: http://www.csie.ntu.edu.tw/~cjlin/libsvm/log -Patch0: libsvm-2.84-7.patch -#BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Patch0: libsvm-2.84-8.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root -BuildRequires: glibc-devel dos2unix +BuildRequires: glibc-devel +%define libsvm_ver_major 2 +%define temp_file /tmp/python.ver +%define python_version %(python -V 2> %{temp_file} ; cat %{temp_file} | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$2,$3)}'; rm -f %{temp_file}) +%define libsvm_python_dir %{_libdir}/python%{python_version}/site-packages/libsvm + %description LIBSVM is an integrated software for support vector classification, @@ -35,7 +39,8 @@ 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 +BuildRequires: python-devel >= 2.4 gawk gnuplot +#gnuplot is required by easy.py Requires: %{name} = %{version}-%{release} %description python @@ -59,46 +64,57 @@ programs with libsvm in Java. %prep %setup -q %patch0 -p0 -b .bak -%define temp_file /tmp/python.ver -%define python_version %(python -V 2> %{temp_file} ; cat %{temp_file} | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$2,$3)}'; rm -f %{temp_file}) -%define libsvm_python_dir %{_libdir}/python%{python_version}/site-packages/libsvm %build make all DESTDIR=%{_builddir} LIBDIR=%{_libdir} -dos2unix -o %{_builddir}/%{name}-%{version}/FAQ.html -mv %{_builddir}/%{name}-%{version}/python/README %{_builddir}/%{name}-%{version}/python/README-Python -mv %{_builddir}/%{name}-%{version}/tools/README %{_builddir}/%{name}-%{version}/tools/README-Tools -cp %{_builddir}/%{name}-%{version}/README %{_builddir}/%{name}-%{version}/java/README-Java +%{__sed} -i 's/\r//' FAQ.html +mv python/README python/README-Python +mv tools/README tools/README-Tools +cp README java/README-Java %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} -ldconfig -n %{_libdir}/libsvm - +#This is required for rpmbuild +#/sbin/ldconfig -n %{_libdir} +%post +/sbin/ldconfig -n %{_libdir} +%postun +if [ "$1" = "0" ]; then + /sbin/ldconfig +fi %clean rm -rf $RPM_BUILD_ROOT + %files %defattr(-,root,root,-) %doc COPYRIGHT FAQ.html %{_bindir}/svm-predict %{_bindir}/svm-scale %{_bindir}/svm-train -%dir %{_datadir}/libsvm -%{_datadir}/libsvm/examples -%{_libdir}/libsvm/ +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/examples +#%dir %{_libdir}/%{name} +#%{_libdir}/%{name}/%{name}.so.%{version} +%{_libdir}/%{name}.so.%{version} +%{_libdir}/%{name}.so.%{libsvm_ver_major} + %files devel %defattr(-,root,root,-) %doc README -%{_includedir}/libsvm/ -%{_datadir}/libsvm/src +%{_includedir}/%{name}/ +#including source for developeer +%{_datadir}/%{name}/src +#%{_libdir}/%{name}/%{name}.so +%{_libdir}/%{name}.so %files python %defattr(-,root,root,-) @@ -108,13 +124,17 @@ rm -rf $RPM_BUILD_ROOT %files java %defattr(-,root,root,-) %doc java/README-Java -%{_datadir}/libsvm/java +%{_datadir}/%{name}/java #%{_datadir}/javadoc/%{name}-%{version} %changelog +* 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) -- Move javadoc to proper place * Thu Sep 26 2007 Ding-Yi Chen - 2.84-6 - Add defattr to each subpackage From 278c449214dc68bbe5635f91a5bd16d39dc1e4f8 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 3 Jan 2008 04:46:43 +0000 Subject: [PATCH 011/136] Bug 254091: Comment 19 --- libsvm-2.84-8.patch => libsvm-2.84.patch | 256 +++++++++++++++-------- libsvm.spec | 36 ++-- 2 files changed, 179 insertions(+), 113 deletions(-) rename libsvm-2.84-8.patch => libsvm-2.84.patch (66%) diff --git a/libsvm-2.84-8.patch b/libsvm-2.84.patch similarity index 66% rename from libsvm-2.84-8.patch rename to libsvm-2.84.patch index d63d686..8347e43 100644 --- a/libsvm-2.84-8.patch +++ b/libsvm-2.84.patch @@ -1,6 +1,26 @@ +diff -up ./java/test_applet.html.orig ./java/test_applet.html +--- ./java/test_applet.html.orig 2008-01-02 09:37:14.000000000 +1000 ++++ ./java/test_applet.html 2008-01-02 09:43:19.000000000 +1000 +@@ -1 +1,3 @@ +- ++ ++ ++ +diff -up ./java/svm_train.java.orig ./java/svm_train.java +diff -up ./java/libsvm/svm_parameter.java.orig ./java/libsvm/svm_parameter.java +--- ./java/libsvm/svm_parameter.java.orig 2006-03-04 01:44:14.000000000 +1000 ++++ ./java/libsvm/svm_parameter.java 2008-01-02 09:43:19.000000000 +1000 +@@ -1,6 +1,7 @@ + package libsvm; + public class svm_parameter implements Cloneable,java.io.Serializable + { ++ static final long serialVersionUID = 2709444323471798245L; + /* svm_type */ + public static final int C_SVC = 0; + public static final int NU_SVC = 1; diff -up ./java/libsvm/svm_problem.java.orig ./java/libsvm/svm_problem.java ---- ./java/libsvm/svm_problem.java.orig 2007-12-12 14:22:51.000000000 +1000 -+++ ./java/libsvm/svm_problem.java 2007-12-13 10:05:16.000000000 +1000 +--- ./java/libsvm/svm_problem.java.orig 2003-10-11 22:30:47.000000000 +1000 ++++ ./java/libsvm/svm_problem.java 2008-01-02 09:43:19.000000000 +1000 @@ -1,6 +1,7 @@ package libsvm; public class svm_problem implements java.io.Serializable @@ -10,8 +30,8 @@ diff -up ./java/libsvm/svm_problem.java.orig ./java/libsvm/svm_problem.java public double[] y; public svm_node[][] x; diff -up ./java/libsvm/svm_node.java.orig ./java/libsvm/svm_node.java ---- ./java/libsvm/svm_node.java.orig 2007-12-12 14:23:11.000000000 +1000 -+++ ./java/libsvm/svm_node.java 2007-12-13 10:05:16.000000000 +1000 +--- ./java/libsvm/svm_node.java.orig 2003-10-11 22:30:47.000000000 +1000 ++++ ./java/libsvm/svm_node.java 2008-01-02 09:43:19.000000000 +1000 @@ -1,6 +1,7 @@ package libsvm; public class svm_node implements java.io.Serializable @@ -20,20 +40,9 @@ diff -up ./java/libsvm/svm_node.java.orig ./java/libsvm/svm_node.java public int index; public double value; } -diff -up ./java/libsvm/svm_parameter.java.orig ./java/libsvm/svm_parameter.java ---- ./java/libsvm/svm_parameter.java.orig 2007-12-12 14:25:43.000000000 +1000 -+++ ./java/libsvm/svm_parameter.java 2007-12-13 10:05:16.000000000 +1000 -@@ -1,6 +1,7 @@ - package libsvm; - public class svm_parameter implements Cloneable,java.io.Serializable - { -+ static final long serialVersionUID = 2709444323471798245L; - /* svm_type */ - public static final int C_SVC = 0; - public static final int NU_SVC = 1; diff -up ./java/libsvm/svm_model.java.orig ./java/libsvm/svm_model.java ---- ./java/libsvm/svm_model.java.orig 2007-12-12 14:27:38.000000000 +1000 -+++ ./java/libsvm/svm_model.java 2007-12-13 10:05:16.000000000 +1000 +--- ./java/libsvm/svm_model.java.orig 2007-01-13 08:23:39.000000000 +1000 ++++ ./java/libsvm/svm_model.java 2008-01-02 09:43:19.000000000 +1000 @@ -4,6 +4,7 @@ package libsvm; public class svm_model implements java.io.Serializable @@ -42,30 +51,10 @@ diff -up ./java/libsvm/svm_model.java.orig ./java/libsvm/svm_model.java svm_parameter param; // parameter int nr_class; // number of classes, = 2 in regression/one class svm int l; // total #SV -diff -up ./java/svm_toy.java.orig ./java/svm_toy.java ---- ./java/svm_toy.java.orig 2007-12-12 14:28:14.000000000 +1000 -+++ ./java/svm_toy.java 2007-12-13 10:05:16.000000000 +1000 -@@ -6,7 +6,7 @@ import java.awt.event.*; - import java.io.*; - - public class svm_toy extends Applet { -- -+ static final long serialVersionUID = -8325676470152687806L; - static final String DEFAULT_PARAM="-t 2 -c 100"; - int XLEN; - int YLEN; -@@ -453,6 +453,7 @@ public class svm_toy extends Applet { - } - - class AppletFrame extends Frame { -+ static final long serialVersionUID = -8428435143024670779L; - AppletFrame(String title, Applet applet, int width, int height) - { - super(title); -diff -up ./java/svm_predict.java.orig ./java/svm_predict.java +diff -up ./java/libsvm/svm.java.orig ./java/libsvm/svm.java diff -up ./java/Makefile.orig ./java/Makefile ---- ./java/Makefile.orig 2007-12-12 15:03:30.000000000 +1000 -+++ ./java/Makefile 2007-12-13 10:05:16.000000000 +1000 +--- ./java/Makefile.orig 2008-01-02 09:32:55.000000000 +1000 ++++ ./java/Makefile 2008-01-02 09:43:19.000000000 +1000 @@ -1,15 +1,18 @@ .SUFFIXES: .class .java -FILES = libsvm/svm.class libsvm/svm_model.class libsvm/svm_node.class \ @@ -116,18 +105,141 @@ diff -up ./java/Makefile.orig ./java/Makefile dist: clean all rm *.class libsvm/*.class -diff -up ./java/test_applet.html.orig ./java/test_applet.html ---- ./java/test_applet.html.orig 2007-12-12 14:49:48.000000000 +1000 -+++ ./java/test_applet.html 2007-12-13 10:05:16.000000000 +1000 -@@ -1 +1,3 @@ -- -+ -+ -+ -diff -up ./java/svm_train.java.orig ./java/svm_train.java +diff -up ./java/svm_toy.java.orig ./java/svm_toy.java +--- ./java/svm_toy.java.orig 2006-03-04 17:40:11.000000000 +1000 ++++ ./java/svm_toy.java 2008-01-02 09:43:19.000000000 +1000 +@@ -6,7 +6,7 @@ import java.awt.event.*; + import java.io.*; + + public class svm_toy extends Applet { +- ++ static final long serialVersionUID = -8325676470152687806L; + static final String DEFAULT_PARAM="-t 2 -c 100"; + int XLEN; + int YLEN; +@@ -453,6 +453,7 @@ public class svm_toy extends Applet { + } + + class AppletFrame extends Frame { ++ static final long serialVersionUID = -8428435143024670779L; + AppletFrame(String title, Applet applet, int width, int height) + { + super(title); +diff -up ./java/svm_predict.java.orig ./java/svm_predict.java +diff -up ./python/cross_validation.py.orig ./python/cross_validation.py +diff -up ./python/svm_test.py.orig ./python/svm_test.py +diff -up ./python/Makefile.orig ./python/Makefile +--- ./python/Makefile.orig 2008-01-02 09:38:18.000000000 +1000 ++++ ./python/Makefile 2008-01-02 11:26:08.000000000 +1000 +@@ -2,9 +2,16 @@ CC = g++ + SWIG ?= swig + + #Windows: see ../README ../Makefile.win +-PYTHON_INCLUDEDIR ?= /usr/include/python2.4 ++#PYTHON_TEMP:=${shell mktemp} ++#PYTHON_VERSION:=${shell python -V 2> ${PYTHON_TEMP} ; cat ${PYTHON_TEMP} | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$$2,$$3)}'; rm -f ${PYTHON_TEMP}} ++ifndef PYTHON_INCLUDEDIR + +-CFLAGS = -O3 -I$(PYTHON_INCLUDEDIR) -I.. ++PYTHON_INCLUDEDIR?= /usr/include/python${PYTHON_VERSION} ++ ++endif ++PYTHON_TARGETDIR=${LIB_INSTDIR}/python${PYTHON_VERSION}/site-packages/libsvm ++ ++CFLAGS_PYTHON = ${CFLAGS} -O3 -I$(PYTHON_INCLUDEDIR) -I.. + LDFLAGS = -shared + # Mac OS + # LDFLAGS = -framework Python -bundle +@@ -15,16 +22,35 @@ svmc.so: svmc_wrap.o svm.o + $(CC) $(LDFLAGS) -o svmc.so svmc_wrap.o svm.o + + svmc_wrap.o: svmc_wrap.c ../svm.h +- $(CC) $(CFLAGS) -fPIC -c svmc_wrap.c ++ echo "PYTHON_VERSION=${PYTHON_VERSION}" ++ echo "CFLAGS=${CFLAGS}" ++ echo "CFLAGS_PYTHON=${CFLAGS_PYTHON}" ++ $(CC) $(CFLAGS_PYTHON) -fPIC -c svmc_wrap.c + + svmc_wrap.c: svmc.i + $(SWIG) -python -noproxy svmc.i + + svm.o: ../svm.cpp ../svm.h +- $(CC) $(CFLAGS) -fPIC -c ../svm.cpp ++ $(CC) $(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 ./python/test_cross_validation.py.orig ./python/test_cross_validation.py +diff -up ./python/svm.py.orig ./python/svm.py +diff -up ./tools/subset.py.orig ./tools/subset.py +diff -up ./tools/easy.py.orig ./tools/easy.py +--- ./tools/easy.py.orig 2004-06-26 23:42:52.000000000 +1000 ++++ ./tools/easy.py 2008-01-03 11:31:31.000000000 +1000 +@@ -2,6 +2,7 @@ + + import sys + import os ++from distutils.sysconfig import get_python_lib + + if len(sys.argv) <= 1: + print 'Usage: %s training_file [testing_file]' % sys.argv[0] +@@ -11,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 = 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 2006-11-30 03:24:59.000000000 +1000 ++++ ./tools/grid.py 2008-01-03 13:03:06.000000000 +1000 +@@ -11,7 +11,7 @@ from string import find, split, join, at + + 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 -up ./Makefile.orig ./Makefile ---- ./Makefile.orig 2007-12-12 15:52:58.000000000 +1000 -+++ ./Makefile 2007-12-14 10:55:02.000000000 +1000 +--- ./Makefile.orig 2008-01-02 09:36:22.000000000 +1000 ++++ ./Makefile 2008-01-02 09:43:19.000000000 +1000 @@ -1,8 +1,41 @@ CXXC = g++ CFLAGS = -Wall -O3 @@ -233,44 +345,4 @@ diff -up ./Makefile.orig ./Makefile + ${MAKE} -C python clean + ${MAKE} -C java clean + -diff -up ./python/Makefile.orig ./python/Makefile ---- ./python/Makefile.orig 2007-12-13 09:33:32.000000000 +1000 -+++ ./python/Makefile 2007-12-13 10:05:16.000000000 +1000 -@@ -2,7 +2,14 @@ CC = g++ - SWIG ?= swig - - #Windows: see ../README ../Makefile.win --PYTHON_INCLUDEDIR ?= /usr/include/python2.4 -+PYTHON_TEMP:=${shell mktemp} -+PYTHON_VERSION:=${shell python -V 2> ${PYTHON_TEMP} ; cat ${PYTHON_TEMP} | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$$2,$$3)}'; rm -f ${PYTHON_TEMP}} -+ifndef PYTHON_INCLUDEDIR -+ -+PYTHON_INCLUDEDIR?= /usr/include/python${PYTHON_VERSION} -+ -+endif -+PYTHON_TARGETDIR=${LIB_INSTDIR}/python${PYTHON_VERSION}/site-packages/libsvm - - CFLAGS = -O3 -I$(PYTHON_INCLUDEDIR) -I.. - LDFLAGS = -shared -@@ -28,3 +35,19 @@ clean: - - 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 ./tools/easy.py.orig ./tools/easy.py -diff -up ./tools/grid.py.orig ./tools/grid.py +diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile diff --git a/libsvm.spec b/libsvm.spec index dd12fcf..b79a093 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.84 -Release: 8%{?dist} +Release: 9%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -10,14 +10,14 @@ 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: ChangeLog #Source1: http://www.csie.ntu.edu.tw/~cjlin/libsvm/log -Patch0: libsvm-2.84-8.patch +Patch0: %{name}-%{version}.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root -BuildRequires: glibc-devel +#BuildRequires: glibc-devel %define libsvm_ver_major 2 -%define temp_file /tmp/python.ver -%define python_version %(python -V 2> %{temp_file} ; cat %{temp_file} | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$2,$3)}'; rm -f %{temp_file}) -%define libsvm_python_dir %{_libdir}/python%{python_version}/site-packages/libsvm +%{!?pyver: %define pyver %(python -c 'import sys; print(sys.version[0:3])')}%{!?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 %description @@ -67,7 +67,7 @@ programs with libsvm in Java. %build -make all DESTDIR=%{_builddir} LIBDIR=%{_libdir} +make all CFLAGS="$RPM_OPT_FLAGS" PYTHON_VERSION="%{pyver}" %{__sed} -i 's/\r//' FAQ.html mv python/README python/README-Python mv tools/README tools/README-Tools @@ -76,18 +76,13 @@ cp README java/README-Java %install rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} -#This is required for rpmbuild -#/sbin/ldconfig -n %{_libdir} +make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} PYTHON_VERSION="%{pyver}" +rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/src -%post -/sbin/ldconfig -n %{_libdir} +%post -p /sbin/ldconfig -%postun -if [ "$1" = "0" ]; then - /sbin/ldconfig -fi +%postun -p /sbin/ldconfig %clean rm -rf $RPM_BUILD_ROOT @@ -101,8 +96,6 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/svm-train %dir %{_datadir}/%{name} %{_datadir}/%{name}/examples -#%dir %{_libdir}/%{name} -#%{_libdir}/%{name}/%{name}.so.%{version} %{_libdir}/%{name}.so.%{version} %{_libdir}/%{name}.so.%{libsvm_ver_major} @@ -111,9 +104,6 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %doc README %{_includedir}/%{name}/ -#including source for developeer -%{_datadir}/%{name}/src -#%{_libdir}/%{name}/%{name}.so %{_libdir}/%{name}.so %files python @@ -128,6 +118,10 @@ rm -rf $RPM_BUILD_ROOT #%{_datadir}/javadoc/%{name}-%{version} %changelog +* 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 From 085b892bddea18447f9cb45547b910a5ac6e1bc9 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Mon, 4 Feb 2008 08:13:47 +0000 Subject: [PATCH 012/136] Upgrade to 2.85, add svm-toy-gtk, svm-toy-qt --- .cvsignore | 3 +- libsvm-2.84.patch => libsvm-2.85.patch | 243 ++++++++++++++++--------- libsvm.spec | 84 +++++++-- ChangeLog => log | 12 +- sources | 3 +- 5 files changed, 242 insertions(+), 103 deletions(-) rename libsvm-2.84.patch => libsvm-2.85.patch (60%) rename ChangeLog => log (89%) diff --git a/.cvsignore b/.cvsignore index 9161481..9708a72 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1,2 @@ -libsvm-2.84.tar.gz +guide.pdf +libsvm-2.85.tar.gz diff --git a/libsvm-2.84.patch b/libsvm-2.85.patch similarity index 60% rename from libsvm-2.84.patch rename to libsvm-2.85.patch index 8347e43..351f2ee 100644 --- a/libsvm-2.84.patch +++ b/libsvm-2.85.patch @@ -1,6 +1,6 @@ diff -up ./java/test_applet.html.orig ./java/test_applet.html ---- ./java/test_applet.html.orig 2008-01-02 09:37:14.000000000 +1000 -+++ ./java/test_applet.html 2008-01-02 09:43:19.000000000 +1000 +--- ./java/test_applet.html.orig 2008-02-04 10:11:00.000000000 +1000 ++++ ./java/test_applet.html 2008-02-04 10:13:02.000000000 +1000 @@ -1 +1,3 @@ - + @@ -8,8 +8,8 @@ diff -up ./java/test_applet.html.orig ./java/test_applet.html + diff -up ./java/svm_train.java.orig ./java/svm_train.java diff -up ./java/libsvm/svm_parameter.java.orig ./java/libsvm/svm_parameter.java ---- ./java/libsvm/svm_parameter.java.orig 2006-03-04 01:44:14.000000000 +1000 -+++ ./java/libsvm/svm_parameter.java 2008-01-02 09:43:19.000000000 +1000 +--- ./java/libsvm/svm_parameter.java.orig 2007-11-06 23:32:49.000000000 +1000 ++++ ./java/libsvm/svm_parameter.java 2008-02-04 10:13:02.000000000 +1000 @@ -1,6 +1,7 @@ package libsvm; public class svm_parameter implements Cloneable,java.io.Serializable @@ -19,8 +19,8 @@ diff -up ./java/libsvm/svm_parameter.java.orig ./java/libsvm/svm_parameter.java public static final int C_SVC = 0; public static final int NU_SVC = 1; diff -up ./java/libsvm/svm_problem.java.orig ./java/libsvm/svm_problem.java ---- ./java/libsvm/svm_problem.java.orig 2003-10-11 22:30:47.000000000 +1000 -+++ ./java/libsvm/svm_problem.java 2008-01-02 09:43:19.000000000 +1000 +--- ./java/libsvm/svm_problem.java.orig 2007-11-06 23:32:49.000000000 +1000 ++++ ./java/libsvm/svm_problem.java 2008-02-04 10:13:02.000000000 +1000 @@ -1,6 +1,7 @@ package libsvm; public class svm_problem implements java.io.Serializable @@ -30,8 +30,8 @@ diff -up ./java/libsvm/svm_problem.java.orig ./java/libsvm/svm_problem.java public double[] y; public svm_node[][] x; diff -up ./java/libsvm/svm_node.java.orig ./java/libsvm/svm_node.java ---- ./java/libsvm/svm_node.java.orig 2003-10-11 22:30:47.000000000 +1000 -+++ ./java/libsvm/svm_node.java 2008-01-02 09:43:19.000000000 +1000 +--- ./java/libsvm/svm_node.java.orig 2007-11-06 23:32:49.000000000 +1000 ++++ ./java/libsvm/svm_node.java 2008-02-04 10:13:02.000000000 +1000 @@ -1,6 +1,7 @@ package libsvm; public class svm_node implements java.io.Serializable @@ -41,8 +41,8 @@ diff -up ./java/libsvm/svm_node.java.orig ./java/libsvm/svm_node.java public double value; } diff -up ./java/libsvm/svm_model.java.orig ./java/libsvm/svm_model.java ---- ./java/libsvm/svm_model.java.orig 2007-01-13 08:23:39.000000000 +1000 -+++ ./java/libsvm/svm_model.java 2008-01-02 09:43:19.000000000 +1000 +--- ./java/libsvm/svm_model.java.orig 2007-11-06 23:32:49.000000000 +1000 ++++ ./java/libsvm/svm_model.java 2008-02-04 10:13:02.000000000 +1000 @@ -4,6 +4,7 @@ package libsvm; public class svm_model implements java.io.Serializable @@ -53,36 +53,37 @@ diff -up ./java/libsvm/svm_model.java.orig ./java/libsvm/svm_model.java int l; // total #SV diff -up ./java/libsvm/svm.java.orig ./java/libsvm/svm.java diff -up ./java/Makefile.orig ./java/Makefile ---- ./java/Makefile.orig 2008-01-02 09:32:55.000000000 +1000 -+++ ./java/Makefile 2008-01-02 09:43:19.000000000 +1000 -@@ -1,15 +1,18 @@ - .SUFFIXES: .class .java --FILES = libsvm/svm.class libsvm/svm_model.class libsvm/svm_node.class \ -- libsvm/svm_parameter.class libsvm/svm_problem.class \ -+FILES = libsvm/svm_node.class libsvm/svm_parameter.class \ -+ libsvm/svm_model.class libsvm/svm_problem.class libsvm/svm.class\ +--- ./java/Makefile.orig 2007-11-06 23:32:49.000000000 +1000 ++++ ./java/Makefile 2008-02-04 14:26:38.000000000 +1000 +@@ -3,13 +3,22 @@ FILES = libsvm/svm.class libsvm/svm_mode + libsvm/svm_parameter.class libsvm/svm_problem.class \ svm_train.class svm_predict.class svm_toy.class -#JAVAC = jikes --#JAVAC_FLAGS = -target 1.1 -source 1.3 +-JAVAC_FLAGS = -target 1.5 -source 1.5 -JAVAC = javac --JAVAC_FLAGS = +-# JAVAC_FLAGS = +JAVA_TARGETDIR=${INSTDIR}/share/libsvm/java +JAVA_DOCDIR=${INSTDIR}/share/javadoc/libsvm-${LIBSVM_VER} -+JAVAC = ecj -+#JAVAC_FLAGS = -target 1.3 -source 1.3 +CLASSPATH = . -+#JAVAC_FLAGS = --classpath=${CLASSPATH} -+JAVAC_FLAGS = -classpath ${CLASSPATH} ++JAVAC_FLAGS = -target 1.5 -source 1.5 -classpath ${CLASSPATH} ++ ++ifndef JAVAC ++JAVAC=javac ++endif ++ ++ifndef JAR ++JAR=jar ++endif ++ --all: $(FILES) + all: $(FILES) - jar cvf libsvm.jar *.class libsvm/*.class -+all: $(FILES) -+ gjar cvf libsvm.jar *.class libsvm/*.class ++ ${JAR} cvf libsvm.jar *.class libsvm/*.class .java.class: $(JAVAC) $(JAVAC_FLAGS) $< -@@ -17,8 +20,22 @@ all: $(FILES) +@@ -17,8 +26,22 @@ all: $(FILES) libsvm/svm.java: libsvm/svm.m4 m4 libsvm/svm.m4 > libsvm/svm.java @@ -106,8 +107,8 @@ diff -up ./java/Makefile.orig ./java/Makefile dist: clean all rm *.class libsvm/*.class diff -up ./java/svm_toy.java.orig ./java/svm_toy.java ---- ./java/svm_toy.java.orig 2006-03-04 17:40:11.000000000 +1000 -+++ ./java/svm_toy.java 2008-01-02 09:43:19.000000000 +1000 +--- ./java/svm_toy.java.orig 2007-11-06 23:32:49.000000000 +1000 ++++ ./java/svm_toy.java 2008-02-04 10:13:02.000000000 +1000 @@ -6,7 +6,7 @@ import java.awt.event.*; import java.io.*; @@ -129,9 +130,9 @@ diff -up ./java/svm_predict.java.orig ./java/svm_predict.java diff -up ./python/cross_validation.py.orig ./python/cross_validation.py diff -up ./python/svm_test.py.orig ./python/svm_test.py diff -up ./python/Makefile.orig ./python/Makefile ---- ./python/Makefile.orig 2008-01-02 09:38:18.000000000 +1000 -+++ ./python/Makefile 2008-01-02 11:26:08.000000000 +1000 -@@ -2,9 +2,16 @@ CC = g++ +--- ./python/Makefile.orig 2007-11-06 23:32:49.000000000 +1000 ++++ ./python/Makefile 2008-02-04 16:49:05.000000000 +1000 +@@ -2,9 +2,16 @@ CXX? = g++ SWIG ?= swig #Windows: see ../README ../Makefile.win @@ -150,22 +151,22 @@ diff -up ./python/Makefile.orig ./python/Makefile LDFLAGS = -shared # Mac OS # LDFLAGS = -framework Python -bundle -@@ -15,16 +22,35 @@ svmc.so: svmc_wrap.o svm.o - $(CC) $(LDFLAGS) -o svmc.so svmc_wrap.o svm.o +@@ -15,16 +22,34 @@ 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 -- $(CC) $(CFLAGS) -fPIC -c svmc_wrap.c -+ echo "PYTHON_VERSION=${PYTHON_VERSION}" -+ echo "CFLAGS=${CFLAGS}" -+ echo "CFLAGS_PYTHON=${CFLAGS_PYTHON}" -+ $(CC) $(CFLAGS_PYTHON) -fPIC -c svmc_wrap.c +- $(CXX) $(CFLAGS) -fPIC -c svmc_wrap.c ++# echo "PYTHON_VERSION=${PYTHON_VERSION}" ++# echo "CFLAGS=${CFLAGS}" ++# echo "CFLAGS_PYTHON=${CFLAGS_PYTHON}" ++ $(CXX) $(CFLAGS_PYTHON) -fPIC -c svmc_wrap.c svmc_wrap.c: svmc.i $(SWIG) -python -noproxy svmc.i svm.o: ../svm.cpp ../svm.h -- $(CC) $(CFLAGS) -fPIC -c ../svm.cpp -+ $(CC) $(CFLAGS_PYTHON) -fPIC -c ../svm.cpp +- $(CXX) $(CFLAGS) -fPIC -c ../svm.cpp ++ $(CXX) $(CFLAGS_PYTHON) -fPIC -c ../svm.cpp clean: rm -f *~ *.o *.so *.pyc *.pyo svm.o @@ -173,6 +174,7 @@ diff -up ./python/Makefile.orig ./python/Makefile moreclean: clean rm -f svmc_wrap.c + ++ +install: all + mkdir -p ${PYTHON_TARGETDIR} + install -m 755 cross_validation.py ${PYTHON_TARGETDIR} @@ -186,23 +188,22 @@ diff -up ./python/Makefile.orig ./python/Makefile +uninstall: + rm -fr ${LIBDIR}/python${PYTHON_VERSION}/site-packages/libsvm + -+ -+ diff -up ./python/test_cross_validation.py.orig ./python/test_cross_validation.py diff -up ./python/svm.py.orig ./python/svm.py diff -up ./tools/subset.py.orig ./tools/subset.py +diff -up ./tools/checkdata.py.orig ./tools/checkdata.py diff -up ./tools/easy.py.orig ./tools/easy.py ---- ./tools/easy.py.orig 2004-06-26 23:42:52.000000000 +1000 -+++ ./tools/easy.py 2008-01-03 11:31:31.000000000 +1000 +--- ./tools/easy.py.orig 2007-11-06 23:32:49.000000000 +1000 ++++ ./tools/easy.py 2008-02-04 10:23:49.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: - print 'Usage: %s training_file [testing_file]' % sys.argv[0] -@@ -11,10 +12,10 @@ if len(sys.argv) <= 1: +@@ -12,10 +13,10 @@ if len(sys.argv) <= 1: is_win32 = (sys.platform == 'win32') if not is_win32: @@ -218,9 +219,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 2006-11-30 03:24:59.000000000 +1000 -+++ ./tools/grid.py 2008-01-03 13:03:06.000000000 +1000 -@@ -11,7 +11,7 @@ from string import find, split, join, at +--- ./tools/grid.py.orig 2007-11-06 23:32:49.000000000 +1000 ++++ ./tools/grid.py 2008-02-04 10:13:02.000000000 +1000 +@@ -11,7 +11,7 @@ from subprocess import * is_win32 = (sys.platform == 'win32') if not is_win32: @@ -238,15 +239,15 @@ diff -up ./tools/grid.py.orig ./tools/grid.py assert os.path.exists(gnuplot_exe),"gnuplot executable not found" assert os.path.exists(dataset_pathname),"dataset not found" diff -up ./Makefile.orig ./Makefile ---- ./Makefile.orig 2008-01-02 09:36:22.000000000 +1000 -+++ ./Makefile 2008-01-02 09:43:19.000000000 +1000 -@@ -1,8 +1,41 @@ - CXXC = g++ +--- ./Makefile.orig 2007-11-06 23:32:49.000000000 +1000 ++++ ./Makefile 2008-02-04 17:22:47.000000000 +1000 +@@ -1,8 +1,46 @@ + CXX? = g++ CFLAGS = -Wall -O3 +MAKE = make +LIBSVM_VER_MAJOR=2 -+LIBSVM_VER_MINOR=84 -+LIBSVM_VER =${LIBSVM_VER_MAJOR}.${LIBSVM_VER_MINOR} ++LIBSVM_VER_MINOR=85 ++LIBSVM_VER=${LIBSVM_VER_MAJOR}.${LIBSVM_VER_MINOR} +export LIBSVM_VER -all: svm-train svm-predict svm-scale @@ -271,42 +272,51 @@ diff -up ./Makefile.orig ./Makefile +LIB_INSTDIR=${INSTDIR}/..${LIBDIR} +endif + ++ifndef LIBDIR ++LIBDIR=/usr/lib${X86_64} ++endif ++ ++export LIBDIR +export LIB_INSTDIR + -+all: svm-train svm-predict svm-scale svm-python svm-java svm-lib ++all: svm-train svm-predict svm-scale svm-python svm-java svm-lib svm-toy-gtk svm-toy-qt + +svm-lib: svm-share.o -+ $(CXXC) -shared -Wl,-soname,libsvm.so.${LIBSVM_VER_MAJOR}\ ++ $(CXX) -shared -Wl,-soname,libsvm.so.${LIBSVM_VER_MAJOR}\ + -o libsvm.so.${LIBSVM_VER} svm-share.o -lm +svm-share.o: svm.cpp svm.h -+ $(CXXC) -g -fPIC $(CFLAGS) -c svm.cpp -o svm-share.o ++ $(CXX) -g -fPIC $(CFLAGS) -c svm.cpp -o svm-share.o svm-predict: svm-predict.c svm.o - $(CXXC) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm + $(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm svm-train: svm-train.c svm.o -@@ -11,5 +44,61 @@ svm-scale: svm-scale.c - $(CXXC) $(CFLAGS) svm-scale.c -o svm-scale +@@ -12,4 +50,61 @@ svm-scale: svm-scale.c svm.o: svm.cpp svm.h - $(CXXC) $(CFLAGS) -c svm.cpp + $(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: + ${MAKE} -C java -+ ++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}/libsvm ++ mkdir -p ${LIB_INSTDIR}/libsvm + mkdir -p ${LIB_INSTDIR} -+# install -m 755 libsvm.so.${LIBSVM_VER} ${LIB_INSTDIR}/libsvm -+ install -m 755 libsvm.so.${LIBSVM_VER} ${LIB_INSTDIR} ++ install -m 755 libsvm.so.${LIBSVM_VER} ${LIB_INSTDIR}/libsvm +# cd ${LIB_INSTDIR}/libsvm; ln -fs libsvm.so.${LIBSVM_VER_MAJOR} libsvm.so -+# cd ${LIB_INSTDIR}; ln -fs libsvm.so.${LIBSVM_VER} libsvm.so.${LIBSVM_VER_MAJOR} ;ln -fs libsvm.so.${LIBSVM_VER_MAJOR} libsvm.so -+ /sbin/ldconfig -n ${LIB_INSTDIR} -+ cd ${LIB_INSTDIR}; ln -fs libsvm.so.${LIBSVM_VER_MAJOR} libsvm.so ++ /sbin/ldconfig -n ${LIB_INSTDIR}/libsvm/ +# install package libsvm-devel -+# install -m 644 svm.o ${LIB_INSTDIR}/libsvm + mkdir -p ${INSTDIR}/include/libsvm + install -m 644 svm.h ${INSTDIR}/include/libsvm + mkdir -p ${INSTDIR}/share/libsvm/src/java/libsvm @@ -318,16 +328,16 @@ diff -up ./Makefile.orig ./Makefile + 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 -+# cp -R java ${INSTDIR}/share/libsvm/src -+# cp -R svm-toy ${INSTDIR}/share/libsvm/src -+# cp -R tools ${INSTDIR}/share/libsvm/src -+# cp -R windows ${INSTDIR}/share/libsvm/src -+ mkdir -p ${INSTDIR}/share/libsvm/examples -+ install -m 644 heart_scale ${INSTDIR}/share/libsvm/examples +# install package libsvm-python + ${MAKE} -C python install ++# install package libsvm-java + ${MAKE} -C java 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 @@ -339,10 +349,77 @@ diff -up ./Makefile.orig ./Makefile + rm -fr ${INSTDIR}/libsvm + ${MAKE} -C python uninstall + ${MAKE} -C java uninstall ++ rm -f ${INSTDIR}/bin/svm-toy-gtk ++ rm -f ${INSTDIR}/bin/svm-toy-qt + - clean: - rm -f *~ svm.o svm-train svm-predict svm-scale -+ ${MAKE} -C python clean -+ ${MAKE} -C java clean +diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile +--- ./svm-toy/qt/Makefile.orig 2008-02-04 15:59:51.000000000 +1000 ++++ ./svm-toy/qt/Makefile 2008-02-04 17:19:43.000000000 +1000 +@@ -1,5 +1,6 @@ + CXX? = g++ + CFLAGS = -Wall -O3 -DQT_THREAD_SUPPORT ++QTDIR = $(LIBDIR)/qt-3.3 + BIN = $(QTDIR)/bin + INCLUDE = $(QTDIR)/include + LIB = $(QTDIR)/lib +@@ -7,13 +8,17 @@ LIB = $(QTDIR)/lib + #INCLUDE = /usr/include/qt3 + #LIB = /usr/lib/qt3 + +-svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o +- $(CXX) -I$(INCLUDE) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy -L$(LIB) -lqt-mt ++all: svm-toy-qt + ++svm-toy-qt: svm-toy.cpp svm-toy.moc ../../svm.o ++ $(CXX) -I$(INCLUDE) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy-qt -L$(LIB) -lqt-mt + # add -pthread for bsd + + svm-toy.moc: svm-toy.cpp ++ echo "LIBDIR=${LIBDIR}" ++ echo "QTDIR=${QTDIR}" + $(BIN)/moc svm-toy.cpp -o svm-toy.moc +-../../svm.o: +- cd ../..; make svm.o ++#../../svm.o: ++# cd ../..; make svm.o + clean: + rm -f *~ svm-toy svm-toy.moc ../../svm.o diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile +--- ./svm-toy/gtk/Makefile.orig 2008-02-04 15:44:19.000000000 +1000 ++++ ./svm-toy/gtk/Makefile 2008-02-04 17:19:37.000000000 +1000 +@@ -1,22 +1,25 @@ + CC? = gcc + CXX? = g++ +-CFLAGS = -Wall -O3 -g `gtk-config --cflags` +-LIBS = `gtk-config --libs` ++#CFLAGS = -Wall -O3 -g `gtk-config --cflags` ++#LIBS = `gtk-config --libs` ++COPT = `pkg-config --cflags --libs gtk+-2.0` + +-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 ../../svm.o ++ $(CXX) $(COPT) main.o interface.o callbacks.o ../../svm.o -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 main.o interface.o callbacks.o diff --git a/libsvm.spec b/libsvm.spec index b79a093..1bd43d4 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm -Version: 2.84 -Release: 9%{?dist} +Version: 2.85 +Release: 0%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -8,17 +8,20 @@ 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: ChangeLog -#Source1: http://www.csie.ntu.edu.tw/~cjlin/libsvm/log +Source1: http://www.csie.ntu.edu.tw/~cjlin/libsvm/log +Source2: http://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf Patch0: %{name}-%{version}.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root -#BuildRequires: glibc-devel %define libsvm_ver_major 2 -%{!?pyver: %define pyver %(python -c 'import sys; print(sys.version[0:3])')}%{!?pyver: %define pyver %(python -c 'import sys; print(sys.version[0:3])')} +%{!?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 + %description LIBSVM is an integrated software for support vector classification, @@ -51,8 +54,9 @@ programs with libsvm in Python. %package java Summary: Java tools and interfaces for libsvm Group: Development/Libraries -BuildRequires: eclipse-ecj >= 3 -Requires: eclipse-ecj >= 3 +BuildRequires: java-1.5.0-gcj-devel >= 1.5.0.0 +#Client doesn't necessory use gcj +#Requires: java-1.5.0-gcj >= 1.5.0.0 Requires: %{name} = %{version}-%{release} %description java @@ -60,29 +64,58 @@ Java tools and interfaces for libsvm. Install this package if you want to develop programs with libsvm in Java. +%package svm-toy-gtk +Summary: GTK version of svm-toy (libsvm demostration program) +Group: Development/Libraries +BuildRequires: gtk2-devel +BuildRequires: 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: qt-devel +BuildRequires: qt +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 +%setup -q %patch0 -p0 -b .bak +cp ../../SOURCES/log ChangeLog +cp ../../SOURCES/guide.pdf . %build -make all CFLAGS="$RPM_OPT_FLAGS" PYTHON_VERSION="%{pyver}" +make all CFLAGS="$RPM_OPT_FLAGS" PYTHON_VERSION="%{pyver}" JAVAC="%{javac}" JAR="%{jar}" %{__sed} -i 's/\r//' FAQ.html +%{__sed} -i 's/\r//' ChangeLog 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}" +#cd ${RPM_BUILD_ROOT}%{libdir_libsvm}; ln -sf %{name}.so.%{version} %{name}.so rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/src -%post -p /sbin/ldconfig +%post +/sbin/ldconfig %{libdir_libsvm} -%postun -p /sbin/ldconfig +%postun +/sbin/ldconfig %{libdir_libsvm} %clean rm -rf $RPM_BUILD_ROOT @@ -90,21 +123,22 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) -%doc COPYRIGHT FAQ.html +%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.%{version} -%{_libdir}/%{name}.so.%{libsvm_ver_major} +%dir %{libdir_libsvm} +%{libdir_libsvm}/%{name}.so.%{version} +%{libdir_libsvm}/%{name}.so.%{libsvm_ver_major} %files devel %defattr(-,root,root,-) %doc README %{_includedir}/%{name}/ -%{_libdir}/%{name}.so +#%{libdir_libsvm}/%{name}.so %files python %defattr(-,root,root,-) @@ -117,7 +151,25 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/%{name}/java #%{_datadir}/javadoc/%{name}-%{version} +%files svm-toy-gtk +%defattr(-,root,root,-) +%doc svm-toy/gtk/README +%{_bindir}/svm-toy-gtk + +%files svm-toy-qt +%defattr(-,root,root,-) +%doc svm-toy/qt/README +%{_bindir}/svm-toy-qt + + %changelog +* 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 diff --git a/ChangeLog b/log similarity index 89% rename from ChangeLog rename to log index d0f9c71..75df634 100644 --- a/ChangeLog +++ b/log @@ -123,5 +123,13 @@ file updated. Modify do_shrinking() so variable names are the same as libsvm document -2.85: 2007/11/? - fix minor memory leak in svm-predict.c \ No newline at end of file +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 \ No newline at end of file diff --git a/sources b/sources index 502194e..03692b7 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -a7bd21b21510e9634950715c2b4a4ce9 libsvm-2.84.tar.gz +aae7a8f7e357e86e1c893b706bb02a63 guide.pdf +c839d919cc6fa7b5ad86ea37b7cebcc3 libsvm-2.85.tar.gz From 95d9efdf40837cff38688cdba2ac6e1126f417c9 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Mon, 4 Feb 2008 23:46:32 +0000 Subject: [PATCH 013/136] Fix build error --- libsvm-2.85.patch | 21 +++++++++++++++------ libsvm.spec | 5 ++++- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/libsvm-2.85.patch b/libsvm-2.85.patch index 351f2ee..d5ee41c 100644 --- a/libsvm-2.85.patch +++ b/libsvm-2.85.patch @@ -131,7 +131,7 @@ diff -up ./python/cross_validation.py.orig ./python/cross_validation.py diff -up ./python/svm_test.py.orig ./python/svm_test.py diff -up ./python/Makefile.orig ./python/Makefile --- ./python/Makefile.orig 2007-11-06 23:32:49.000000000 +1000 -+++ ./python/Makefile 2008-02-04 16:49:05.000000000 +1000 ++++ ./python/Makefile 2008-02-05 09:37:16.000000000 +1000 @@ -2,9 +2,16 @@ CXX? = g++ SWIG ?= swig @@ -386,7 +386,7 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile rm -f *~ svm-toy svm-toy.moc ../../svm.o diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile --- ./svm-toy/gtk/Makefile.orig 2008-02-04 15:44:19.000000000 +1000 -+++ ./svm-toy/gtk/Makefile 2008-02-04 17:19:37.000000000 +1000 ++++ ./svm-toy/gtk/Makefile 2008-02-05 09:33:08.000000000 +1000 @@ -1,22 +1,25 @@ CC? = gcc CXX? = g++ @@ -415,11 +415,20 @@ diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile - $(CXX) $(CFLAGS) -c callbacks.cpp + $(CXX) $(COPT) -c callbacks.cpp --../../svm.o: -- cd ../..; make svm.o -+#../../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 main.o interface.o callbacks.o +diff -up ./svm-toy/gtk/callbacks.cpp.orig ./svm-toy/gtk/callbacks.cpp +--- ./svm-toy/gtk/callbacks.cpp.orig 2008-02-05 09:43:28.000000000 +1000 ++++ ./svm-toy/gtk/callbacks.cpp 2008-02-05 09:43:42.000000000 +1000 +@@ -2,6 +2,7 @@ + #include + #include + #include ++#include + #include "callbacks.h" + #include "interface.h" + #include "../../svm.h" diff --git a/libsvm.spec b/libsvm.spec index 1bd43d4..224bea8 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.85 -Release: 0%{?dist} +Release: 1%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -163,6 +163,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Feb 04 2008 Ding-Yi Chen - 2.85-1 +- Fix build error + * Mon Feb 04 2008 Ding-Yi Chen - 2.85-0 - Upgrade to 2.85 - Include guide.pdf in main package From fe7c948b650ab926cfe77b3cc38e489f17599fbb Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 5 Feb 2008 01:07:17 +0000 Subject: [PATCH 014/136] Fix svm-toy-gt build error --- libsvm-2.85.patch | 17 ++++++----------- libsvm.spec | 13 ++++++++----- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/libsvm-2.85.patch b/libsvm-2.85.patch index d5ee41c..0e58eee 100644 --- a/libsvm-2.85.patch +++ b/libsvm-2.85.patch @@ -240,8 +240,8 @@ diff -up ./tools/grid.py.orig ./tools/grid.py assert os.path.exists(dataset_pathname),"dataset not found" diff -up ./Makefile.orig ./Makefile --- ./Makefile.orig 2007-11-06 23:32:49.000000000 +1000 -+++ ./Makefile 2008-02-04 17:22:47.000000000 +1000 -@@ -1,8 +1,46 @@ ++++ ./Makefile 2008-02-05 11:00:21.000000000 +1000 +@@ -1,8 +1,41 @@ CXX? = g++ CFLAGS = -Wall -O3 +MAKE = make @@ -259,21 +259,16 @@ diff -up ./Makefile.orig ./Makefile +export INSTDIR + -+PROCESSOR=$(shell /bin/uname -p) -+ifeq "${PROCESSOR}" "x86_64" -+X86_64=64 -+else -+X86_64= -+endif ++IS_64=$(shell /bin/uname -i | awk '/64/ {print 64}') + +ifndef LIBDIR -+LIB_INSTDIR=${INSTDIR}/lib${X86_64} ++LIB_INSTDIR=${INSTDIR}/lib${IS_64} +else +LIB_INSTDIR=${INSTDIR}/..${LIBDIR} +endif + +ifndef LIBDIR -+LIBDIR=/usr/lib${X86_64} ++LIBDIR=/usr/lib${IS_64} +endif + +export LIBDIR @@ -289,7 +284,7 @@ diff -up ./Makefile.orig ./Makefile svm-predict: svm-predict.c svm.o $(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm svm-train: svm-train.c svm.o -@@ -12,4 +50,61 @@ svm-scale: svm-scale.c +@@ -12,4 +45,61 @@ svm-scale: svm-scale.c svm.o: svm.cpp svm.h $(CXX) $(CFLAGS) -c svm.cpp clean: diff --git a/libsvm.spec b/libsvm.spec index 224bea8..f199549 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.85 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -31,7 +31,7 @@ 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 +BuildRequires: glibc-devel gawk Requires: %{name} = %{version}-%{release} %description devel @@ -94,7 +94,7 @@ cp ../../SOURCES/guide.pdf . %build -make all CFLAGS="$RPM_OPT_FLAGS" PYTHON_VERSION="%{pyver}" JAVAC="%{javac}" JAR="%{jar}" +make all CFLAGS="$RPM_OPT_FLAGS" PYTHON_VERSION="%{pyver}" JAVAC="%{javac}" JAR="%{jar}" LIBDIR=%{_libdir} %{__sed} -i 's/\r//' FAQ.html %{__sed} -i 's/\r//' ChangeLog mv python/README python/README-Python @@ -163,8 +163,11 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Mon Feb 04 2008 Ding-Yi Chen - 2.85-1 -- Fix build error +* 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 From 7e0dcdf9f11191bdbca265f89f44bb46ad654428 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 7 Feb 2008 04:07:39 +0000 Subject: [PATCH 015/136] Fix linking problems --- libsvm-2.85.patch | 77 ++++++++++++++++++++++++++++++----------------- libsvm.spec | 19 ++++++------ 2 files changed, 60 insertions(+), 36 deletions(-) diff --git a/libsvm-2.85.patch b/libsvm-2.85.patch index 0e58eee..dc68a3d 100644 --- a/libsvm-2.85.patch +++ b/libsvm-2.85.patch @@ -240,23 +240,34 @@ diff -up ./tools/grid.py.orig ./tools/grid.py assert os.path.exists(dataset_pathname),"dataset not found" diff -up ./Makefile.orig ./Makefile --- ./Makefile.orig 2007-11-06 23:32:49.000000000 +1000 -+++ ./Makefile 2008-02-05 11:00:21.000000000 +1000 -@@ -1,8 +1,41 @@ ++++ ./Makefile 2008-02-06 15:12:25.000000000 +1000 +@@ -1,15 +1,111 @@ CXX? = g++ CFLAGS = -Wall -O3 +MAKE = make +LIBSVM_VER_MAJOR=2 +LIBSVM_VER_MINOR=85 +LIBSVM_VER=${LIBSVM_VER_MAJOR}.${LIBSVM_VER_MINOR} -+export LIBSVM_VER ++DOT_LIBS=.libs ++LIBS= -L${DOT_LIBS} -lsvm -all: svm-train svm-predict svm-scale ++export LIBSVM_VER + +-svm-predict: svm-predict.c svm.o +- $(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm +-svm-train: svm-train.c svm.o +- $(CXX) $(CFLAGS) svm-train.c svm.o -o svm-train -lm +-svm-scale: svm-scale.c +- $(CXX) $(CFLAGS) svm-scale.c -o svm-scale +-svm.o: svm.cpp svm.h +- $(CXX) $(CFLAGS) -c svm.cpp +ifndef DESTDIR +INSTDIR=/usr +else +INSTDIR=${DESTDIR}/usr +endif - ++ +export INSTDIR + +IS_64=$(shell /bin/uname -i | awk '/64/ {print 64}') @@ -276,17 +287,23 @@ diff -up ./Makefile.orig ./Makefile + +all: svm-train svm-predict svm-scale svm-python svm-java svm-lib svm-toy-gtk svm-toy-qt + -+svm-lib: svm-share.o ++svm-lib: %{DOT_LIBS}/libsvm.so ++ ++%{DOT_LIBS}/libsvm.so: svm-share.o + $(CXX) -shared -Wl,-soname,libsvm.so.${LIBSVM_VER_MAJOR}\ + -o libsvm.so.${LIBSVM_VER} svm-share.o -lm ++ mkdir -p .libs ++ cd ${DOT_LIBS}; ln -sf ../libsvm.so.${LIBSVM_VER} libsvm.so +svm-share.o: svm.cpp svm.h + $(CXX) -g -fPIC $(CFLAGS) -c svm.cpp -o svm-share.o - svm-predict: svm-predict.c svm.o - $(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm - svm-train: svm-train.c svm.o -@@ -12,4 +45,61 @@ svm-scale: svm-scale.c - svm.o: svm.cpp svm.h - $(CXX) $(CFLAGS) -c svm.cpp ++svm-predict: svm-predict.c %{DOT_LIBS}/libsvm.so ++ $(CXX) $(CFLAGS) svm-predict.c -o svm-predict $(LIBS) -lm ++svm-train: svm-train.c %{DOT_LIBS}/libsvm.so ++ $(CXX) $(CFLAGS) svm-train.c -o svm-train $(LIBS) -lm ++svm-scale: svm-scale.c %{DOT_LIBS}/libsvm.so ++ $(CXX) $(CFLAGS) svm-scale.c -o svm-scale $(LIBS) ++#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 @@ -306,11 +323,10 @@ diff -up ./Makefile.orig ./Makefile + 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}/libsvm + mkdir -p ${LIB_INSTDIR} -+ install -m 755 libsvm.so.${LIBSVM_VER} ${LIB_INSTDIR}/libsvm -+# cd ${LIB_INSTDIR}/libsvm; ln -fs libsvm.so.${LIBSVM_VER_MAJOR} libsvm.so -+ /sbin/ldconfig -n ${LIB_INSTDIR}/libsvm/ ++ install -m 755 libsvm.so.${LIBSVM_VER} ${LIB_INSTDIR} ++ /sbin/ldconfig -n ${LIB_INSTDIR} ++ cd ${LIB_INSTDIR}; ln -fs libsvm.so.${LIBSVM_VER_MAJOR} libsvm.so +# install package libsvm-devel + mkdir -p ${INSTDIR}/include/libsvm + install -m 644 svm.h ${INSTDIR}/include/libsvm @@ -349,24 +365,26 @@ diff -up ./Makefile.orig ./Makefile + diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile --- ./svm-toy/qt/Makefile.orig 2008-02-04 15:59:51.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2008-02-04 17:19:43.000000000 +1000 -@@ -1,5 +1,6 @@ ++++ ./svm-toy/qt/Makefile 2008-02-06 15:08:55.000000000 +1000 +@@ -1,19 +1,23 @@ CXX? = g++ CFLAGS = -Wall -O3 -DQT_THREAD_SUPPORT +QTDIR = $(LIBDIR)/qt-3.3 BIN = $(QTDIR)/bin INCLUDE = $(QTDIR)/include LIB = $(QTDIR)/lib -@@ -7,13 +8,17 @@ LIB = $(QTDIR)/lib - #INCLUDE = /usr/include/qt3 - #LIB = /usr/lib/qt3 +-#BIN = /usr/bin +-#INCLUDE = /usr/include/qt3 +-#LIB = /usr/lib/qt3 ++DOT_LIBS=../../.libs ++LIBS= -L${DOT_LIBS} -lsvm -svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o - $(CXX) -I$(INCLUDE) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy -L$(LIB) -lqt-mt +all: svm-toy-qt + +svm-toy-qt: svm-toy.cpp svm-toy.moc ../../svm.o -+ $(CXX) -I$(INCLUDE) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy-qt -L$(LIB) -lqt-mt ++ $(CXX) -I$(INCLUDE) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy-qt -L$(LIB) $(LIBS) -lqt-mt # add -pthread for bsd svm-toy.moc: svm-toy.cpp @@ -381,8 +399,8 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile rm -f *~ svm-toy svm-toy.moc ../../svm.o diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile --- ./svm-toy/gtk/Makefile.orig 2008-02-04 15:44:19.000000000 +1000 -+++ ./svm-toy/gtk/Makefile 2008-02-05 09:33:08.000000000 +1000 -@@ -1,22 +1,25 @@ ++++ ./svm-toy/gtk/Makefile 2008-02-06 15:08:10.000000000 +1000 +@@ -1,22 +1,28 @@ CC? = gcc CXX? = g++ -CFLAGS = -Wall -O3 -g `gtk-config --cflags` @@ -390,13 +408,16 @@ diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile +#CFLAGS = -Wall -O3 -g `gtk-config --cflags` +#LIBS = `gtk-config --libs` +COPT = `pkg-config --cflags --libs gtk+-2.0` ++DOT_LIBS=../../.libs ++LIBS= -L${DOT_LIBS} -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 ../../svm.o -+ $(CXX) $(COPT) main.o interface.o callbacks.o ../../svm.o -o 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 @@ -410,8 +431,10 @@ diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile - $(CXX) $(CFLAGS) -c callbacks.cpp + $(CXX) $(COPT) -c callbacks.cpp - ../../svm.o: - cd ../..; make svm.o +-../../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 diff --git a/libsvm.spec b/libsvm.spec index f199549..d1cbfc4 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.85 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -111,11 +111,9 @@ make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} PYTHON_VERSION="%{pyver}" rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/src -%post -/sbin/ldconfig %{libdir_libsvm} +%post -p /sbin/ldconfig -%postun -/sbin/ldconfig %{libdir_libsvm} +%postun -p /sbin/ldconfig %clean rm -rf $RPM_BUILD_ROOT @@ -129,16 +127,15 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/svm-train %dir %{_datadir}/%{name} %{_datadir}/%{name}/examples -%dir %{libdir_libsvm} -%{libdir_libsvm}/%{name}.so.%{version} -%{libdir_libsvm}/%{name}.so.%{libsvm_ver_major} +%{_libdir}/%{name}.so.%{version} +%{_libdir}/%{name}.so.%{libsvm_ver_major} %files devel %defattr(-,root,root,-) %doc README %{_includedir}/%{name}/ -#%{libdir_libsvm}/%{name}.so +%{_libdir}/%{name}.so %files python %defattr(-,root,root,-) @@ -163,6 +160,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* 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 From df2773420105e807eb9b7093920917c79abace14 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Mon, 10 Mar 2008 06:08:59 +0000 Subject: [PATCH 016/136] Fix [Bug 436392] --- LibSVM-svm-toy-48.png | Bin 0 -> 566 bytes libsvm-svm-toy-gtk.desktop | 10 ++++++++ libsvm-svm-toy-qt.desktop | 10 ++++++++ libsvm.spec | 51 ++++++++++++++++++++++++++++++++++--- 4 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 LibSVM-svm-toy-48.png create mode 100644 libsvm-svm-toy-gtk.desktop create mode 100644 libsvm-svm-toy-qt.desktop 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/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..de85a40 --- /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=QT;Education;Science;Math;DataVisualization diff --git a/libsvm.spec b/libsvm.spec index d1cbfc4..cbb801b 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.85 -Release: 3%{?dist} +Release: 5%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -10,6 +10,9 @@ 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 @@ -42,9 +45,10 @@ 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 +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. @@ -69,6 +73,7 @@ Summary: GTK version of svm-toy (libsvm demostration program) Group: Development/Libraries BuildRequires: gtk2-devel BuildRequires: gtk2 +BuildRequires: desktop-file-utils Requires: %{name} = %{version}-%{release} %description svm-toy-gtk @@ -80,6 +85,7 @@ Summary: QT version of svm-toy (libsvm demostration program) Group: Development/Libraries BuildRequires: qt-devel BuildRequires: qt +BuildRequires: desktop-file-utils Requires: %{name} = %{version}-%{release} %description svm-toy-qt @@ -89,8 +95,13 @@ display the derived separating hyperplane. %prep %setup -q %patch0 -p0 -b .bak -cp ../../SOURCES/log ChangeLog -cp ../../SOURCES/guide.pdf . +cp %{SOURCE1} ChangeLog +cp %{SOURCE2} . +cp %{SOURCE3} . +cp %{SOURCE4} . +cp %{SOURCE5} libsvm-svm-toy-gtk-48.png +cp %{SOURCE5} libsvm-svm-toy-qt-48.png + %build @@ -109,12 +120,35 @@ rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} PYTHON_VERSION="%{pyver}" #cd ${RPM_BUILD_ROOT}%{libdir_libsvm}; ln -sf %{name}.so.%{version} %{name}.so rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/src +mkdir -p $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/48x48/apps/ +cp libsvm-svm-toy-gtk-48.png $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/48x48/apps/ +cp libsvm-svm-toy-qt-48.png $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/48x48/apps/ + +desktop-file-install --delete-original --vendor=fedora \ + --dir=${RPM_BUILD_ROOT}%{_datadir}/applications \ + ${RPM_BUILD_ROOT}/%{_datadir}/applications/libsvm-svm-toy-gtk.desktop \ + ${RPM_BUILD_ROOT}/%{_datadir}/applications/libsvm-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 @@ -152,14 +186,23 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %doc svm-toy/gtk/README %{_bindir}/svm-toy-gtk +%{_datadir}/icons/hicolor/48x48/apps/libsvm-svm-toy-gtk-48.png %files svm-toy-qt %defattr(-,root,root,-) %doc svm-toy/qt/README %{_bindir}/svm-toy-qt +%{_datadir}/icons/hicolor/48x48/apps/libsvm-svm-toy-qt-48.png %changelog +* Tue Feb 11 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 From de6acf6b57da5faa3bf3a31397a4da7a9ab6feac Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Mon, 10 Mar 2008 23:37:12 +0000 Subject: [PATCH 017/136] Add desktop files in install section --- libsvm-svm-toy-qt.desktop | 2 +- libsvm.spec | 28 ++++++++++++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/libsvm-svm-toy-qt.desktop b/libsvm-svm-toy-qt.desktop index de85a40..5c7fd2f 100644 --- a/libsvm-svm-toy-qt.desktop +++ b/libsvm-svm-toy-qt.desktop @@ -7,4 +7,4 @@ Icon=libsvm-svm-toy-qt-48 StartupNotify=true Terminal=false Type=Application -Categories=QT;Education;Science;Math;DataVisualization +Categories=KDE;Education;Science;Math;DataVisualization diff --git a/libsvm.spec b/libsvm.spec index cbb801b..5a8ea06 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.85 -Release: 5%{?dist} +Release: 6%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -99,8 +99,8 @@ cp %{SOURCE1} ChangeLog cp %{SOURCE2} . cp %{SOURCE3} . cp %{SOURCE4} . -cp %{SOURCE5} libsvm-svm-toy-gtk-48.png -cp %{SOURCE5} libsvm-svm-toy-qt-48.png +cp %{SOURCE5} %{name}-svm-toy-gtk-48.png +cp %{SOURCE5} %{name}-svm-toy-qt-48.png @@ -121,13 +121,16 @@ make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} PYTHON_VERSION="%{pyver}" #cd ${RPM_BUILD_ROOT}%{libdir_libsvm}; ln -sf %{name}.so.%{version} %{name}.so rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/src mkdir -p $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/48x48/apps/ -cp libsvm-svm-toy-gtk-48.png $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/48x48/apps/ -cp libsvm-svm-toy-qt-48.png $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 desktop-file-install --delete-original --vendor=fedora \ --dir=${RPM_BUILD_ROOT}%{_datadir}/applications \ - ${RPM_BUILD_ROOT}/%{_datadir}/applications/libsvm-svm-toy-gtk.desktop \ - ${RPM_BUILD_ROOT}/%{_datadir}/applications/libsvm-svm-toy-qt.desktop \ + ${RPM_BUILD_ROOT}/%{_datadir}/applications/%{name}-svm-toy-gtk.desktop \ + ${RPM_BUILD_ROOT}/%{_datadir}/applications/%{name}-svm-toy-qt.desktop \ @@ -186,17 +189,22 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %doc svm-toy/gtk/README %{_bindir}/svm-toy-gtk -%{_datadir}/icons/hicolor/48x48/apps/libsvm-svm-toy-gtk-48.png +%{_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/libsvm-svm-toy-qt-48.png +%{_datadir}/icons/hicolor/48x48/apps/%{name}-svm-toy-qt-48.png +%{_datadir}/applications/fedora-%{name}-svm-toy-qt.desktop %changelog -* Tue Feb 11 2008 Ding-Yi Chen - 2.85-5 +* Tue Mar 11 2008 Ding-Yi Chen - 2.85-6 +- Add desktop files in install section. + +* 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 From 04c3d61d049562f9e2164574357b673ade448928 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 1 Apr 2008 07:34:44 +0000 Subject: [PATCH 018/136] Upstream update to 2.86 --- .cvsignore | 2 +- libsvm-2.85.patch => libsvm-2.86.patch | 77 +++++++++++++++----------- libsvm.spec | 20 +++++-- log | 9 ++- sources | 2 +- 5 files changed, 69 insertions(+), 41 deletions(-) rename libsvm-2.85.patch => libsvm-2.86.patch (83%) diff --git a/.cvsignore b/.cvsignore index 9708a72..d5d706e 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1,2 @@ guide.pdf -libsvm-2.85.tar.gz +libsvm-2.86.tar.gz diff --git a/libsvm-2.85.patch b/libsvm-2.86.patch similarity index 83% rename from libsvm-2.85.patch rename to libsvm-2.86.patch index dc68a3d..45b5277 100644 --- a/libsvm-2.85.patch +++ b/libsvm-2.86.patch @@ -1,6 +1,6 @@ diff -up ./java/test_applet.html.orig ./java/test_applet.html ---- ./java/test_applet.html.orig 2008-02-04 10:11:00.000000000 +1000 -+++ ./java/test_applet.html 2008-02-04 10:13:02.000000000 +1000 +--- ./java/test_applet.html.orig 2003-07-12 14:06:55.000000000 +1000 ++++ ./java/test_applet.html 2008-04-01 16:17:52.000000000 +1000 @@ -1 +1,3 @@ - + @@ -8,8 +8,8 @@ diff -up ./java/test_applet.html.orig ./java/test_applet.html + diff -up ./java/svm_train.java.orig ./java/svm_train.java diff -up ./java/libsvm/svm_parameter.java.orig ./java/libsvm/svm_parameter.java ---- ./java/libsvm/svm_parameter.java.orig 2007-11-06 23:32:49.000000000 +1000 -+++ ./java/libsvm/svm_parameter.java 2008-02-04 10:13:02.000000000 +1000 +--- ./java/libsvm/svm_parameter.java.orig 2006-03-04 01:44:14.000000000 +1000 ++++ ./java/libsvm/svm_parameter.java 2008-04-01 16:17:52.000000000 +1000 @@ -1,6 +1,7 @@ package libsvm; public class svm_parameter implements Cloneable,java.io.Serializable @@ -19,8 +19,8 @@ diff -up ./java/libsvm/svm_parameter.java.orig ./java/libsvm/svm_parameter.java public static final int C_SVC = 0; public static final int NU_SVC = 1; diff -up ./java/libsvm/svm_problem.java.orig ./java/libsvm/svm_problem.java ---- ./java/libsvm/svm_problem.java.orig 2007-11-06 23:32:49.000000000 +1000 -+++ ./java/libsvm/svm_problem.java 2008-02-04 10:13:02.000000000 +1000 +--- ./java/libsvm/svm_problem.java.orig 2003-10-11 22:30:47.000000000 +1000 ++++ ./java/libsvm/svm_problem.java 2008-04-01 16:17:52.000000000 +1000 @@ -1,6 +1,7 @@ package libsvm; public class svm_problem implements java.io.Serializable @@ -30,8 +30,8 @@ diff -up ./java/libsvm/svm_problem.java.orig ./java/libsvm/svm_problem.java public double[] y; public svm_node[][] x; diff -up ./java/libsvm/svm_node.java.orig ./java/libsvm/svm_node.java ---- ./java/libsvm/svm_node.java.orig 2007-11-06 23:32:49.000000000 +1000 -+++ ./java/libsvm/svm_node.java 2008-02-04 10:13:02.000000000 +1000 +--- ./java/libsvm/svm_node.java.orig 2003-10-11 22:30:47.000000000 +1000 ++++ ./java/libsvm/svm_node.java 2008-04-01 16:17:52.000000000 +1000 @@ -1,6 +1,7 @@ package libsvm; public class svm_node implements java.io.Serializable @@ -40,9 +40,10 @@ diff -up ./java/libsvm/svm_node.java.orig ./java/libsvm/svm_node.java public int index; public double value; } +diff -up ./java/libsvm/svm.m4.orig ./java/libsvm/svm.m4 diff -up ./java/libsvm/svm_model.java.orig ./java/libsvm/svm_model.java ---- ./java/libsvm/svm_model.java.orig 2007-11-06 23:32:49.000000000 +1000 -+++ ./java/libsvm/svm_model.java 2008-02-04 10:13:02.000000000 +1000 +--- ./java/libsvm/svm_model.java.orig 2007-01-13 08:23:39.000000000 +1000 ++++ ./java/libsvm/svm_model.java 2008-04-01 16:17:52.000000000 +1000 @@ -4,6 +4,7 @@ package libsvm; public class svm_model implements java.io.Serializable @@ -53,11 +54,11 @@ diff -up ./java/libsvm/svm_model.java.orig ./java/libsvm/svm_model.java int l; // total #SV diff -up ./java/libsvm/svm.java.orig ./java/libsvm/svm.java diff -up ./java/Makefile.orig ./java/Makefile ---- ./java/Makefile.orig 2007-11-06 23:32:49.000000000 +1000 -+++ ./java/Makefile 2008-02-04 14:26:38.000000000 +1000 +--- ./java/Makefile.orig 2007-11-11 22:17:30.000000000 +1000 ++++ ./java/Makefile 2008-04-01 16:17:52.000000000 +1000 @@ -3,13 +3,22 @@ FILES = libsvm/svm.class libsvm/svm_mode libsvm/svm_parameter.class libsvm/svm_problem.class \ - svm_train.class svm_predict.class svm_toy.class + svm_train.class svm_predict.class svm_toy.class svm_scale.class -#JAVAC = jikes -JAVAC_FLAGS = -target 1.5 -source 1.5 @@ -107,8 +108,8 @@ diff -up ./java/Makefile.orig ./java/Makefile dist: clean all rm *.class libsvm/*.class diff -up ./java/svm_toy.java.orig ./java/svm_toy.java ---- ./java/svm_toy.java.orig 2007-11-06 23:32:49.000000000 +1000 -+++ ./java/svm_toy.java 2008-02-04 10:13:02.000000000 +1000 +--- ./java/svm_toy.java.orig 2007-07-01 23:02:51.000000000 +1000 ++++ ./java/svm_toy.java 2008-04-01 16:17:52.000000000 +1000 @@ -6,7 +6,7 @@ import java.awt.event.*; import java.io.*; @@ -127,11 +128,14 @@ diff -up ./java/svm_toy.java.orig ./java/svm_toy.java { super(title); diff -up ./java/svm_predict.java.orig ./java/svm_predict.java +diff -up ./java/svm_scale.java.orig ./java/svm_scale.java +diff -up ./svm.h.orig ./svm.h diff -up ./python/cross_validation.py.orig ./python/cross_validation.py +diff -up ./python/svmc_wrap.c.orig ./python/svmc_wrap.c diff -up ./python/svm_test.py.orig ./python/svm_test.py diff -up ./python/Makefile.orig ./python/Makefile ---- ./python/Makefile.orig 2007-11-06 23:32:49.000000000 +1000 -+++ ./python/Makefile 2008-02-05 09:37:16.000000000 +1000 +--- ./python/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 ++++ ./python/Makefile 2008-04-01 16:17:52.000000000 +1000 @@ -2,9 +2,16 @@ CXX? = g++ SWIG ?= swig @@ -193,8 +197,8 @@ diff -up ./python/svm.py.orig ./python/svm.py diff -up ./tools/subset.py.orig ./tools/subset.py diff -up ./tools/checkdata.py.orig ./tools/checkdata.py diff -up ./tools/easy.py.orig ./tools/easy.py ---- ./tools/easy.py.orig 2007-11-06 23:32:49.000000000 +1000 -+++ ./tools/easy.py 2008-02-04 10:23:49.000000000 +1000 +--- ./tools/easy.py.orig 2008-02-10 22:12:43.000000000 +1000 ++++ ./tools/easy.py 2008-04-01 16:17:52.000000000 +1000 @@ -2,6 +2,7 @@ import sys @@ -219,8 +223,8 @@ 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 2007-11-06 23:32:49.000000000 +1000 -+++ ./tools/grid.py 2008-02-04 10:13:02.000000000 +1000 +--- ./tools/grid.py.orig 2008-03-10 00:33:09.000000000 +1000 ++++ ./tools/grid.py 2008-04-01 16:17:52.000000000 +1000 @@ -11,7 +11,7 @@ from subprocess import * is_win32 = (sys.platform == 'win32') @@ -238,15 +242,14 @@ diff -up ./tools/grid.py.orig ./tools/grid.py 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 -up ./svm-train.c.orig ./svm-train.c diff -up ./Makefile.orig ./Makefile ---- ./Makefile.orig 2007-11-06 23:32:49.000000000 +1000 -+++ ./Makefile 2008-02-06 15:12:25.000000000 +1000 -@@ -1,15 +1,111 @@ +--- ./Makefile.orig 2007-10-14 16:29:12.000000000 +1000 ++++ ./Makefile 2008-04-01 16:21:40.000000000 +1000 +@@ -1,15 +1,109 @@ CXX? = g++ CFLAGS = -Wall -O3 +MAKE = make -+LIBSVM_VER_MAJOR=2 -+LIBSVM_VER_MINOR=85 +LIBSVM_VER=${LIBSVM_VER_MAJOR}.${LIBSVM_VER_MINOR} +DOT_LIBS=.libs +LIBS= -L${DOT_LIBS} -lsvm @@ -363,9 +366,12 @@ diff -up ./Makefile.orig ./Makefile + rm -f ${INSTDIR}/bin/svm-toy-gtk + rm -f ${INSTDIR}/bin/svm-toy-qt + +diff -up ./svm-scale.c.orig ./svm-scale.c +diff -up ./FAQ.html.orig ./FAQ.html +diff -up ./svm-predict.c.orig ./svm-predict.c diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile ---- ./svm-toy/qt/Makefile.orig 2008-02-04 15:59:51.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2008-02-06 15:08:55.000000000 +1000 +--- ./svm-toy/qt/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 ++++ ./svm-toy/qt/Makefile 2008-04-01 16:17:52.000000000 +1000 @@ -1,19 +1,23 @@ CXX? = g++ CFLAGS = -Wall -O3 -DQT_THREAD_SUPPORT @@ -397,9 +403,12 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile +# cd ../..; make svm.o clean: rm -f *~ svm-toy svm-toy.moc ../../svm.o +diff -up ./svm-toy/qt/svm-toy.cpp.orig ./svm-toy/qt/svm-toy.cpp +diff -up ./svm-toy/gtk/interface.h.orig ./svm-toy/gtk/interface.h +diff -up ./svm-toy/gtk/interface.c.orig ./svm-toy/gtk/interface.c diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile ---- ./svm-toy/gtk/Makefile.orig 2008-02-04 15:44:19.000000000 +1000 -+++ ./svm-toy/gtk/Makefile 2008-02-06 15:08:10.000000000 +1000 +--- ./svm-toy/gtk/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 ++++ ./svm-toy/gtk/Makefile 2008-04-01 16:17:52.000000000 +1000 @@ -1,22 +1,28 @@ CC? = gcc CXX? = g++ @@ -439,14 +448,16 @@ diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile 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/gtk/callbacks.h.orig ./svm-toy/gtk/callbacks.h +diff -up ./svm-toy/gtk/main.c.orig ./svm-toy/gtk/main.c diff -up ./svm-toy/gtk/callbacks.cpp.orig ./svm-toy/gtk/callbacks.cpp ---- ./svm-toy/gtk/callbacks.cpp.orig 2008-02-05 09:43:28.000000000 +1000 -+++ ./svm-toy/gtk/callbacks.cpp 2008-02-05 09:43:42.000000000 +1000 +--- ./svm-toy/gtk/callbacks.cpp.orig 2008-04-01 16:55:09.000000000 +1000 ++++ ./svm-toy/gtk/callbacks.cpp 2008-04-01 17:04:12.000000000 +1000 @@ -2,6 +2,7 @@ #include #include #include -+#include ++#include #include "callbacks.h" #include "interface.h" #include "../../svm.h" diff --git a/libsvm.spec b/libsvm.spec index 5a8ea06..460ac20 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm -Version: 2.85 -Release: 6%{?dist} +Version: 2.86 +Release: 0%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -17,6 +17,7 @@ Patch0: %{name}-%{version}.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root %define libsvm_ver_major 2 +%define libsvm_ver_minor 86 %{!?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 @@ -105,7 +106,7 @@ cp %{SOURCE5} %{name}-svm-toy-qt-48.png %build -make all CFLAGS="$RPM_OPT_FLAGS" PYTHON_VERSION="%{pyver}" JAVAC="%{javac}" JAR="%{jar}" LIBDIR=%{_libdir} +make all CFLAGS="$RPM_OPT_FLAGS" PYTHON_VERSION="%{pyver}" JAVAC="%{javac}" JAR="%{jar}" LIBDIR="%{_libdir}" LIBSVM_VER_MAJOR="%{libsvm_ver_major}" LIBSVM_VER_MINOR=%{libsvm_ver_minor} %{__sed} -i 's/\r//' FAQ.html %{__sed} -i 's/\r//' ChangeLog mv python/README python/README-Python @@ -117,7 +118,7 @@ cp README svm-toy/qt %install rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} PYTHON_VERSION="%{pyver}" +make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} PYTHON_VERSION="%{pyver}" LIBSVM_VER_MAJOR="%{libsvm_ver_major}" LIBSVM_VER_MINOR=%{libsvm_ver_minor} #cd ${RPM_BUILD_ROOT}%{libdir_libsvm}; ln -sf %{name}.so.%{version} %{name}.so rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/src mkdir -p $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/48x48/apps/ @@ -201,8 +202,17 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Mar 11 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 -- Add desktop files in install section. +- Fix build error. * Mon Mar 10 2008 Ding-Yi Chen - 2.85-5 - [Bug 436392]: Fix by copy from right place. diff --git a/log b/log index 75df634..4df78fb 100644 --- a/log +++ b/log @@ -132,4 +132,11 @@ file updated. 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 \ No newline at end of file + 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 \ No newline at end of file diff --git a/sources b/sources index 03692b7..0372550 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ aae7a8f7e357e86e1c893b706bb02a63 guide.pdf -c839d919cc6fa7b5ad86ea37b7cebcc3 libsvm-2.85.tar.gz +fe0cccace12516382be5a7c513e4b056 libsvm-2.86.tar.gz From e6c436665f4004f2e3530e03b421fac09d036c91 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 2 Apr 2008 04:23:24 +0000 Subject: [PATCH 019/136] Support both Qt3 and Qt4 --- libsvm.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index 460ac20..28b07e9 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.86 -Release: 0%{?dist} +Release: 1%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -73,8 +73,8 @@ programs with libsvm in Java. Summary: GTK version of svm-toy (libsvm demostration program) Group: Development/Libraries BuildRequires: gtk2-devel -BuildRequires: gtk2 BuildRequires: desktop-file-utils +Requires: gtk2 Requires: %{name} = %{version}-%{release} %description svm-toy-gtk @@ -85,8 +85,9 @@ display the derived separating hyperplane. Summary: QT version of svm-toy (libsvm demostration program) Group: Development/Libraries BuildRequires: qt-devel -BuildRequires: qt BuildRequires: desktop-file-utils +BuildRequires: pkgconfig +Requires: qt Requires: %{name} = %{version}-%{release} %description svm-toy-qt @@ -202,6 +203,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Mar 11 2008 Ding-Yi Chen - 2.86-1 +- Support both Qt3 for F8 and earlier, and Qt4 for F9 + * Tue Mar 11 2008 Ding-Yi Chen - 2.86-0 - Upstream update to 2.86 - svm-scale for java From 169423c34a3f4620f38a27deac5459c502204617 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 2 Apr 2008 04:50:12 +0000 Subject: [PATCH 020/136] Support both Qt3 and Qt4 --- libsvm-2.86.patch | 164 +++++++++++++++++++++++++++++++++++++++++----- libsvm.spec | 4 +- 2 files changed, 150 insertions(+), 18 deletions(-) diff --git a/libsvm-2.86.patch b/libsvm-2.86.patch index 45b5277..215e18c 100644 --- a/libsvm-2.86.patch +++ b/libsvm-2.86.patch @@ -371,39 +371,171 @@ diff -up ./FAQ.html.orig ./FAQ.html diff -up ./svm-predict.c.orig ./svm-predict.c diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile --- ./svm-toy/qt/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2008-04-01 16:17:52.000000000 +1000 -@@ -1,19 +1,23 @@ ++++ ./svm-toy/qt/Makefile 2008-04-02 14:07:17.000000000 +1000 +@@ -1,19 +1,43 @@ CXX? = g++ - CFLAGS = -Wall -O3 -DQT_THREAD_SUPPORT -+QTDIR = $(LIBDIR)/qt-3.3 - BIN = $(QTDIR)/bin - INCLUDE = $(QTDIR)/include - LIB = $(QTDIR)/lib +-CFLAGS = -Wall -O3 -DQT_THREAD_SUPPORT +-BIN = $(QTDIR)/bin +-INCLUDE = $(QTDIR)/include +-LIB = $(QTDIR)/lib -#BIN = /usr/bin -#INCLUDE = /usr/include/qt3 -#LIB = /usr/lib/qt3 -+DOT_LIBS=../../.libs -+LIBS= -L${DOT_LIBS} -lsvm ++#CFLAGS = -Wall -O3 -DQT_THREAD_SUPPORT ++CFLAGS = -Wall -O3 ++QT4_DIR= $(shell if [ -e /usr/lib/qt4 ]; then echo /usr/lib/qt4; fi) ++#LIBDIR=/usr/lib64 ++#QT4_DIR= -svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o - $(CXX) -I$(INCLUDE) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy -L$(LIB) -lqt-mt ++ifdef QT4_DIR ++ QTDIR=${QT4_DIR} ++ BIN = $(QTDIR)/bin ++ FLAGS=${CFLAGS} -I/usr/include/Qt -DQT3_SUPPORT `pkg-config --cflags --libs Qt3Support QtGui` ++else ++ QTDIR=${LIBDIR}/qt-3.3 ++ BIN = $(QTDIR)/bin ++ FLAGS=${CFLAGS} `pkg-config --cflags --libs qt-mt` ++endif ++ ++ ++DOT_LIBS=../../.libs ++LIBS= -L${DOT_LIBS} -lsvm ++ +all: svm-toy-qt + -+svm-toy-qt: svm-toy.cpp svm-toy.moc ../../svm.o -+ $(CXX) -I$(INCLUDE) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy-qt -L$(LIB) $(LIBS) -lqt-mt ++svm-toy-qt: svm-toy.new.cpp svm-toy.moc ../../svm.o ++ $(CXX) $(FLAGS) svm-toy.new.cpp ../../svm.o -o svm-toy-qt $(LIBS) # add -pthread for bsd - svm-toy.moc: svm-toy.cpp -+ echo "LIBDIR=${LIBDIR}" -+ echo "QTDIR=${QTDIR}" - $(BIN)/moc svm-toy.cpp -o svm-toy.moc +-svm-toy.moc: svm-toy.cpp +- $(BIN)/moc svm-toy.cpp -o svm-toy.moc -../../svm.o: - cd ../..; make svm.o ++ ++svm-toy.moc: svm-toy.new.cpp ++ echo "LIBDIR=${LIBDIR}" ++ echo "QTDIR=${QTDIR}" ++ echo "FLAGS=${FLAGS}" ++ $(BIN)/moc svm-toy.new.cpp -o svm-toy.moc +#../../svm.o: +# cd ../..; make svm.o ++svm-toy.new.cpp: svm-toy.cpp ++ cp svm-toy.cpp svm-toy.new.cpp ++ifdef QT4_DIR ++ ${BIN}/qt3to4 -alwaysOverwrite svm-toy.new.cpp ++endif ++ clean: - rm -f *~ svm-toy svm-toy.moc ../../svm.o +- rm -f *~ svm-toy svm-toy.moc ../../svm.o ++ rm -f *~ svm-toy-qt svm-toy.moc ../../svm.o svm-toy.new.cpp diff -up ./svm-toy/qt/svm-toy.cpp.orig ./svm-toy/qt/svm-toy.cpp +--- ./svm-toy/qt/svm-toy.cpp.orig 2008-04-01 16:55:51.000000000 +1000 ++++ ./svm-toy/qt/svm-toy.cpp 2008-04-02 14:01:47.000000000 +1000 +@@ -67,14 +67,15 @@ private: + void clear_all() + { + point_list.clear(); +- buffer.fill(black); ++ buffer.fill(Qt::black); + paintEvent(NULL); + } + void draw_point(const point& p) + { + const QPixmap& icon = choose_icon(p.value); +- window_painter.drawPixmap((int)(p.x*XLEN),(int)(p.y*YLEN),icon); ++ + buffer_painter.drawPixmap((int)(p.x*XLEN),(int)(p.y*YLEN),icon); ++ repaint(FALSE); + } + void draw_all_points() + { +@@ -213,33 +214,23 @@ private slots: + + buffer_painter.setPen(colors[0]); + buffer_painter.drawLine(0,0,0,YLEN-1); +- window_painter.setPen(colors[0]); +- window_painter.drawLine(0,0,0,YLEN-1); + + int p = (int)(param.p * YLEN); + for(i = 1; i < XLEN; i++) + { + buffer_painter.setPen(colors[0]); + buffer_painter.drawLine(i,0,i,YLEN-1); +- window_painter.setPen(colors[0]); +- window_painter.drawLine(i,0,i,YLEN-1); + + buffer_painter.setPen(colors[5]); + buffer_painter.drawLine(i-1,j[i-1],i,j[i]); +- window_painter.setPen(colors[5]); +- window_painter.drawLine(i-1,j[i-1],i,j[i]); + + if(param.svm_type == EPSILON_SVR) + { + buffer_painter.setPen(colors[2]); + buffer_painter.drawLine(i-1,j[i-1]+p,i,j[i]+p); +- window_painter.setPen(colors[2]); +- window_painter.drawLine(i-1,j[i-1]+p,i,j[i]+p); + + buffer_painter.setPen(colors[2]); + buffer_painter.drawLine(i-1,j[i-1]-p,i,j[i]-p); +- window_painter.setPen(colors[2]); +- window_painter.drawLine(i-1,j[i-1]-p,i,j[i]-p); + } + } + +@@ -281,9 +272,7 @@ private slots: + double d = svm_predict(model, x); + if (param.svm_type == ONE_CLASS && d<0) d=2; + buffer_painter.setPen(colors[(int)d]); +- window_painter.setPen(colors[(int)d]); + buffer_painter.drawPoint(i,j); +- window_painter.drawPoint(i,j); + } + + svm_destroy_model(model); +@@ -352,9 +341,9 @@ SvmToyWindow::SvmToyWindow() + ,current_value(1) + { + buffer.resize(XLEN,YLEN); +- buffer.fill(black); ++ buffer.fill(Qt::black); + +- window_painter.begin(this); ++// window_painter.begin(this); + buffer_painter.begin(&buffer); + + QObject::connect(&button_change_icon, SIGNAL(clicked()), this, +@@ -371,7 +360,7 @@ SvmToyWindow::SvmToyWindow() + SLOT(button_run_clicked())); + + // don't blank the window before repainting +- setBackgroundMode( NoBackground ); ++ setBackgroundMode( Qt::NoBackground ); + + icon1.resize(4,4); + icon2.resize(4,4); +@@ -403,7 +392,7 @@ SvmToyWindow::SvmToyWindow() + + SvmToyWindow::~SvmToyWindow() + { +- window_painter.end(); ++// window_painter.end(); + buffer_painter.end(); + } + +@@ -417,7 +406,9 @@ void SvmToyWindow::mousePressEvent( QMou + void SvmToyWindow::paintEvent( QPaintEvent* ) + { + // copy the image from the buffer pixmap to the window +- bitBlt( this, 0, 0, &buffer ); ++ // Compatiable both Qt-3 and Qt-4 ++ QPainter p(this); ++ p.drawPixmap(0, 0, buffer); + } + + int main( int argc, char* argv[] ) diff -up ./svm-toy/gtk/interface.h.orig ./svm-toy/gtk/interface.h diff -up ./svm-toy/gtk/interface.c.orig ./svm-toy/gtk/interface.c diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile diff --git a/libsvm.spec b/libsvm.spec index 28b07e9..3f66662 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.86 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -203,7 +203,7 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Tue Mar 11 2008 Ding-Yi Chen - 2.86-1 +* Wed Mar 12 2008 Ding-Yi Chen - 2.86-2 - Support both Qt3 for F8 and earlier, and Qt4 for F9 * Tue Mar 11 2008 Ding-Yi Chen - 2.86-0 From 6eeb2b56fa8a48f89e4ca96e5f38c5feb2d12203 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 2 Apr 2008 05:01:38 +0000 Subject: [PATCH 021/136] Support both Qt3 and Qt4 --- libsvm-2.86.patch | 13 ++++++++----- libsvm.spec | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/libsvm-2.86.patch b/libsvm-2.86.patch index 215e18c..a33b271 100644 --- a/libsvm-2.86.patch +++ b/libsvm-2.86.patch @@ -371,8 +371,8 @@ diff -up ./FAQ.html.orig ./FAQ.html diff -up ./svm-predict.c.orig ./svm-predict.c diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile --- ./svm-toy/qt/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2008-04-02 14:07:17.000000000 +1000 -@@ -1,19 +1,43 @@ ++++ ./svm-toy/qt/Makefile 2008-04-02 14:46:28.000000000 +1000 +@@ -1,19 +1,46 @@ CXX? = g++ -CFLAGS = -Wall -O3 -DQT_THREAD_SUPPORT -BIN = $(QTDIR)/bin @@ -391,11 +391,11 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile - $(CXX) -I$(INCLUDE) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy -L$(LIB) -lqt-mt +ifdef QT4_DIR + QTDIR=${QT4_DIR} -+ BIN = $(QTDIR)/bin ++ BIN = ${QTDIR}/bin + FLAGS=${CFLAGS} -I/usr/include/Qt -DQT3_SUPPORT `pkg-config --cflags --libs Qt3Support QtGui` +else + QTDIR=${LIBDIR}/qt-3.3 -+ BIN = $(QTDIR)/bin ++ BIN = ${QTDIR}/bin + FLAGS=${CFLAGS} `pkg-config --cflags --libs qt-mt` +endif + @@ -418,10 +418,13 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile + echo "LIBDIR=${LIBDIR}" + echo "QTDIR=${QTDIR}" + echo "FLAGS=${FLAGS}" -+ $(BIN)/moc svm-toy.new.cpp -o svm-toy.moc ++ ${BIN}/moc svm-toy.new.cpp -o svm-toy.moc +#../../svm.o: +# cd ../..; make svm.o +svm-toy.new.cpp: svm-toy.cpp ++ echo "LIBDIR=${LIBDIR}" ++ echo "QTDIR=${QTDIR}" ++ echo "FLAGS=${FLAGS}" + cp svm-toy.cpp svm-toy.new.cpp +ifdef QT4_DIR + ${BIN}/qt3to4 -alwaysOverwrite svm-toy.new.cpp diff --git a/libsvm.spec b/libsvm.spec index 3f66662..24c6ddf 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.86 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -203,7 +203,7 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Wed Mar 12 2008 Ding-Yi Chen - 2.86-2 +* Wed Mar 12 2008 Ding-Yi Chen - 2.86-3 - Support both Qt3 for F8 and earlier, and Qt4 for F9 * Tue Mar 11 2008 Ding-Yi Chen - 2.86-0 From f58faf6c993efec789e1735b2c320b447170fd71 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 2 Apr 2008 05:31:16 +0000 Subject: [PATCH 022/136] Support both Qt3 and Qt4 --- libsvm-2.86.patch | 6 +++--- libsvm.spec | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libsvm-2.86.patch b/libsvm-2.86.patch index a33b271..9a3e6b0 100644 --- a/libsvm-2.86.patch +++ b/libsvm-2.86.patch @@ -371,7 +371,7 @@ diff -up ./FAQ.html.orig ./FAQ.html diff -up ./svm-predict.c.orig ./svm-predict.c diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile --- ./svm-toy/qt/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2008-04-02 14:46:28.000000000 +1000 ++++ ./svm-toy/qt/Makefile 2008-04-02 15:27:24.000000000 +1000 @@ -1,19 +1,46 @@ CXX? = g++ -CFLAGS = -Wall -O3 -DQT_THREAD_SUPPORT @@ -390,7 +390,7 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile -svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o - $(CXX) -I$(INCLUDE) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy -L$(LIB) -lqt-mt +ifdef QT4_DIR -+ QTDIR=${QT4_DIR} ++ QTDIR=/usr/lib/qt4 + BIN = ${QTDIR}/bin + FLAGS=${CFLAGS} -I/usr/include/Qt -DQT3_SUPPORT `pkg-config --cflags --libs Qt3Support QtGui` +else @@ -427,7 +427,7 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile + echo "FLAGS=${FLAGS}" + cp svm-toy.cpp svm-toy.new.cpp +ifdef QT4_DIR -+ ${BIN}/qt3to4 -alwaysOverwrite svm-toy.new.cpp ++ /usr/lib/qt4/bin/qt3to4 -alwaysOverwrite svm-toy.new.cpp +endif + clean: diff --git a/libsvm.spec b/libsvm.spec index 24c6ddf..9838ae4 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.86 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -203,7 +203,7 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Wed Mar 12 2008 Ding-Yi Chen - 2.86-3 +* Wed Mar 12 2008 Ding-Yi Chen - 2.86-4 - Support both Qt3 for F8 and earlier, and Qt4 for F9 * Tue Mar 11 2008 Ding-Yi Chen - 2.86-0 From 1556c905baf4107ddd179b9e556245c6641bbb3e Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 3 Apr 2008 01:14:27 +0000 Subject: [PATCH 023/136] Fix Qt path --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index 9838ae4..2b1a67e 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.86 -Release: 4%{?dist} +Release: 5%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -203,6 +203,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Mar 13 2008 Ding-Yi Chen - 2.86-5 +- Fix the Qt path problem + * Wed Mar 12 2008 Ding-Yi Chen - 2.86-4 - Support both Qt3 for F8 and earlier, and Qt4 for F9 From b05f25ab547c9776395c504c80dc154e81c6999b Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 3 Apr 2008 02:36:03 +0000 Subject: [PATCH 024/136] Fix Qt path --- libsvm-2.86.patch | 23 ++++++++++++----------- libsvm.spec | 4 ++-- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/libsvm-2.86.patch b/libsvm-2.86.patch index 9a3e6b0..e5130a2 100644 --- a/libsvm-2.86.patch +++ b/libsvm-2.86.patch @@ -371,8 +371,8 @@ diff -up ./FAQ.html.orig ./FAQ.html diff -up ./svm-predict.c.orig ./svm-predict.c diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile --- ./svm-toy/qt/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2008-04-02 15:27:24.000000000 +1000 -@@ -1,19 +1,46 @@ ++++ ./svm-toy/qt/Makefile 2008-04-03 12:27:41.000000000 +1000 +@@ -1,19 +1,47 @@ CXX? = g++ -CFLAGS = -Wall -O3 -DQT_THREAD_SUPPORT -BIN = $(QTDIR)/bin @@ -381,7 +381,6 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile -#BIN = /usr/bin -#INCLUDE = /usr/include/qt3 -#LIB = /usr/lib/qt3 -+#CFLAGS = -Wall -O3 -DQT_THREAD_SUPPORT +CFLAGS = -Wall -O3 +QT4_DIR= $(shell if [ -e /usr/lib/qt4 ]; then echo /usr/lib/qt4; fi) +#LIBDIR=/usr/lib64 @@ -392,7 +391,11 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile +ifdef QT4_DIR + QTDIR=/usr/lib/qt4 + BIN = ${QTDIR}/bin -+ FLAGS=${CFLAGS} -I/usr/include/Qt -DQT3_SUPPORT `pkg-config --cflags --libs Qt3Support QtGui` ++ FLAGS=${CFLAGS} -I/usr/include/Qt -DQT3_SUPPORT -DQT_INCLUDE_COMPAT `pkg-config --cflags --libs Qt3Support QtGui` ++ QT3_TO_4=$(shell if [ -e ${BIN}/qt3to4 ]; then echo ${BIN}/qt3to4; fi) ++ ifndef QT3_TO4 ++ QT3_TO_4=/usr/bin/qt3to4 ++ endif +else + QTDIR=${LIBDIR}/qt-3.3 + BIN = ${QTDIR}/bin @@ -415,19 +418,17 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile - cd ../..; make svm.o + +svm-toy.moc: svm-toy.new.cpp -+ echo "LIBDIR=${LIBDIR}" -+ echo "QTDIR=${QTDIR}" -+ echo "FLAGS=${FLAGS}" ++# echo "LIBDIR=${LIBDIR}" ++# echo "QTDIR=${QTDIR}" ++# echo "FLAGS=${FLAGS}" + ${BIN}/moc svm-toy.new.cpp -o svm-toy.moc +#../../svm.o: +# cd ../..; make svm.o ++ +svm-toy.new.cpp: svm-toy.cpp -+ echo "LIBDIR=${LIBDIR}" -+ echo "QTDIR=${QTDIR}" -+ echo "FLAGS=${FLAGS}" + cp svm-toy.cpp svm-toy.new.cpp +ifdef QT4_DIR -+ /usr/lib/qt4/bin/qt3to4 -alwaysOverwrite svm-toy.new.cpp ++ ${QT3_TO4$} -alwaysOverwrite svm-toy.new.cpp +endif + clean: diff --git a/libsvm.spec b/libsvm.spec index 2b1a67e..f51d160 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.86 -Release: 5%{?dist} +Release: 6%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -203,7 +203,7 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Thu Mar 13 2008 Ding-Yi Chen - 2.86-5 +* Thu Mar 13 2008 Ding-Yi Chen - 2.86-6 - Fix the Qt path problem * Wed Mar 12 2008 Ding-Yi Chen - 2.86-4 From b9ecb474a8c8a4e8ad0c399a0d60f59dbdddcb39 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 3 Apr 2008 02:58:06 +0000 Subject: [PATCH 025/136] Fix Qt path --- libsvm-2.86.patch | 17 +++++++++-------- libsvm.spec | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/libsvm-2.86.patch b/libsvm-2.86.patch index e5130a2..08dd8e5 100644 --- a/libsvm-2.86.patch +++ b/libsvm-2.86.patch @@ -371,8 +371,8 @@ diff -up ./FAQ.html.orig ./FAQ.html diff -up ./svm-predict.c.orig ./svm-predict.c diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile --- ./svm-toy/qt/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2008-04-03 12:27:41.000000000 +1000 -@@ -1,19 +1,47 @@ ++++ ./svm-toy/qt/Makefile 2008-04-03 12:55:56.000000000 +1000 +@@ -1,19 +1,48 @@ CXX? = g++ -CFLAGS = -Wall -O3 -DQT_THREAD_SUPPORT -BIN = $(QTDIR)/bin @@ -389,12 +389,12 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile -svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o - $(CXX) -I$(INCLUDE) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy -L$(LIB) -lqt-mt +ifdef QT4_DIR -+ QTDIR=/usr/lib/qt4 ++ QTDIR=${QT4_DIR} + BIN = ${QTDIR}/bin + FLAGS=${CFLAGS} -I/usr/include/Qt -DQT3_SUPPORT -DQT_INCLUDE_COMPAT `pkg-config --cflags --libs Qt3Support QtGui` -+ QT3_TO_4=$(shell if [ -e ${BIN}/qt3to4 ]; then echo ${BIN}/qt3to4; fi) -+ ifndef QT3_TO4 -+ QT3_TO_4=/usr/bin/qt3to4 ++ QT3_TO_4=$(shell if [ -e "${BIN}/qt3to4" ]; then echo "${BIN}/qt3to4"; fi) ++ ifndef QT3_TO_4 ++ QT3_TO_4=$(shell if [ -e /usr/bin/qt3to4 ]; then echo /usr/bin/qt3to4; fi) + endif +else + QTDIR=${LIBDIR}/qt-3.3 @@ -419,16 +419,17 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile + +svm-toy.moc: svm-toy.new.cpp +# echo "LIBDIR=${LIBDIR}" -+# echo "QTDIR=${QTDIR}" +# echo "FLAGS=${FLAGS}" + ${BIN}/moc svm-toy.new.cpp -o svm-toy.moc +#../../svm.o: +# cd ../..; make svm.o + +svm-toy.new.cpp: svm-toy.cpp ++# echo "QTDIR=${QTDIR}" + cp svm-toy.cpp svm-toy.new.cpp +ifdef QT4_DIR -+ ${QT3_TO4$} -alwaysOverwrite svm-toy.new.cpp ++ echo "QT3_TO_4=${QT3_TO_4}" ++ ${QT3_TO_4} -alwaysOverwrite svm-toy.new.cpp +endif + clean: diff --git a/libsvm.spec b/libsvm.spec index f51d160..21e753c 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.86 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -203,7 +203,7 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Thu Mar 13 2008 Ding-Yi Chen - 2.86-6 +* Thu Mar 13 2008 Ding-Yi Chen - 2.86-7 - Fix the Qt path problem * Wed Mar 12 2008 Ding-Yi Chen - 2.86-4 From cb285d07f3e3751f93434505b43981b95bef45ad Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 3 Apr 2008 03:34:44 +0000 Subject: [PATCH 026/136] Fix Qt path --- libsvm-2.86.patch | 6 +++--- libsvm.spec | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libsvm-2.86.patch b/libsvm-2.86.patch index 08dd8e5..f6f5eb7 100644 --- a/libsvm-2.86.patch +++ b/libsvm-2.86.patch @@ -371,7 +371,7 @@ diff -up ./FAQ.html.orig ./FAQ.html diff -up ./svm-predict.c.orig ./svm-predict.c diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile --- ./svm-toy/qt/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2008-04-03 12:55:56.000000000 +1000 ++++ ./svm-toy/qt/Makefile 2008-04-03 13:32:39.000000000 +1000 @@ -1,19 +1,48 @@ CXX? = g++ -CFLAGS = -Wall -O3 -DQT_THREAD_SUPPORT @@ -382,9 +382,9 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile -#INCLUDE = /usr/include/qt3 -#LIB = /usr/lib/qt3 +CFLAGS = -Wall -O3 -+QT4_DIR= $(shell if [ -e /usr/lib/qt4 ]; then echo /usr/lib/qt4; fi) -+#LIBDIR=/usr/lib64 ++#LIBDIR?=/usr/lib64 +#QT4_DIR= ++QT4_DIR= $(shell if [ -e ${LIBDIR}/qt4 ]; then echo ${LIBDIR}/qt4; fi) -svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o - $(CXX) -I$(INCLUDE) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy -L$(LIB) -lqt-mt diff --git a/libsvm.spec b/libsvm.spec index 21e753c..ae45d72 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.86 -Release: 7%{?dist} +Release: 8%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -203,7 +203,7 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Thu Mar 13 2008 Ding-Yi Chen - 2.86-7 +* Thu Mar 13 2008 Ding-Yi Chen - 2.86-8 - Fix the Qt path problem * Wed Mar 12 2008 Ding-Yi Chen - 2.86-4 From a4966eed706695453818b61c92f0ff07296e1a52 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 3 Apr 2008 04:24:32 +0000 Subject: [PATCH 027/136] Fix Qt path --- libsvm-2.86.patch | 4 ++-- libsvm.spec | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libsvm-2.86.patch b/libsvm-2.86.patch index f6f5eb7..a477cbd 100644 --- a/libsvm-2.86.patch +++ b/libsvm-2.86.patch @@ -371,7 +371,7 @@ diff -up ./FAQ.html.orig ./FAQ.html diff -up ./svm-predict.c.orig ./svm-predict.c diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile --- ./svm-toy/qt/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2008-04-03 13:32:39.000000000 +1000 ++++ ./svm-toy/qt/Makefile 2008-04-03 14:19:47.000000000 +1000 @@ -1,19 +1,48 @@ CXX? = g++ -CFLAGS = -Wall -O3 -DQT_THREAD_SUPPORT @@ -427,8 +427,8 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile +svm-toy.new.cpp: svm-toy.cpp +# echo "QTDIR=${QTDIR}" + cp svm-toy.cpp svm-toy.new.cpp -+ifdef QT4_DIR + echo "QT3_TO_4=${QT3_TO_4}" ++ifdef QT3_To_4 + ${QT3_TO_4} -alwaysOverwrite svm-toy.new.cpp +endif + diff --git a/libsvm.spec b/libsvm.spec index ae45d72..0606864 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.86 -Release: 8%{?dist} +Release: 9%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -203,7 +203,7 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Thu Mar 13 2008 Ding-Yi Chen - 2.86-8 +* Thu Mar 13 2008 Ding-Yi Chen - 2.86-9 - Fix the Qt path problem * Wed Mar 12 2008 Ding-Yi Chen - 2.86-4 From b78d674c5ba02acf8eef593fdeeb84032214d86a Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 3 Apr 2008 05:49:33 +0000 Subject: [PATCH 028/136] Fix Qt path --- libsvm-2.86.patch | 434 +++++++++++++++++++++++----------------------- libsvm.spec | 4 +- 2 files changed, 220 insertions(+), 218 deletions(-) diff --git a/libsvm-2.86.patch b/libsvm-2.86.patch index a477cbd..72bfddb 100644 --- a/libsvm-2.86.patch +++ b/libsvm-2.86.patch @@ -1,12 +1,28 @@ -diff -up ./java/test_applet.html.orig ./java/test_applet.html ---- ./java/test_applet.html.orig 2003-07-12 14:06:55.000000000 +1000 -+++ ./java/test_applet.html 2008-04-01 16:17:52.000000000 +1000 -@@ -1 +1,3 @@ -- -+ -+ -+ -diff -up ./java/svm_train.java.orig ./java/svm_train.java +diff -up ./FAQ.html.orig ./FAQ.html +diff -up ./java/libsvm/svm.java.orig ./java/libsvm/svm.java +diff -up ./java/libsvm/svm.m4.orig ./java/libsvm/svm.m4 +diff -up ./java/libsvm/svm_model.java.orig ./java/libsvm/svm_model.java +--- ./java/libsvm/svm_model.java.orig 2007-01-13 08:23:39.000000000 +1000 ++++ ./java/libsvm/svm_model.java 2008-04-01 16:17:52.000000000 +1000 +@@ -4,6 +4,7 @@ + package libsvm; + public class svm_model implements java.io.Serializable + { ++ static final long serialVersionUID = 2709444323471798245L; + svm_parameter param; // parameter + int nr_class; // number of classes, = 2 in regression/one class svm + int l; // total #SV +diff -up ./java/libsvm/svm_node.java.orig ./java/libsvm/svm_node.java +--- ./java/libsvm/svm_node.java.orig 2003-10-11 22:30:47.000000000 +1000 ++++ ./java/libsvm/svm_node.java 2008-04-01 16:17:52.000000000 +1000 +@@ -1,6 +1,7 @@ + package libsvm; + public class svm_node implements java.io.Serializable + { ++ static final long serialVersionUID = 2709444323471798245L; + public int index; + public double value; + } diff -up ./java/libsvm/svm_parameter.java.orig ./java/libsvm/svm_parameter.java --- ./java/libsvm/svm_parameter.java.orig 2006-03-04 01:44:14.000000000 +1000 +++ ./java/libsvm/svm_parameter.java 2008-04-01 16:17:52.000000000 +1000 @@ -29,30 +45,6 @@ diff -up ./java/libsvm/svm_problem.java.orig ./java/libsvm/svm_problem.java public int l; public double[] y; public svm_node[][] x; -diff -up ./java/libsvm/svm_node.java.orig ./java/libsvm/svm_node.java ---- ./java/libsvm/svm_node.java.orig 2003-10-11 22:30:47.000000000 +1000 -+++ ./java/libsvm/svm_node.java 2008-04-01 16:17:52.000000000 +1000 -@@ -1,6 +1,7 @@ - package libsvm; - public class svm_node implements java.io.Serializable - { -+ static final long serialVersionUID = 2709444323471798245L; - public int index; - public double value; - } -diff -up ./java/libsvm/svm.m4.orig ./java/libsvm/svm.m4 -diff -up ./java/libsvm/svm_model.java.orig ./java/libsvm/svm_model.java ---- ./java/libsvm/svm_model.java.orig 2007-01-13 08:23:39.000000000 +1000 -+++ ./java/libsvm/svm_model.java 2008-04-01 16:17:52.000000000 +1000 -@@ -4,6 +4,7 @@ - package libsvm; - public class svm_model implements java.io.Serializable - { -+ static final long serialVersionUID = 2709444323471798245L; - svm_parameter param; // parameter - int nr_class; // number of classes, = 2 in regression/one class svm - int l; // total #SV -diff -up ./java/libsvm/svm.java.orig ./java/libsvm/svm.java diff -up ./java/Makefile.orig ./java/Makefile --- ./java/Makefile.orig 2007-11-11 22:17:30.000000000 +1000 +++ ./java/Makefile 2008-04-01 16:17:52.000000000 +1000 @@ -107,6 +99,8 @@ diff -up ./java/Makefile.orig ./java/Makefile dist: clean all rm *.class libsvm/*.class +diff -up ./java/svm_predict.java.orig ./java/svm_predict.java +diff -up ./java/svm_scale.java.orig ./java/svm_scale.java diff -up ./java/svm_toy.java.orig ./java/svm_toy.java --- ./java/svm_toy.java.orig 2007-07-01 23:02:51.000000000 +1000 +++ ./java/svm_toy.java 2008-04-01 16:17:52.000000000 +1000 @@ -127,122 +121,15 @@ diff -up ./java/svm_toy.java.orig ./java/svm_toy.java AppletFrame(String title, Applet applet, int width, int height) { super(title); -diff -up ./java/svm_predict.java.orig ./java/svm_predict.java -diff -up ./java/svm_scale.java.orig ./java/svm_scale.java -diff -up ./svm.h.orig ./svm.h -diff -up ./python/cross_validation.py.orig ./python/cross_validation.py -diff -up ./python/svmc_wrap.c.orig ./python/svmc_wrap.c -diff -up ./python/svm_test.py.orig ./python/svm_test.py -diff -up ./python/Makefile.orig ./python/Makefile ---- ./python/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./python/Makefile 2008-04-01 16:17:52.000000000 +1000 -@@ -2,9 +2,16 @@ CXX? = g++ - SWIG ?= swig - - #Windows: see ../README ../Makefile.win --PYTHON_INCLUDEDIR ?= /usr/include/python2.4 -+#PYTHON_TEMP:=${shell mktemp} -+#PYTHON_VERSION:=${shell python -V 2> ${PYTHON_TEMP} ; cat ${PYTHON_TEMP} | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$$2,$$3)}'; rm -f ${PYTHON_TEMP}} -+ifndef PYTHON_INCLUDEDIR - --CFLAGS = -O3 -I$(PYTHON_INCLUDEDIR) -I.. -+PYTHON_INCLUDEDIR?= /usr/include/python${PYTHON_VERSION} -+ -+endif -+PYTHON_TARGETDIR=${LIB_INSTDIR}/python${PYTHON_VERSION}/site-packages/libsvm -+ -+CFLAGS_PYTHON = ${CFLAGS} -O3 -I$(PYTHON_INCLUDEDIR) -I.. - LDFLAGS = -shared - # Mac OS - # LDFLAGS = -framework Python -bundle -@@ -15,16 +22,34 @@ 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 -+# echo "PYTHON_VERSION=${PYTHON_VERSION}" -+# echo "CFLAGS=${CFLAGS}" -+# echo "CFLAGS_PYTHON=${CFLAGS_PYTHON}" -+ $(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 ./python/test_cross_validation.py.orig ./python/test_cross_validation.py -diff -up ./python/svm.py.orig ./python/svm.py -diff -up ./tools/subset.py.orig ./tools/subset.py -diff -up ./tools/checkdata.py.orig ./tools/checkdata.py -diff -up ./tools/easy.py.orig ./tools/easy.py ---- ./tools/easy.py.orig 2008-02-10 22:12:43.000000000 +1000 -+++ ./tools/easy.py 2008-04-01 16:17:52.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-03-10 00:33:09.000000000 +1000 -+++ ./tools/grid.py 2008-04-01 16:17:52.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 -up ./svm-train.c.orig ./svm-train.c +diff -up ./java/svm_train.java.orig ./java/svm_train.java +diff -up ./java/test_applet.html.orig ./java/test_applet.html +--- ./java/test_applet.html.orig 2003-07-12 14:06:55.000000000 +1000 ++++ ./java/test_applet.html 2008-04-01 16:17:52.000000000 +1000 +@@ -1 +1,3 @@ +- ++ ++ ++ diff -up ./Makefile.orig ./Makefile --- ./Makefile.orig 2007-10-14 16:29:12.000000000 +1000 +++ ./Makefile 2008-04-01 16:21:40.000000000 +1000 @@ -366,13 +253,134 @@ diff -up ./Makefile.orig ./Makefile + rm -f ${INSTDIR}/bin/svm-toy-gtk + rm -f ${INSTDIR}/bin/svm-toy-qt + -diff -up ./svm-scale.c.orig ./svm-scale.c -diff -up ./FAQ.html.orig ./FAQ.html +diff -up ./python/cross_validation.py.orig ./python/cross_validation.py +diff -up ./python/Makefile.orig ./python/Makefile +--- ./python/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 ++++ ./python/Makefile 2008-04-01 16:17:52.000000000 +1000 +@@ -2,9 +2,16 @@ CXX? = g++ + SWIG ?= swig + + #Windows: see ../README ../Makefile.win +-PYTHON_INCLUDEDIR ?= /usr/include/python2.4 ++#PYTHON_TEMP:=${shell mktemp} ++#PYTHON_VERSION:=${shell python -V 2> ${PYTHON_TEMP} ; cat ${PYTHON_TEMP} | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$$2,$$3)}'; rm -f ${PYTHON_TEMP}} ++ifndef PYTHON_INCLUDEDIR + +-CFLAGS = -O3 -I$(PYTHON_INCLUDEDIR) -I.. ++PYTHON_INCLUDEDIR?= /usr/include/python${PYTHON_VERSION} ++ ++endif ++PYTHON_TARGETDIR=${LIB_INSTDIR}/python${PYTHON_VERSION}/site-packages/libsvm ++ ++CFLAGS_PYTHON = ${CFLAGS} -O3 -I$(PYTHON_INCLUDEDIR) -I.. + LDFLAGS = -shared + # Mac OS + # LDFLAGS = -framework Python -bundle +@@ -15,16 +22,34 @@ 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 ++# echo "PYTHON_VERSION=${PYTHON_VERSION}" ++# echo "CFLAGS=${CFLAGS}" ++# echo "CFLAGS_PYTHON=${CFLAGS_PYTHON}" ++ $(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 ./python/svmc_wrap.c.orig ./python/svmc_wrap.c +diff -up ./python/svm.py.orig ./python/svm.py +diff -up ./python/svm_test.py.orig ./python/svm_test.py +diff -up ./python/test_cross_validation.py.orig ./python/test_cross_validation.py +diff -up ./svm.h.orig ./svm.h diff -up ./svm-predict.c.orig ./svm-predict.c +diff -up ./svm-scale.c.orig ./svm-scale.c +diff -up ./svm-toy/gtk/callbacks.cpp.orig ./svm-toy/gtk/callbacks.cpp +--- ./svm-toy/gtk/callbacks.cpp.orig 2008-04-01 16:55:09.000000000 +1000 ++++ ./svm-toy/gtk/callbacks.cpp 2008-04-01 17:04:12.000000000 +1000 +@@ -2,6 +2,7 @@ + #include + #include + #include ++#include + #include "callbacks.h" + #include "interface.h" + #include "../../svm.h" +diff -up ./svm-toy/gtk/callbacks.h.orig ./svm-toy/gtk/callbacks.h +diff -up ./svm-toy/gtk/interface.c.orig ./svm-toy/gtk/interface.c +diff -up ./svm-toy/gtk/interface.h.orig ./svm-toy/gtk/interface.h +diff -up ./svm-toy/gtk/main.c.orig ./svm-toy/gtk/main.c +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 2008-04-01 16:17:52.000000000 +1000 +@@ -1,22 +1,28 @@ + CC? = gcc + CXX? = g++ +-CFLAGS = -Wall -O3 -g `gtk-config --cflags` +-LIBS = `gtk-config --libs` ++#CFLAGS = -Wall -O3 -g `gtk-config --cflags` ++#LIBS = `gtk-config --libs` ++COPT = `pkg-config --cflags --libs gtk+-2.0` ++DOT_LIBS=../../.libs ++LIBS= -L${DOT_LIBS} -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 main.o interface.o callbacks.o diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile --- ./svm-toy/qt/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2008-04-03 14:19:47.000000000 +1000 -@@ -1,19 +1,48 @@ ++++ ./svm-toy/qt/Makefile 2008-04-03 15:23:17.000000000 +1000 +@@ -1,19 +1,50 @@ CXX? = g++ -CFLAGS = -Wall -O3 -DQT_THREAD_SUPPORT -BIN = $(QTDIR)/bin @@ -384,22 +392,22 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile +CFLAGS = -Wall -O3 +#LIBDIR?=/usr/lib64 +#QT4_DIR= -+QT4_DIR= $(shell if [ -e ${LIBDIR}/qt4 ]; then echo ${LIBDIR}/qt4; fi) ++QT4_DIR:= $(shell if [ -e ${LIBDIR}/qt4 ]; then echo ${LIBDIR}/qt4; fi) -svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o - $(CXX) -I$(INCLUDE) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy -L$(LIB) -lqt-mt +ifdef QT4_DIR -+ QTDIR=${QT4_DIR} -+ BIN = ${QTDIR}/bin -+ FLAGS=${CFLAGS} -I/usr/include/Qt -DQT3_SUPPORT -DQT_INCLUDE_COMPAT `pkg-config --cflags --libs Qt3Support QtGui` -+ QT3_TO_4=$(shell if [ -e "${BIN}/qt3to4" ]; then echo "${BIN}/qt3to4"; fi) ++ QTDIR:=${QT4_DIR} ++ BIN := ${QTDIR}/bin ++ FLAGS:=${CFLAGS} -I/usr/include/Qt -DQT3_SUPPORT -DQT_INCLUDE_COMPAT `pkg-config --cflags --libs Qt3Support QtGui` ++ QT3_TO_4:=$(shell if [ -e "${BIN}/qt3to4" ]; then echo "${BIN}/qt3to4"; fi) + ifndef QT3_TO_4 -+ QT3_TO_4=$(shell if [ -e /usr/bin/qt3to4 ]; then echo /usr/bin/qt3to4; fi) ++ QT3_TO_4:=$(shell if [ -e /usr/bin/qt3to4 ]; then echo /usr/bin/qt3to4; fi) + endif +else -+ QTDIR=${LIBDIR}/qt-3.3 -+ BIN = ${QTDIR}/bin -+ FLAGS=${CFLAGS} `pkg-config --cflags --libs qt-mt` ++ QTDIR:=${LIBDIR}/qt-3.3 ++ BIN := ${QTDIR}/bin ++ FLAGS:=${CFLAGS} `pkg-config --cflags --libs qt-mt` +endif + + @@ -418,6 +426,9 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile - cd ../..; make svm.o + +svm-toy.moc: svm-toy.new.cpp ++ echo "QT4_DIR=${QT4_DIR}" ++ echo "QTDIR=${QTDIR}" ++ echo "BIN=${BIN}" +# echo "LIBDIR=${LIBDIR}" +# echo "FLAGS=${FLAGS}" + ${BIN}/moc svm-toy.new.cpp -o svm-toy.moc @@ -425,10 +436,9 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile +# cd ../..; make svm.o + +svm-toy.new.cpp: svm-toy.cpp -+# echo "QTDIR=${QTDIR}" + cp svm-toy.cpp svm-toy.new.cpp ++ifdef QT3_TO_4 + echo "QT3_TO_4=${QT3_TO_4}" -+ifdef QT3_To_4 + ${QT3_TO_4} -alwaysOverwrite svm-toy.new.cpp +endif + @@ -541,60 +551,52 @@ diff -up ./svm-toy/qt/svm-toy.cpp.orig ./svm-toy/qt/svm-toy.cpp } int main( int argc, char* argv[] ) -diff -up ./svm-toy/gtk/interface.h.orig ./svm-toy/gtk/interface.h -diff -up ./svm-toy/gtk/interface.c.orig ./svm-toy/gtk/interface.c -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 2008-04-01 16:17:52.000000000 +1000 -@@ -1,22 +1,28 @@ - CC? = gcc - CXX? = g++ --CFLAGS = -Wall -O3 -g `gtk-config --cflags` --LIBS = `gtk-config --libs` -+#CFLAGS = -Wall -O3 -g `gtk-config --cflags` -+#LIBS = `gtk-config --libs` -+COPT = `pkg-config --cflags --libs gtk+-2.0` -+DOT_LIBS=../../.libs -+LIBS= -L${DOT_LIBS} -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 +diff -up ./svm-train.c.orig ./svm-train.c +diff -up ./tools/checkdata.py.orig ./tools/checkdata.py +diff -up ./tools/easy.py.orig ./tools/easy.py +--- ./tools/easy.py.orig 2008-02-10 22:12:43.000000000 +1000 ++++ ./tools/easy.py 2008-04-01 16:17:52.000000000 +1000 +@@ -2,6 +2,7 @@ - main.o: main.c -- $(CC) $(CFLAGS) -c main.c -+ $(CC) $(COPT) -c main.c + import sys + import os ++from distutils.sysconfig import get_python_lib + from subprocess import * - interface.o: interface.c interface.h -- $(CC) $(CFLAGS) -c interface.c -+ $(CC) $(COPT) -c interface.c + if len(sys.argv) <= 1: +@@ -12,10 +13,10 @@ if len(sys.argv) <= 1: - callbacks.o: callbacks.cpp callbacks.h -- $(CXX) $(CFLAGS) -c callbacks.cpp -+ $(CXX) $(COPT) -c callbacks.cpp + 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-03-10 00:33:09.000000000 +1000 ++++ ./tools/grid.py 2008-04-01 16:17:52.000000000 +1000 +@@ -11,7 +11,7 @@ from subprocess import * --../../svm.o: -- cd ../..; make svm.o -+#../../svm.o: -+# cd ../..; make svm.o + 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 - 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/gtk/callbacks.h.orig ./svm-toy/gtk/callbacks.h -diff -up ./svm-toy/gtk/main.c.orig ./svm-toy/gtk/main.c -diff -up ./svm-toy/gtk/callbacks.cpp.orig ./svm-toy/gtk/callbacks.cpp ---- ./svm-toy/gtk/callbacks.cpp.orig 2008-04-01 16:55:09.000000000 +1000 -+++ ./svm-toy/gtk/callbacks.cpp 2008-04-01 17:04:12.000000000 +1000 -@@ -2,6 +2,7 @@ - #include - #include - #include -+#include - #include "callbacks.h" - #include "interface.h" - #include "../../svm.h" + 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 -up ./tools/subset.py.orig ./tools/subset.py diff --git a/libsvm.spec b/libsvm.spec index 0606864..d491d51 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.86 -Release: 9%{?dist} +Release: 11%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -203,7 +203,7 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Thu Mar 13 2008 Ding-Yi Chen - 2.86-9 +* Thu Mar 13 2008 Ding-Yi Chen - 2.86-11 - Fix the Qt path problem * Wed Mar 12 2008 Ding-Yi Chen - 2.86-4 From 8915963aa387389c4660cdefb5b7c3205870257d Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 3 Apr 2008 06:20:01 +0000 Subject: [PATCH 029/136] Correct changlog date --- libsvm.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index d491d51..3bcb8e6 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.86 -Release: 11%{?dist} +Release: 12%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -203,13 +203,16 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Thu Mar 13 2008 Ding-Yi Chen - 2.86-11 +* 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 Mar 12 2008 Ding-Yi Chen - 2.86-4 +* Wed Apr 2 2008 Ding-Yi Chen - 2.86-4 - Support both Qt3 for F8 and earlier, and Qt4 for F9 -* Tue Mar 11 2008 Ding-Yi Chen - 2.86-0 +* 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 From 61c60df60afed4393a5e864e66e47e204d8055b3 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 29 Apr 2008 08:16:36 +0000 Subject: [PATCH 030/136] Fix svm-toy-qt clear buttom problem --- libsvm-2.86.patch | 42 ++++++++++++++++++++++-------------------- libsvm.spec | 7 ++++++- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/libsvm-2.86.patch b/libsvm-2.86.patch index 72bfddb..c8314e1 100644 --- a/libsvm-2.86.patch +++ b/libsvm-2.86.patch @@ -1,9 +1,8 @@ diff -up ./FAQ.html.orig ./FAQ.html diff -up ./java/libsvm/svm.java.orig ./java/libsvm/svm.java -diff -up ./java/libsvm/svm.m4.orig ./java/libsvm/svm.m4 diff -up ./java/libsvm/svm_model.java.orig ./java/libsvm/svm_model.java --- ./java/libsvm/svm_model.java.orig 2007-01-13 08:23:39.000000000 +1000 -+++ ./java/libsvm/svm_model.java 2008-04-01 16:17:52.000000000 +1000 ++++ ./java/libsvm/svm_model.java 2008-04-29 15:48:00.000000000 +1000 @@ -4,6 +4,7 @@ package libsvm; public class svm_model implements java.io.Serializable @@ -14,7 +13,7 @@ diff -up ./java/libsvm/svm_model.java.orig ./java/libsvm/svm_model.java int l; // total #SV diff -up ./java/libsvm/svm_node.java.orig ./java/libsvm/svm_node.java --- ./java/libsvm/svm_node.java.orig 2003-10-11 22:30:47.000000000 +1000 -+++ ./java/libsvm/svm_node.java 2008-04-01 16:17:52.000000000 +1000 ++++ ./java/libsvm/svm_node.java 2008-04-29 15:48:00.000000000 +1000 @@ -1,6 +1,7 @@ package libsvm; public class svm_node implements java.io.Serializable @@ -25,7 +24,7 @@ diff -up ./java/libsvm/svm_node.java.orig ./java/libsvm/svm_node.java } diff -up ./java/libsvm/svm_parameter.java.orig ./java/libsvm/svm_parameter.java --- ./java/libsvm/svm_parameter.java.orig 2006-03-04 01:44:14.000000000 +1000 -+++ ./java/libsvm/svm_parameter.java 2008-04-01 16:17:52.000000000 +1000 ++++ ./java/libsvm/svm_parameter.java 2008-04-29 15:48:00.000000000 +1000 @@ -1,6 +1,7 @@ package libsvm; public class svm_parameter implements Cloneable,java.io.Serializable @@ -36,7 +35,7 @@ diff -up ./java/libsvm/svm_parameter.java.orig ./java/libsvm/svm_parameter.java public static final int NU_SVC = 1; diff -up ./java/libsvm/svm_problem.java.orig ./java/libsvm/svm_problem.java --- ./java/libsvm/svm_problem.java.orig 2003-10-11 22:30:47.000000000 +1000 -+++ ./java/libsvm/svm_problem.java 2008-04-01 16:17:52.000000000 +1000 ++++ ./java/libsvm/svm_problem.java 2008-04-29 15:48:00.000000000 +1000 @@ -1,6 +1,7 @@ package libsvm; public class svm_problem implements java.io.Serializable @@ -47,7 +46,7 @@ diff -up ./java/libsvm/svm_problem.java.orig ./java/libsvm/svm_problem.java public svm_node[][] x; diff -up ./java/Makefile.orig ./java/Makefile --- ./java/Makefile.orig 2007-11-11 22:17:30.000000000 +1000 -+++ ./java/Makefile 2008-04-01 16:17:52.000000000 +1000 ++++ ./java/Makefile 2008-04-29 15:48:00.000000000 +1000 @@ -3,13 +3,22 @@ FILES = libsvm/svm.class libsvm/svm_mode libsvm/svm_parameter.class libsvm/svm_problem.class \ svm_train.class svm_predict.class svm_toy.class svm_scale.class @@ -103,7 +102,7 @@ diff -up ./java/svm_predict.java.orig ./java/svm_predict.java diff -up ./java/svm_scale.java.orig ./java/svm_scale.java diff -up ./java/svm_toy.java.orig ./java/svm_toy.java --- ./java/svm_toy.java.orig 2007-07-01 23:02:51.000000000 +1000 -+++ ./java/svm_toy.java 2008-04-01 16:17:52.000000000 +1000 ++++ ./java/svm_toy.java 2008-04-29 15:48:00.000000000 +1000 @@ -6,7 +6,7 @@ import java.awt.event.*; import java.io.*; @@ -124,7 +123,7 @@ diff -up ./java/svm_toy.java.orig ./java/svm_toy.java diff -up ./java/svm_train.java.orig ./java/svm_train.java diff -up ./java/test_applet.html.orig ./java/test_applet.html --- ./java/test_applet.html.orig 2003-07-12 14:06:55.000000000 +1000 -+++ ./java/test_applet.html 2008-04-01 16:17:52.000000000 +1000 ++++ ./java/test_applet.html 2008-04-29 15:48:00.000000000 +1000 @@ -1 +1,3 @@ - + @@ -132,7 +131,7 @@ diff -up ./java/test_applet.html.orig ./java/test_applet.html + diff -up ./Makefile.orig ./Makefile --- ./Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./Makefile 2008-04-01 16:21:40.000000000 +1000 ++++ ./Makefile 2008-04-29 15:48:00.000000000 +1000 @@ -1,15 +1,109 @@ CXX? = g++ CFLAGS = -Wall -O3 @@ -256,7 +255,7 @@ diff -up ./Makefile.orig ./Makefile diff -up ./python/cross_validation.py.orig ./python/cross_validation.py diff -up ./python/Makefile.orig ./python/Makefile --- ./python/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./python/Makefile 2008-04-01 16:17:52.000000000 +1000 ++++ ./python/Makefile 2008-04-29 15:48:00.000000000 +1000 @@ -2,9 +2,16 @@ CXX? = g++ SWIG ?= swig @@ -317,12 +316,13 @@ diff -up ./python/svmc_wrap.c.orig ./python/svmc_wrap.c diff -up ./python/svm.py.orig ./python/svm.py diff -up ./python/svm_test.py.orig ./python/svm_test.py diff -up ./python/test_cross_validation.py.orig ./python/test_cross_validation.py +diff -up ./svm.cpp.orig ./svm.cpp diff -up ./svm.h.orig ./svm.h diff -up ./svm-predict.c.orig ./svm-predict.c diff -up ./svm-scale.c.orig ./svm-scale.c diff -up ./svm-toy/gtk/callbacks.cpp.orig ./svm-toy/gtk/callbacks.cpp ---- ./svm-toy/gtk/callbacks.cpp.orig 2008-04-01 16:55:09.000000000 +1000 -+++ ./svm-toy/gtk/callbacks.cpp 2008-04-01 17:04:12.000000000 +1000 +--- ./svm-toy/gtk/callbacks.cpp.orig 2006-03-04 17:40:12.000000000 +1000 ++++ ./svm-toy/gtk/callbacks.cpp 2008-04-29 15:48:00.000000000 +1000 @@ -2,6 +2,7 @@ #include #include @@ -337,7 +337,7 @@ diff -up ./svm-toy/gtk/interface.h.orig ./svm-toy/gtk/interface.h diff -up ./svm-toy/gtk/main.c.orig ./svm-toy/gtk/main.c 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 2008-04-01 16:17:52.000000000 +1000 ++++ ./svm-toy/gtk/Makefile 2008-04-29 15:48:00.000000000 +1000 @@ -1,22 +1,28 @@ CC? = gcc CXX? = g++ @@ -379,7 +379,7 @@ diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile + rm -f *~ callbacks.o svm-toy main.o interface.o callbacks.o diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile --- ./svm-toy/qt/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2008-04-03 15:23:17.000000000 +1000 ++++ ./svm-toy/qt/Makefile 2008-04-29 16:29:15.000000000 +1000 @@ -1,19 +1,50 @@ CXX? = g++ -CFLAGS = -Wall -O3 -DQT_THREAD_SUPPORT @@ -392,7 +392,7 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile +CFLAGS = -Wall -O3 +#LIBDIR?=/usr/lib64 +#QT4_DIR= -+QT4_DIR:= $(shell if [ -e ${LIBDIR}/qt4 ]; then echo ${LIBDIR}/qt4; fi) ++QT4_DIR:= $(shell if [ -e ${LIBDIR}/pkgconfig/Qt3Support.pc ]; then echo ${LIBDIR}/qt4; fi) -svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o - $(CXX) -I$(INCLUDE) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy -L$(LIB) -lqt-mt @@ -446,15 +446,16 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile - rm -f *~ svm-toy svm-toy.moc ../../svm.o + rm -f *~ svm-toy-qt svm-toy.moc ../../svm.o svm-toy.new.cpp diff -up ./svm-toy/qt/svm-toy.cpp.orig ./svm-toy/qt/svm-toy.cpp ---- ./svm-toy/qt/svm-toy.cpp.orig 2008-04-01 16:55:51.000000000 +1000 -+++ ./svm-toy/qt/svm-toy.cpp 2008-04-02 14:01:47.000000000 +1000 +--- ./svm-toy/qt/svm-toy.cpp.orig 2006-03-04 17:40:12.000000000 +1000 ++++ ./svm-toy/qt/svm-toy.cpp 2008-04-29 16:13:32.000000000 +1000 @@ -67,14 +67,15 @@ private: void clear_all() { point_list.clear(); - buffer.fill(black); +- paintEvent(NULL); + buffer.fill(Qt::black); - paintEvent(NULL); ++ repaint(FALSE); } void draw_point(const point& p) { @@ -551,11 +552,12 @@ diff -up ./svm-toy/qt/svm-toy.cpp.orig ./svm-toy/qt/svm-toy.cpp } int main( int argc, char* argv[] ) +diff -up ./svm-toy/windows/svm-toy.cpp.orig ./svm-toy/windows/svm-toy.cpp diff -up ./svm-train.c.orig ./svm-train.c diff -up ./tools/checkdata.py.orig ./tools/checkdata.py diff -up ./tools/easy.py.orig ./tools/easy.py --- ./tools/easy.py.orig 2008-02-10 22:12:43.000000000 +1000 -+++ ./tools/easy.py 2008-04-01 16:17:52.000000000 +1000 ++++ ./tools/easy.py 2008-04-29 15:48:00.000000000 +1000 @@ -2,6 +2,7 @@ import sys @@ -581,7 +583,7 @@ diff -up ./tools/easy.py.orig ./tools/easy.py # example for windows diff -up ./tools/grid.py.orig ./tools/grid.py --- ./tools/grid.py.orig 2008-03-10 00:33:09.000000000 +1000 -+++ ./tools/grid.py 2008-04-01 16:17:52.000000000 +1000 ++++ ./tools/grid.py 2008-04-29 15:48:00.000000000 +1000 @@ -11,7 +11,7 @@ from subprocess import * is_win32 = (sys.platform == 'win32') diff --git a/libsvm.spec b/libsvm.spec index 3bcb8e6..91cb695 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.86 -Release: 12%{?dist} +Release: 13%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -203,6 +203,11 @@ rm -rf $RPM_BUILD_ROOT %changelog +* 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 From af6ee5565c2cf0e0731047d3e417a1bedac516a0 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Fri, 7 Nov 2008 08:00:37 +0000 Subject: [PATCH 031/136] Upstream update --- .cvsignore | 2 +- import.log | 1 + libsvm-2.86.patch | 604 ---------------------------------------------- libsvm-2.88.patch | 373 ++++++++++++++++++++++++++++ libsvm.spec | 56 +++-- log | 20 +- sources | 2 +- 7 files changed, 436 insertions(+), 622 deletions(-) create mode 100644 import.log delete mode 100644 libsvm-2.86.patch create mode 100644 libsvm-2.88.patch diff --git a/.cvsignore b/.cvsignore index d5d706e..12c8c4b 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1,2 @@ guide.pdf -libsvm-2.86.tar.gz +libsvm-2.88.tar.gz diff --git a/import.log b/import.log new file mode 100644 index 0000000..c281024 --- /dev/null +++ b/import.log @@ -0,0 +1 @@ +libsvm-2_88-0_fc9:HEAD:libsvm-2.88-0.fc9.src.rpm:1226043285 diff --git a/libsvm-2.86.patch b/libsvm-2.86.patch deleted file mode 100644 index c8314e1..0000000 --- a/libsvm-2.86.patch +++ /dev/null @@ -1,604 +0,0 @@ -diff -up ./FAQ.html.orig ./FAQ.html -diff -up ./java/libsvm/svm.java.orig ./java/libsvm/svm.java -diff -up ./java/libsvm/svm_model.java.orig ./java/libsvm/svm_model.java ---- ./java/libsvm/svm_model.java.orig 2007-01-13 08:23:39.000000000 +1000 -+++ ./java/libsvm/svm_model.java 2008-04-29 15:48:00.000000000 +1000 -@@ -4,6 +4,7 @@ - package libsvm; - public class svm_model implements java.io.Serializable - { -+ static final long serialVersionUID = 2709444323471798245L; - svm_parameter param; // parameter - int nr_class; // number of classes, = 2 in regression/one class svm - int l; // total #SV -diff -up ./java/libsvm/svm_node.java.orig ./java/libsvm/svm_node.java ---- ./java/libsvm/svm_node.java.orig 2003-10-11 22:30:47.000000000 +1000 -+++ ./java/libsvm/svm_node.java 2008-04-29 15:48:00.000000000 +1000 -@@ -1,6 +1,7 @@ - package libsvm; - public class svm_node implements java.io.Serializable - { -+ static final long serialVersionUID = 2709444323471798245L; - public int index; - public double value; - } -diff -up ./java/libsvm/svm_parameter.java.orig ./java/libsvm/svm_parameter.java ---- ./java/libsvm/svm_parameter.java.orig 2006-03-04 01:44:14.000000000 +1000 -+++ ./java/libsvm/svm_parameter.java 2008-04-29 15:48:00.000000000 +1000 -@@ -1,6 +1,7 @@ - package libsvm; - public class svm_parameter implements Cloneable,java.io.Serializable - { -+ static final long serialVersionUID = 2709444323471798245L; - /* svm_type */ - public static final int C_SVC = 0; - public static final int NU_SVC = 1; -diff -up ./java/libsvm/svm_problem.java.orig ./java/libsvm/svm_problem.java ---- ./java/libsvm/svm_problem.java.orig 2003-10-11 22:30:47.000000000 +1000 -+++ ./java/libsvm/svm_problem.java 2008-04-29 15:48:00.000000000 +1000 -@@ -1,6 +1,7 @@ - package libsvm; - public class svm_problem implements java.io.Serializable - { -+ static final long serialVersionUID = -4451389443706847272L; - public int l; - public double[] y; - public svm_node[][] x; -diff -up ./java/Makefile.orig ./java/Makefile ---- ./java/Makefile.orig 2007-11-11 22:17:30.000000000 +1000 -+++ ./java/Makefile 2008-04-29 15:48:00.000000000 +1000 -@@ -3,13 +3,22 @@ FILES = libsvm/svm.class libsvm/svm_mode - libsvm/svm_parameter.class libsvm/svm_problem.class \ - svm_train.class svm_predict.class svm_toy.class svm_scale.class - --#JAVAC = jikes --JAVAC_FLAGS = -target 1.5 -source 1.5 --JAVAC = javac --# JAVAC_FLAGS = -+JAVA_TARGETDIR=${INSTDIR}/share/libsvm/java -+JAVA_DOCDIR=${INSTDIR}/share/javadoc/libsvm-${LIBSVM_VER} -+CLASSPATH = . -+JAVAC_FLAGS = -target 1.5 -source 1.5 -classpath ${CLASSPATH} -+ -+ifndef JAVAC -+JAVAC=javac -+endif -+ -+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) $< -@@ -17,8 +26,22 @@ all: $(FILES) - libsvm/svm.java: libsvm/svm.m4 - m4 libsvm/svm.m4 > libsvm/svm.java - -+javadoc: -+ javadoc -d docs *.java libsvm/*.java -+ -+install: -+ mkdir -p ${JAVA_TARGETDIR} -+ install -m 644 libsvm.jar ${JAVA_TARGETDIR} -+ install -m 644 test_applet.html ${JAVA_TARGETDIR} -+# mkdir -p ${JAVA_DOCDIR} -+# cd docs; cp -R * ${JAVA_DOCDIR} -+uninstall: -+ rm -fr ${JAVA_TARGETDIR} -+ rm -fr ${JAVA_DOCDIR} -+ - clean: - rm -f libsvm/*.class *.class *.jar libsvm/*~ *~ libsvm/svm.java -+ rm -rf docs - - dist: clean all - rm *.class libsvm/*.class -diff -up ./java/svm_predict.java.orig ./java/svm_predict.java -diff -up ./java/svm_scale.java.orig ./java/svm_scale.java -diff -up ./java/svm_toy.java.orig ./java/svm_toy.java ---- ./java/svm_toy.java.orig 2007-07-01 23:02:51.000000000 +1000 -+++ ./java/svm_toy.java 2008-04-29 15:48:00.000000000 +1000 -@@ -6,7 +6,7 @@ import java.awt.event.*; - import java.io.*; - - public class svm_toy extends Applet { -- -+ static final long serialVersionUID = -8325676470152687806L; - static final String DEFAULT_PARAM="-t 2 -c 100"; - int XLEN; - int YLEN; -@@ -453,6 +453,7 @@ public class svm_toy extends Applet { - } - - class AppletFrame extends Frame { -+ static final long serialVersionUID = -8428435143024670779L; - AppletFrame(String title, Applet applet, int width, int height) - { - super(title); -diff -up ./java/svm_train.java.orig ./java/svm_train.java -diff -up ./java/test_applet.html.orig ./java/test_applet.html ---- ./java/test_applet.html.orig 2003-07-12 14:06:55.000000000 +1000 -+++ ./java/test_applet.html 2008-04-29 15:48:00.000000000 +1000 -@@ -1 +1,3 @@ -- -+ -+ -+ -diff -up ./Makefile.orig ./Makefile ---- ./Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./Makefile 2008-04-29 15:48:00.000000000 +1000 -@@ -1,15 +1,109 @@ - CXX? = g++ - CFLAGS = -Wall -O3 -+MAKE = make -+LIBSVM_VER=${LIBSVM_VER_MAJOR}.${LIBSVM_VER_MINOR} -+DOT_LIBS=.libs -+LIBS= -L${DOT_LIBS} -lsvm - --all: svm-train svm-predict svm-scale -+export LIBSVM_VER - --svm-predict: svm-predict.c svm.o -- $(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm --svm-train: svm-train.c svm.o -- $(CXX) $(CFLAGS) svm-train.c svm.o -o svm-train -lm --svm-scale: svm-scale.c -- $(CXX) $(CFLAGS) svm-scale.c -o svm-scale --svm.o: svm.cpp svm.h -- $(CXX) $(CFLAGS) -c svm.cpp -+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: svm-train svm-predict svm-scale svm-python svm-java svm-lib svm-toy-gtk svm-toy-qt -+ -+svm-lib: %{DOT_LIBS}/libsvm.so -+ -+%{DOT_LIBS}/libsvm.so: svm-share.o -+ $(CXX) -shared -Wl,-soname,libsvm.so.${LIBSVM_VER_MAJOR}\ -+ -o libsvm.so.${LIBSVM_VER} svm-share.o -lm -+ mkdir -p .libs -+ cd ${DOT_LIBS}; ln -sf ../libsvm.so.${LIBSVM_VER} libsvm.so -+svm-share.o: svm.cpp svm.h -+ $(CXX) -g -fPIC $(CFLAGS) -c svm.cpp -o svm-share.o -+svm-predict: svm-predict.c %{DOT_LIBS}/libsvm.so -+ $(CXX) $(CFLAGS) svm-predict.c -o svm-predict $(LIBS) -lm -+svm-train: svm-train.c %{DOT_LIBS}/libsvm.so -+ $(CXX) $(CFLAGS) svm-train.c -o svm-train $(LIBS) -lm -+svm-scale: svm-scale.c %{DOT_LIBS}/libsvm.so -+ $(CXX) $(CFLAGS) svm-scale.c -o svm-scale $(LIBS) -+#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: -+ ${MAKE} -C java -+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.${LIBSVM_VER} ${LIB_INSTDIR} -+ /sbin/ldconfig -n ${LIB_INSTDIR} -+ cd ${LIB_INSTDIR}; ln -fs libsvm.so.${LIBSVM_VER_MAJOR} libsvm.so -+# 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 -+ 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-python -+ ${MAKE} -C python install -+# install package libsvm-java -+ ${MAKE} -C java 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 -+ ${MAKE} -C java uninstall -+ rm -f ${INSTDIR}/bin/svm-toy-gtk -+ rm -f ${INSTDIR}/bin/svm-toy-qt -+ -diff -up ./python/cross_validation.py.orig ./python/cross_validation.py -diff -up ./python/Makefile.orig ./python/Makefile ---- ./python/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./python/Makefile 2008-04-29 15:48:00.000000000 +1000 -@@ -2,9 +2,16 @@ CXX? = g++ - SWIG ?= swig - - #Windows: see ../README ../Makefile.win --PYTHON_INCLUDEDIR ?= /usr/include/python2.4 -+#PYTHON_TEMP:=${shell mktemp} -+#PYTHON_VERSION:=${shell python -V 2> ${PYTHON_TEMP} ; cat ${PYTHON_TEMP} | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$$2,$$3)}'; rm -f ${PYTHON_TEMP}} -+ifndef PYTHON_INCLUDEDIR - --CFLAGS = -O3 -I$(PYTHON_INCLUDEDIR) -I.. -+PYTHON_INCLUDEDIR?= /usr/include/python${PYTHON_VERSION} -+ -+endif -+PYTHON_TARGETDIR=${LIB_INSTDIR}/python${PYTHON_VERSION}/site-packages/libsvm -+ -+CFLAGS_PYTHON = ${CFLAGS} -O3 -I$(PYTHON_INCLUDEDIR) -I.. - LDFLAGS = -shared - # Mac OS - # LDFLAGS = -framework Python -bundle -@@ -15,16 +22,34 @@ 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 -+# echo "PYTHON_VERSION=${PYTHON_VERSION}" -+# echo "CFLAGS=${CFLAGS}" -+# echo "CFLAGS_PYTHON=${CFLAGS_PYTHON}" -+ $(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 ./python/svmc_wrap.c.orig ./python/svmc_wrap.c -diff -up ./python/svm.py.orig ./python/svm.py -diff -up ./python/svm_test.py.orig ./python/svm_test.py -diff -up ./python/test_cross_validation.py.orig ./python/test_cross_validation.py -diff -up ./svm.cpp.orig ./svm.cpp -diff -up ./svm.h.orig ./svm.h -diff -up ./svm-predict.c.orig ./svm-predict.c -diff -up ./svm-scale.c.orig ./svm-scale.c -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 2008-04-29 15:48:00.000000000 +1000 -@@ -2,6 +2,7 @@ - #include - #include - #include -+#include - #include "callbacks.h" - #include "interface.h" - #include "../../svm.h" -diff -up ./svm-toy/gtk/callbacks.h.orig ./svm-toy/gtk/callbacks.h -diff -up ./svm-toy/gtk/interface.c.orig ./svm-toy/gtk/interface.c -diff -up ./svm-toy/gtk/interface.h.orig ./svm-toy/gtk/interface.h -diff -up ./svm-toy/gtk/main.c.orig ./svm-toy/gtk/main.c -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 2008-04-29 15:48:00.000000000 +1000 -@@ -1,22 +1,28 @@ - CC? = gcc - CXX? = g++ --CFLAGS = -Wall -O3 -g `gtk-config --cflags` --LIBS = `gtk-config --libs` -+#CFLAGS = -Wall -O3 -g `gtk-config --cflags` -+#LIBS = `gtk-config --libs` -+COPT = `pkg-config --cflags --libs gtk+-2.0` -+DOT_LIBS=../../.libs -+LIBS= -L${DOT_LIBS} -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 main.o interface.o callbacks.o -diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile ---- ./svm-toy/qt/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2008-04-29 16:29:15.000000000 +1000 -@@ -1,19 +1,50 @@ - CXX? = g++ --CFLAGS = -Wall -O3 -DQT_THREAD_SUPPORT --BIN = $(QTDIR)/bin --INCLUDE = $(QTDIR)/include --LIB = $(QTDIR)/lib --#BIN = /usr/bin --#INCLUDE = /usr/include/qt3 --#LIB = /usr/lib/qt3 -+CFLAGS = -Wall -O3 -+#LIBDIR?=/usr/lib64 -+#QT4_DIR= -+QT4_DIR:= $(shell if [ -e ${LIBDIR}/pkgconfig/Qt3Support.pc ]; then echo ${LIBDIR}/qt4; fi) - --svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o -- $(CXX) -I$(INCLUDE) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy -L$(LIB) -lqt-mt -+ifdef QT4_DIR -+ QTDIR:=${QT4_DIR} -+ BIN := ${QTDIR}/bin -+ FLAGS:=${CFLAGS} -I/usr/include/Qt -DQT3_SUPPORT -DQT_INCLUDE_COMPAT `pkg-config --cflags --libs Qt3Support QtGui` -+ QT3_TO_4:=$(shell if [ -e "${BIN}/qt3to4" ]; then echo "${BIN}/qt3to4"; fi) -+ ifndef QT3_TO_4 -+ QT3_TO_4:=$(shell if [ -e /usr/bin/qt3to4 ]; then echo /usr/bin/qt3to4; fi) -+ endif -+else -+ QTDIR:=${LIBDIR}/qt-3.3 -+ BIN := ${QTDIR}/bin -+ FLAGS:=${CFLAGS} `pkg-config --cflags --libs qt-mt` -+endif -+ -+ -+DOT_LIBS=../../.libs -+LIBS= -L${DOT_LIBS} -lsvm -+ -+all: svm-toy-qt -+ -+svm-toy-qt: svm-toy.new.cpp svm-toy.moc ../../svm.o -+ $(CXX) $(FLAGS) svm-toy.new.cpp ../../svm.o -o svm-toy-qt $(LIBS) - # add -pthread for bsd - --svm-toy.moc: svm-toy.cpp -- $(BIN)/moc svm-toy.cpp -o svm-toy.moc --../../svm.o: -- cd ../..; make svm.o -+ -+svm-toy.moc: svm-toy.new.cpp -+ echo "QT4_DIR=${QT4_DIR}" -+ echo "QTDIR=${QTDIR}" -+ echo "BIN=${BIN}" -+# echo "LIBDIR=${LIBDIR}" -+# echo "FLAGS=${FLAGS}" -+ ${BIN}/moc svm-toy.new.cpp -o svm-toy.moc -+#../../svm.o: -+# cd ../..; make svm.o -+ -+svm-toy.new.cpp: svm-toy.cpp -+ cp svm-toy.cpp svm-toy.new.cpp -+ifdef QT3_TO_4 -+ echo "QT3_TO_4=${QT3_TO_4}" -+ ${QT3_TO_4} -alwaysOverwrite svm-toy.new.cpp -+endif -+ - clean: -- rm -f *~ svm-toy svm-toy.moc ../../svm.o -+ rm -f *~ svm-toy-qt svm-toy.moc ../../svm.o svm-toy.new.cpp -diff -up ./svm-toy/qt/svm-toy.cpp.orig ./svm-toy/qt/svm-toy.cpp ---- ./svm-toy/qt/svm-toy.cpp.orig 2006-03-04 17:40:12.000000000 +1000 -+++ ./svm-toy/qt/svm-toy.cpp 2008-04-29 16:13:32.000000000 +1000 -@@ -67,14 +67,15 @@ private: - void clear_all() - { - point_list.clear(); -- buffer.fill(black); -- paintEvent(NULL); -+ buffer.fill(Qt::black); -+ repaint(FALSE); - } - void draw_point(const point& p) - { - const QPixmap& icon = choose_icon(p.value); -- window_painter.drawPixmap((int)(p.x*XLEN),(int)(p.y*YLEN),icon); -+ - buffer_painter.drawPixmap((int)(p.x*XLEN),(int)(p.y*YLEN),icon); -+ repaint(FALSE); - } - void draw_all_points() - { -@@ -213,33 +214,23 @@ private slots: - - buffer_painter.setPen(colors[0]); - buffer_painter.drawLine(0,0,0,YLEN-1); -- window_painter.setPen(colors[0]); -- window_painter.drawLine(0,0,0,YLEN-1); - - int p = (int)(param.p * YLEN); - for(i = 1; i < XLEN; i++) - { - buffer_painter.setPen(colors[0]); - buffer_painter.drawLine(i,0,i,YLEN-1); -- window_painter.setPen(colors[0]); -- window_painter.drawLine(i,0,i,YLEN-1); - - buffer_painter.setPen(colors[5]); - buffer_painter.drawLine(i-1,j[i-1],i,j[i]); -- window_painter.setPen(colors[5]); -- window_painter.drawLine(i-1,j[i-1],i,j[i]); - - if(param.svm_type == EPSILON_SVR) - { - buffer_painter.setPen(colors[2]); - buffer_painter.drawLine(i-1,j[i-1]+p,i,j[i]+p); -- window_painter.setPen(colors[2]); -- window_painter.drawLine(i-1,j[i-1]+p,i,j[i]+p); - - buffer_painter.setPen(colors[2]); - buffer_painter.drawLine(i-1,j[i-1]-p,i,j[i]-p); -- window_painter.setPen(colors[2]); -- window_painter.drawLine(i-1,j[i-1]-p,i,j[i]-p); - } - } - -@@ -281,9 +272,7 @@ private slots: - double d = svm_predict(model, x); - if (param.svm_type == ONE_CLASS && d<0) d=2; - buffer_painter.setPen(colors[(int)d]); -- window_painter.setPen(colors[(int)d]); - buffer_painter.drawPoint(i,j); -- window_painter.drawPoint(i,j); - } - - svm_destroy_model(model); -@@ -352,9 +341,9 @@ SvmToyWindow::SvmToyWindow() - ,current_value(1) - { - buffer.resize(XLEN,YLEN); -- buffer.fill(black); -+ buffer.fill(Qt::black); - -- window_painter.begin(this); -+// window_painter.begin(this); - buffer_painter.begin(&buffer); - - QObject::connect(&button_change_icon, SIGNAL(clicked()), this, -@@ -371,7 +360,7 @@ SvmToyWindow::SvmToyWindow() - SLOT(button_run_clicked())); - - // don't blank the window before repainting -- setBackgroundMode( NoBackground ); -+ setBackgroundMode( Qt::NoBackground ); - - icon1.resize(4,4); - icon2.resize(4,4); -@@ -403,7 +392,7 @@ SvmToyWindow::SvmToyWindow() - - SvmToyWindow::~SvmToyWindow() - { -- window_painter.end(); -+// window_painter.end(); - buffer_painter.end(); - } - -@@ -417,7 +406,9 @@ void SvmToyWindow::mousePressEvent( QMou - void SvmToyWindow::paintEvent( QPaintEvent* ) - { - // copy the image from the buffer pixmap to the window -- bitBlt( this, 0, 0, &buffer ); -+ // Compatiable both Qt-3 and Qt-4 -+ QPainter p(this); -+ p.drawPixmap(0, 0, buffer); - } - - int main( int argc, char* argv[] ) -diff -up ./svm-toy/windows/svm-toy.cpp.orig ./svm-toy/windows/svm-toy.cpp -diff -up ./svm-train.c.orig ./svm-train.c -diff -up ./tools/checkdata.py.orig ./tools/checkdata.py -diff -up ./tools/easy.py.orig ./tools/easy.py ---- ./tools/easy.py.orig 2008-02-10 22:12:43.000000000 +1000 -+++ ./tools/easy.py 2008-04-29 15:48:00.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-03-10 00:33:09.000000000 +1000 -+++ ./tools/grid.py 2008-04-29 15:48:00.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 -up ./tools/subset.py.orig ./tools/subset.py diff --git a/libsvm-2.88.patch b/libsvm-2.88.patch new file mode 100644 index 0000000..d42d46a --- /dev/null +++ b/libsvm-2.88.patch @@ -0,0 +1,373 @@ +diff -up ./FAQ.html.orig ./FAQ.html +diff -up ./java/Makefile.orig ./java/Makefile +--- ./java/Makefile.orig 2007-11-11 22:17:30.000000000 +1000 ++++ ./java/Makefile 2008-11-05 16:59:35.000000000 +1000 +@@ -3,13 +3,22 @@ FILES = libsvm/svm.class libsvm/svm_mode + libsvm/svm_parameter.class libsvm/svm_problem.class \ + svm_train.class svm_predict.class svm_toy.class svm_scale.class + +-#JAVAC = jikes +-JAVAC_FLAGS = -target 1.5 -source 1.5 +-JAVAC = javac +-# JAVAC_FLAGS = ++JAVA_TARGETDIR=${INSTDIR}/share/libsvm/java ++JAVA_DOCDIR=${INSTDIR}/share/javadoc/libsvm-${LIBSVM_VER} ++CLASSPATH = . ++JAVAC_FLAGS = -target 1.5 -source 1.5 -classpath ${CLASSPATH} ++ ++ifndef JAVAC ++JAVAC=javac ++endif ++ ++ifndef JAR ++JAR=jar ++endif + +-all: $(FILES) +- jar cvf libsvm.jar *.class libsvm/*.class ++ ++all: $(FILES) javadoc ++ ${JAR} cvf libsvm.jar *.class libsvm/*.class + + .java.class: + $(JAVAC) $(JAVAC_FLAGS) $< +@@ -17,8 +26,24 @@ 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_TARGETDIR} ++ install -m 644 libsvm.jar ${JAVA_TARGETDIR} ++ install -m 644 test_applet.html ${JAVA_TARGETDIR} ++ mkdir -p ${JAVA_DOCDIR} ++ cd docs; cp -R * ${JAVA_DOCDIR} ++uninstall: ++ rm -fr ${JAVA_TARGETDIR} ++ rm -fr ${JAVA_DOCDIR} ++ + 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 2008-11-05 14:08:00.000000000 +1000 +@@ -1 +1,3 @@ +- ++ ++ ++ +diff -up ./Makefile.orig ./Makefile +--- ./Makefile.orig 2008-09-15 14:36:48.000000000 +1000 ++++ ./Makefile 2008-11-05 18:18:03.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: svm-train svm-predict svm-scale lib 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,59 @@ 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: ++ ${MAKE} -C java ++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 ++ 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-python ++ ${MAKE} -C python install ++# install package libsvm-java ++ ${MAKE} -C java 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 ++ ${MAKE} -C java uninstall ++ rm -f ${INSTDIR}/bin/svm-toy-gtk ++ rm -f ${INSTDIR}/bin/svm-toy-qt ++ ++ +diff -up ./python/cross_validation.py.orig ./python/cross_validation.py +diff -up ./python/Makefile.orig ./python/Makefile +--- ./python/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 ++++ ./python/Makefile 2008-11-05 14:08:00.000000000 +1000 +@@ -2,9 +2,16 @@ CXX? = g++ + SWIG ?= swig + + #Windows: see ../README ../Makefile.win +-PYTHON_INCLUDEDIR ?= /usr/include/python2.4 ++#PYTHON_TEMP:=${shell mktemp} ++#PYTHON_VERSION:=${shell python -V 2> ${PYTHON_TEMP} ; cat ${PYTHON_TEMP} | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$$2,$$3)}'; rm -f ${PYTHON_TEMP}} ++ifndef PYTHON_INCLUDEDIR + +-CFLAGS = -O3 -I$(PYTHON_INCLUDEDIR) -I.. ++PYTHON_INCLUDEDIR?= /usr/include/python${PYTHON_VERSION} ++ ++endif ++PYTHON_TARGETDIR=${LIB_INSTDIR}/python${PYTHON_VERSION}/site-packages/libsvm ++ ++CFLAGS_PYTHON = ${CFLAGS} -O3 -I$(PYTHON_INCLUDEDIR) -I.. + LDFLAGS = -shared + # Mac OS + # LDFLAGS = -framework Python -bundle +@@ -15,16 +22,34 @@ 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 ++# echo "PYTHON_VERSION=${PYTHON_VERSION}" ++# echo "CFLAGS=${CFLAGS}" ++# echo "CFLAGS_PYTHON=${CFLAGS_PYTHON}" ++ $(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 ./python/setup.py.orig ./python/setup.py +diff -up ./python/svm.py.orig ./python/svm.py +diff -up ./python/svm_test.py.orig ./python/svm_test.py +diff -up ./python/test_cross_validation.py.orig ./python/test_cross_validation.py +diff -up ./svm.cpp.orig ./svm.cpp +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 2008-11-05 14:08:00.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 2008-11-05 16:18:10.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-05-01 22:42:15.000000000 +1000 ++++ ./svm-toy/qt/Makefile 2008-11-05 17:42:43.000000000 +1000 +@@ -1,17 +1,24 @@ + 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) $(FLAGS) svm-toy.cpp ../../svm.o -o svm-toy ++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 ./svm-toy/qt/svm-toy.cpp.orig ./svm-toy/qt/svm-toy.cpp +diff -up ./svm-toy/windows/svm-toy.cpp.orig ./svm-toy/windows/svm-toy.cpp +diff -up ./tools/checkdata.py.orig ./tools/checkdata.py +diff -up ./tools/easy.py.orig ./tools/easy.py +--- ./tools/easy.py.orig 2008-02-10 22:12:43.000000000 +1000 ++++ ./tools/easy.py 2008-11-05 14:08:00.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 2008-11-05 14:08:00.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 -up ./tools/subset.py.orig ./tools/subset.py diff --git a/libsvm.spec b/libsvm.spec index 91cb695..c6503a4 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm -Version: 2.86 -Release: 13%{?dist} +Version: 2.88 +Release: 0%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -16,8 +16,6 @@ Source5: LibSVM-svm-toy-48.png Patch0: %{name}-%{version}.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root -%define libsvm_ver_major 2 -%define libsvm_ver_minor 86 %{!?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 @@ -59,15 +57,16 @@ programs with libsvm in Python. %package java Summary: Java tools and interfaces for libsvm Group: Development/Libraries -BuildRequires: java-1.5.0-gcj-devel >= 1.5.0.0 -#Client doesn't necessory use gcj -#Requires: java-1.5.0-gcj >= 1.5.0.0 +BuildRequires: java-1.6.0-openjdk-devel +#Client doesn't necessory use java-1.6.0 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. +Install libsvm-javadoc for + %package svm-toy-gtk Summary: GTK version of svm-toy (libsvm demostration program) @@ -84,10 +83,16 @@ display the derived separating hyperplane. %package svm-toy-qt Summary: QT version of svm-toy (libsvm demostration program) Group: Development/Libraries -BuildRequires: qt-devel BuildRequires: desktop-file-utils BuildRequires: pkgconfig + +%if 0%{?fedora} >= 9 +BuildRequires: qt-devel Requires: qt +%else +BuildRequires: qt4-devel +Requires: qt4 +%endif Requires: %{name} = %{version}-%{release} %description svm-toy-qt @@ -107,9 +112,9 @@ cp %{SOURCE5} %{name}-svm-toy-qt-48.png %build -make all CFLAGS="$RPM_OPT_FLAGS" PYTHON_VERSION="%{pyver}" JAVAC="%{javac}" JAR="%{jar}" LIBDIR="%{_libdir}" LIBSVM_VER_MAJOR="%{libsvm_ver_major}" LIBSVM_VER_MINOR=%{libsvm_ver_minor} %{__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}" mv python/README python/README-Python mv tools/README tools/README-Tools cp README java/README-Java @@ -119,8 +124,8 @@ cp README svm-toy/qt %install rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} PYTHON_VERSION="%{pyver}" LIBSVM_VER_MAJOR="%{libsvm_ver_major}" LIBSVM_VER_MINOR=%{libsvm_ver_minor} -#cd ${RPM_BUILD_ROOT}%{libdir_libsvm}; ln -sf %{name}.so.%{version} %{name}.so +make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} PYTHON_VERSION="%{pyver}" LIBSVM_VER="%{version}" +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/ @@ -166,8 +171,7 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/svm-train %dir %{_datadir}/%{name} %{_datadir}/%{name}/examples -%{_libdir}/%{name}.so.%{version} -%{_libdir}/%{name}.so.%{libsvm_ver_major} +%{_libdir}/%{name}.so.1 %files devel @@ -183,9 +187,9 @@ rm -rf $RPM_BUILD_ROOT %files java %defattr(-,root,root,-) -%doc java/README-Java +%doc java/README-Java %{_datadir}/%{name}/java -#%{_datadir}/javadoc/%{name}-%{version} +%{_datadir}/javadoc/%{name}-%{version} %files svm-toy-gtk %defattr(-,root,root,-) @@ -203,6 +207,28 @@ rm -rf $RPM_BUILD_ROOT %changelog +* 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) diff --git a/log b/log index 4df78fb..15da1b9 100644 --- a/log +++ b/log @@ -139,4 +139,22 @@ file updated. 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 \ No newline at end of file + 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 index 0372550..2a65311 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ aae7a8f7e357e86e1c893b706bb02a63 guide.pdf -fe0cccace12516382be5a7c513e4b056 libsvm-2.86.tar.gz +1b69c7d887d349b13f9f2cf245310fea libsvm-2.88.tar.gz From b2087ead7bac97e2a199fa9bc5649da4e5e7e310 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Mon, 10 Nov 2008 05:51:47 +0000 Subject: [PATCH 032/136] Fix java BuildRequire and Build --- import.log | 1 + libsvm-2.88.patch | 4 ++-- libsvm.spec | 16 ++++++++-------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/import.log b/import.log index c281024..6d19672 100644 --- a/import.log +++ b/import.log @@ -1 +1,2 @@ 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 diff --git a/libsvm-2.88.patch b/libsvm-2.88.patch index d42d46a..7db64b9 100644 --- a/libsvm-2.88.patch +++ b/libsvm-2.88.patch @@ -66,7 +66,7 @@ diff -up ./java/test_applet.html.orig ./java/test_applet.html + diff -up ./Makefile.orig ./Makefile --- ./Makefile.orig 2008-09-15 14:36:48.000000000 +1000 -+++ ./Makefile 2008-11-05 18:18:03.000000000 +1000 ++++ ./Makefile 2008-11-10 14:17:06.000000000 +1000 @@ -1,11 +1,40 @@ CXX? = g++ -CFLAGS = -Wall -Wconversion -O3 -fPIC @@ -102,7 +102,7 @@ diff -up ./Makefile.orig ./Makefile +export LIB_INSTDIR + + -+all: svm-train svm-predict svm-scale lib svm-python svm-java svm-toy-gtk svm-toy-qt ++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) diff --git a/libsvm.spec b/libsvm.spec index c6503a4..a0c4d05 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.88 -Release: 0%{?dist} +Release: 1%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -23,6 +23,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root %define javac javac %define jar jar %define libdir_libsvm %{_libdir}/libsvm +%{!?qt3-devel: } %description @@ -57,8 +58,9 @@ programs with libsvm in Python. %package java Summary: Java tools and interfaces for libsvm Group: Development/Libraries -BuildRequires: java-1.6.0-openjdk-devel -#Client doesn't necessory use java-1.6.0 +# javadoc in java-1.5.0-gcj-devel-1.5.0.0-18 is bad. +BuildRequires: java-sdk >= 0:1.5.0.0-21 +Requires: jre >= 0:1.5.0 Requires: %{name} = %{version}-%{release} %description java @@ -86,13 +88,8 @@ Group: Development/Libraries BuildRequires: desktop-file-utils BuildRequires: pkgconfig -%if 0%{?fedora} >= 9 -BuildRequires: qt-devel -Requires: qt -%else BuildRequires: qt4-devel Requires: qt4 -%endif Requires: %{name} = %{version}-%{release} %description svm-toy-qt @@ -207,6 +204,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Nov 10 2008 Ding-Yi Chen - 2.88-1 +- Fix java BuildRequire and Build + * 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. From 888cdbfbe62fea2246a840509439a1f4d14ab127 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 11 Nov 2008 01:06:18 +0000 Subject: [PATCH 033/136] ppc java fix --- import.log | 1 + libsvm-2.88.patch | 11 +++++------ libsvm.spec | 9 ++++----- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/import.log b/import.log index 6d19672..dda8e06 100644 --- a/import.log +++ b/import.log @@ -1,2 +1,3 @@ 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 diff --git a/libsvm-2.88.patch b/libsvm-2.88.patch index 7db64b9..7d31237 100644 --- a/libsvm-2.88.patch +++ b/libsvm-2.88.patch @@ -1,7 +1,7 @@ diff -up ./FAQ.html.orig ./FAQ.html diff -up ./java/Makefile.orig ./java/Makefile --- ./java/Makefile.orig 2007-11-11 22:17:30.000000000 +1000 -+++ ./java/Makefile 2008-11-05 16:59:35.000000000 +1000 ++++ ./java/Makefile 2008-11-11 10:54:50.000000000 +1000 @@ -3,13 +3,22 @@ FILES = libsvm/svm.class libsvm/svm_mode libsvm/svm_parameter.class libsvm/svm_problem.class \ svm_train.class svm_predict.class svm_toy.class svm_scale.class @@ -22,11 +22,10 @@ diff -up ./java/Makefile.orig ./java/Makefile +ifndef JAR +JAR=jar +endif ++ --all: $(FILES) + all: $(FILES) - jar cvf libsvm.jar *.class libsvm/*.class -+ -+all: $(FILES) javadoc + ${JAR} cvf libsvm.jar *.class libsvm/*.class .java.class: @@ -44,8 +43,8 @@ diff -up ./java/Makefile.orig ./java/Makefile + mkdir -p ${JAVA_TARGETDIR} + install -m 644 libsvm.jar ${JAVA_TARGETDIR} + install -m 644 test_applet.html ${JAVA_TARGETDIR} -+ mkdir -p ${JAVA_DOCDIR} -+ cd docs; cp -R * ${JAVA_DOCDIR} ++# mkdir -p ${JAVA_DOCDIR} ++# cd docs; cp -R * ${JAVA_DOCDIR} +uninstall: + rm -fr ${JAVA_TARGETDIR} + rm -fr ${JAVA_DOCDIR} diff --git a/libsvm.spec b/libsvm.spec index a0c4d05..5973f8f 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.88 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -58,8 +58,7 @@ programs with libsvm in Python. %package java Summary: Java tools and interfaces for libsvm Group: Development/Libraries -# javadoc in java-1.5.0-gcj-devel-1.5.0.0-18 is bad. -BuildRequires: java-sdk >= 0:1.5.0.0-21 +BuildRequires: java-sdk >= 0:1.5.0 Requires: jre >= 0:1.5.0 Requires: %{name} = %{version}-%{release} @@ -186,7 +185,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %doc java/README-Java %{_datadir}/%{name}/java -%{_datadir}/javadoc/%{name}-%{version} +#%{_datadir}/javadoc/%{name}-%{version} %files svm-toy-gtk %defattr(-,root,root,-) @@ -204,7 +203,7 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Mon Nov 10 2008 Ding-Yi Chen - 2.88-1 +* Mon Nov 10 2008 Ding-Yi Chen - 2.88-2 - Fix java BuildRequire and Build * Wed Nov 05 2008 Ding-Yi Chen - 2.88-0 From 04ccb3e9c7814ddd3c2ecea28b3424c84a4ced89 Mon Sep 17 00:00:00 2001 From: Ignacio Vazquez-Abrams Date: Sat, 29 Nov 2008 16:48:06 +0000 Subject: [PATCH 034/136] Rebuild for Python 2.6 --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index 5973f8f..9934fe9 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.88 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -203,6 +203,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sat Nov 29 2008 Ignacio Vazquez-Abrams - 2.88-3 +- Rebuild for Python 2.6 + * Mon Nov 10 2008 Ding-Yi Chen - 2.88-2 - Fix java BuildRequire and Build From 034ff9722b53ae199d8d0c66e9eab0cc5dc40efb Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Wed, 25 Feb 2009 19:09:26 +0000 Subject: [PATCH 035/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index 9934fe9..88fa453 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.88 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -203,6 +203,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Feb 25 2009 Fedora Release Engineering - 2.88-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + * Sat Nov 29 2008 Ignacio Vazquez-Abrams - 2.88-3 - Rebuild for Python 2.6 From 0d800094362de787256b010ef0889147f09ce73a Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Fri, 3 Apr 2009 06:30:04 +0000 Subject: [PATCH 036/136] Upstream update to 2.89 --- .cvsignore | 2 +- import.log | 1 + libsvm-2.88.patch => libsvm-2.89.patch | 118 ++++++++++--------------- libsvm.spec | 25 ++++-- sources | 2 +- 5 files changed, 66 insertions(+), 82 deletions(-) rename libsvm-2.88.patch => libsvm-2.89.patch (72%) diff --git a/.cvsignore b/.cvsignore index 12c8c4b..0b08845 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1,2 @@ guide.pdf -libsvm-2.88.tar.gz +libsvm-2.89.tar.gz diff --git a/import.log b/import.log index dda8e06..4383245 100644 --- a/import.log +++ b/import.log @@ -1,3 +1,4 @@ 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 diff --git a/libsvm-2.88.patch b/libsvm-2.89.patch similarity index 72% rename from libsvm-2.88.patch rename to libsvm-2.89.patch index 7d31237..680186a 100644 --- a/libsvm-2.88.patch +++ b/libsvm-2.89.patch @@ -1,36 +1,32 @@ -diff -up ./FAQ.html.orig ./FAQ.html -diff -up ./java/Makefile.orig ./java/Makefile ---- ./java/Makefile.orig 2007-11-11 22:17:30.000000000 +1000 -+++ ./java/Makefile 2008-11-11 10:54:50.000000000 +1000 -@@ -3,13 +3,22 @@ FILES = libsvm/svm.class libsvm/svm_mode - libsvm/svm_parameter.class libsvm/svm_problem.class \ - svm_train.class svm_predict.class svm_toy.class svm_scale.class +diff -up ./java/Makefile.bak ./java/Makefile +--- ./java/Makefile.bak 2009-02-18 10:41:04.000000000 +1000 ++++ ./java/Makefile 2009-04-03 15:13:40.000000000 +1000 +@@ -4,13 +4,22 @@ FILES = libsvm/svm.class libsvm/svm_mode + libsvm/svm_print_interface.class \ + svm_train.class svm_predict.class svm_toy.class svm_scale.class --#JAVAC = jikes --JAVAC_FLAGS = -target 1.5 -source 1.5 --JAVAC = javac --# JAVAC_FLAGS = +JAVA_TARGETDIR=${INSTDIR}/share/libsvm/java +JAVA_DOCDIR=${INSTDIR}/share/javadoc/libsvm-${LIBSVM_VER} +CLASSPATH = . -+JAVAC_FLAGS = -target 1.5 -source 1.5 -classpath ${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 + 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) $< -@@ -17,8 +26,24 @@ all: $(FILES) +@@ -18,8 +27,24 @@ all: $(FILES) libsvm/svm.java: libsvm/svm.m4 m4 libsvm/svm.m4 > libsvm/svm.java @@ -55,17 +51,17 @@ diff -up ./java/Makefile.orig ./java/Makefile 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 2008-11-05 14:08:00.000000000 +1000 +diff -up ./java/test_applet.html.bak ./java/test_applet.html +--- ./java/test_applet.html.bak 2003-07-12 14:07:32.000000000 +1000 ++++ ./java/test_applet.html 2009-04-03 15:04:06.000000000 +1000 @@ -1 +1,3 @@ - + + + -diff -up ./Makefile.orig ./Makefile ---- ./Makefile.orig 2008-09-15 14:36:48.000000000 +1000 -+++ ./Makefile 2008-11-10 14:17:06.000000000 +1000 +diff -up ./Makefile.bak ./Makefile +--- ./Makefile.bak 2008-09-15 14:36:48.000000000 +1000 ++++ ./Makefile 2009-04-03 15:04:06.000000000 +1000 @@ -1,11 +1,40 @@ CXX? = g++ -CFLAGS = -Wall -Wconversion -O3 -fPIC @@ -171,37 +167,27 @@ diff -up ./Makefile.orig ./Makefile + rm -f ${INSTDIR}/bin/svm-toy-qt + + -diff -up ./python/cross_validation.py.orig ./python/cross_validation.py -diff -up ./python/Makefile.orig ./python/Makefile ---- ./python/Makefile.orig 2007-10-14 16:29:12.000000000 +1000 -+++ ./python/Makefile 2008-11-05 14:08:00.000000000 +1000 -@@ -2,9 +2,16 @@ CXX? = g++ +diff -up ./python/Makefile.bak ./python/Makefile +--- ./python/Makefile.bak 2008-12-10 09:05:08.000000000 +1000 ++++ ./python/Makefile 2009-04-03 15:21:19.000000000 +1000 +@@ -2,9 +2,11 @@ CXX? = g++ SWIG ?= swig #Windows: see ../README ../Makefile.win --PYTHON_INCLUDEDIR ?= /usr/include/python2.4 -+#PYTHON_TEMP:=${shell mktemp} -+#PYTHON_VERSION:=${shell python -V 2> ${PYTHON_TEMP} ; cat ${PYTHON_TEMP} | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$$2,$$3)}'; rm -f ${PYTHON_TEMP}} -+ifndef PYTHON_INCLUDEDIR - --CFLAGS = -O3 -I$(PYTHON_INCLUDEDIR) -I.. -+PYTHON_INCLUDEDIR?= /usr/include/python${PYTHON_VERSION} -+ -+endif +-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 +22,34 @@ 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 -+# echo "PYTHON_VERSION=${PYTHON_VERSION}" -+# echo "CFLAGS=${CFLAGS}" -+# echo "CFLAGS_PYTHON=${CFLAGS_PYTHON}" + $(CXX) $(CFLAGS_PYTHON) -fPIC -c svmc_wrap.c svmc_wrap.c: svmc.i @@ -231,14 +217,9 @@ diff -up ./python/Makefile.orig ./python/Makefile +uninstall: + rm -fr ${LIBDIR}/python${PYTHON_VERSION}/site-packages/libsvm + -diff -up ./python/setup.py.orig ./python/setup.py -diff -up ./python/svm.py.orig ./python/svm.py -diff -up ./python/svm_test.py.orig ./python/svm_test.py -diff -up ./python/test_cross_validation.py.orig ./python/test_cross_validation.py -diff -up ./svm.cpp.orig ./svm.cpp -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 2008-11-05 14:08:00.000000000 +1000 +diff -up ./svm-toy/gtk/callbacks.cpp.bak ./svm-toy/gtk/callbacks.cpp +--- ./svm-toy/gtk/callbacks.cpp.bak 2006-03-04 17:40:12.000000000 +1000 ++++ ./svm-toy/gtk/callbacks.cpp 2009-04-03 15:04:06.000000000 +1000 @@ -2,6 +2,7 @@ #include #include @@ -247,9 +228,9 @@ diff -up ./svm-toy/gtk/callbacks.cpp.orig ./svm-toy/gtk/callbacks.cpp #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 2008-11-05 16:18:10.000000000 +1000 +diff -up ./svm-toy/gtk/Makefile.bak ./svm-toy/gtk/Makefile +--- ./svm-toy/gtk/Makefile.bak 2007-10-14 16:29:12.000000000 +1000 ++++ ./svm-toy/gtk/Makefile 2009-04-03 15:04:06.000000000 +1000 @@ -2,21 +2,27 @@ CC? = gcc CXX? = g++ CFLAGS = -Wall -O3 -g `gtk-config --cflags` @@ -286,16 +267,14 @@ diff -up ./svm-toy/gtk/Makefile.orig ./svm-toy/gtk/Makefile 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-05-01 22:42:15.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2008-11-05 17:42:43.000000000 +1000 -@@ -1,17 +1,24 @@ +diff -up ./svm-toy/qt/Makefile.bak ./svm-toy/qt/Makefile +--- ./svm-toy/qt/Makefile.bak 2008-12-19 16:42:05.000000000 +1000 ++++ ./svm-toy/qt/Makefile 2009-04-03 15:25:25.000000000 +1000 +@@ -1,17 +1,20 @@ 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 + @@ -303,29 +282,25 @@ diff -up ./svm-toy/qt/Makefile.orig ./svm-toy/qt/Makefile MOC = /usr/bin/moc-qt4 -svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o -- $(CXX) $(FLAGS) svm-toy.cpp ../../svm.o -o svm-toy +- $(CXX) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy +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 ./svm-toy/qt/svm-toy.cpp.orig ./svm-toy/qt/svm-toy.cpp -diff -up ./svm-toy/windows/svm-toy.cpp.orig ./svm-toy/windows/svm-toy.cpp -diff -up ./tools/checkdata.py.orig ./tools/checkdata.py -diff -up ./tools/easy.py.orig ./tools/easy.py ---- ./tools/easy.py.orig 2008-02-10 22:12:43.000000000 +1000 -+++ ./tools/easy.py 2008-11-05 14:08:00.000000000 +1000 +diff -up ./tools/easy.py.bak ./tools/easy.py +--- ./tools/easy.py.bak 2009-01-14 07:13:26.000000000 +1000 ++++ ./tools/easy.py 2009-04-03 15:04:06.000000000 +1000 @@ -2,6 +2,7 @@ import sys @@ -349,9 +324,9 @@ diff -up ./tools/easy.py.orig ./tools/easy.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 2008-11-05 14:08:00.000000000 +1000 +diff -up ./tools/grid.py.bak ./tools/grid.py +--- ./tools/grid.py.bak 2008-08-08 20:41:11.000000000 +1000 ++++ ./tools/grid.py 2009-04-03 15:04:06.000000000 +1000 @@ -11,7 +11,7 @@ from subprocess import * is_win32 = (sys.platform == 'win32') @@ -369,4 +344,3 @@ diff -up ./tools/grid.py.orig ./tools/grid.py 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 -up ./tools/subset.py.orig ./tools/subset.py diff --git a/libsvm.spec b/libsvm.spec index 88fa453..b588976 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm -Version: 2.88 -Release: 4%{?dist} +Version: 2.89 +Release: 1%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -97,7 +97,7 @@ display the derived separating hyperplane. %prep %setup -q -%patch0 -p0 -b .bak +%patch0 -p0 -b .orig cp %{SOURCE1} ChangeLog cp %{SOURCE2} . cp %{SOURCE3} . @@ -203,14 +203,23 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Wed Feb 25 2009 Fedora Release Engineering - 2.88-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild - -* Sat Nov 29 2008 Ignacio Vazquez-Abrams - 2.88-3 -- Rebuild for Python 2.6 +* 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: diff --git a/sources b/sources index 2a65311..3321f93 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ aae7a8f7e357e86e1c893b706bb02a63 guide.pdf -1b69c7d887d349b13f9f2cf245310fea libsvm-2.88.tar.gz +71975f20d37b30eb13a3ec8897f4f546 libsvm-2.89.tar.gz From fb5d7698ea63e0fa16f291413b2a50baf49bcbb3 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Sat, 25 Jul 2009 08:42:40 +0000 Subject: [PATCH 037/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index b588976..cf76cf1 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.89 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -203,6 +203,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* 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 From 9ef4f9ec976f9b83e1a9bc138762c5b1379fe5ca Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 16 Sep 2009 06:39:52 +0000 Subject: [PATCH 038/136] Fixed Bug 521194 --- import.log | 1 + libsvm-2.89.patch | 72 ++++++++++++++++++++++++++--------------------- libsvm.spec | 40 ++++++++++++++++++++------ 3 files changed, 73 insertions(+), 40 deletions(-) diff --git a/import.log b/import.log index 4383245..5d497c5 100644 --- a/import.log +++ b/import.log @@ -2,3 +2,4 @@ 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 diff --git a/libsvm-2.89.patch b/libsvm-2.89.patch index 680186a..2c0d28f 100644 --- a/libsvm-2.89.patch +++ b/libsvm-2.89.patch @@ -1,6 +1,6 @@ -diff -up ./java/Makefile.bak ./java/Makefile ---- ./java/Makefile.bak 2009-02-18 10:41:04.000000000 +1000 -+++ ./java/Makefile 2009-04-03 15:13:40.000000000 +1000 +diff -up ./java/Makefile.orig ./java/Makefile +--- ./java/Makefile.orig 2009-02-18 10:41:04.000000000 +1000 ++++ ./java/Makefile 2009-09-16 13:44:31.000000000 +1000 @@ -4,13 +4,22 @@ 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,17 +51,17 @@ diff -up ./java/Makefile.bak ./java/Makefile dist: clean all rm *.class libsvm/*.class -diff -up ./java/test_applet.html.bak ./java/test_applet.html ---- ./java/test_applet.html.bak 2003-07-12 14:07:32.000000000 +1000 -+++ ./java/test_applet.html 2009-04-03 15:04:06.000000000 +1000 +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-16 13:44:31.000000000 +1000 @@ -1 +1,3 @@ - + + + -diff -up ./Makefile.bak ./Makefile ---- ./Makefile.bak 2008-09-15 14:36:48.000000000 +1000 -+++ ./Makefile 2009-04-03 15:04:06.000000000 +1000 +diff -up ./Makefile.orig ./Makefile +--- ./Makefile.orig 2008-09-15 14:36:48.000000000 +1000 ++++ ./Makefile 2009-09-16 14:40:39.000000000 +1000 @@ -1,11 +1,40 @@ CXX? = g++ -CFLAGS = -Wall -Wconversion -O3 -fPIC @@ -106,7 +106,7 @@ diff -up ./Makefile.bak ./Makefile svm-predict: svm-predict.c svm.o $(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm -@@ -16,4 +45,59 @@ svm-scale: svm-scale.c +@@ -16,4 +45,65 @@ svm-scale: svm-scale.c svm.o: svm.cpp svm.h $(CXX) $(CFLAGS) -c svm.cpp clean: @@ -117,7 +117,9 @@ diff -up ./Makefile.bak ./Makefile +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: @@ -138,14 +140,16 @@ diff -up ./Makefile.bak ./Makefile + 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-python -+ ${MAKE} -C python install +# 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 @@ -162,14 +166,16 @@ diff -up ./Makefile.bak ./Makefile + 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.bak ./python/Makefile ---- ./python/Makefile.bak 2008-12-10 09:05:08.000000000 +1000 -+++ ./python/Makefile 2009-04-03 15:21:19.000000000 +1000 +diff -up ./python/Makefile.orig ./python/Makefile +--- ./python/Makefile.orig 2008-12-10 09:05:08.000000000 +1000 ++++ ./python/Makefile 2009-09-16 13:44:31.000000000 +1000 @@ -2,9 +2,11 @@ CXX? = g++ SWIG ?= swig @@ -217,9 +223,9 @@ diff -up ./python/Makefile.bak ./python/Makefile +uninstall: + rm -fr ${LIBDIR}/python${PYTHON_VERSION}/site-packages/libsvm + -diff -up ./svm-toy/gtk/callbacks.cpp.bak ./svm-toy/gtk/callbacks.cpp ---- ./svm-toy/gtk/callbacks.cpp.bak 2006-03-04 17:40:12.000000000 +1000 -+++ ./svm-toy/gtk/callbacks.cpp 2009-04-03 15:04:06.000000000 +1000 +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-16 13:44:31.000000000 +1000 @@ -2,6 +2,7 @@ #include #include @@ -228,9 +234,9 @@ diff -up ./svm-toy/gtk/callbacks.cpp.bak ./svm-toy/gtk/callbacks.cpp #include "callbacks.h" #include "interface.h" #include "../../svm.h" -diff -up ./svm-toy/gtk/Makefile.bak ./svm-toy/gtk/Makefile ---- ./svm-toy/gtk/Makefile.bak 2007-10-14 16:29:12.000000000 +1000 -+++ ./svm-toy/gtk/Makefile 2009-04-03 15:04:06.000000000 +1000 +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-16 13:44:31.000000000 +1000 @@ -2,21 +2,27 @@ CC? = gcc CXX? = g++ CFLAGS = -Wall -O3 -g `gtk-config --cflags` @@ -267,10 +273,10 @@ diff -up ./svm-toy/gtk/Makefile.bak ./svm-toy/gtk/Makefile 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.bak ./svm-toy/qt/Makefile ---- ./svm-toy/qt/Makefile.bak 2008-12-19 16:42:05.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2009-04-03 15:25:25.000000000 +1000 -@@ -1,17 +1,20 @@ +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-16 13:44:31.000000000 +1000 +@@ -1,17 +1,21 @@ CXX? = g++ -CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtGui -lQtGui +CFLAGS = -Wall -O3 @@ -279,10 +285,12 @@ diff -up ./svm-toy/qt/Makefile.bak ./svm-toy/qt/Makefile +LIBS= -L${LOCAL_LIBDIR} -lsvm + INCLUDE = /usr/include/qt4 - MOC = /usr/bin/moc-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 @@ -298,9 +306,9 @@ diff -up ./svm-toy/qt/Makefile.bak ./svm-toy/qt/Makefile - rm -f *~ svm-toy svm-toy.moc ../../svm.o + rm -f *~ svm-toy-qt svm-toy.moc ../../svm.o -diff -up ./tools/easy.py.bak ./tools/easy.py ---- ./tools/easy.py.bak 2009-01-14 07:13:26.000000000 +1000 -+++ ./tools/easy.py 2009-04-03 15:04:06.000000000 +1000 +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-16 13:44:31.000000000 +1000 @@ -2,6 +2,7 @@ import sys @@ -324,9 +332,9 @@ diff -up ./tools/easy.py.bak ./tools/easy.py gnuplot_exe = "/usr/bin/gnuplot" else: # example for windows -diff -up ./tools/grid.py.bak ./tools/grid.py ---- ./tools/grid.py.bak 2008-08-08 20:41:11.000000000 +1000 -+++ ./tools/grid.py 2009-04-03 15:04:06.000000000 +1000 +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-16 13:44:31.000000000 +1000 @@ -11,7 +11,7 @@ from subprocess import * is_win32 = (sys.platform == 'win32') diff --git a/libsvm.spec b/libsvm.spec index cf76cf1..89a8616 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.89 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -23,7 +23,16 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root %define javac javac %define jar jar %define libdir_libsvm %{_libdir}/libsvm -%{!?qt3-devel: } +%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 @@ -55,19 +64,19 @@ 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-sdk >= 0:1.5.0 -Requires: jre >= 0:1.5.0 +BuildRequires: java-1.6.0-openjdk-devel +Requires: jre >= 1.6.0 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. -Install libsvm-javadoc for - +%endif %package svm-toy-gtk Summary: GTK version of svm-toy (libsvm demostration program) @@ -110,7 +119,7 @@ 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}" +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 @@ -120,7 +129,7 @@ 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}" +make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} PYTHON_VERSION="%{pyver}" LIBSVM_VER="%{version}" NO_JAVA="%{no_java}" 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/ @@ -130,6 +139,11 @@ 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 \ @@ -181,11 +195,13 @@ rm -rf $RPM_BUILD_ROOT %doc python/README-Python tools/README-Tools %{libsvm_python_dir} +%ifnarch ppc ppc64 %files java %defattr(-,root,root,-) %doc java/README-Java %{_datadir}/%{name}/java #%{_datadir}/javadoc/%{name}-%{version} +%endif %files svm-toy-gtk %defattr(-,root,root,-) @@ -203,6 +219,14 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon 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 From e3d9a94e4098d97a8e9d913e56228207f084a80d Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Fri, 18 Sep 2009 01:00:33 +0000 Subject: [PATCH 039/136] Fixed [Bug 524108] --- import.log | 1 + libsvm-2.89.patch | 36 +++++++++++++++++------------------- libsvm.spec | 26 ++++++++++++++++++-------- 3 files changed, 36 insertions(+), 27 deletions(-) diff --git a/import.log b/import.log index 5d497c5..cdc99e7 100644 --- a/import.log +++ b/import.log @@ -3,3 +3,4 @@ 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 diff --git a/libsvm-2.89.patch b/libsvm-2.89.patch index 2c0d28f..5673758 100644 --- a/libsvm-2.89.patch +++ b/libsvm-2.89.patch @@ -1,12 +1,11 @@ diff -up ./java/Makefile.orig ./java/Makefile --- ./java/Makefile.orig 2009-02-18 10:41:04.000000000 +1000 -+++ ./java/Makefile 2009-09-16 13:44:31.000000000 +1000 -@@ -4,13 +4,22 @@ FILES = libsvm/svm.class libsvm/svm_mode ++++ ./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_TARGETDIR=${INSTDIR}/share/libsvm/java -+JAVA_DOCDIR=${INSTDIR}/share/javadoc/libsvm-${LIBSVM_VER} ++JAVA_DOC_DIR=${INSTDIR}/share/javadoc/libsvm-${LIBSVM_VER} +CLASSPATH = . #JAVAC = jikes -JAVAC_FLAGS = -target 1.5 -source 1.5 @@ -26,7 +25,7 @@ diff -up ./java/Makefile.orig ./java/Makefile .java.class: $(JAVAC) $(JAVAC_FLAGS) $< -@@ -18,8 +27,24 @@ all: $(FILES) +@@ -18,8 +26,23 @@ all: $(FILES) libsvm/svm.java: libsvm/svm.m4 m4 libsvm/svm.m4 > libsvm/svm.java @@ -36,14 +35,13 @@ diff -up ./java/Makefile.orig ./java/Makefile + javadoc -d docs *.java libsvm/*.java + +install: -+ mkdir -p ${JAVA_TARGETDIR} -+ install -m 644 libsvm.jar ${JAVA_TARGETDIR} -+ install -m 644 test_applet.html ${JAVA_TARGETDIR} -+# mkdir -p ${JAVA_DOCDIR} -+# cd docs; cp -R * ${JAVA_DOCDIR} ++ 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_DOCDIR} ++# rm -fr ${JAVA_DOC_DIR} + clean: rm -f libsvm/*.class *.class *.jar libsvm/*~ *~ libsvm/svm.java @@ -53,7 +51,7 @@ 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-16 13:44:31.000000000 +1000 ++++ ./java/test_applet.html 2009-09-18 10:10:34.000000000 +1000 @@ -1 +1,3 @@ - + @@ -61,7 +59,7 @@ diff -up ./java/test_applet.html.orig ./java/test_applet.html + diff -up ./Makefile.orig ./Makefile --- ./Makefile.orig 2008-09-15 14:36:48.000000000 +1000 -+++ ./Makefile 2009-09-16 14:40:39.000000000 +1000 ++++ ./Makefile 2009-09-18 10:10:34.000000000 +1000 @@ -1,11 +1,40 @@ CXX? = g++ -CFLAGS = -Wall -Wconversion -O3 -fPIC @@ -175,7 +173,7 @@ 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-16 13:44:31.000000000 +1000 ++++ ./python/Makefile 2009-09-18 10:10:34.000000000 +1000 @@ -2,9 +2,11 @@ CXX? = g++ SWIG ?= swig @@ -225,7 +223,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-16 13:44:31.000000000 +1000 ++++ ./svm-toy/gtk/callbacks.cpp 2009-09-18 10:10:34.000000000 +1000 @@ -2,6 +2,7 @@ #include #include @@ -236,7 +234,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-16 13:44:31.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` @@ -275,7 +273,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-16 13:44:31.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 @@ -308,7 +306,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-01-14 07:13:26.000000000 +1000 -+++ ./tools/easy.py 2009-09-16 13:44:31.000000000 +1000 ++++ ./tools/easy.py 2009-09-18 10:10:34.000000000 +1000 @@ -2,6 +2,7 @@ import sys @@ -334,7 +332,7 @@ diff -up ./tools/easy.py.orig ./tools/easy.py # 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-16 13:44:31.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') diff --git a/libsvm.spec b/libsvm.spec index 89a8616..6d6705f 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ Name: libsvm Version: 2.89 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -28,13 +28,13 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root %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 @@ -68,8 +68,11 @@ programs with libsvm in Python. %package java Summary: Java tools and interfaces for libsvm Group: Development/Libraries -BuildRequires: java-1.6.0-openjdk-devel -Requires: jre >= 1.6.0 +BuildRequires: java-devel >= 1.5.0 +BuildRequires: jpackage-utils + +Requires: java >= 1.5.0 +Requires: jpackage-utils Requires: %{name} = %{version}-%{release} %description java @@ -129,7 +132,7 @@ 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}" +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/ @@ -198,8 +201,8 @@ rm -rf $RPM_BUILD_ROOT %ifnarch ppc ppc64 %files java %defattr(-,root,root,-) -%doc java/README-Java -%{_datadir}/%{name}/java +%doc java/README-Java java/test_applet.html +%{_javadir}/%{name}.jar #%{_datadir}/javadoc/%{name}-%{version} %endif @@ -219,7 +222,14 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Mon Sep 16 2009 Ding-Yi Chen - 2.89-3 +* 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. From a9b80f1c5944d5b446c28342c1fed8187b2aad33 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Fri, 18 Sep 2009 01:30:36 +0000 Subject: [PATCH 040/136] 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 041/136] 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 a27d7fecda6ce76d3edf6680fb37f5842156baf7 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 4 Nov 2009 06:43:40 +0000 Subject: [PATCH 042/136] 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 30a8428056be3738f03f6b9ee3b2819c04e955ea Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 4 Nov 2009 07:01:28 +0000 Subject: [PATCH 043/136] 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..0140707 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:F-12:libsvm-2.90-1.fc11.src.rpm:1257317774 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 4fad22ccdcbb66c398343b6ca81e52cf3328fd01 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 4 Nov 2009 07:14:33 +0000 Subject: [PATCH 044/136] 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 c3790ba7f04ae24d4544ca07a5331b84e85d6e7a Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 5 Nov 2009 03:35:21 +0000 Subject: [PATCH 045/136] 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 bdd507b158e9b15e5180bbe011b75ac4f91339cc Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 5 Nov 2009 03:47:51 +0000 Subject: [PATCH 046/136] 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 0140707..f3abd3d 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:F-12:libsvm-2.90-1.fc11.src.rpm:1257317774 +libsvm-2_90-2_fc11:F-12:libsvm-2.90-2.fc11.src.rpm:1257392151 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 e75602c19a4b7e62a0b3e3f5e677151f16186513 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 5 Nov 2009 06:58:56 +0000 Subject: [PATCH 047/136] 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 843d3a875a8ae2fde3c43dda9040359d2e5d9378 Mon Sep 17 00:00:00 2001 From: Kevin Kofler Date: Wed, 25 Nov 2009 00:16:46 +0000 Subject: [PATCH 048/136] - 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 049/136] 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 c816245a19379aefdfba93b19425e45da91b1940 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 26 Nov 2009 01:54:03 +0000 Subject: [PATCH 050/136] 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 1b340076f2fe8aa7964fbe4c44aab48db5181d51 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 26 Nov 2009 01:54:04 +0000 Subject: [PATCH 051/136] 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 052/136] 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 3ae3809e1f68402fc07079998e19eaab62ee7d62 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 7 Apr 2010 05:28:16 +0000 Subject: [PATCH 053/136] Upstream update to 2.91 --- .cvsignore | 2 +- import.log | 1 + libsvm-2.90.patch => libsvm-2.91.patch | 193 +++++++------------------ libsvm.spec | 16 +- log | 18 ++- sources | 2 +- 6 files changed, 87 insertions(+), 145 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 f3abd3d..9638d1e 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:F-12:libsvm-2.90-1.fc11.src.rpm:1257317774 libsvm-2_90-2_fc11:F-12:libsvm-2.90-2.fc11.src.rpm:1257392151 +libsvm-2_91-1_el5:F-12:libsvm-2.91-1.el5.src.rpm:1270618043 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 e18686e91c039be48238524f3f46c76e43d98902 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 7 Apr 2010 05:30:40 +0000 Subject: [PATCH 054/136] 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 228a847f190cb3e2c22858fae6521febf86cb961 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 8 May 2010 01:57:15 +0000 Subject: [PATCH 055/136] Initialize branch EL-6 for libsvm --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..46381b9 --- /dev/null +++ b/branch @@ -0,0 +1 @@ +EL-6 From dc4fc9b7dd6b7cbb075456c94607e9eefeb63cd0 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Thu, 22 Jul 2010 02:20:57 +0000 Subject: [PATCH 056/136] - 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 e60143e28f29dacefd4317d89a7e9eab8916e6a8 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 28 Jul 2010 21:42:56 +0000 Subject: [PATCH 057/136] 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 2b5e349397be08788575ad45011aa60ac7b8f789 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 28 Jul 2010 21:42:59 +0000 Subject: [PATCH 058/136] 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 0da17a9f7817c125f59d65795c640766a89ccdee Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 28 Jul 2010 21:43:03 +0000 Subject: [PATCH 059/136] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- branch | 1 - import.log | 9 --------- 4 files changed, 31 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch 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/branch b/branch deleted file mode 100644 index 46381b9..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -EL-6 diff --git a/import.log b/import.log deleted file mode 100644 index 9638d1e..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:F-12:libsvm-2.90-1.fc11.src.rpm:1257317774 -libsvm-2_90-2_fc11:F-12:libsvm-2.90-2.fc11.src.rpm:1257392151 -libsvm-2_91-1_el5:F-12:libsvm-2.91-1.el5.src.rpm:1270618043 From 56c74599e4875a980bb04f9897b6df864a569d60 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Mon, 8 Nov 2010 12:17:50 +1000 Subject: [PATCH 060/136] 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 From d76627158102e5d1e2c9645402d44a66a0aff6e6 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 14 Dec 2010 16:38:14 +1000 Subject: [PATCH 061/136] Fixed [Bug 661404] New: Wrong symbolic link libsvm.so --- ...in.patch => libsvm-3.0-1.packageMain.patch | 10 ++--- libsvm.spec | 42 +++++++++++-------- 2 files changed, 29 insertions(+), 23 deletions(-) rename libsvm-3.0.packageMain.patch => libsvm-3.0-1.packageMain.patch (97%) diff --git a/libsvm-3.0.packageMain.patch b/libsvm-3.0-1.packageMain.patch similarity index 97% rename from libsvm-3.0.packageMain.patch rename to libsvm-3.0-1.packageMain.patch index fb6a009..ac7a7f7 100644 --- a/libsvm-3.0.packageMain.patch +++ b/libsvm-3.0-1.packageMain.patch @@ -1,6 +1,6 @@ diff -up ./Makefile.packageMain ./Makefile --- ./Makefile.packageMain 2010-09-12 22:11:10.000000000 +1000 -+++ ./Makefile 2010-11-08 11:04:38.423570586 +1000 ++++ ./Makefile 2010-12-14 16:00:15.269681221 +1000 @@ -1,11 +1,40 @@ CXX ?= g++ -CFLAGS = -Wall -Wconversion -O3 -fPIC @@ -9,14 +9,14 @@ diff -up ./Makefile.packageMain ./Makefile +MAKE = make +DOT_LIBS=.libs +LIBS= -L${DOT_LIBS} -lsvm -+export LIBSVM_VER -+ ++export LIBSVM_VER ++ +ifndef DESTDIR + INSTDIR=/usr +else + INSTDIR=${DESTDIR}/usr +endif -+ ++ +export INSTDIR + +IS_64=$(shell /bin/uname -i | awk '/64/ {print 64}') @@ -65,7 +65,7 @@ diff -up ./Makefile.packageMain ./Makefile + +svm-toy-qt: + ${MAKE} -C svm-toy/qt -+ ++ +install: all + mkdir -p ${INSTDIR}/bin + install -m 755 svm-train ${INSTDIR}/bin diff --git a/libsvm.spec b/libsvm.spec index 7f4cc8d..82dcf9c 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,7 @@ +%define shver 2 Name: libsvm Version: 3.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -13,12 +14,13 @@ 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}.packageMain.patch +Patch0: %{name}-%{version}-1.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 +BuildRequires: grep %{!?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)")} @@ -66,7 +68,7 @@ Requires: gnuplot %description python Python tools and interfaces for libsvm. -Install this package if you want to develop +Install this package if you want to develop programs with libsvm in Python. %ifnarch ppc ppc64 @@ -82,7 +84,7 @@ Requires: %{name} = %{version}-%{release} %description java Java tools and interfaces for libsvm. -Install this package if you want to develop +Install this package if you want to develop programs with libsvm in Java. %endif @@ -95,7 +97,7 @@ Requires: gtk2 Requires: %{name} = %{version}-%{release} %description svm-toy-gtk -svm-toy is a libsvm demonstration 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 @@ -109,7 +111,7 @@ Requires: qt4 Requires: %{name} = %{version}-%{release} %description svm-toy-qt -svm-toy is a libsvm demonstration 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 @@ -127,7 +129,6 @@ 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 @@ -142,7 +143,6 @@ 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/ @@ -151,6 +151,9 @@ 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 +%__ln_s %{name}.so.%{shver} $RPM_BUILD_ROOT/%{_libdir}/%{name}.so + + # [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"\ @@ -193,7 +196,7 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/svm-train %dir %{_datadir}/%{name} %{_datadir}/%{name}/examples -%{_libdir}/%{name}.so.2 +%{_libdir}/%{name}.so.%{shver} %files devel @@ -231,13 +234,16 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Dec 14 2010 Ding-Yi Chen - 3.0-2 +- Fixed [Bug 661404] New: Wrong symbolic link libsvm.so + * 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 + * exit status for checkdata.py * old python interface (swig) is removed * Wed Jul 21 2010 David Malcolm - 2.91-2 @@ -270,12 +276,12 @@ rm -rf $RPM_BUILD_ROOT * 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, + 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 @@ -283,7 +289,7 @@ rm -rf $RPM_BUILD_ROOT - 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() + + remove info_flush() + a extern variable libsvm_version + svm-train -q option (disable outputs) + svm-scale: warning if more nonzero produced @@ -292,7 +298,7 @@ rm -rf $RPM_BUILD_ROOT * 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 +- 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. @@ -322,7 +328,7 @@ rm -rf $RPM_BUILD_ROOT * 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 @@ -337,10 +343,10 @@ rm -rf $RPM_BUILD_ROOT - Upstream update to 2.86 - svm-scale for java - version number in svm.h and svm.m4 - - rename svmtrain.exe to svm-train.exe + - 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 +- 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. @@ -379,7 +385,7 @@ rm -rf $RPM_BUILD_ROOT - 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) +- [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 From 1ee5d6d56b52c05fc87fe68a63279d6f2c0567a5 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 8 Feb 2011 05:55:01 -0600 Subject: [PATCH 062/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index 82dcf9c..9c3dcf0 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm Version: 3.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -234,6 +234,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Feb 08 2011 Fedora Release Engineering - 3.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + * Tue Dec 14 2010 Ding-Yi Chen - 3.0-2 - Fixed [Bug 661404] New: Wrong symbolic link libsvm.so From 921d0620f9ac1f71d0b92c77a075264036576e50 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 14 Jun 2011 17:12:57 +1000 Subject: [PATCH 063/136] Upstream update to 3.1 --- .gitignore | 1 + libsvm-3.0-1.packageMain.patch | 114 ----------------- libsvm-3.0.pythonDir.patch | 22 ---- libsvm-3.0.toolsDir.patch | 30 ----- ....javaDir.patch => libsvm-3.1.javaDir.patch | 12 +- libsvm-3.1.packageMain.patch | 117 ++++++++++++++++++ libsvm-3.1.pythonDir.patch | 25 ++++ ....svm-toy.patch => libsvm-3.1.svm-toy.patch | 22 ++-- libsvm-3.1.toolsDir.patch | 52 ++++++++ libsvm.spec | 35 +++++- log | 24 +++- sources | 2 +- 12 files changed, 268 insertions(+), 188 deletions(-) delete mode 100644 libsvm-3.0-1.packageMain.patch delete mode 100644 libsvm-3.0.pythonDir.patch delete mode 100644 libsvm-3.0.toolsDir.patch rename libsvm-3.0.javaDir.patch => libsvm-3.1.javaDir.patch (98%) create mode 100644 libsvm-3.1.packageMain.patch create mode 100644 libsvm-3.1.pythonDir.patch rename libsvm-3.0.svm-toy.patch => libsvm-3.1.svm-toy.patch (74%) create mode 100644 libsvm-3.1.toolsDir.patch diff --git a/.gitignore b/.gitignore index 1ad2fca..2068ba3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ guide.pdf libsvm-2.91.tar.gz /guide.pdf /libsvm-3.0.tar.gz +/libsvm-3.1.tar.gz diff --git a/libsvm-3.0-1.packageMain.patch b/libsvm-3.0-1.packageMain.patch deleted file mode 100644 index ac7a7f7..0000000 --- a/libsvm-3.0-1.packageMain.patch +++ /dev/null @@ -1,114 +0,0 @@ -diff -up ./Makefile.packageMain ./Makefile ---- ./Makefile.packageMain 2010-09-12 22:11:10.000000000 +1000 -+++ ./Makefile 2010-12-14 16:00:15.269681221 +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 deleted file mode 100644 index 2471a06..0000000 --- a/libsvm-3.0.pythonDir.patch +++ /dev/null @@ -1,22 +0,0 @@ -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.toolsDir.patch b/libsvm-3.0.toolsDir.patch deleted file mode 100644 index 1d3d69f..0000000 --- a/libsvm-3.0.toolsDir.patch +++ /dev/null @@ -1,30 +0,0 @@ -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-3.0.javaDir.patch b/libsvm-3.1.javaDir.patch similarity index 98% rename from libsvm-3.0.javaDir.patch rename to libsvm-3.1.javaDir.patch index 056374b..ed7cf4b 100644 --- a/libsvm-3.0.javaDir.patch +++ b/libsvm-3.1.javaDir.patch @@ -4,7 +4,7 @@ diff -up ./java/Makefile.javaDir ./java/Makefile @@ -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 @@ -14,7 +14,7 @@ diff -up ./java/Makefile.javaDir ./java/Makefile JAVAC = javac +endif # JAVAC_FLAGS = - + +ifndef JAR +JAR=jar +endif @@ -22,19 +22,19 @@ diff -up ./java/Makefile.javaDir ./java/Makefile 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: ++install: + mkdir -p ${JAVA_TARGET_DIR} + install -m 644 libsvm.jar ${JAVA_TARGET_DIR} +# mkdir -p ${JAVA_DOC_DIR} @@ -46,7 +46,7 @@ diff -up ./java/Makefile.javaDir ./java/Makefile 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 diff --git a/libsvm-3.1.packageMain.patch b/libsvm-3.1.packageMain.patch new file mode 100644 index 0000000..87209e9 --- /dev/null +++ b/libsvm-3.1.packageMain.patch @@ -0,0 +1,117 @@ +diff -up ./Makefile.packageMain ./Makefile +--- ./Makefile.packageMain 2010-09-12 22:11:10.000000000 +1000 ++++ ./Makefile 2011-06-14 17:00:32.774749405 +1000 +@@ -1,11 +1,44 @@ + 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 ++ ++IS_64:=$(shell /bin/uname -i | awk '/64/ {print 64}') ++ ++PREFIXDIR?= /usr ++export PREFIXDIR ++ ++LIBDIR?=${PREFIXDIR}/lib${IS_64} ++export LIBDIR ++ ++DATADIR?=${PREFIXDIR}/share ++export DATADIR ++ ++BINDIR?=${PREFIXDIR}/bin ++export BINDIR ++ ++INCLUDEDIR_INSTALL:=${DESTDIR}/${PREFIXDIR}/include ++export INCLUDEDIR_INSTALL ++ ++LIBDIR_INSTALL:=${DESTDIR}/${LIBDIR} ++export LIBDIR_INSTALL ++ ++DATADIR_INSTALL:=${DESTDIR}/${DATADIR} ++export DATA_INSTALL ++ ++BINDIR_INSTALL:=${DESTDIR}/${BINDIR} ++export BINDIR_INSTALL ++ ++ ++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 +49,64 @@ 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 ${BINDIR_INSTALL} ++ install -m 755 svm-train ${BINDIR_INSTALL} ++ install -m 755 svm-predict ${BINDIR_INSTALL} ++ install -m 755 svm-scale ${BINDIR_INSTALL} ++ mkdir -p ${LIBDIR_INSTALL} ++ install -m 755 libsvm.so.$(SHVER) ${LIBDIR_INSTALL} ++# install package libsvm-devel ++ mkdir -p ${INCLUDEDIR_INSTALL}/libsvm ++ install -m 644 svm.h ${INCLUDEDIR_INSTALL}/libsvm ++ mkdir -p ${DATADIR_INSTALL}/libsvm/src/java/libsvm ++ install -m 644 *.h ${DATADIR_INSTALL}/libsvm/src ++ install -m 644 *.c ${DATADIR_INSTALL}/libsvm/src ++ install -m 644 *.cpp ${DATADIR_INSTALL}/libsvm/src ++ install -m 644 Makefile ${DATADIR_INSTALL}/libsvm/src ++ifneq ("${NO_JAVA}","NO_JAVA") ++ install -m 644 java/*.java ${DATADIR_INSTALL}/libsvm/src/java ++ install -m 644 java/Makefile ${DATADIR_INSTALL}/libsvm/src/java ++ install -m 644 java/libsvm/*.java ${DATADIR_INSTALL}/libsvm/src/java/libsvm ++ install -m 644 java/libsvm/*.m4 ${DATADIR_INSTALL}/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 ${BINDIR_INSTALL} ++ install -m 755 svm-toy/qt/svm-toy-qt ${BINDIR_INSTALL} ++# install examples ++ mkdir -p ${DATADIR_INSTALL}/libsvm/examples ++ install -m 644 heart_scale ${DATADIR_INSTALL}/libsvm/examples ++uninstall: ++ rm -f ${BINDIR_INSTALL}/svm-train ++ rm -f ${BINDIR_INSTALL}/svm-predict ++ rm -f ${BINDIR_INSTALL}/svm-scale ++ rm -fr ${DATADIR_INSTALL}/libsvm ++ rm -f ${INCLUDEDIR_INSTALL}/libsvm/svm.h ++ rm -f ${LIBDIR_INSTALL}/libsvm.so* ++ ${MAKE} -C python uninstall ++ifneq ("${NO_JAVA}","NO_JAVA") ++ ${MAKE} -C java uninstall ++endif ++ rm -f ${BINDIR_INSTALL}/svm-toy-gtk ++ rm -f ${BINDIR_INSTALL}/svm-toy-qt ++ diff --git a/libsvm-3.1.pythonDir.patch b/libsvm-3.1.pythonDir.patch new file mode 100644 index 0000000..8d8d7ec --- /dev/null +++ b/libsvm-3.1.pythonDir.patch @@ -0,0 +1,25 @@ +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 ++PYTHONDIR_NAME ?= python${PYTHON_VERSION}/site-packages/libsvm ++PYTHONDIR?=${LIBDIR}/${PYTHONDIR_NAME} ++PYTHONDIR_INSTALL=${DESTDIR}/${PYTHONDIR} ++SVM_TOOLS:= $(notdir $(wildcard ../tools/*.py)) + +-lib: ++all: lib ++ ++lib: ../svm.cpp ../svm.h + cd ..; make lib; cd - ++ ++install: all ++ mkdir -p ${PYTHONDIR_INSTALL} ++ install -m 755 *.py ${PYTHONDIR_INSTALL} ++ install -m 755 ../tools/*.py ${PYTHONDIR_INSTALL} ++ $(foreach toolPy,$(SVM_TOOLS),ln -s ${PYTHONDIR}/$(toolPy) ${BINDIR_INSTALL}/svm-$(toolPy);) ++ ++uninstall: ++ rm -fr ${LIBDIR}/${PYTHON_PATH} $(addprefix ${BINDIR_INSTALL}/svm-,$(SVM_TOOLS)) ++ diff --git a/libsvm-3.0.svm-toy.patch b/libsvm-3.1.svm-toy.patch similarity index 74% rename from libsvm-3.0.svm-toy.patch rename to libsvm-3.1.svm-toy.patch index 5faade5..baad72a 100644 --- a/libsvm-3.0.svm-toy.patch +++ b/libsvm-3.1.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 2010-11-08 12:04:22.564509303 +1000 ++++ ./svm-toy/gtk/callbacks.cpp 2011-06-14 13:36:25.726748304 +1000 @@ -3,6 +3,7 @@ #include #include @@ -10,25 +10,25 @@ 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-09-12 22:11:10.000000000 +1000 -+++ ./svm-toy/gtk/Makefile 2010-11-08 12:05:58.925509978 +1000 -@@ -1,10 +1,11 @@ +--- ./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 +@@ -1,10 +1,12 @@ CC? = gcc CXX? = g++ --CFLAGS = -Wall -O3 -g `pkg-config --libs gtk+-2.0` + CFLAGS = -Wall -O3 -g `pkg-config --cflags 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 $@ ++ ++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 +@@ -15,8 +17,5 @@ interface.o: interface.c interface.h callbacks.o: callbacks.cpp callbacks.h $(CXX) $(CFLAGS) -c callbacks.cpp @@ -40,7 +40,7 @@ diff -up ./svm-toy/gtk/Makefile.svm-toy ./svm-toy/gtk/Makefile + 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 ++++ ./svm-toy/qt/Makefile 2011-06-14 13:50:02.634748539 +1000 @@ -1,17 +1,18 @@ CXX? = g++ -CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtGui -lQtGui @@ -49,7 +49,7 @@ diff -up ./svm-toy/qt/Makefile.svm-toy ./svm-toy/qt/Makefile -MOC = /usr/bin/moc-qt4 +MOC=${MOC_PATH} +LOCAL_LIBDIR=../../ -+LIBS = `pkg-config --libs gtk+-2.0` -L${LOCAL_LIBDIR} -lsvm ++LIBS = `pkg-config --libs QtGui` -L${LOCAL_LIBDIR} -lsvm -svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o - $(CXX) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy diff --git a/libsvm-3.1.toolsDir.patch b/libsvm-3.1.toolsDir.patch new file mode 100644 index 0000000..1f4c1d2 --- /dev/null +++ b/libsvm-3.1.toolsDir.patch @@ -0,0 +1,52 @@ +diff -up ./tools/easy.py.toolsDir ./tools/easy.py +--- ./tools/easy.py.toolsDir 2010-12-31 15:51:25.000000000 +1000 ++++ ./tools/easy.py 2011-06-14 15:15:06.611622820 +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/svm-grid.py" + gnuplot_exe = "/usr/bin/gnuplot" + else: + # example for windows +@@ -47,7 +47,7 @@ if len(sys.argv) > 2: + + cmd = '{0} -s "{1}" "{2}" > "{3}"'.format(svmscale_exe, range_file, train_pathname, scaled_file) + print('Scaling training data...') +-Popen(cmd, shell = True, stdout = PIPE).communicate() ++Popen(cmd, shell = True, stdout = PIPE).communicate() + + cmd = '{0} -svmtrain "{1}" -gnuplot "{2}" "{3}"'.format(grid_py, svmtrain_exe, gnuplot_exe, scaled_file) + print('Cross validation...') +@@ -70,10 +70,10 @@ print('Output model: {0}'.format(model_f + if len(sys.argv) > 2: + cmd = '{0} -r "{1}" "{2}" > "{3}"'.format(svmscale_exe, range_file, test_pathname, scaled_test_file) + print('Scaling testing data...') +- Popen(cmd, shell = True, stdout = PIPE).communicate() ++ Popen(cmd, shell = True, stdout = PIPE).communicate() + + cmd = '{0} "{1}" "{2}" "{3}"'.format(svmpredict_exe, scaled_test_file, model_file, predict_test_file) + print('Testing...') +- Popen(cmd, shell = True).communicate() ++ Popen(cmd, shell = True).communicate() + + print('Output prediction: {0}'.format(predict_test_file)) +diff -up ./tools/grid.py.toolsDir ./tools/grid.py +--- ./tools/grid.py.toolsDir 2011-02-03 01:55:20.000000000 +1000 ++++ ./tools/grid.py 2011-06-14 14:56:11.817748117 +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 9c3dcf0..f81c408 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm -Version: 3.0 -Release: 3%{?dist} +Version: 3.1 +Release: 1%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -14,7 +14,7 @@ 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}-1.packageMain.patch +Patch0: %{name}-%{version}.packageMain.patch Patch1: %{name}-%{version}.pythonDir.patch Patch2: %{name}-%{version}.javaDir.patch Patch3: %{name}-%{version}.svm-toy.patch @@ -32,6 +32,10 @@ BuildRequires: grep %if 0%{?fedora} >= 9 %define moc_path %{_bindir}/moc-qt4 %else +%if 0%{?rhel} >= 6 +%define moc_path %{_bindir}/moc-qt4 +%endif +%else %define moc_path %{_libdir}/qt4/bin/moc %endif @@ -209,6 +213,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %doc python/README-Python tools/README-Tools %{libsvm_python_dir} +%{_bindir}/svm-*.py %ifnarch ppc ppc64 %files java @@ -234,6 +239,30 @@ rm -rf $RPM_BUILD_ROOT %changelog +* 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. +- Upstream update: + + MATLAB interface: + + Merge matlab interface to core libsvm + + Using mexPrintf() when calling info() in MATLAB interface. + + Both 32- and 64-bit windows binary files are provided + + Java: + Math.random is replaced by Random in java interface + + Python interface: + subroutines to get SVs + relative path to load *.dll and *.so + + svm.cpp: + null pointer check before release memory in svm_free_model_content() + svm_destroy_model() no longer supported. + + svm-train.c and svm-predict.c + Better format check in reading data labels + + svm-toy: + fix the svm_toy dialog path + + tools: + Using new string formatting/encoding in tools/*.py + clearer png output, fix grid.py legend + * Tue Feb 08 2011 Fedora Release Engineering - 3.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild diff --git a/log b/log index 9d41631..ede03f3 100644 --- a/log +++ b/log @@ -184,9 +184,31 @@ file updated. 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 + +3.1: 2011/04/01 + MATLAB interface: + Merge matlab interface to core libsvm + Using mexPrintf() when calling info() in MATLAB interface. + Both 32- and 64-bit windows binary files are provided + Java: + Math.random is replaced by Random in java interface + Python interface: + subroutines to get SVs + relative path to load *.dll and *.so + svm.cpp: + null pointer check before release memory in svm_free_model_content() + svm_destroy_model() no longer supported. + svm-train.c and svm-predict.c + Better format check in reading data labels + svm-toy: + fix the svm_toy dialog path + tools: + Using new string formatting/encoding in tools/*.py + clearer png output, fix grid.py legend + ------------------ Future plan: ?.?: - 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 f04e60f..045b743 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ aae7a8f7e357e86e1c893b706bb02a63 guide.pdf -016e29668aae8aa6eaeb125c9e23d834 libsvm-3.0.tar.gz +a157c1edfdb290fe8081d6a011022055 libsvm-3.1.tar.gz From 2d694e467c485b035a30c9cb3313aae0603cc0e8 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Fri, 17 Jun 2011 13:29:56 +1000 Subject: [PATCH 064/136] 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 065/136] 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 33024b21a79a43a9ae90172c55246816c050738a Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 8 Nov 2011 16:45:57 +1000 Subject: [PATCH 066/136] 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 | 15 +- log | 15 +- sources | 2 +- 10 files changed, 64 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 f81c408..9fffb40 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,6 @@ %define shver 2 Name: libsvm -Version: 3.1 +Version: 3.11 Release: 1%{?dist} Summary: A Library for Support Vector Machines @@ -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,17 @@ 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 + * 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. 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 e0682851cf01d6ecde79284211fbbe3b36f9823d Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 8 Nov 2011 16:53:53 +1000 Subject: [PATCH 067/136] 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 068/136] 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 From c8f3ad58cbaf472db0d313cdb8926cdc399ecf0a Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 5 Apr 2012 11:28:46 +1000 Subject: [PATCH 069/136] Upstream update: 3.12 --- .gitignore | 1 + ...javaDir.patch => libsvm-3.12.javaDir.patch | 0 ...ain.patch => libsvm-3.12.packageMain.patch | 39 +++++++++++++------ ...onDir.patch => libsvm-3.12.pythonDir.patch | 0 ...svm-toy.patch => libsvm-3.12.svm-toy.patch | 27 +++++-------- ...olsDir.patch => libsvm-3.12.toolsDir.patch | 0 libsvm.spec | 15 ++++--- log | 7 +++- sources | 4 +- 9 files changed, 56 insertions(+), 37 deletions(-) rename libsvm-3.11.javaDir.patch => libsvm-3.12.javaDir.patch (100%) rename libsvm-3.11.packageMain.patch => libsvm-3.12.packageMain.patch (76%) rename libsvm-3.11.pythonDir.patch => libsvm-3.12.pythonDir.patch (100%) rename libsvm-3.11.svm-toy.patch => libsvm-3.12.svm-toy.patch (71%) rename libsvm-3.11.toolsDir.patch => libsvm-3.12.toolsDir.patch (100%) diff --git a/.gitignore b/.gitignore index 4373f69..0ab1e09 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ libsvm-2.91.tar.gz /libsvm-3.0.tar.gz /libsvm-3.1.tar.gz /libsvm-3.11.tar.gz +/libsvm-3.12.tar.gz diff --git a/libsvm-3.11.javaDir.patch b/libsvm-3.12.javaDir.patch similarity index 100% rename from libsvm-3.11.javaDir.patch rename to libsvm-3.12.javaDir.patch diff --git a/libsvm-3.11.packageMain.patch b/libsvm-3.12.packageMain.patch similarity index 76% rename from libsvm-3.11.packageMain.patch rename to libsvm-3.12.packageMain.patch index 5fbadbe..5d692ff 100644 --- a/libsvm-3.11.packageMain.patch +++ b/libsvm-3.12.packageMain.patch @@ -1,19 +1,22 @@ diff -up ./Makefile.packageMain ./Makefile ---- ./Makefile.packageMain 2011-06-26 05:55:06.000000000 +1000 -+++ ./Makefile 2011-11-08 09:42:13.106501233 +1000 -@@ -1,11 +1,44 @@ +--- ./Makefile.packageMain 2012-01-02 01:10:52.000000000 +1000 ++++ ./Makefile 2012-04-05 11:14:42.683613523 +1000 +@@ -1,25 +1,121 @@ CXX ?= g++ -CFLAGS = -Wall -Wconversion -O3 -fPIC +CFLAGS = ${RPM_CFLAGS} -Wall -Wconversion -O3 -fPIC SHVER = 2 ++export SHVER + OS = $(shell uname) +MAKE = make -+DOT_LIBS=.libs ++DOT_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}') -+ + +-lib: svm.o +PREFIXDIR?= /usr +export PREFIXDIR + @@ -38,17 +41,31 @@ diff -up ./Makefile.packageMain ./Makefile +BINDIR_INSTALL:=${DESTDIR}/${BINDIR} +export BINDIR_INSTALL + -+ +all: lib svm-train svm-predict svm-scale svm-python svm-java svm-toy-gtk svm-toy-qt - - lib: svm.o - $(CXX) -shared -dynamiclib -Wl,-soname,libsvm.so.$(SHVER) svm.o -o libsvm.so.$(SHVER) ++ ++lib: libsvm.so.$(SHVER) libsvm.so ++ ++libsvm.so: libsvm.so.$(SHVER) + ln -sf libsvm.so.$(SHVER) libsvm.so + ++libsvm.so.$(SHVER): svm.o + if [ "$(OS)" = "Darwin" ]; then \ +- SHARED_LIB_FLAG="-dynamiclib -W1,-install_name,libsvm.so.$(SHVER)"; \ ++ SHARED_LIB_FLAG="-dynamiclib -Wl,-install_name,libsvm.so.$(SHVER)"; \ + else \ +- SHARED_LIB_FLAG="-shared -W1,-soname,libsvm.so.$(SHVER)"; \ ++ SHARED_LIB_FLAG="-shared -Wl,-soname,libsvm.so.$(SHVER)"; \ + fi; \ + $(CXX) $${SHARED_LIB_FLAG} svm.o -o libsvm.so.$(SHVER) svm-predict: svm-predict.c svm.o - $(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm -@@ -16,4 +49,64 @@ svm-scale: svm-scale.c +- $(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm ++ $(CXX) $(CFLAGS) svm-predict.c $(LIBS) -o svm-predict -lm + svm-train: svm-train.c svm.o +- $(CXX) $(CFLAGS) svm-train.c svm.o -o svm-train -lm ++ $(CXX) $(CFLAGS) svm-train.c $(LIBS) -o svm-train -lm + svm-scale: svm-scale.c + $(CXX) $(CFLAGS) svm-scale.c -o svm-scale svm.o: svm.cpp svm.h $(CXX) $(CFLAGS) -c svm.cpp clean: diff --git a/libsvm-3.11.pythonDir.patch b/libsvm-3.12.pythonDir.patch similarity index 100% rename from libsvm-3.11.pythonDir.patch rename to libsvm-3.12.pythonDir.patch diff --git a/libsvm-3.11.svm-toy.patch b/libsvm-3.12.svm-toy.patch similarity index 71% rename from libsvm-3.11.svm-toy.patch rename to libsvm-3.12.svm-toy.patch index e8d4e69..d2a9274 100644 --- a/libsvm-3.11.svm-toy.patch +++ b/libsvm-3.12.svm-toy.patch @@ -1,17 +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-11-08 09:57:01.782500360 +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 2011-05-11 12:15:45.000000000 +1000 -+++ ./svm-toy/gtk/Makefile 2011-11-08 10:06:35.686501266 +1000 ++++ ./svm-toy/gtk/Makefile 2012-04-04 17:02:28.366615284 +1000 @@ -1,10 +1,12 @@ CC? = gcc CXX? = g++ @@ -43,22 +32,24 @@ diff -up ./svm-toy/gtk/Makefile.svm-toy ./svm-toy/gtk/Makefile + 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 2011-05-11 12:15:45.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2011-11-08 10:06:11.702501216 +1000 -@@ -1,17 +1,20 @@ ++++ ./svm-toy/qt/Makefile 2012-04-04 17:02:28.366615284 +1000 +@@ -1,17 +1,22 @@ CXX? = g++ -CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtGui -lQtGui -INCLUDE = /usr/include/qt4 -MOC = /usr/bin/moc-qt4 ++SHVER?=2 +CFLAGS = -Wall -O3 `pkg-config --cflags --libs QtGui` +MOC=${MOC_PATH} +LOCAL_LIBDIR=../.. +LIBS = -L${LOCAL_LIBDIR} -lsvm ++LIBSVM_SO_SHVER=${LOCAL_LIBDIR}/libsvm.so.$(SHVER) -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 ${LOCAL_LIBDIR}/svm.o ++svm-toy-qt: svm-toy.cpp svm-toy.moc $(LIBSVM_SO_SHVER) + $(CXX) $(CFLAGS) svm-toy.cpp ${LIBS} -o $@ svm-toy.moc: svm-toy.cpp @@ -66,10 +57,10 @@ diff -up ./svm-toy/qt/Makefile.svm-toy ./svm-toy/qt/Makefile -../../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 ++$(LIBSVM_SO_SHVER): ${LOCAL_LIBDIR}/svm.cpp ${LOCAL_LIBDIR}/svm.h ++ make -C ${LOCAL_LIBDIR} lib clean: - rm -f *~ svm-toy svm-toy.moc ../../svm.o -+ rm -f *~ svm-toy svm-toy.moc ${LOCAL_LIBDIR}/svm.o ++ rm -f *~ svm-toy svm-toy.moc $(LIBSVM_SO_SHVER) diff --git a/libsvm-3.11.toolsDir.patch b/libsvm-3.12.toolsDir.patch similarity index 100% rename from libsvm-3.11.toolsDir.patch rename to libsvm-3.12.toolsDir.patch diff --git a/libsvm.spec b/libsvm.spec index 02d8e86..31f087d 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,14 +1,13 @@ %define shver 2 Name: libsvm -Version: 3.11 -Release: 3%{?dist} +Version: 3.12 +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}-%{version}.tar.gz -#Source0: http://www.csie.ntu.edu.tw/~cjlin/cgi-bin/libsvm.cgi?+http://www.csie.ntu.edu.tw/~cjlin/%{name}+tar.gz +Source0: http://www.csie.ntu.edu.tw/~cjlin/libsvm/%{name}-%{version}.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 @@ -203,7 +202,6 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/%{name}/examples %{_libdir}/%{name}.so.%{shver} - %files devel %defattr(-,root,root,-) %doc README @@ -241,6 +239,13 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Apr 04 2012 Ding-Yi Chen - 3.12-1 +- Upstream update: + svm-toy: support loading/saving of regression data + python interface: handle the issue of the "0th" feature if using lists + tools/grid.py: not redrawing contour if c,g, cv doesn't change + add setlocale when saving and loading model so not affected by users' locale + * Thu Jan 12 2012 Ding-Yi Chen - 3.11-3 - Fixed Bug 646154 - libsvm-python's pth is not set correctly diff --git a/log b/log index dac608b..f37fc86 100644 --- a/log +++ b/log @@ -212,4 +212,9 @@ i subroutines to get SVs 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 + +3.12: 2012/04/01 + svm-toy: support loading/saving of regression data + python interface: handle the issue of the "0th" feature if using lists + tools/grid.py: not redrawing contour if c,g, cv doesn't change + add setlocale when saving and loading model so not affected by users' locale \ No newline at end of file diff --git a/sources b/sources index 3a815ba..a61604a 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -aae7a8f7e357e86e1c893b706bb02a63 guide.pdf -44d2a3a611280ecd0d66aafe0d52233e libsvm-3.11.tar.gz +b1543809993e2653dd2787f62c3c390a guide.pdf +a1b1083fe69a4ac695da753f4c83ed42 libsvm-3.12.tar.gz From 066eb5971a4e80c0ac3de0b16ed21a9fa1dad72f Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 19 Jul 2012 16:19:11 -0500 Subject: [PATCH 070/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index 31f087d..f9486be 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm Version: 3.12 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -239,6 +239,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Jul 19 2012 Fedora Release Engineering - 3.12-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + * Wed Apr 04 2012 Ding-Yi Chen - 3.12-1 - Upstream update: svm-toy: support loading/saving of regression data From 92087ddbd2faa48c3e87d167b79b1acf9a9430b6 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 13 Feb 2013 23:19:02 -0600 Subject: [PATCH 071/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index f9486be..aea85fe 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm Version: 3.12 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -239,6 +239,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Feb 14 2013 Fedora Release Engineering - 3.12-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + * Thu Jul 19 2012 Fedora Release Engineering - 3.12-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild From 0f3e08bb4411eacb178a68b150669ffec4f3b603 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Sat, 13 Apr 2013 23:35:20 +1000 Subject: [PATCH 072/136] Upstream update to 3.17 --- .gitignore | 1 + ...javaDir.patch => libsvm-3.17.javaDir.patch | 0 ...ain.patch => libsvm-3.17.packageMain.patch | 23 ++++------ ...onDir.patch => libsvm-3.17.pythonDir.patch | 0 ...svm-toy.patch => libsvm-3.17.svm-toy.patch | 0 ...olsDir.patch => libsvm-3.17.toolsDir.patch | 26 +++++------ libsvm.spec | 44 ++++++++++++++++--- log | 43 +++++++++++++++++- sources | 2 +- 9 files changed, 104 insertions(+), 35 deletions(-) rename libsvm-3.12.javaDir.patch => libsvm-3.17.javaDir.patch (100%) rename libsvm-3.12.packageMain.patch => libsvm-3.17.packageMain.patch (90%) rename libsvm-3.12.pythonDir.patch => libsvm-3.17.pythonDir.patch (100%) rename libsvm-3.12.svm-toy.patch => libsvm-3.17.svm-toy.patch (100%) rename libsvm-3.12.toolsDir.patch => libsvm-3.17.toolsDir.patch (72%) diff --git a/.gitignore b/.gitignore index 0ab1e09..aa1a6ec 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ libsvm-2.91.tar.gz /libsvm-3.1.tar.gz /libsvm-3.11.tar.gz /libsvm-3.12.tar.gz +/libsvm-3.17.tar.gz diff --git a/libsvm-3.12.javaDir.patch b/libsvm-3.17.javaDir.patch similarity index 100% rename from libsvm-3.12.javaDir.patch rename to libsvm-3.17.javaDir.patch diff --git a/libsvm-3.12.packageMain.patch b/libsvm-3.17.packageMain.patch similarity index 90% rename from libsvm-3.12.packageMain.patch rename to libsvm-3.17.packageMain.patch index 5d692ff..dee23cd 100644 --- a/libsvm-3.12.packageMain.patch +++ b/libsvm-3.17.packageMain.patch @@ -1,7 +1,7 @@ diff -up ./Makefile.packageMain ./Makefile ---- ./Makefile.packageMain 2012-01-02 01:10:52.000000000 +1000 -+++ ./Makefile 2012-04-05 11:14:42.683613523 +1000 -@@ -1,25 +1,121 @@ +--- ./Makefile.packageMain 2013-03-31 17:06:44.000000000 +1000 ++++ ./Makefile 2013-04-13 22:59:43.796601417 +1000 +@@ -1,11 +1,45 @@ CXX ?= g++ -CFLAGS = -Wall -Wconversion -O3 -fPIC +CFLAGS = ${RPM_CFLAGS} -Wall -Wconversion -O3 -fPIC @@ -12,17 +12,15 @@ diff -up ./Makefile.packageMain ./Makefile +DOT_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}') - --lib: svm.o +PREFIXDIR?= /usr +export PREFIXDIR -+ + +-all: svm-train svm-predict svm-scale +LIBDIR?=${PREFIXDIR}/lib${IS_64} +export LIBDIR -+ + +-lib: svm.o +DATADIR?=${PREFIXDIR}/share +export DATADIR + @@ -50,12 +48,9 @@ diff -up ./Makefile.packageMain ./Makefile + +libsvm.so.$(SHVER): svm.o if [ "$(OS)" = "Darwin" ]; then \ -- SHARED_LIB_FLAG="-dynamiclib -W1,-install_name,libsvm.so.$(SHVER)"; \ -+ SHARED_LIB_FLAG="-dynamiclib -Wl,-install_name,libsvm.so.$(SHVER)"; \ + SHARED_LIB_FLAG="-dynamiclib -Wl,-install_name,libsvm.so.$(SHVER)"; \ else \ -- SHARED_LIB_FLAG="-shared -W1,-soname,libsvm.so.$(SHVER)"; \ -+ SHARED_LIB_FLAG="-shared -Wl,-soname,libsvm.so.$(SHVER)"; \ - fi; \ +@@ -14,12 +48,72 @@ lib: svm.o $(CXX) $${SHARED_LIB_FLAG} svm.o -o libsvm.so.$(SHVER) svm-predict: svm-predict.c svm.o diff --git a/libsvm-3.12.pythonDir.patch b/libsvm-3.17.pythonDir.patch similarity index 100% rename from libsvm-3.12.pythonDir.patch rename to libsvm-3.17.pythonDir.patch diff --git a/libsvm-3.12.svm-toy.patch b/libsvm-3.17.svm-toy.patch similarity index 100% rename from libsvm-3.12.svm-toy.patch rename to libsvm-3.17.svm-toy.patch diff --git a/libsvm-3.12.toolsDir.patch b/libsvm-3.17.toolsDir.patch similarity index 72% rename from libsvm-3.12.toolsDir.patch rename to libsvm-3.17.toolsDir.patch index 1f4c1d2..a303895 100644 --- a/libsvm-3.12.toolsDir.patch +++ b/libsvm-3.17.toolsDir.patch @@ -1,6 +1,6 @@ diff -up ./tools/easy.py.toolsDir ./tools/easy.py ---- ./tools/easy.py.toolsDir 2010-12-31 15:51:25.000000000 +1000 -+++ ./tools/easy.py 2011-06-14 15:15:06.611622820 +1000 +--- ./tools/easy.py.toolsDir 2013-03-31 17:06:49.000000000 +1000 ++++ ./tools/easy.py 2013-04-13 23:17:53.399526910 +1000 @@ -12,10 +12,10 @@ if len(sys.argv) <= 1: is_win32 = (sys.platform == 'win32') @@ -39,14 +39,14 @@ diff -up ./tools/easy.py.toolsDir ./tools/easy.py print('Output prediction: {0}'.format(predict_test_file)) diff -up ./tools/grid.py.toolsDir ./tools/grid.py ---- ./tools/grid.py.toolsDir 2011-02-03 01:55:20.000000000 +1000 -+++ ./tools/grid.py 2011-06-14 14:56:11.817748117 +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 +--- ./tools/grid.py.toolsDir 2013-03-31 17:06:50.000000000 +1000 ++++ ./tools/grid.py 2013-04-13 23:18:53.964522769 +1000 +@@ -18,7 +18,7 @@ class GridOption: + def __init__(self, dataset_pathname, options): + dirname = os.path.dirname(__file__) + if sys.platform != 'win32': +- self.svmtrain_pathname = os.path.join(dirname, '../svm-train') ++ self.svmtrain_pathname = '/usr/bin/svm-train' + self.gnuplot_pathname = '/usr/bin/gnuplot' + else: + # example for windows diff --git a/libsvm.spec b/libsvm.spec index aea85fe..bba690b 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm -Version: 3.12 -Release: 3%{?dist} +Version: 3.17 +Release: 1%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -220,7 +220,6 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %doc java/README-Java java/test_applet.html %{_javadir}/%{name}.jar -#%{_datadir}/javadoc/%{name}-%{version} %endif %files svm-toy-gtk @@ -239,6 +238,39 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sat Apr 13 2013 Ding-Yi Chen - 3.17-1 +- Upstream update from 3.13 to 3.17 + svm.c and svm.h: + add sv_indices in model structure, so users can know which training instances are SVs + two library funs svm_get_sv_indices and svm_get_nr_sv are added + max_iter warning moved to stderr so -q won't disable it + svm-train.c: + usage modified to stress that multiclass is supported + svm-predict.c: + add -q for svm-predict + svm-scale.c: + issue a warning if feature indices do not start from 1 + issue a warning for inconsistency between scaling-factor file and input file + tools: + subset.py is written to be much faster + fix the bug of not freeing sv_indices + tools/grid.py: + -null option: allow the search on C or g only + -resume option: resume tasks from an earlier run + can be called as a python module + python interface: + local package searched first + libsvm options can be str or list + param.show() becomes print(param) + tools/: + easy.py fails in 3.15. Fix it by modifying grid.py + svm.cpp: + if class labels are 1 and -1, ensure labels[0] = 1 and labels[1] = -1 + initialize model->sv_indices as null in svm_load_model + if nr_fold > # data, change nr_fold to be # data and ro leave-one-out cv + matlab interface: + handle the problem where output variables are not specified + * Thu Feb 14 2013 Fedora Release Engineering - 3.12-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild @@ -247,9 +279,9 @@ rm -rf $RPM_BUILD_ROOT * Wed Apr 04 2012 Ding-Yi Chen - 3.12-1 - Upstream update: - svm-toy: support loading/saving of regression data - python interface: handle the issue of the "0th" feature if using lists - tools/grid.py: not redrawing contour if c,g, cv doesn't change + svm-toy: support loading/saving of regression data + python interface: handle the issue of the "0th" feature if using lists + tools/grid.py: not redrawing contour if c,g, cv doesn't change add setlocale when saving and loading model so not affected by users' locale * Thu Jan 12 2012 Ding-Yi Chen - 3.11-3 diff --git a/log b/log index f37fc86..4c7d592 100644 --- a/log +++ b/log @@ -217,4 +217,45 @@ i subroutines to get SVs svm-toy: support loading/saving of regression data python interface: handle the issue of the "0th" feature if using lists tools/grid.py: not redrawing contour if c,g, cv doesn't change - add setlocale when saving and loading model so not affected by users' locale \ No newline at end of file + add setlocale when saving and loading model so not affected by users' locale + +3.13: 2012/11/06 + svm.c and svm.h: + add sv_indices in model structure, so users can know which training instances are SVs + two library funs svm_get_sv_indices and svm_get_nr_sv are added + max_iter warning moved to stderr so -q won't disable it + svm-train.c: + usage modified to stress that multiclass is supported + svm-predict.c: + add -q for svm-predict + svm-scale.c: + issue a warning if feature indices do not start from 1 + issue a warning for inconsistency between scaling-factor file and input file + tools: + subset.py is written to be much faster + +3.14: 2012/11/16 + fix a bug: we didn't re-compile windows binary after updating svm.def + +3.15: 2013/1/27 + fix the bug of not freeing sv_indices + tools/grid.py: + -null option: allow the search on C or g only + -resume option: resume tasks from an earlier run + can be called as a python module + python interface: + local package searched first + libsvm options can be str or list + param.show() becomes print(param) + +3.16: 2013/1/27 + tools/: + easy.py fails in 3.15. Fix it by modifying grid.py + +3.17: 2013/04/01 + svm.cpp: + if class labels are 1 and -1, ensure labels[0] = 1 and labels[1] = -1 + initialize model->sv_indices as null in svm_load_model + if nr_fold > # data, change nr_fold to be # data and ro leave-one-out cv + matlab interface: + handle the problem where output variables are not specified \ No newline at end of file diff --git a/sources b/sources index a61604a..5984ec3 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ b1543809993e2653dd2787f62c3c390a guide.pdf -a1b1083fe69a4ac695da753f4c83ed42 libsvm-3.12.tar.gz +67f8b597ce85c1f5288d7838e57ea28a libsvm-3.17.tar.gz From 14b00c05dd6b74f09f8c514e12df96f9f1dca3b3 Mon Sep 17 00:00:00 2001 From: Jon Ciesla Date: Thu, 25 Apr 2013 13:13:24 -0500 Subject: [PATCH 073/136] Drop vendor tag. --- libsvm.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index bba690b..59af794 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm Version: 3.17 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -162,7 +162,7 @@ echo -e "# This file is not in the original libsvm tarball, but added for conven # 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 \ +desktop-file-install --delete-original \ --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 \ @@ -227,17 +227,20 @@ rm -rf $RPM_BUILD_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 +%{_datadir}/applications/*%{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 +%{_datadir}/applications/*%{name}-svm-toy-qt.desktop %changelog +* Thu Apr 25 2013 Jon Ciesla - 3.17-2 +- Drop desktop vendor tag. + * Sat Apr 13 2013 Ding-Yi Chen - 3.17-1 - Upstream update from 3.13 to 3.17 svm.c and svm.h: From 037457f529b19bf0d4d65f8c5ccf16c2cef298fb Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 3 Aug 2013 02:09:08 -0500 Subject: [PATCH 074/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index 59af794..7919f7e 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm Version: 3.17 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -238,6 +238,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sat Aug 03 2013 Fedora Release Engineering - 3.17-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + * Thu Apr 25 2013 Jon Ciesla - 3.17-2 - Drop desktop vendor tag. From 0324c7aef42b8b6bbf1a1fea869ba5df948fd86c Mon Sep 17 00:00:00 2001 From: Michael Simacek Date: Fri, 28 Mar 2014 16:30:01 +0100 Subject: [PATCH 075/136] Use Requires: java-headless rebuild (#1067528) Signed-off-by: Michael Simacek Signed-off-by: Mikolaj Izdebski --- libsvm.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index 7919f7e..fa4da57 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm Version: 3.17 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -81,7 +81,7 @@ Group: Development/Libraries BuildRequires: java-devel >= 1.5.0 BuildRequires: jpackage-utils -Requires: java >= 1.5.0 +Requires: java-headless >= 1.5.0 Requires: jpackage-utils Requires: %{name} = %{version}-%{release} @@ -238,6 +238,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Mar 28 2014 Michael Simacek - 3.17-4 +- Use Requires: java-headless rebuild (#1067528) + * Sat Aug 03 2013 Fedora Release Engineering - 3.17-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild From bde6ad5c19fb0fcad90a2065efca00779bb57ffe Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 22 Apr 2014 10:29:04 +1000 Subject: [PATCH 076/136] libsvm-3.18 --- .gitignore | 2 ++ ...javaDir.patch => libsvm-3.18.javaDir.patch | 0 ...ain.patch => libsvm-3.18.packageMain.patch | 0 ...onDir.patch => libsvm-3.18.pythonDir.patch | 0 ...svm-toy.patch => libsvm-3.18.svm-toy.patch | 0 ...olsDir.patch => libsvm-3.18.toolsDir.patch | 0 libsvm.spec | 28 +++++++++++-------- sources | 4 +-- 8 files changed, 21 insertions(+), 13 deletions(-) rename libsvm-3.17.javaDir.patch => libsvm-3.18.javaDir.patch (100%) rename libsvm-3.17.packageMain.patch => libsvm-3.18.packageMain.patch (100%) rename libsvm-3.17.pythonDir.patch => libsvm-3.18.pythonDir.patch (100%) rename libsvm-3.17.svm-toy.patch => libsvm-3.18.svm-toy.patch (100%) rename libsvm-3.17.toolsDir.patch => libsvm-3.18.toolsDir.patch (100%) diff --git a/.gitignore b/.gitignore index aa1a6ec..23ae323 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ libsvm-2.91.tar.gz /libsvm-3.11.tar.gz /libsvm-3.12.tar.gz /libsvm-3.17.tar.gz +/libsvm-3.18.tar.gz +/log diff --git a/libsvm-3.17.javaDir.patch b/libsvm-3.18.javaDir.patch similarity index 100% rename from libsvm-3.17.javaDir.patch rename to libsvm-3.18.javaDir.patch diff --git a/libsvm-3.17.packageMain.patch b/libsvm-3.18.packageMain.patch similarity index 100% rename from libsvm-3.17.packageMain.patch rename to libsvm-3.18.packageMain.patch diff --git a/libsvm-3.17.pythonDir.patch b/libsvm-3.18.pythonDir.patch similarity index 100% rename from libsvm-3.17.pythonDir.patch rename to libsvm-3.18.pythonDir.patch diff --git a/libsvm-3.17.svm-toy.patch b/libsvm-3.18.svm-toy.patch similarity index 100% rename from libsvm-3.17.svm-toy.patch rename to libsvm-3.18.svm-toy.patch diff --git a/libsvm-3.17.toolsDir.patch b/libsvm-3.18.toolsDir.patch similarity index 100% rename from libsvm-3.17.toolsDir.patch rename to libsvm-3.18.toolsDir.patch diff --git a/libsvm.spec b/libsvm.spec index fa4da57..fb2dd6b 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm -Version: 3.17 -Release: 4%{?dist} +Version: 3.18 +Release: 1%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -238,6 +238,12 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Apr 22 2014 Ding-Yi Chen - 3.18-1 +- Upstream update to 3.18 +- svm.cpp and svm-scale.c: check return values of fscanf +- matlab interface: Makefile no longer handles octave + because make.m should be used + * Fri Mar 28 2014 Michael Simacek - 3.17-4 - Use Requires: java-headless rebuild (#1067528) @@ -352,10 +358,10 @@ rm -rf $RPM_BUILD_ROOT * 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 + * 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. @@ -425,7 +431,7 @@ rm -rf $RPM_BUILD_ROOT * better gradient reconstructions * issue a warning when -h 0 may be faster -* Thu Apr 29 2008 Ding-Yi Chen - 2.86-13 +* Tue 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) @@ -455,7 +461,7 @@ rm -rf $RPM_BUILD_ROOT - [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 +* Mon 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 @@ -475,7 +481,7 @@ rm -rf $RPM_BUILD_ROOT - Add svm-toy-gtk - Add svm-toy-qt -* Wed Dec 20 2007 Ding-Yi Chen - 2.84-9 +* Thu Dec 20 2007 Ding-Yi Chen - 2.84-9 - [Bug 254091] Comment 19 - Fix python/Makefile @@ -487,11 +493,11 @@ rm -rf $RPM_BUILD_ROOT * 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 +* Wed 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 +* Mon Sep 24 2007 Ding-Yi Chen - 2.84-5 - Split out libsvm-java - Add libsvm.so diff --git a/sources b/sources index 5984ec3..b7c6488 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -b1543809993e2653dd2787f62c3c390a guide.pdf -67f8b597ce85c1f5288d7838e57ea28a libsvm-3.17.tar.gz +bba35e2cf9d14e158009ef8b90fd840a libsvm-3.18.tar.gz +95918671ee5435803a1646e1ad2f3317 log From 93e652256c9fbd9c55600de101ca53bc2f9d230f Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 22 Apr 2014 10:35:46 +1000 Subject: [PATCH 077/136] Upload guide.pdf --- sources | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sources b/sources index b7c6488..367e019 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -bba35e2cf9d14e158009ef8b90fd840a libsvm-3.18.tar.gz -95918671ee5435803a1646e1ad2f3317 log +b1543809993e2653dd2787f62c3c390a guide.pdf From 6a2c872b23d73eeac56cdafe4123e036a3182179 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 22 Apr 2014 10:47:09 +1000 Subject: [PATCH 078/136] libsvm-3.18 new-sources --- .gitignore | 3 +++ sources | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 23ae323..77e536b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ libsvm-2.91.tar.gz /libsvm-3.17.tar.gz /libsvm-3.18.tar.gz /log +/LibSVM-svm-toy-48.png +/libsvm-svm-toy-gtk.desktop +/libsvm-svm-toy-qt.desktop diff --git a/sources b/sources index 367e019..4a9b52a 100644 --- a/sources +++ b/sources @@ -1 +1,6 @@ b1543809993e2653dd2787f62c3c390a guide.pdf +bba35e2cf9d14e158009ef8b90fd840a libsvm-3.18.tar.gz +95918671ee5435803a1646e1ad2f3317 log +0bc4868057a7c1c422f91a798f14a562 LibSVM-svm-toy-48.png +398721fc66bb0903d46c685e9a3cba27 libsvm-svm-toy-gtk.desktop +9a518db15afe9224e3a04695c82d7142 libsvm-svm-toy-qt.desktop From 45474b1efd120f3235bd470ad2e4291ca620ff3a Mon Sep 17 00:00:00 2001 From: Jon Ciesla Date: Thu, 25 Apr 2013 13:13:24 -0500 Subject: [PATCH 079/136] Drop vendor tag. --- libsvm.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index bba690b..59af794 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm Version: 3.17 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -162,7 +162,7 @@ echo -e "# This file is not in the original libsvm tarball, but added for conven # 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 \ +desktop-file-install --delete-original \ --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 \ @@ -227,17 +227,20 @@ rm -rf $RPM_BUILD_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 +%{_datadir}/applications/*%{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 +%{_datadir}/applications/*%{name}-svm-toy-qt.desktop %changelog +* Thu Apr 25 2013 Jon Ciesla - 3.17-2 +- Drop desktop vendor tag. + * Sat Apr 13 2013 Ding-Yi Chen - 3.17-1 - Upstream update from 3.13 to 3.17 svm.c and svm.h: From 09712fbb92edcc62c84a980e7a24529bc80a9523 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 3 Aug 2013 02:09:08 -0500 Subject: [PATCH 080/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index 59af794..7919f7e 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm Version: 3.17 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -238,6 +238,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sat Aug 03 2013 Fedora Release Engineering - 3.17-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + * Thu Apr 25 2013 Jon Ciesla - 3.17-2 - Drop desktop vendor tag. From 406372669296efacb80d3c1fb090dc575e91a034 Mon Sep 17 00:00:00 2001 From: Michael Simacek Date: Fri, 28 Mar 2014 16:30:01 +0100 Subject: [PATCH 081/136] Use Requires: java-headless rebuild (#1067528) Signed-off-by: Michael Simacek Signed-off-by: Mikolaj Izdebski --- libsvm.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index 7919f7e..fa4da57 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm Version: 3.17 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -81,7 +81,7 @@ Group: Development/Libraries BuildRequires: java-devel >= 1.5.0 BuildRequires: jpackage-utils -Requires: java >= 1.5.0 +Requires: java-headless >= 1.5.0 Requires: jpackage-utils Requires: %{name} = %{version}-%{release} @@ -238,6 +238,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Mar 28 2014 Michael Simacek - 3.17-4 +- Use Requires: java-headless rebuild (#1067528) + * Sat Aug 03 2013 Fedora Release Engineering - 3.17-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild From 61e0772fade52872dab8aecda3996a6f42ee36c4 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 22 Apr 2014 10:29:04 +1000 Subject: [PATCH 082/136] libsvm-3.18 --- .gitignore | 2 ++ ...javaDir.patch => libsvm-3.18.javaDir.patch | 0 ...ain.patch => libsvm-3.18.packageMain.patch | 0 ...onDir.patch => libsvm-3.18.pythonDir.patch | 0 ...svm-toy.patch => libsvm-3.18.svm-toy.patch | 0 ...olsDir.patch => libsvm-3.18.toolsDir.patch | 0 libsvm.spec | 28 +++++++++++-------- sources | 4 +-- 8 files changed, 21 insertions(+), 13 deletions(-) rename libsvm-3.17.javaDir.patch => libsvm-3.18.javaDir.patch (100%) rename libsvm-3.17.packageMain.patch => libsvm-3.18.packageMain.patch (100%) rename libsvm-3.17.pythonDir.patch => libsvm-3.18.pythonDir.patch (100%) rename libsvm-3.17.svm-toy.patch => libsvm-3.18.svm-toy.patch (100%) rename libsvm-3.17.toolsDir.patch => libsvm-3.18.toolsDir.patch (100%) diff --git a/.gitignore b/.gitignore index aa1a6ec..23ae323 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ libsvm-2.91.tar.gz /libsvm-3.11.tar.gz /libsvm-3.12.tar.gz /libsvm-3.17.tar.gz +/libsvm-3.18.tar.gz +/log diff --git a/libsvm-3.17.javaDir.patch b/libsvm-3.18.javaDir.patch similarity index 100% rename from libsvm-3.17.javaDir.patch rename to libsvm-3.18.javaDir.patch diff --git a/libsvm-3.17.packageMain.patch b/libsvm-3.18.packageMain.patch similarity index 100% rename from libsvm-3.17.packageMain.patch rename to libsvm-3.18.packageMain.patch diff --git a/libsvm-3.17.pythonDir.patch b/libsvm-3.18.pythonDir.patch similarity index 100% rename from libsvm-3.17.pythonDir.patch rename to libsvm-3.18.pythonDir.patch diff --git a/libsvm-3.17.svm-toy.patch b/libsvm-3.18.svm-toy.patch similarity index 100% rename from libsvm-3.17.svm-toy.patch rename to libsvm-3.18.svm-toy.patch diff --git a/libsvm-3.17.toolsDir.patch b/libsvm-3.18.toolsDir.patch similarity index 100% rename from libsvm-3.17.toolsDir.patch rename to libsvm-3.18.toolsDir.patch diff --git a/libsvm.spec b/libsvm.spec index fa4da57..fb2dd6b 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm -Version: 3.17 -Release: 4%{?dist} +Version: 3.18 +Release: 1%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -238,6 +238,12 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Apr 22 2014 Ding-Yi Chen - 3.18-1 +- Upstream update to 3.18 +- svm.cpp and svm-scale.c: check return values of fscanf +- matlab interface: Makefile no longer handles octave + because make.m should be used + * Fri Mar 28 2014 Michael Simacek - 3.17-4 - Use Requires: java-headless rebuild (#1067528) @@ -352,10 +358,10 @@ rm -rf $RPM_BUILD_ROOT * 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 + * 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. @@ -425,7 +431,7 @@ rm -rf $RPM_BUILD_ROOT * better gradient reconstructions * issue a warning when -h 0 may be faster -* Thu Apr 29 2008 Ding-Yi Chen - 2.86-13 +* Tue 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) @@ -455,7 +461,7 @@ rm -rf $RPM_BUILD_ROOT - [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 +* Mon 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 @@ -475,7 +481,7 @@ rm -rf $RPM_BUILD_ROOT - Add svm-toy-gtk - Add svm-toy-qt -* Wed Dec 20 2007 Ding-Yi Chen - 2.84-9 +* Thu Dec 20 2007 Ding-Yi Chen - 2.84-9 - [Bug 254091] Comment 19 - Fix python/Makefile @@ -487,11 +493,11 @@ rm -rf $RPM_BUILD_ROOT * 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 +* Wed 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 +* Mon Sep 24 2007 Ding-Yi Chen - 2.84-5 - Split out libsvm-java - Add libsvm.so diff --git a/sources b/sources index 5984ec3..b7c6488 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -b1543809993e2653dd2787f62c3c390a guide.pdf -67f8b597ce85c1f5288d7838e57ea28a libsvm-3.17.tar.gz +bba35e2cf9d14e158009ef8b90fd840a libsvm-3.18.tar.gz +95918671ee5435803a1646e1ad2f3317 log From 61cc8d17f0414e58e5a72309965db29ca4e5c016 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 22 Apr 2014 10:35:46 +1000 Subject: [PATCH 083/136] Upload guide.pdf --- sources | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sources b/sources index b7c6488..367e019 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -bba35e2cf9d14e158009ef8b90fd840a libsvm-3.18.tar.gz -95918671ee5435803a1646e1ad2f3317 log +b1543809993e2653dd2787f62c3c390a guide.pdf From b886949a662527466a213ad6ed12605a8bf2e4e5 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 22 Apr 2014 10:47:09 +1000 Subject: [PATCH 084/136] libsvm-3.18 new-sources --- .gitignore | 3 +++ sources | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 23ae323..77e536b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ libsvm-2.91.tar.gz /libsvm-3.17.tar.gz /libsvm-3.18.tar.gz /log +/LibSVM-svm-toy-48.png +/libsvm-svm-toy-gtk.desktop +/libsvm-svm-toy-qt.desktop diff --git a/sources b/sources index 367e019..4a9b52a 100644 --- a/sources +++ b/sources @@ -1 +1,6 @@ b1543809993e2653dd2787f62c3c390a guide.pdf +bba35e2cf9d14e158009ef8b90fd840a libsvm-3.18.tar.gz +95918671ee5435803a1646e1ad2f3317 log +0bc4868057a7c1c422f91a798f14a562 LibSVM-svm-toy-48.png +398721fc66bb0903d46c685e9a3cba27 libsvm-svm-toy-gtk.desktop +9a518db15afe9224e3a04695c82d7142 libsvm-svm-toy-qt.desktop From c5f7d9044cf7f5fd068141ee5e8e8af3dbb3204b Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 8 Nov 2011 16:53:53 +1000 Subject: [PATCH 085/136] Upstream update:3.11 --- .gitignore | 3 --- libsvm.spec | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 77e536b..ce9d876 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -guide.pdf -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.spec b/libsvm.spec index fb2dd6b..edd0f0f 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -202,6 +202,7 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/%{name}/examples %{_libdir}/%{name}.so.%{shver} + %files devel %defattr(-,root,root,-) %doc README @@ -220,6 +221,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %doc java/README-Java java/test_applet.html %{_javadir}/%{name}.jar +#%{_datadir}/javadoc/%{name}-%{version} %endif %files svm-toy-gtk From 0ce5d8c52bd23d1467e80024af27f79a7a3002c6 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Mon, 28 Apr 2014 11:40:45 +1000 Subject: [PATCH 086/136] Fixed Bug 1090844 - libsvm-java has unresolved dependencies on epel6 testing --- libsvm.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index fb2dd6b..2767a2d 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm Version: 3.18 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -81,7 +81,12 @@ Group: Development/Libraries BuildRequires: java-devel >= 1.5.0 BuildRequires: jpackage-utils +%if 0%{?rhel} <= 6 +Requires: java >= 1.5.0 +%else Requires: java-headless >= 1.5.0 +%endif + Requires: jpackage-utils Requires: %{name} = %{version}-%{release} @@ -238,6 +243,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Apr 28 2014 Ding-Yi Chen - 3.18-2 +- Fixed Bug 1090844 - libsvm-java has unresolved dependencies on epel6 testing + * Tue Apr 22 2014 Ding-Yi Chen - 3.18-1 - Upstream update to 3.18 - svm.cpp and svm-scale.c: check return values of fscanf From 6afe4b22432fdeb664a04dd1ceea8742a8598fed Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Mon, 28 Apr 2014 11:40:45 +1000 Subject: [PATCH 087/136] Fixed Bug 1090844 - libsvm-java has unresolved dependencies on epel6 testing --- libsvm.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index fb2dd6b..2767a2d 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm Version: 3.18 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -81,7 +81,12 @@ Group: Development/Libraries BuildRequires: java-devel >= 1.5.0 BuildRequires: jpackage-utils +%if 0%{?rhel} <= 6 +Requires: java >= 1.5.0 +%else Requires: java-headless >= 1.5.0 +%endif + Requires: jpackage-utils Requires: %{name} = %{version}-%{release} @@ -238,6 +243,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Apr 28 2014 Ding-Yi Chen - 3.18-2 +- Fixed Bug 1090844 - libsvm-java has unresolved dependencies on epel6 testing + * Tue Apr 22 2014 Ding-Yi Chen - 3.18-1 - Upstream update to 3.18 - svm.cpp and svm-scale.c: check return values of fscanf From 246d0d661c7029f32a402f7b47a759453d6e0198 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 4 Nov 2009 07:01:28 +0000 Subject: [PATCH 088/136] Upstream update --- log | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log b/log index 4c7d592..12cce0f 100644 --- a/log +++ b/log @@ -258,4 +258,4 @@ i subroutines to get SVs initialize model->sv_indices as null in svm_load_model if nr_fold > # data, change nr_fold to be # data and ro leave-one-out cv matlab interface: - handle the problem where output variables are not specified \ No newline at end of file + handle the problem where output variables are not specified From d7f7ae62d53cba6296f0c605a0a08ea9e8bbe98d Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 8 May 2010 01:57:15 +0000 Subject: [PATCH 089/136] Initialize branch EL-6 for libsvm --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..46381b9 --- /dev/null +++ b/branch @@ -0,0 +1 @@ +EL-6 From 8c49b21f9056d5ba85c913a330ae8c4e158ff9f2 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 28 Jul 2010 21:43:03 +0000 Subject: [PATCH 090/136] dist-git conversion --- .gitignore | 11 ----------- branch | 1 - 2 files changed, 12 deletions(-) delete mode 100644 branch diff --git a/.gitignore b/.gitignore index 77e536b..ce11a88 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,2 @@ guide.pdf libsvm-2.91.tar.gz -/guide.pdf -/libsvm-3.0.tar.gz -/libsvm-3.1.tar.gz -/libsvm-3.11.tar.gz -/libsvm-3.12.tar.gz -/libsvm-3.17.tar.gz -/libsvm-3.18.tar.gz -/log -/LibSVM-svm-toy-48.png -/libsvm-svm-toy-gtk.desktop -/libsvm-svm-toy-qt.desktop diff --git a/branch b/branch deleted file mode 100644 index 46381b9..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -EL-6 From a31e58fce62716a70063c008b68212d799933373 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 8 Nov 2011 16:45:57 +1000 Subject: [PATCH 091/136] Upstream update:3.11 --- .gitignore | 2 +- log | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ce11a88..8764a5f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ guide.pdf -libsvm-2.91.tar.gz +libsvm-3.91.tar.gz diff --git a/log b/log index 12cce0f..056a560 100644 --- a/log +++ b/log @@ -212,6 +212,7 @@ i subroutines to get SVs 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 +<<<<<<< HEAD 3.12: 2012/04/01 svm-toy: support loading/saving of regression data From 5459b8aaa6510359e19c8f21568d24a5c7255396 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Mon, 28 Apr 2014 11:40:45 +1000 Subject: [PATCH 092/136] Fixed Bug 1090844 - libsvm-java has unresolved dependencies on epel6 testing --- libsvm.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index edd0f0f..0580eff 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,7 @@ %define shver 2 Name: libsvm Version: 3.18 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -81,7 +81,12 @@ Group: Development/Libraries BuildRequires: java-devel >= 1.5.0 BuildRequires: jpackage-utils +%if 0%{?rhel} <= 6 +Requires: java >= 1.5.0 +%else Requires: java-headless >= 1.5.0 +%endif + Requires: jpackage-utils Requires: %{name} = %{version}-%{release} @@ -240,6 +245,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Apr 28 2014 Ding-Yi Chen - 3.18-2 +- Fixed Bug 1090844 - libsvm-java has unresolved dependencies on epel6 testing + * Tue Apr 22 2014 Ding-Yi Chen - 3.18-1 - Upstream update to 3.18 - svm.cpp and svm-scale.c: check return values of fscanf From f13cf841ccf6bcf784700ab8f229addf8b7d75c1 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 8 Nov 2011 16:53:53 +1000 Subject: [PATCH 093/136] Upstream update:3.11 --- log | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log b/log index 4c7d592..12cce0f 100644 --- a/log +++ b/log @@ -258,4 +258,4 @@ i subroutines to get SVs initialize model->sv_indices as null in svm_load_model if nr_fold > # data, change nr_fold to be # data and ro leave-one-out cv matlab interface: - handle the problem where output variables are not specified \ No newline at end of file + handle the problem where output variables are not specified From 0852a8c1ca647613af7ef481cacd3178451dbd68 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 3 Aug 2013 02:09:08 -0500 Subject: [PATCH 094/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild --- libsvm.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libsvm.spec b/libsvm.spec index 0580eff..c23d2c8 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -245,6 +245,7 @@ rm -rf $RPM_BUILD_ROOT %changelog +<<<<<<< HEAD * Mon Apr 28 2014 Ding-Yi Chen - 3.18-2 - Fixed Bug 1090844 - libsvm-java has unresolved dependencies on epel6 testing @@ -257,6 +258,8 @@ rm -rf $RPM_BUILD_ROOT * Fri Mar 28 2014 Michael Simacek - 3.17-4 - Use Requires: java-headless rebuild (#1067528) +======= +>>>>>>> - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Sat Aug 03 2013 Fedora Release Engineering - 3.17-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild From 556eaba32cb85ad7d2562e67cfb00a0816bc60ed Mon Sep 17 00:00:00 2001 From: Michael Simacek Date: Fri, 28 Mar 2014 16:30:01 +0100 Subject: [PATCH 095/136] Use Requires: java-headless rebuild (#1067528) Signed-off-by: Michael Simacek Signed-off-by: Mikolaj Izdebski --- libsvm.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index c23d2c8..6503de3 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -81,12 +81,16 @@ Group: Development/Libraries BuildRequires: java-devel >= 1.5.0 BuildRequires: jpackage-utils +<<<<<<< HEAD %if 0%{?rhel} <= 6 Requires: java >= 1.5.0 %else Requires: java-headless >= 1.5.0 %endif +======= +Requires: java-headless >= 1.5.0 +>>>>>>> Use Requires: java-headless rebuild (#1067528) Requires: jpackage-utils Requires: %{name} = %{version}-%{release} @@ -245,7 +249,6 @@ rm -rf $RPM_BUILD_ROOT %changelog -<<<<<<< HEAD * Mon Apr 28 2014 Ding-Yi Chen - 3.18-2 - Fixed Bug 1090844 - libsvm-java has unresolved dependencies on epel6 testing @@ -258,8 +261,6 @@ rm -rf $RPM_BUILD_ROOT * Fri Mar 28 2014 Michael Simacek - 3.17-4 - Use Requires: java-headless rebuild (#1067528) -======= ->>>>>>> - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Sat Aug 03 2013 Fedora Release Engineering - 3.17-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild From 5e0873a54f8b32a1641e4095c68fc291927d74bb Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 22 Apr 2014 10:29:04 +1000 Subject: [PATCH 096/136] libsvm-3.18 --- libsvm.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index 6503de3..0580eff 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -81,16 +81,12 @@ Group: Development/Libraries BuildRequires: java-devel >= 1.5.0 BuildRequires: jpackage-utils -<<<<<<< HEAD %if 0%{?rhel} <= 6 Requires: java >= 1.5.0 %else Requires: java-headless >= 1.5.0 %endif -======= -Requires: java-headless >= 1.5.0 ->>>>>>> Use Requires: java-headless rebuild (#1067528) Requires: jpackage-utils Requires: %{name} = %{version}-%{release} From 578d57f9463bea876730f72f42db851780b1bcc1 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Mon, 28 Apr 2014 15:34:32 +1000 Subject: [PATCH 097/136] EPEL5 desktop files need vendor --- libsvm.spec | 54 ++++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index 0580eff..ac457b5 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,7 +1,11 @@ %define shver 2 +%{!?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 + Name: libsvm Version: 3.18 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -21,25 +25,22 @@ Patch4: %{name}-%{version}.toolsDir.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: grep -%{!?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 + +%if 0%{?rhel} <= 5 +%define moc_path %{_libdir}/qt4/bin/moc +%define with_vendor "fedora" %else -%if 0%{?rhel} >= 6 %define moc_path %{_bindir}/moc-qt4 -%else -%define moc_path %{_libdir}/qt4/bin/moc -%endif -%endif +%fi %ifnarch ppc ppc64 %define no_java FALSE +%if 0%{?rhel} <= 6 +%define java_dependency java +%else +%define java_dependency java-headless +%endif %else %define no_java NO_JAVA Obsoletes: libsvm-java < 2.88-1 @@ -74,19 +75,14 @@ Python tools and interfaces for libsvm. Install this package if you want to develop programs with libsvm in Python. -%ifnarch ppc ppc64 +%if "%{NO_JAVA}" == "FALSE" %package java Summary: Java tools and interfaces for libsvm Group: Development/Libraries BuildRequires: java-devel >= 1.5.0 BuildRequires: jpackage-utils -%if 0%{?rhel} <= 6 -Requires: java >= 1.5.0 -%else -Requires: java-headless >= 1.5.0 -%endif - +Requires: %{java_dependency} >= 1.5.0 Requires: jpackage-utils Requires: %{name} = %{version}-%{release} @@ -136,18 +132,16 @@ 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}" +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}" @@ -167,10 +161,17 @@ echo -e "# This file is not in the original libsvm tarball, but added for conven # This file is released under BSD license, just like the rest of the package.\n"\ > $RPM_BUILD_ROOT/%{libsvm_python_dir}/__init__.py +%if 0%{?with_vendor} +desktop-file-install --delete-original --vendor=%{with_vendor} \ + --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 +%eles desktop-file-install --delete-original \ --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 \ + ${RPM_BUILD_ROOT}/%{_datadir}/applications/%{name}-svm-toy-qt.desktop +%endif # Fix Bug 646154 - libsvm-python's pth is not set correctly echo 'libsvm' > $RPM_BUILD_ROOT/%{python_sitearch}/libsvm.pth @@ -245,6 +246,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Apr 28 2014 Ding-Yi Chen - 3.18-3 +- EPEL5 desktop files need vendor. + * Mon Apr 28 2014 Ding-Yi Chen - 3.18-2 - Fixed Bug 1090844 - libsvm-java has unresolved dependencies on epel6 testing From 6418af21bc4dc027471ecbb52354fc210672d22e Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Mon, 28 Apr 2014 15:49:14 +1000 Subject: [PATCH 098/136] Fix spec --- libsvm.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index ac457b5..20c069c 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -32,7 +32,7 @@ BuildRequires: grep %define with_vendor "fedora" %else %define moc_path %{_bindir}/moc-qt4 -%fi +%endif %ifnarch ppc ppc64 %define no_java FALSE From db3f53eb75e671a09e0d9a0b8024352d3f2f91e6 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Mon, 28 Apr 2014 16:11:13 +1000 Subject: [PATCH 099/136] Fix SPEC --- libsvm.spec | 12 +++++------- log | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index 20c069c..6aaad7e 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,6 +1,7 @@ %define shver 2 %{!?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 libdir_libsvm %{_libdir}/libsvm %define libsvm_python_dir %{python_sitearch}/libsvm Name: libsvm @@ -25,8 +26,6 @@ Patch4: %{name}-%{version}.toolsDir.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: grep -%define libdir_libsvm %{_libdir}/libsvm - %if 0%{?rhel} <= 5 %define moc_path %{_libdir}/qt4/bin/moc %define with_vendor "fedora" @@ -75,7 +74,7 @@ Python tools and interfaces for libsvm. Install this package if you want to develop programs with libsvm in Python. -%if "%{NO_JAVA}" == "FALSE" +%if "%{no_java}" == "FALSE" %package java Summary: Java tools and interfaces for libsvm Group: Development/Libraries @@ -161,12 +160,12 @@ echo -e "# This file is not in the original libsvm tarball, but added for conven # This file is released under BSD license, just like the rest of the package.\n"\ > $RPM_BUILD_ROOT/%{libsvm_python_dir}/__init__.py -%if 0%{?with_vendor} +%if 0%{?with_vendor:1} desktop-file-install --delete-original --vendor=%{with_vendor} \ --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 -%eles +%else desktop-file-install --delete-original \ --dir=${RPM_BUILD_ROOT}%{_datadir}/applications \ ${RPM_BUILD_ROOT}/%{_datadir}/applications/%{name}-svm-toy-gtk.desktop \ @@ -208,7 +207,6 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/%{name}/examples %{_libdir}/%{name}.so.%{shver} - %files devel %defattr(-,root,root,-) %doc README @@ -222,7 +220,7 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/svm-*.py %{python_sitearch}/libsvm.pth -%ifnarch ppc ppc64 +%if "%{no_java}" == "FALSE" %files java %defattr(-,root,root,-) %doc java/README-Java java/test_applet.html diff --git a/log b/log index 12cce0f..4c7d592 100644 --- a/log +++ b/log @@ -258,4 +258,4 @@ i subroutines to get SVs initialize model->sv_indices as null in svm_load_model if nr_fold > # data, change nr_fold to be # data and ro leave-one-out cv matlab interface: - handle the problem where output variables are not specified + handle the problem where output variables are not specified \ No newline at end of file From 728a554971ce719de00d0c48ccda5580fa81e95e Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 7 Jun 2014 00:36:50 -0500 Subject: [PATCH 100/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index 6aaad7e..9f17228 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -6,7 +6,7 @@ Name: libsvm Version: 3.18 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -244,6 +244,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sat Jun 07 2014 Fedora Release Engineering - 3.18-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + * Mon Apr 28 2014 Ding-Yi Chen - 3.18-3 - EPEL5 desktop files need vendor. From 4662e10ce34140d16f82ec68f05315ac96b0b29e Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Thu, 10 Jul 2014 11:18:17 +0100 Subject: [PATCH 101/136] Do not use vendor prefixes on Fedora --- libsvm.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index 9f17228..5d50b6c 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -6,7 +6,7 @@ Name: libsvm Version: 3.18 -Release: 4%{?dist} +Release: 5%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -26,7 +26,7 @@ Patch4: %{name}-%{version}.toolsDir.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: grep -%if 0%{?rhel} <= 5 +%if 0%{?rhel} != 0 && 0%{?rhel} <= 5 %define moc_path %{_libdir}/qt4/bin/moc %define with_vendor "fedora" %else @@ -244,6 +244,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Jul 10 2014 Richard Hughes - 3.18-5 +- Do not use vendor prefixes on Fedora + * Sat Jun 07 2014 Fedora Release Engineering - 3.18-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild From 7d22c2204800404de3212f22588dd15d3a579fb7 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 17 Aug 2014 06:13:05 +0000 Subject: [PATCH 102/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index 5d50b6c..602ed7d 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -6,7 +6,7 @@ Name: libsvm Version: 3.18 -Release: 5%{?dist} +Release: 6%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -244,6 +244,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sun Aug 17 2014 Fedora Release Engineering - 3.18-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + * Thu Jul 10 2014 Richard Hughes - 3.18-5 - Do not use vendor prefixes on Fedora From e82ed31763f81a4a5704a3d91023aeac0953d4f7 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 17 Aug 2014 06:13:17 +0000 Subject: [PATCH 103/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index 9f17228..660043b 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -6,7 +6,7 @@ Name: libsvm Version: 3.18 -Release: 4%{?dist} +Release: 5%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -244,6 +244,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sun Aug 17 2014 Fedora Release Engineering - 3.18-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + * Sat Jun 07 2014 Fedora Release Engineering - 3.18-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild From 9587f983f23297586c24eb05fc6d8368b9e210f2 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 20 Jan 2015 13:40:14 +1000 Subject: [PATCH 104/136] - Upstream update to 3.20 --- .gitignore | 1 + libsvm-3.17.pom | 36 +++++++ ...javaDir.patch => libsvm-3.20.javaDir.patch | 0 ...ain.patch => libsvm-3.20.packageMain.patch | 0 ...onDir.patch => libsvm-3.20.pythonDir.patch | 0 ...svm-toy.patch => libsvm-3.20.svm-toy.patch | 0 ...olsDir.patch => libsvm-3.20.toolsDir.patch | 0 libsvm.spec | 93 ++++++++++++++----- log | 3 +- sources | 6 +- 10 files changed, 107 insertions(+), 32 deletions(-) create mode 100644 libsvm-3.17.pom rename libsvm-3.18.javaDir.patch => libsvm-3.20.javaDir.patch (100%) rename libsvm-3.18.packageMain.patch => libsvm-3.20.packageMain.patch (100%) rename libsvm-3.18.pythonDir.patch => libsvm-3.20.pythonDir.patch (100%) rename libsvm-3.18.svm-toy.patch => libsvm-3.20.svm-toy.patch (100%) rename libsvm-3.18.toolsDir.patch => libsvm-3.20.toolsDir.patch (100%) diff --git a/.gitignore b/.gitignore index 288995a..f223af3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ libsvm-3.91.tar.gz /LibSVM-svm-toy-48.png /libsvm-svm-toy-gtk.desktop /libsvm-svm-toy-qt.desktop +/libsvm-3.20.tar.gz diff --git a/libsvm-3.17.pom b/libsvm-3.17.pom new file mode 100644 index 0000000..511b1b2 --- /dev/null +++ b/libsvm-3.17.pom @@ -0,0 +1,36 @@ + + 4.0.0 + tw.edu.ntu.csie + libsvm + 3.20 + jar + LIBSVM + A Library for Support Vector Machines + http://www.csie.ntu.edu.tw/~cjlin/libsvm/ + + + BSD 3-Clause License + http://www.csie.ntu.edu.tw/~cjlin/libsvm/COPYRIGHT + + + + http://www.csie.ntu.edu.tw/~cjlin/cgi-bin/libsvm.cgi?+http://www.csie.ntu.edu.tw/~cjlin/libsvm+tar.gz + http://www.csie.ntu.edu.tw/~cjlin/cgi-bin/libsvm.cgi?+http://www.csie.ntu.edu.tw/~cjlin/libsvm+tar.gz + + + + chih-jen.lin + Chih-Jen Lin + cjlin@csie.ntu.edu.tw + + + + 1.5 + 1.5 + UTF-8 + + + java + + diff --git a/libsvm-3.18.javaDir.patch b/libsvm-3.20.javaDir.patch similarity index 100% rename from libsvm-3.18.javaDir.patch rename to libsvm-3.20.javaDir.patch diff --git a/libsvm-3.18.packageMain.patch b/libsvm-3.20.packageMain.patch similarity index 100% rename from libsvm-3.18.packageMain.patch rename to libsvm-3.20.packageMain.patch diff --git a/libsvm-3.18.pythonDir.patch b/libsvm-3.20.pythonDir.patch similarity index 100% rename from libsvm-3.18.pythonDir.patch rename to libsvm-3.20.pythonDir.patch diff --git a/libsvm-3.18.svm-toy.patch b/libsvm-3.20.svm-toy.patch similarity index 100% rename from libsvm-3.18.svm-toy.patch rename to libsvm-3.20.svm-toy.patch diff --git a/libsvm-3.18.toolsDir.patch b/libsvm-3.20.toolsDir.patch similarity index 100% rename from libsvm-3.18.toolsDir.patch rename to libsvm-3.20.toolsDir.patch diff --git a/libsvm.spec b/libsvm.spec index 602ed7d..e1996c1 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -3,10 +3,12 @@ %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %define libdir_libsvm %{_libdir}/libsvm %define libsvm_python_dir %{python_sitearch}/libsvm +%global maven_group_id tw.edu.ntu.csie +%global pom_file_version 3.17 Name: libsvm -Version: 3.18 -Release: 6%{?dist} +Version: 3.20 +Release: 1%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -18,6 +20,7 @@ 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 +Source6: http://central.maven.org/maven2/tw/edu/ntu/csie/libsvm/%{pom_file_version}/libsvm-%{pom_file_version}.pom Patch0: %{name}-%{version}.packageMain.patch Patch1: %{name}-%{version}.pythonDir.patch Patch2: %{name}-%{version}.javaDir.patch @@ -26,6 +29,7 @@ Patch4: %{name}-%{version}.toolsDir.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: grep +%global pom_file_name "JPP.%{maven_group_id}-%{name}.pom" %if 0%{?rhel} != 0 && 0%{?rhel} <= 5 %define moc_path %{_libdir}/qt4/bin/moc %define with_vendor "fedora" @@ -131,6 +135,23 @@ cp %{SOURCE4} . cp %{SOURCE5} %{name}-svm-toy-gtk-48.png cp %{SOURCE5} %{name}-svm-toy-qt-48.png + +%if "%{no_java}" == "FALSE" +# Update the POM file, which is stuck on version 3.17 +# pom_xpath_set does not work in rpm-4.11.1 +# as it generated something like +# +# +# 3.20 +# +# +# +%{__sed} -e 's/%{pom_file_version}/%{version}/' %{SOURCE6} > %{name}.pom +%{__sed} -i 's|http://www.csie.ntu.edu.tw/~cjlin/cgi-bin/libsvm.cgi?+http://www.csie.ntu.edu.tw/~cjlin/libsvm+tar.gz|https://github.com/cjlin1/libsvm|' %{name}.pom +%{__sed} -i 's|http://www.csie.ntu.edu.tw/~cjlin/cgi-bin/libsvm.cgi?+http://www.csie.ntu.edu.tw/~cjlin/libsvm+tar.gz|scm:git:https://github.com/cjlin1/libsvm.git|' %{name}.pom + +%endif + %build %{__sed} -i 's/\r//' FAQ.html %{__sed} -i 's/\r//' ChangeLog @@ -142,38 +163,54 @@ 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}" -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 - -%__ln_s %{name}.so.%{shver} $RPM_BUILD_ROOT/%{_libdir}/%{name}.so - +rm -rf %{buildroot} +make install DESTDIR=%{buildroot} LIBDIR=%{_libdir} PYTHON_VERSION="%{pyver}" LIBSVM_VER="%{version}" NO_JAVA="%{no_java}" JAVA_TARGET_DIR="%{buildroot}/%{_javadir}" +rm -rf %{buildroot}%{_datadir}/%{name}/src +mkdir -p %{buildroot}/%{_datadir}/icons/hicolor/48x48/apps/ +cp %{name}-svm-toy-gtk-48.png %{buildroot}/%{_datadir}/icons/hicolor/48x48/apps/ +cp %{name}-svm-toy-qt-48.png %{buildroot}/%{_datadir}/icons/hicolor/48x48/apps/ +mkdir -p %{buildroot}/%{_datadir}/applications +cp %{name}-svm-toy-gtk.desktop %{buildroot}/%{_datadir}/applications +cp %{name}-svm-toy-qt.desktop %{buildroot}/%{_datadir}/applications + +%__ln_s %{name}.so.%{shver} %{buildroot}/%{_libdir}/%{name}.so # [Bug 521194] Python: 'import libsvm' doesn't work +mkdir -p %{buildroot}/%{libsvm_python_dir} 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 + > %{buildroot}/%{libsvm_python_dir}/__init__.py %if 0%{?with_vendor:1} desktop-file-install --delete-original --vendor=%{with_vendor} \ - --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 + --dir=%{buildroot}%{_datadir}/applications \ + %{buildroot}/%{_datadir}/applications/%{name}-svm-toy-gtk.desktop \ + %{buildroot}/%{_datadir}/applications/%{name}-svm-toy-qt.desktop %else desktop-file-install --delete-original \ - --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 + --dir=%{buildroot}%{_datadir}/applications \ + %{buildroot}/%{_datadir}/applications/%{name}-svm-toy-gtk.desktop \ + %{buildroot}/%{_datadir}/applications/%{name}-svm-toy-qt.desktop %endif # Fix Bug 646154 - libsvm-python's pth is not set correctly -echo 'libsvm' > $RPM_BUILD_ROOT/%{python_sitearch}/libsvm.pth +echo 'libsvm' > %{buildroot}/%{python_sitearch}/libsvm.pth + + +# Java +%if "%{no_java}" == "FALSE" +## Move jars to correct directory +mkdir -p %{buildroot}/%{_javadir}/%{maven_group_id} +mv %{buildroot}/%{_javadir}/%{name}.jar %{buildroot}/%{_javadir}/%{maven_group_id}/%{name}-%{version}.jar +ln -s %{name}-%{version}.jar %{buildroot}/%{_javadir}/%{maven_group_id}/%{name}.jar +ln -s %{_javadir}/%{maven_group_id}/%{name}.jar %{buildroot}/%{_javadir}/%{name}.jar + +## Install the Java POM +mkdir -p %{buildroot}%{_mavenpomdir} +cp -p %{name}.pom %{buildroot}%{_mavenpomdir}/%{pom_file_name} +%add_maven_depmap %{pom_file_name} %{maven_group_id}/%{name}.jar +%endif + %post -p /sbin/ldconfig @@ -194,7 +231,7 @@ fi %clean -rm -rf $RPM_BUILD_ROOT +rm -rf %{buildroot} %files @@ -221,11 +258,11 @@ rm -rf $RPM_BUILD_ROOT %{python_sitearch}/libsvm.pth %if "%{no_java}" == "FALSE" -%files java +%files java -f .mfiles %defattr(-,root,root,-) %doc java/README-Java java/test_applet.html %{_javadir}/%{name}.jar -#%{_datadir}/javadoc/%{name}-%{version} +%{_javadir}/%{maven_group_id}/%{name}-%{version}.jar %endif %files svm-toy-gtk @@ -244,6 +281,12 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Jan 20 2015 Ding-Yi Chen - 3.20-1 +- Upstream update to 3.20 + +* Fri Dec 19 2014 Jerry James - 3.18-7 +- Install maven POM and depmaps (bz 1175898) + * Sun Aug 17 2014 Fedora Release Engineering - 3.18-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild diff --git a/log b/log index 056a560..4c7d592 100644 --- a/log +++ b/log @@ -212,7 +212,6 @@ i subroutines to get SVs 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 -<<<<<<< HEAD 3.12: 2012/04/01 svm-toy: support loading/saving of regression data @@ -259,4 +258,4 @@ i subroutines to get SVs initialize model->sv_indices as null in svm_load_model if nr_fold > # data, change nr_fold to be # data and ro leave-one-out cv matlab interface: - handle the problem where output variables are not specified + handle the problem where output variables are not specified \ No newline at end of file diff --git a/sources b/sources index 4a9b52a..2aa72d2 100644 --- a/sources +++ b/sources @@ -1,6 +1,2 @@ b1543809993e2653dd2787f62c3c390a guide.pdf -bba35e2cf9d14e158009ef8b90fd840a libsvm-3.18.tar.gz -95918671ee5435803a1646e1ad2f3317 log -0bc4868057a7c1c422f91a798f14a562 LibSVM-svm-toy-48.png -398721fc66bb0903d46c685e9a3cba27 libsvm-svm-toy-gtk.desktop -9a518db15afe9224e3a04695c82d7142 libsvm-svm-toy-qt.desktop +5f088e5f89da1c65b642300c9c5ea772 libsvm-3.20.tar.gz From c8e73cdf053839497a588ba99641bc36432e99d5 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 20 Jan 2015 14:21:57 +1000 Subject: [PATCH 105/136] libsvm-3.20-2 --- libsvm.spec | 4 +- log | 540 +++++++++++++++++++++++++++------------------------- sources | 3 +- 3 files changed, 283 insertions(+), 264 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index e1996c1..2c0b755 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -8,7 +8,7 @@ Name: libsvm Version: 3.20 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -281,7 +281,7 @@ rm -rf %{buildroot} %changelog -* Tue Jan 20 2015 Ding-Yi Chen - 3.20-1 +* Tue Jan 20 2015 Ding-Yi Chen - 3.20-2 - Upstream update to 3.20 * Fri Dec 19 2014 Jerry James - 3.18-7 diff --git a/log b/log index 4c7d592..85ef1bb 100644 --- a/log +++ b/log @@ -1,261 +1,279 @@ -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 - 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/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 - -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 - -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 - -3.1: 2011/04/01 - MATLAB interface: - Merge matlab interface to core libsvm - Using mexPrintf() when calling info() in MATLAB interface. - Both 32- and 64-bit windows binary files are provided - Java: - Math.random is replaced by Random in java interface - Python interface: -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() - svm_destroy_model() no longer supported. - svm-train.c and svm-predict.c - Better format check in reading data labels - svm-toy: - fix the svm_toy dialog path - tools: - Using new string formatting/encoding in tools/*.py - clearer png output, fix grid.py legend - -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 - -3.12: 2012/04/01 - svm-toy: support loading/saving of regression data - python interface: handle the issue of the "0th" feature if using lists - tools/grid.py: not redrawing contour if c,g, cv doesn't change - add setlocale when saving and loading model so not affected by users' locale - -3.13: 2012/11/06 - svm.c and svm.h: - add sv_indices in model structure, so users can know which training instances are SVs - two library funs svm_get_sv_indices and svm_get_nr_sv are added - max_iter warning moved to stderr so -q won't disable it - svm-train.c: - usage modified to stress that multiclass is supported - svm-predict.c: - add -q for svm-predict - svm-scale.c: - issue a warning if feature indices do not start from 1 - issue a warning for inconsistency between scaling-factor file and input file - tools: - subset.py is written to be much faster - -3.14: 2012/11/16 - fix a bug: we didn't re-compile windows binary after updating svm.def - -3.15: 2013/1/27 - fix the bug of not freeing sv_indices - tools/grid.py: - -null option: allow the search on C or g only - -resume option: resume tasks from an earlier run - can be called as a python module - python interface: - local package searched first - libsvm options can be str or list - param.show() becomes print(param) - -3.16: 2013/1/27 - tools/: - easy.py fails in 3.15. Fix it by modifying grid.py - -3.17: 2013/04/01 - svm.cpp: - if class labels are 1 and -1, ensure labels[0] = 1 and labels[1] = -1 - initialize model->sv_indices as null in svm_load_model - if nr_fold > # data, change nr_fold to be # data and ro leave-one-out cv - matlab interface: - handle the problem where output variables are not specified \ No newline at end of file +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 + 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/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 + +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 + +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 + +3.1: 2011/04/01 + MATLAB interface: + Merge matlab interface to core libsvm + Using mexPrintf() when calling info() in MATLAB interface. + Both 32- and 64-bit windows binary files are provided + Java: + Math.random is replaced by Random in java interface + Python interface: +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() + svm_destroy_model() no longer supported. + svm-train.c and svm-predict.c + Better format check in reading data labels + svm-toy: + fix the svm_toy dialog path + tools: + Using new string formatting/encoding in tools/*.py + clearer png output, fix grid.py legend + +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 + +3.12: 2012/04/01 + svm-toy: support loading/saving of regression data + python interface: handle the issue of the "0th" feature if using lists + tools/grid.py: not redrawing contour if c,g, cv doesn't change + add setlocale when saving and loading model so not affected by users' locale + +3.13: 2012/11/06 + svm.c and svm.h: + add sv_indices in model structure, so users can know which training instances are SVs + two library funs svm_get_sv_indices and svm_get_nr_sv are added + max_iter warning moved to stderr so -q won't disable it + svm-train.c: + usage modified to stress that multiclass is supported + svm-predict.c: + add -q for svm-predict + svm-scale.c: + issue a warning if feature indices do not start from 1 + issue a warning for inconsistency between scaling-factor file and input file + tools: + subset.py is written to be much faster + +3.14: 2012/11/16 + fix a bug: we didn't re-compile windows binary after updating svm.def + +3.15: 2013/1/27 + fix the bug of not freeing sv_indices + tools/grid.py: + -null option: allow the search on C or g only + -resume option: resume tasks from an earlier run + can be called as a python module + python interface: + local package searched first + libsvm options can be str or list + param.show() becomes print(param) + +3.16: 2013/1/27 + tools/: + easy.py fails in 3.15. Fix it by modifying grid.py + +3.17: 2013/04/01 + svm.cpp: + if class labels are 1 and -1, ensure labels[0] = 1 and labels[1] = -1 + initialize model->sv_indices as null in svm_load_model + if nr_fold > # data, change nr_fold to be # data and ro leave-one-out cv + matlab interface: + handle the problem where output variables are not specified + +3.18: 2014/04/01 + svm.cpp and svm-scale.c: + check return values of fscanf + matlab interface: + Makefile no longer handles octave because make.m should be used + +3.19: 2014/10/27 + svm.cpp: + use size_t rather than long int in some places for 64-bit windows support + matlab interface: + use size_t and mwIndex to avoid type conversions + python interface: + use __all__ + +3.20: 2014/11/15 + matlab interface: + fix a bug in libsvmwrite.c introduced in 3.19 (cannot run on windows) diff --git a/sources b/sources index 2aa72d2..1bb493a 100644 --- a/sources +++ b/sources @@ -1,2 +1,3 @@ -b1543809993e2653dd2787f62c3c390a guide.pdf 5f088e5f89da1c65b642300c9c5ea772 libsvm-3.20.tar.gz +b1543809993e2653dd2787f62c3c390a guide.pdf +9444b10a60253fcc1b4feec621eb883d log From 4dbffe0720289b370a3dd45f3a640cb519533ee0 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 20 Jan 2015 14:37:39 +1000 Subject: [PATCH 106/136] - Upstream update to 3.20 --- sources | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sources b/sources index 1bb493a..2aa72d2 100644 --- a/sources +++ b/sources @@ -1,3 +1,2 @@ -5f088e5f89da1c65b642300c9c5ea772 libsvm-3.20.tar.gz b1543809993e2653dd2787f62c3c390a guide.pdf -9444b10a60253fcc1b4feec621eb883d log +5f088e5f89da1c65b642300c9c5ea772 libsvm-3.20.tar.gz From c4a36f638bb59d40d4d217674b87d4bcc97b1843 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 20 Jan 2015 16:44:07 +1000 Subject: [PATCH 107/136] Fix for RHEL6 --- libsvm.spec | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index 01fc8f7..54c67fd 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -5,6 +5,7 @@ %define libsvm_python_dir %{python_sitearch}/libsvm %global maven_group_id tw.edu.ntu.csie %global pom_file_version 3.17 +%global pom_file_name "JPP.%{maven_group_id}-%{name}.pom" Name: libsvm Version: 3.20 @@ -29,7 +30,6 @@ Patch4: %{name}-%{version}.toolsDir.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: grep -%global pom_file_name "JPP.%{maven_group_id}-%{name}.pom" %if 0%{?rhel} != 0 && 0%{?rhel} <= 5 %define moc_path %{_libdir}/qt4/bin/moc %define with_vendor "fedora" @@ -37,6 +37,14 @@ BuildRequires: grep %define moc_path %{_bindir}/moc-qt4 %endif +# RHEL6 does not have add_maven_depmap +%if 0%{?rhel} != 0 && 0%{?rhel} <=6 +%define no_add_maven_depmap TRUE +%else +%define no_add_maven_depmap FALSE +%endif + + %ifnarch ppc ppc64 %define no_java FALSE %if 0%{?rhel} <= 6 @@ -46,6 +54,7 @@ BuildRequires: grep %endif %else %define no_java NO_JAVA +%define no_add_maven_depmap no_add_maven_depmap Obsoletes: libsvm-java < 2.88-1 %endif @@ -135,7 +144,6 @@ cp %{SOURCE4} . cp %{SOURCE5} %{name}-svm-toy-gtk-48.png cp %{SOURCE5} %{name}-svm-toy-qt-48.png - %if "%{no_java}" == "FALSE" # Update the POM file, which is stuck on version 3.17 # pom_xpath_set does not work in rpm-4.11.1 @@ -149,7 +157,6 @@ cp %{SOURCE5} %{name}-svm-toy-qt-48.png %{__sed} -e 's/%{pom_file_version}/%{version}/' %{SOURCE6} > %{name}.pom %{__sed} -i 's|http://www.csie.ntu.edu.tw/~cjlin/cgi-bin/libsvm.cgi?+http://www.csie.ntu.edu.tw/~cjlin/libsvm+tar.gz|https://github.com/cjlin1/libsvm|' %{name}.pom %{__sed} -i 's|http://www.csie.ntu.edu.tw/~cjlin/cgi-bin/libsvm.cgi?+http://www.csie.ntu.edu.tw/~cjlin/libsvm+tar.gz|scm:git:https://github.com/cjlin1/libsvm.git|' %{name}.pom - %endif %build @@ -204,10 +211,13 @@ mkdir -p %{buildroot}/%{_javadir}/%{maven_group_id} mv %{buildroot}/%{_javadir}/%{name}.jar %{buildroot}/%{_javadir}/%{maven_group_id}/%{name}-%{version}.jar ln -s %{name}-%{version}.jar %{buildroot}/%{_javadir}/%{maven_group_id}/%{name}.jar ln -s %{_javadir}/%{maven_group_id}/%{name}.jar %{buildroot}/%{_javadir}/%{name}.jar - ## Install the Java POM mkdir -p %{buildroot}%{_mavenpomdir} cp -p %{name}.pom %{buildroot}%{_mavenpomdir}/%{pom_file_name} +%endif + +# RHEL6 does not support add_maven_depmap +%if "%{no_add_maven_depmap}" == "FALSE" %add_maven_depmap %{pom_file_name} %{maven_group_id}/%{name}.jar %endif @@ -281,6 +291,9 @@ rm -rf %{buildroot} %changelog +* Tue Jan 20 2015 Ding-Yi Chen - 3.20-3 +- Fix for RHEL6 + * Tue Jan 20 2015 Ding-Yi Chen - 3.20-2 - Upstream update to 3.20 From 836f0d3042ea44a88eb9a766b1923a92b60bafd9 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 20 Jan 2015 17:06:56 +1000 Subject: [PATCH 108/136] Fix RHEL6 build --- libsvm.spec | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index 54c67fd..0407039 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -37,11 +37,11 @@ BuildRequires: grep %define moc_path %{_bindir}/moc-qt4 %endif -# RHEL6 does not have add_maven_depmap -%if 0%{?rhel} != 0 && 0%{?rhel} <=6 -%define no_add_maven_depmap TRUE +# RHEL6 does not have enable_add_maven_depmap +%if 0%{?rhel} != 0 && 0%{?rhel} <= 6 +%define enable_add_maven_depmap FALSE %else -%define no_add_maven_depmap FALSE +%define enable_add_maven_depmap TRUE %endif @@ -54,7 +54,7 @@ BuildRequires: grep %endif %else %define no_java NO_JAVA -%define no_add_maven_depmap no_add_maven_depmap +%define enable_add_maven_depmap FALSE Obsoletes: libsvm-java < 2.88-1 %endif @@ -214,13 +214,15 @@ ln -s %{_javadir}/%{maven_group_id}/%{name}.jar %{buildroot}/%{_javadir}/%{name} ## Install the Java POM mkdir -p %{buildroot}%{_mavenpomdir} cp -p %{name}.pom %{buildroot}%{_mavenpomdir}/%{pom_file_name} -%endif -# RHEL6 does not support add_maven_depmap -%if "%{no_add_maven_depmap}" == "FALSE" +# RHEL6 does not support enable_add_maven_depmap +%if "%{enable_add_maven_depmap}" == "TRUE" %add_maven_depmap %{pom_file_name} %{maven_group_id}/%{name}.jar %endif +%endif + + %post -p /sbin/ldconfig From 868b52ce4e7d7b0487780f1a1857a0510424ccdf Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 20 Jan 2015 17:17:08 +1000 Subject: [PATCH 109/136] Fix RHEL6 build --- libsvm.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index 0407039..3fa6dd6 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -5,7 +5,7 @@ %define libsvm_python_dir %{python_sitearch}/libsvm %global maven_group_id tw.edu.ntu.csie %global pom_file_version 3.17 -%global pom_file_name "JPP.%{maven_group_id}-%{name}.pom" +%global pom_file_name JPP.%{maven_group_id}-%{name}.pom Name: libsvm Version: 3.20 @@ -270,11 +270,19 @@ rm -rf %{buildroot} %{python_sitearch}/libsvm.pth %if "%{no_java}" == "FALSE" +%if "%{enable_add_maven_depmap}" == "TRUE" %files java -f .mfiles +%else +%files java +%endif %defattr(-,root,root,-) %doc java/README-Java java/test_applet.html %{_javadir}/%{name}.jar %{_javadir}/%{maven_group_id}/%{name}-%{version}.jar +%if "%{enable_add_maven_depmap}" == "FALSE" +%{_javadir}/%{maven_group_id}/%{name}.jar +%{_mavenpomdir}/%{pom_file_name} +%endif %endif %files svm-toy-gtk From c9e788dc7be933bd28f6b3173eab512c8ddbbc2e Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 20 Jan 2015 17:20:55 +1000 Subject: [PATCH 110/136] Correct release number --- libsvm.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index 3fa6dd6..1e21f15 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -9,7 +9,7 @@ Name: libsvm Version: 3.20 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries From b04bddcbf768e7a0c4479cfacbcfc0d4d08dea83 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 20 Jan 2015 17:22:27 +1000 Subject: [PATCH 111/136] - Fix for RHEL6 --- libsvm.spec | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index 54c67fd..1e21f15 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -5,11 +5,11 @@ %define libsvm_python_dir %{python_sitearch}/libsvm %global maven_group_id tw.edu.ntu.csie %global pom_file_version 3.17 -%global pom_file_name "JPP.%{maven_group_id}-%{name}.pom" +%global pom_file_name JPP.%{maven_group_id}-%{name}.pom Name: libsvm Version: 3.20 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -37,11 +37,11 @@ BuildRequires: grep %define moc_path %{_bindir}/moc-qt4 %endif -# RHEL6 does not have add_maven_depmap -%if 0%{?rhel} != 0 && 0%{?rhel} <=6 -%define no_add_maven_depmap TRUE +# RHEL6 does not have enable_add_maven_depmap +%if 0%{?rhel} != 0 && 0%{?rhel} <= 6 +%define enable_add_maven_depmap FALSE %else -%define no_add_maven_depmap FALSE +%define enable_add_maven_depmap TRUE %endif @@ -54,7 +54,7 @@ BuildRequires: grep %endif %else %define no_java NO_JAVA -%define no_add_maven_depmap no_add_maven_depmap +%define enable_add_maven_depmap FALSE Obsoletes: libsvm-java < 2.88-1 %endif @@ -214,13 +214,15 @@ ln -s %{_javadir}/%{maven_group_id}/%{name}.jar %{buildroot}/%{_javadir}/%{name} ## Install the Java POM mkdir -p %{buildroot}%{_mavenpomdir} cp -p %{name}.pom %{buildroot}%{_mavenpomdir}/%{pom_file_name} -%endif -# RHEL6 does not support add_maven_depmap -%if "%{no_add_maven_depmap}" == "FALSE" +# RHEL6 does not support enable_add_maven_depmap +%if "%{enable_add_maven_depmap}" == "TRUE" %add_maven_depmap %{pom_file_name} %{maven_group_id}/%{name}.jar %endif +%endif + + %post -p /sbin/ldconfig @@ -268,11 +270,19 @@ rm -rf %{buildroot} %{python_sitearch}/libsvm.pth %if "%{no_java}" == "FALSE" +%if "%{enable_add_maven_depmap}" == "TRUE" %files java -f .mfiles +%else +%files java +%endif %defattr(-,root,root,-) %doc java/README-Java java/test_applet.html %{_javadir}/%{name}.jar %{_javadir}/%{maven_group_id}/%{name}-%{version}.jar +%if "%{enable_add_maven_depmap}" == "FALSE" +%{_javadir}/%{maven_group_id}/%{name}.jar +%{_mavenpomdir}/%{pom_file_name} +%endif %endif %files svm-toy-gtk From 69d0f194dadb0eeb993ad991424974159d11f7db Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Sat, 2 May 2015 15:33:28 +0200 Subject: [PATCH 112/136] Rebuilt for GCC 5 C++11 ABI change --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index 1e21f15..f193893 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -9,7 +9,7 @@ Name: libsvm Version: 3.20 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -301,6 +301,9 @@ rm -rf %{buildroot} %changelog +* Sat May 02 2015 Kalev Lember - 3.20-4 +- Rebuilt for GCC 5 C++11 ABI change + * Tue Jan 20 2015 Ding-Yi Chen - 3.20-3 - Fix for RHEL6 From 48ac61ab657179102f965b955311350f559af81e Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 17 Jun 2015 17:23:09 +0000 Subject: [PATCH 113/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index f193893..edbc1f5 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -9,7 +9,7 @@ Name: libsvm Version: 3.20 -Release: 4%{?dist} +Release: 5%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -301,6 +301,9 @@ rm -rf %{buildroot} %changelog +* Wed Jun 17 2015 Fedora Release Engineering - 3.20-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + * Sat May 02 2015 Kalev Lember - 3.20-4 - Rebuilt for GCC 5 C++11 ABI change From 268e525d962d60e88e3842b157a0cd80dbfa27e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Fri, 25 Dec 2015 09:02:17 +0100 Subject: [PATCH 114/136] Replaced %%define with %%global dropped %%defattr clean trailing whitespaces --- libsvm.spec | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index edbc1f5..2836820 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,15 +1,15 @@ -%define shver 2 -%{!?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 libdir_libsvm %{_libdir}/libsvm -%define libsvm_python_dir %{python_sitearch}/libsvm +%global shver 2 +%{!?pyver: %global pyver %(python -c 'import sys; print(sys.version[0:3])')} +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +%global libdir_libsvm %{_libdir}/libsvm +%global libsvm_python_dir %{python_sitearch}/libsvm %global maven_group_id tw.edu.ntu.csie %global pom_file_version 3.17 %global pom_file_name JPP.%{maven_group_id}-%{name}.pom Name: libsvm Version: 3.20 -Release: 5%{?dist} +Release: 6%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -31,30 +31,30 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: grep %if 0%{?rhel} != 0 && 0%{?rhel} <= 5 -%define moc_path %{_libdir}/qt4/bin/moc -%define with_vendor "fedora" +%global moc_path %{_libdir}/qt4/bin/moc +%global with_vendor "fedora" %else -%define moc_path %{_bindir}/moc-qt4 +%global moc_path %{_bindir}/moc-qt4 %endif # RHEL6 does not have enable_add_maven_depmap %if 0%{?rhel} != 0 && 0%{?rhel} <= 6 -%define enable_add_maven_depmap FALSE +%global enable_add_maven_depmap FALSE %else -%define enable_add_maven_depmap TRUE +%global enable_add_maven_depmap TRUE %endif %ifnarch ppc ppc64 -%define no_java FALSE +%global no_java FALSE %if 0%{?rhel} <= 6 -%define java_dependency java -%else -%define java_dependency java-headless +%global java_dependency java +%else +%global java_dependency java-headless %endif %else -%define no_java NO_JAVA -%define enable_add_maven_depmap FALSE +%global no_java NO_JAVA +%global enable_add_maven_depmap FALSE Obsoletes: libsvm-java < 2.88-1 %endif @@ -247,7 +247,6 @@ rm -rf %{buildroot} %files -%defattr(-,root,root,-) %doc COPYRIGHT FAQ.html ChangeLog guide.pdf %{_bindir}/svm-predict %{_bindir}/svm-scale @@ -257,13 +256,11 @@ rm -rf %{buildroot} %{_libdir}/%{name}.so.%{shver} %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} %{_bindir}/svm-*.py @@ -275,7 +272,6 @@ rm -rf %{buildroot} %else %files java %endif -%defattr(-,root,root,-) %doc java/README-Java java/test_applet.html %{_javadir}/%{name}.jar %{_javadir}/%{maven_group_id}/%{name}-%{version}.jar @@ -286,14 +282,12 @@ rm -rf %{buildroot} %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/*%{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 @@ -301,6 +295,11 @@ rm -rf %{buildroot} %changelog +* Fri Dec 25 2015 Björn Esser - 3.20-6 +- Replaced %%define with %%global +- dropped %%defattr +- clean trailing whitespaces + * Wed Jun 17 2015 Fedora Release Engineering - 3.20-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild @@ -334,7 +333,7 @@ rm -rf %{buildroot} * Tue Apr 22 2014 Ding-Yi Chen - 3.18-1 - Upstream update to 3.18 - svm.cpp and svm-scale.c: check return values of fscanf -- matlab interface: Makefile no longer handles octave +- matlab interface: Makefile no longer handles octave because make.m should be used * Fri Mar 28 2014 Michael Simacek - 3.17-4 From 8a8a719c1d084bb4a68f78bd5eeb94d94dda49e1 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 4 Feb 2016 03:59:11 +0000 Subject: [PATCH 115/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index 2836820..be3bfc7 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -9,7 +9,7 @@ Name: libsvm Version: 3.20 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -295,6 +295,9 @@ rm -rf %{buildroot} %changelog +* Thu Feb 04 2016 Fedora Release Engineering - 3.20-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + * Fri Dec 25 2015 Björn Esser - 3.20-6 - Replaced %%define with %%global - dropped %%defattr From d5af832bbdfcc8794f86751b9fa41748a74ac3c9 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 19 Jul 2016 07:47:16 +0000 Subject: [PATCH 116/136] - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index be3bfc7..bf33982 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -9,7 +9,7 @@ Name: libsvm Version: 3.20 -Release: 7%{?dist} +Release: 8%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -295,6 +295,9 @@ rm -rf %{buildroot} %changelog +* Tue Jul 19 2016 Fedora Release Engineering - 3.20-8 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + * Thu Feb 04 2016 Fedora Release Engineering - 3.20-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild From f7acaea272ab319a388c812ffd49519502448d55 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 20 Jul 2016 15:27:36 +1000 Subject: [PATCH 117/136] - Upstream update to 3.21 - Fixes Bug 1277450 - libsvm(-java) remove versioned jars from {_javadir} --- .gitignore | 1 + libsvm-3.17.pom | 2 +- ...3.20.javaDir.patch => libsvm.javaDir.patch | 0 ...kageMain.patch => libsvm.packageMain.patch | 0 ....pythonDir.patch => libsvm.pythonDir.patch | 0 libsvm.spec | 75 +++++++++---------- ...3.20.svm-toy.patch => libsvm.svm-toy.patch | 27 +++---- ...20.toolsDir.patch => libsvm.toolsDir.patch | 0 log | 6 ++ sources | 4 +- 10 files changed, 61 insertions(+), 54 deletions(-) rename libsvm-3.20.javaDir.patch => libsvm.javaDir.patch (100%) rename libsvm-3.20.packageMain.patch => libsvm.packageMain.patch (100%) rename libsvm-3.20.pythonDir.patch => libsvm.pythonDir.patch (100%) rename libsvm-3.20.svm-toy.patch => libsvm.svm-toy.patch (75%) rename libsvm-3.20.toolsDir.patch => libsvm.toolsDir.patch (100%) diff --git a/.gitignore b/.gitignore index f223af3..c5ed10e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ libsvm-3.91.tar.gz /libsvm-svm-toy-gtk.desktop /libsvm-svm-toy-qt.desktop /libsvm-3.20.tar.gz +/libsvm-3.21.tar.gz diff --git a/libsvm-3.17.pom b/libsvm-3.17.pom index 511b1b2..7b7977b 100644 --- a/libsvm-3.17.pom +++ b/libsvm-3.17.pom @@ -3,7 +3,7 @@ 4.0.0 tw.edu.ntu.csie libsvm - 3.20 + 3.17 jar LIBSVM A Library for Support Vector Machines diff --git a/libsvm-3.20.javaDir.patch b/libsvm.javaDir.patch similarity index 100% rename from libsvm-3.20.javaDir.patch rename to libsvm.javaDir.patch diff --git a/libsvm-3.20.packageMain.patch b/libsvm.packageMain.patch similarity index 100% rename from libsvm-3.20.packageMain.patch rename to libsvm.packageMain.patch diff --git a/libsvm-3.20.pythonDir.patch b/libsvm.pythonDir.patch similarity index 100% rename from libsvm-3.20.pythonDir.patch rename to libsvm.pythonDir.patch diff --git a/libsvm.spec b/libsvm.spec index bf33982..28a7613 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,15 +1,15 @@ -%global shver 2 +%define shver 2 %{!?pyver: %global pyver %(python -c 'import sys; print(sys.version[0:3])')} -%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} -%global libdir_libsvm %{_libdir}/libsvm -%global libsvm_python_dir %{python_sitearch}/libsvm +%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +%define libdir_libsvm %{_libdir}/libsvm +%define libsvm_python_dir %{python_sitearch}/libsvm %global maven_group_id tw.edu.ntu.csie %global pom_file_version 3.17 %global pom_file_name JPP.%{maven_group_id}-%{name}.pom Name: libsvm -Version: 3.20 -Release: 8%{?dist} +Version: 3.21 +Release: 1%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -22,39 +22,39 @@ Source3: libsvm-svm-toy-gtk.desktop Source4: libsvm-svm-toy-qt.desktop Source5: LibSVM-svm-toy-48.png Source6: http://central.maven.org/maven2/tw/edu/ntu/csie/libsvm/%{pom_file_version}/libsvm-%{pom_file_version}.pom -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 +Patch0: %{name}.packageMain.patch +Patch1: %{name}.pythonDir.patch +Patch2: %{name}.javaDir.patch +Patch3: %{name}.svm-toy.patch +Patch4: %{name}.toolsDir.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: grep %if 0%{?rhel} != 0 && 0%{?rhel} <= 5 -%global moc_path %{_libdir}/qt4/bin/moc -%global with_vendor "fedora" +%define moc_path %{_libdir}/qt4/bin/moc +%define with_vendor "fedora" %else -%global moc_path %{_bindir}/moc-qt4 +%define moc_path %{_bindir}/moc-qt4 %endif # RHEL6 does not have enable_add_maven_depmap %if 0%{?rhel} != 0 && 0%{?rhel} <= 6 -%global enable_add_maven_depmap FALSE +%define enable_add_maven_depmap FALSE %else -%global enable_add_maven_depmap TRUE +%define enable_add_maven_depmap TRUE %endif %ifnarch ppc ppc64 -%global no_java FALSE +%define no_java FALSE %if 0%{?rhel} <= 6 -%global java_dependency java -%else -%global java_dependency java-headless +%define java_dependency java +%else +%define java_dependency java-headless %endif %else -%global no_java NO_JAVA -%global enable_add_maven_depmap FALSE +%define no_java NO_JAVA +%define enable_add_maven_depmap FALSE Obsoletes: libsvm-java < 2.88-1 %endif @@ -200,16 +200,18 @@ desktop-file-install --delete-original \ %{buildroot}/%{_datadir}/applications/%{name}-svm-toy-qt.desktop %endif +# Python # Fix Bug 646154 - libsvm-python's pth is not set correctly echo 'libsvm' > %{buildroot}/%{python_sitearch}/libsvm.pth - +for p in %{buildroot}%{libsvm_python_dir}/*.py;do + sed -i -e 's|#!/usr/bin/env python|#!%{__python2}|' $p +done # Java %if "%{no_java}" == "FALSE" ## Move jars to correct directory mkdir -p %{buildroot}/%{_javadir}/%{maven_group_id} -mv %{buildroot}/%{_javadir}/%{name}.jar %{buildroot}/%{_javadir}/%{maven_group_id}/%{name}-%{version}.jar -ln -s %{name}-%{version}.jar %{buildroot}/%{_javadir}/%{maven_group_id}/%{name}.jar +mv %{buildroot}/%{_javadir}/%{name}.jar %{buildroot}/%{_javadir}/%{maven_group_id}/%{name}.jar ln -s %{_javadir}/%{maven_group_id}/%{name}.jar %{buildroot}/%{_javadir}/%{name}.jar ## Install the Java POM mkdir -p %{buildroot}%{_mavenpomdir} @@ -247,6 +249,7 @@ rm -rf %{buildroot} %files +%defattr(-,root,root,-) %doc COPYRIGHT FAQ.html ChangeLog guide.pdf %{_bindir}/svm-predict %{_bindir}/svm-scale @@ -256,11 +259,13 @@ rm -rf %{buildroot} %{_libdir}/%{name}.so.%{shver} %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} %{_bindir}/svm-*.py @@ -272,9 +277,9 @@ rm -rf %{buildroot} %else %files java %endif +%defattr(-,root,root,-) %doc java/README-Java java/test_applet.html %{_javadir}/%{name}.jar -%{_javadir}/%{maven_group_id}/%{name}-%{version}.jar %if "%{enable_add_maven_depmap}" == "FALSE" %{_javadir}/%{maven_group_id}/%{name}.jar %{_mavenpomdir}/%{pom_file_name} @@ -282,29 +287,23 @@ rm -rf %{buildroot} %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/*%{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/*%{name}-svm-toy-qt.desktop - %changelog -* Tue Jul 19 2016 Fedora Release Engineering - 3.20-8 -- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages - -* Thu Feb 04 2016 Fedora Release Engineering - 3.20-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Fri Dec 25 2015 Björn Esser - 3.20-6 -- Replaced %%define with %%global -- dropped %%defattr -- clean trailing whitespaces +* Wed Jul 20 2016 Ding-Yi Chen - 3.21-1 +- Upstream update to 3.21 +- Fixes Bug 1277450 - libsvm(-java) remove versioned jars from {_javadir} * Wed Jun 17 2015 Fedora Release Engineering - 3.20-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild @@ -339,7 +338,7 @@ rm -rf %{buildroot} * Tue Apr 22 2014 Ding-Yi Chen - 3.18-1 - Upstream update to 3.18 - svm.cpp and svm-scale.c: check return values of fscanf -- matlab interface: Makefile no longer handles octave +- matlab interface: Makefile no longer handles octave because make.m should be used * Fri Mar 28 2014 Michael Simacek - 3.17-4 diff --git a/libsvm-3.20.svm-toy.patch b/libsvm.svm-toy.patch similarity index 75% rename from libsvm-3.20.svm-toy.patch rename to libsvm.svm-toy.patch index d2a9274..4fc0982 100644 --- a/libsvm-3.20.svm-toy.patch +++ b/libsvm.svm-toy.patch @@ -1,6 +1,6 @@ diff -up ./svm-toy/gtk/Makefile.svm-toy ./svm-toy/gtk/Makefile ---- ./svm-toy/gtk/Makefile.svm-toy 2011-05-11 12:15:45.000000000 +1000 -+++ ./svm-toy/gtk/Makefile 2012-04-04 17:02:28.366615284 +1000 +--- ./svm-toy/gtk/Makefile.svm-toy 2015-12-14 23:49:17.000000000 +1000 ++++ ./svm-toy/gtk/Makefile 2016-07-20 11:56:30.157119649 +1000 @@ -1,10 +1,12 @@ CC? = gcc CXX? = g++ @@ -31,24 +31,27 @@ diff -up ./svm-toy/gtk/Makefile.svm-toy ./svm-toy/gtk/Makefile - 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 ${LOCAL_LIBDIR}/svm.o diff -up ./svm-toy/qt/Makefile.svm-toy ./svm-toy/qt/Makefile ---- ./svm-toy/qt/Makefile.svm-toy 2011-05-11 12:15:45.000000000 +1000 -+++ ./svm-toy/qt/Makefile 2012-04-04 17:02:28.366615284 +1000 -@@ -1,17 +1,22 @@ +--- ./svm-toy/qt/Makefile.svm-toy 2016-07-20 11:56:30.157119649 +1000 ++++ ./svm-toy/qt/Makefile 2016-07-20 13:40:21.876341574 +1000 +@@ -1,17 +1,25 @@ CXX? = g++ --CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtGui -lQtGui --INCLUDE = /usr/include/qt4 --MOC = /usr/bin/moc-qt4 ++-CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtGui -lQtGui ++-MOC = /usr/bin/moc-qt4 + INCLUDE = /usr/include/qt4 +-CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtGui -I$(INCLUDE)/QtCore +SHVER?=2 +CFLAGS = -Wall -O3 `pkg-config --cflags --libs QtGui` + LIB = -lQtGui -lQtCore +-MOC = /usr/bin/moc-qt4 +MOC=${MOC_PATH} +LOCAL_LIBDIR=../.. +LIBS = -L${LOCAL_LIBDIR} -lsvm +LIBSVM_SO_SHVER=${LOCAL_LIBDIR}/libsvm.so.$(SHVER) -svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o -- $(CXX) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy +- $(CXX) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy $(LIB) +all: svm-toy-qt -+ ++ +svm-toy-qt: svm-toy.cpp svm-toy.moc $(LIBSVM_SO_SHVER) + $(CXX) $(CFLAGS) svm-toy.cpp ${LIBS} -o $@ @@ -61,6 +64,4 @@ diff -up ./svm-toy/qt/Makefile.svm-toy ./svm-toy/qt/Makefile + make -C ${LOCAL_LIBDIR} lib clean: -- rm -f *~ svm-toy svm-toy.moc ../../svm.o -+ rm -f *~ svm-toy svm-toy.moc $(LIBSVM_SO_SHVER) - + rm -f *~ svm-toy svm-toy.moc ../../svm.o diff --git a/libsvm-3.20.toolsDir.patch b/libsvm.toolsDir.patch similarity index 100% rename from libsvm-3.20.toolsDir.patch rename to libsvm.toolsDir.patch diff --git a/log b/log index 85ef1bb..c6074b0 100644 --- a/log +++ b/log @@ -277,3 +277,9 @@ i subroutines to get SVs 3.20: 2014/11/15 matlab interface: fix a bug in libsvmwrite.c introduced in 3.19 (cannot run on windows) + +3.21: 2015/12/14 + pre-built windows exe files changed from 32 to 64 bit + matlab interface: + now use #include "../svm.h" + fix some minor issues in make.m of matlab interface \ No newline at end of file diff --git a/sources b/sources index 2aa72d2..46bd5da 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -b1543809993e2653dd2787f62c3c390a guide.pdf -5f088e5f89da1c65b642300c9c5ea772 libsvm-3.20.tar.gz +e7392f325efd1c6ddacd8e2c8bb023d1 guide.pdf +30d2a0a8043e0f66cb7903b3ce45b3bf libsvm-3.21.tar.gz From 39cb09de9d024f44548926adcea5f8474d3b44d0 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Mon, 7 Nov 2016 15:52:19 +0100 Subject: [PATCH 118/136] bz#1392340, enable java part on ppc64 --- libsvm.spec | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index 28a7613..756483a 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -9,7 +9,7 @@ Name: libsvm Version: 3.21 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -38,24 +38,17 @@ BuildRequires: grep %endif # RHEL6 does not have enable_add_maven_depmap +%define no_java FALSE %if 0%{?rhel} != 0 && 0%{?rhel} <= 6 +%define java_dependency java %define enable_add_maven_depmap FALSE -%else -%define enable_add_maven_depmap TRUE +%ifarch ppc ppc64 +%define no_java NO_JAVA +Obsoletes: libsvm-java < 2.88-1 %endif - - -%ifnarch ppc ppc64 -%define no_java FALSE -%if 0%{?rhel} <= 6 -%define java_dependency java %else %define java_dependency java-headless -%endif -%else -%define no_java NO_JAVA -%define enable_add_maven_depmap FALSE -Obsoletes: libsvm-java < 2.88-1 +%define enable_add_maven_depmap TRUE %endif %description @@ -301,6 +294,9 @@ rm -rf %{buildroot} %{_datadir}/applications/*%{name}-svm-toy-qt.desktop %changelog +* Mon Nov 07 2016 Than Ngo - 3.21-2 +- bz#1392340, enable java part on ppc64 + * Wed Jul 20 2016 Ding-Yi Chen - 3.21-1 - Upstream update to 3.21 - Fixes Bug 1277450 - libsvm(-java) remove versioned jars from {_javadir} From 8a12966b281629d52e82aa36743acd8d7338a07e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 10 Feb 2017 19:31:28 +0000 Subject: [PATCH 119/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index 756483a..a17c43a 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -9,7 +9,7 @@ Name: libsvm Version: 3.21 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -294,6 +294,9 @@ rm -rf %{buildroot} %{_datadir}/applications/*%{name}-svm-toy-qt.desktop %changelog +* Fri Feb 10 2017 Fedora Release Engineering - 3.21-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Mon Nov 07 2016 Than Ngo - 3.21-2 - bz#1392340, enable java part on ppc64 From 4ad7e86e2c6adaa91b912096527f59f346a70b1c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 26 Jul 2017 19:47:31 +0000 Subject: [PATCH 120/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index a17c43a..12fb238 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -9,7 +9,7 @@ Name: libsvm Version: 3.21 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -294,6 +294,9 @@ rm -rf %{buildroot} %{_datadir}/applications/*%{name}-svm-toy-qt.desktop %changelog +* Wed Jul 26 2017 Fedora Release Engineering - 3.21-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Fri Feb 10 2017 Fedora Release Engineering - 3.21-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild From b3baabd17920da4bbaea34e0e3f640f4192c7fe0 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 3 Aug 2017 02:20:55 +0000 Subject: [PATCH 121/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index 12fb238..1974f31 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -9,7 +9,7 @@ Name: libsvm Version: 3.21 -Release: 4%{?dist} +Release: 5%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -294,6 +294,9 @@ rm -rf %{buildroot} %{_datadir}/applications/*%{name}-svm-toy-qt.desktop %changelog +* Thu Aug 03 2017 Fedora Release Engineering - 3.21-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + * Wed Jul 26 2017 Fedora Release Engineering - 3.21-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From 4add8ae170c82cac48a5bcc2e59f6e0d40038992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 19 Aug 2017 09:38:52 -0400 Subject: [PATCH 122/136] Python 2 binary package renamed to python2-libsvm --- libsvm.spec | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index 1974f31..487ec8b 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -9,7 +9,7 @@ Name: libsvm Version: 3.21 -Release: 5%{?dist} +Release: 6%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -67,7 +67,11 @@ Header file, object file of libsvm in C, C++ and Java. Install this package if you want to develop programs with libsvm. -%package python +%package -n python2-libsvm +%{?python_provide:%python_provide python2-libsvm} +# Remove before F30 +Provides: %{name}-python%{?_isa} = %{version}-%{release} +Obsoletes: %{name}-python < %{version}-%{release} Summary: Python tools and interfaces for libsvm Group: Development/Libraries BuildRequires: python-devel >= 2.4 gawk @@ -75,7 +79,7 @@ BuildRequires: python-devel >= 2.4 gawk Requires: %{name} = %{version}-%{release} Requires: gnuplot -%description python +%description -n python2-libsvm Python tools and interfaces for libsvm. Install this package if you want to develop programs with libsvm in Python. @@ -257,7 +261,7 @@ rm -rf %{buildroot} %{_includedir}/%{name}/ %{_libdir}/%{name}.so -%files python +%files -n python2-libsvm %defattr(-,root,root,-) %doc python/README-Python tools/README-Tools %{libsvm_python_dir} @@ -294,6 +298,10 @@ rm -rf %{buildroot} %{_datadir}/applications/*%{name}-svm-toy-qt.desktop %changelog +* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 3.21-6 +- Python 2 binary package renamed to python2-libsvm + See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 + * Thu Aug 03 2017 Fedora Release Engineering - 3.21-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild From 0bb2e735e7c8bdc2670e653a11ef4182ffeccd4a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 7 Feb 2018 23:26:59 +0000 Subject: [PATCH 123/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index 487ec8b..f2dd774 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -9,7 +9,7 @@ Name: libsvm Version: 3.21 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -298,6 +298,9 @@ rm -rf %{buildroot} %{_datadir}/applications/*%{name}-svm-toy-qt.desktop %changelog +* Wed Feb 07 2018 Fedora Release Engineering - 3.21-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 3.21-6 - Python 2 binary package renamed to python2-libsvm See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 From 1abeac56ccbd89a924db9472e5e0a24c5f322987 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 13 Feb 2018 23:43:35 +0100 Subject: [PATCH 124/136] Remove BuildRoot definition None of currently supported distributions need that. It was needed last for EL5 which is EOL now Signed-off-by: Igor Gnatenko --- libsvm.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index f2dd774..91e64a8 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -27,7 +27,6 @@ Patch1: %{name}.pythonDir.patch Patch2: %{name}.javaDir.patch Patch3: %{name}.svm-toy.patch Patch4: %{name}.toolsDir.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: grep %if 0%{?rhel} != 0 && 0%{?rhel} <= 5 From 7a0be5133e7f13fcdd37a3f4edb820bcff640783 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 14 Feb 2018 07:19:27 +0100 Subject: [PATCH 125/136] Remove %clean section None of currently supported distributions need that. Last one was EL5 which is EOL for a while. Signed-off-by: Igor Gnatenko --- libsvm.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index 91e64a8..b9b9f96 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -240,9 +240,6 @@ if [ -x %{_bindir}/gtk-update-icon-cache ]; then fi -%clean -rm -rf %{buildroot} - %files %defattr(-,root,root,-) From 5b7bc69c03eba54ac37cf09b8cc38fc6c7ed025c Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: Tue, 10 Jul 2018 01:47:30 -0500 Subject: [PATCH 126/136] Remove needless use of %defattr --- libsvm.spec | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index b9b9f96..ceca677 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -242,7 +242,6 @@ fi %files -%defattr(-,root,root,-) %doc COPYRIGHT FAQ.html ChangeLog guide.pdf %{_bindir}/svm-predict %{_bindir}/svm-scale @@ -252,13 +251,11 @@ fi %{_libdir}/%{name}.so.%{shver} %files devel -%defattr(-,root,root,-) %doc README %{_includedir}/%{name}/ %{_libdir}/%{name}.so %files -n python2-libsvm -%defattr(-,root,root,-) %doc python/README-Python tools/README-Tools %{libsvm_python_dir} %{_bindir}/svm-*.py @@ -280,14 +277,12 @@ fi %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/*%{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 From e584449fa411030b95629038103e3960ff737bea Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 13 Jul 2018 08:53:56 +0000 Subject: [PATCH 127/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index ceca677..12348e4 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -9,7 +9,7 @@ Name: libsvm Version: 3.21 -Release: 7%{?dist} +Release: 8%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -289,6 +289,9 @@ fi %{_datadir}/applications/*%{name}-svm-toy-qt.desktop %changelog +* Fri Jul 13 2018 Fedora Release Engineering - 3.21-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Wed Feb 07 2018 Fedora Release Engineering - 3.21-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From e6b06f5e1ecb99478ac787124851e2f343e7e5b4 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 19 Jul 2018 11:46:10 +1000 Subject: [PATCH 128/136] Upstream update to 3.23 --- .gitignore | 1 + libsvm-svm-toy-gtk.desktop | 10 -- libsvm.javaDir.patch | 48 ++---- libsvm.packageMain.patch | 40 +---- libsvm.pythonDir.patch | 25 ---- libsvm.spec | 296 +++++++++++++++++++++---------------- libsvm.svm-toy-qt5.patch | 28 ++++ libsvm.svm-toy.patch | 67 --------- libsvm.toolsDir.patch | 24 +-- log | 25 +++- sources | 4 +- 11 files changed, 245 insertions(+), 323 deletions(-) delete mode 100644 libsvm-svm-toy-gtk.desktop delete mode 100644 libsvm.pythonDir.patch create mode 100644 libsvm.svm-toy-qt5.patch delete mode 100644 libsvm.svm-toy.patch diff --git a/.gitignore b/.gitignore index c5ed10e..48a9e12 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ libsvm-3.91.tar.gz /libsvm-svm-toy-qt.desktop /libsvm-3.20.tar.gz /libsvm-3.21.tar.gz +/libsvm-3.23.tar.gz diff --git a/libsvm-svm-toy-gtk.desktop b/libsvm-svm-toy-gtk.desktop deleted file mode 100644 index 3b8613d..0000000 --- a/libsvm-svm-toy-gtk.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[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.javaDir.patch b/libsvm.javaDir.patch index ed7cf4b..5131c4f 100644 --- a/libsvm.javaDir.patch +++ b/libsvm.javaDir.patch @@ -1,34 +1,21 @@ 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 \ +--- ./java/Makefile.javaDir 2016-12-22 04:58:49.000000000 +1000 ++++ ./java/Makefile 2018-04-17 12:11:53.773004141 +1000 +@@ -5,8 +5,8 @@ FILES = libsvm/svm.class libsvm/svm_mode 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 = -target 1.7 -source 1.7 +-JAVAC = javac ++JAVAC_FLAGS = -target 1.7 -source 1.7 -classpath ${CLASSPATH} ++JAVAC ?= javac # 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) + export CLASSPATH := .:$(CLASSPATH) + +@@ -19,8 +19,20 @@ all: $(FILES) libsvm/svm.java: libsvm/svm.m4 m4 libsvm/svm.m4 > libsvm/svm.java - + +javadoc: docs/index.html + +docs/index.html: $(FILES) @@ -37,21 +24,18 @@ diff -up ./java/Makefile.javaDir ./java/Makefile +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} ++ rm -fr ${JAVA_TARGET_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 +--- ./java/test_applet.html.javaDir 2016-12-22 04:58:51.000000000 +1000 ++++ ./java/test_applet.html 2018-04-17 11:51:17.927996424 +1000 @@ -1 +1,3 @@ - + diff --git a/libsvm.packageMain.patch b/libsvm.packageMain.patch index dee23cd..f594c5b 100644 --- a/libsvm.packageMain.patch +++ b/libsvm.packageMain.patch @@ -4,7 +4,7 @@ diff -up ./Makefile.packageMain ./Makefile @@ -1,11 +1,45 @@ CXX ?= g++ -CFLAGS = -Wall -Wconversion -O3 -fPIC -+CFLAGS = ${RPM_CFLAGS} -Wall -Wconversion -O3 -fPIC ++CFLAGS = ${RPM_CFLAGS} -Wconversion -fPIC SHVER = 2 +export SHVER OS = $(shell uname) @@ -15,11 +15,11 @@ diff -up ./Makefile.packageMain ./Makefile +IS_64:=$(shell /bin/uname -i | awk '/64/ {print 64}') +PREFIXDIR?= /usr +export PREFIXDIR - + -all: svm-train svm-predict svm-scale +LIBDIR?=${PREFIXDIR}/lib${IS_64} +export LIBDIR - + -lib: svm.o +DATADIR?=${PREFIXDIR}/share +export DATADIR @@ -39,7 +39,7 @@ diff -up ./Makefile.packageMain ./Makefile +BINDIR_INSTALL:=${DESTDIR}/${BINDIR} +export BINDIR_INSTALL + -+all: lib svm-train svm-predict svm-scale svm-python svm-java svm-toy-gtk svm-toy-qt ++all: lib svm-train svm-predict svm-scale svm-python svm-toy-qt + +lib: libsvm.so.$(SHVER) libsvm.so + @@ -50,9 +50,9 @@ diff -up ./Makefile.packageMain ./Makefile if [ "$(OS)" = "Darwin" ]; then \ SHARED_LIB_FLAG="-dynamiclib -Wl,-install_name,libsvm.so.$(SHVER)"; \ else \ -@@ -14,12 +48,72 @@ lib: svm.o +@@ -14,12 +48,46 @@ lib: svm.o $(CXX) $${SHARED_LIB_FLAG} svm.o -o libsvm.so.$(SHVER) - + svm-predict: svm-predict.c svm.o - $(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm + $(CXX) $(CFLAGS) svm-predict.c $(LIBS) -o svm-predict -lm @@ -65,19 +65,12 @@ diff -up ./Makefile.packageMain ./Makefile $(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 ++ rm -f *~ svm.o svm-train svm-predict svm-scale 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 + @@ -91,23 +84,7 @@ diff -up ./Makefile.packageMain ./Makefile +# install package libsvm-devel + mkdir -p ${INCLUDEDIR_INSTALL}/libsvm + install -m 644 svm.h ${INCLUDEDIR_INSTALL}/libsvm -+ mkdir -p ${DATADIR_INSTALL}/libsvm/src/java/libsvm -+ install -m 644 *.h ${DATADIR_INSTALL}/libsvm/src -+ install -m 644 *.c ${DATADIR_INSTALL}/libsvm/src -+ install -m 644 *.cpp ${DATADIR_INSTALL}/libsvm/src -+ install -m 644 Makefile ${DATADIR_INSTALL}/libsvm/src -+ifneq ("${NO_JAVA}","NO_JAVA") -+ install -m 644 java/*.java ${DATADIR_INSTALL}/libsvm/src/java -+ install -m 644 java/Makefile ${DATADIR_INSTALL}/libsvm/src/java -+ install -m 644 java/libsvm/*.java ${DATADIR_INSTALL}/libsvm/src/java/libsvm -+ install -m 644 java/libsvm/*.m4 ${DATADIR_INSTALL}/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 ${BINDIR_INSTALL} + install -m 755 svm-toy/qt/svm-toy-qt ${BINDIR_INSTALL} +# install examples + mkdir -p ${DATADIR_INSTALL}/libsvm/examples @@ -120,9 +97,6 @@ diff -up ./Makefile.packageMain ./Makefile + rm -f ${INCLUDEDIR_INSTALL}/libsvm/svm.h + rm -f ${LIBDIR_INSTALL}/libsvm.so* + ${MAKE} -C python uninstall -+ifneq ("${NO_JAVA}","NO_JAVA") + ${MAKE} -C java uninstall -+endif -+ rm -f ${BINDIR_INSTALL}/svm-toy-gtk + rm -f ${BINDIR_INSTALL}/svm-toy-qt + diff --git a/libsvm.pythonDir.patch b/libsvm.pythonDir.patch deleted file mode 100644 index ff0991d..0000000 --- a/libsvm.pythonDir.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -up ./python/Makefile.pythonDir ./python/Makefile ---- ./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 - make -C .. lib -+ -+install: all -+ mkdir -p ${PYTHONDIR_INSTALL} -+ install -m 755 *.py ${PYTHONDIR_INSTALL} -+ install -m 755 ../tools/*.py ${PYTHONDIR_INSTALL} -+ $(foreach toolPy,$(SVM_TOOLS),ln -s ${PYTHONDIR}/$(toolPy) ${BINDIR_INSTALL}/svm-$(toolPy);) -+ -+uninstall: -+ rm -fr ${LIBDIR}/${PYTHON_PATH} $(addprefix ${BINDIR_INSTALL}/svm-,$(SVM_TOOLS)) diff --git a/libsvm.spec b/libsvm.spec index 12348e4..5b9f40c 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,15 +1,46 @@ %define shver 2 -%{!?pyver: %global 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 libdir_libsvm %{_libdir}/libsvm -%define libsvm_python_dir %{python_sitearch}/libsvm +# EL7 and EL6 only have python_version +%{!?python2_version: %global python2_version %{python_version}} +%{!?python2_sitearch: %global python2_sitearch %{python_sitearch}} +%{!?python2_sitelib: %global python2_sitearch %{python_sitelib}} +%global libdir_libsvm %{_libdir}/libsvm +%global python2_libsvm_dir %{python2_sitearch}/libsvm +%global python3_libsvm_dir %{python3_sitearch}/libsvm %global maven_group_id tw.edu.ntu.csie %global pom_file_version 3.17 %global pom_file_name JPP.%{maven_group_id}-%{name}.pom +# el_version is RHEL major version, but empty in Fedora +%global el_version %(/usr/lib/rpm/redhat/dist.sh --el) + +# EL <= 6 does not have enable_maven +%if 0%{?el_version} != 0 && 0%{?el_version} <= 6 +%global java_dependency java +%ifarch ppc64 +%bcond_with java +%else +%bcond_without java +%endif +%global cpp_std c++0x +%else +%define java_dependency java-headless +%bcond_without java +%bcond_without maven +%global cpp_std c++11 +%endif + +# EL <= 7 python 3 is not available by default +%if 0%{?el_version} != 0 && 0%{?el_version} <= 7 +%global python2_package_name libsvm-python +%bcond_with python3 +%else +%global python2_package_name python2-libsvm +%bcond_without python3 +%endif + Name: libsvm -Version: 3.21 -Release: 8%{?dist} +Version: 3.23 +Release: 1%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -18,38 +49,15 @@ URL: http://www.csie.ntu.edu.tw/~cjlin/libsvm/ Source0: http://www.csie.ntu.edu.tw/~cjlin/libsvm/%{name}-%{version}.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 Source6: http://central.maven.org/maven2/tw/edu/ntu/csie/libsvm/%{pom_file_version}/libsvm-%{pom_file_version}.pom Patch0: %{name}.packageMain.patch -Patch1: %{name}.pythonDir.patch Patch2: %{name}.javaDir.patch -Patch3: %{name}.svm-toy.patch Patch4: %{name}.toolsDir.patch +Patch5: %{name}.svm-toy-qt5.patch BuildRequires: grep -%if 0%{?rhel} != 0 && 0%{?rhel} <= 5 -%define moc_path %{_libdir}/qt4/bin/moc -%define with_vendor "fedora" -%else -%define moc_path %{_bindir}/moc-qt4 -%endif - -# RHEL6 does not have enable_add_maven_depmap -%define no_java FALSE -%if 0%{?rhel} != 0 && 0%{?rhel} <= 6 -%define java_dependency java -%define enable_add_maven_depmap FALSE -%ifarch ppc ppc64 -%define no_java NO_JAVA -Obsoletes: libsvm-java < 2.88-1 -%endif -%else -%define java_dependency java-headless -%define enable_add_maven_depmap TRUE -%endif - %description LIBSVM is an integrated software for support vector classification, (C-SVC, nu-SVC ), regression (epsilon-SVR, nu-SVR) and distribution @@ -65,34 +73,52 @@ Requires: %{name} = %{version}-%{release} Header file, object file of libsvm in C, C++ and Java. Install this package if you want to develop programs with libsvm. - -%package -n python2-libsvm +%package -n %{python2_package_name} %{?python_provide:%python_provide python2-libsvm} -# Remove before F30 Provides: %{name}-python%{?_isa} = %{version}-%{release} -Obsoletes: %{name}-python < %{version}-%{release} -Summary: Python tools and interfaces for libsvm +Obsoletes: %{name}-python%{?_isa} < %{version}-%{release} +Summary: Python2 tools and interfaces for libsvm Group: Development/Libraries -BuildRequires: python-devel >= 2.4 gawk +BuildRequires: python2-devel >= 2.4 gawk #gnuplot is required by easy.py Requires: %{name} = %{version}-%{release} Requires: gnuplot -%description -n python2-libsvm -Python tools and interfaces for libsvm. +%description -n %{python2_package_name} +Python2 tools and interfaces for libsvm. Install this package if you want to develop -programs with libsvm in Python. +programs with libsvm in Python2. -%if "%{no_java}" == "FALSE" +%if %{with python3} +%package -n python3-%{name} +%{?python_provide:%python_provide python3-%{name}} +Provides: %{name}-python%{?_isa} = %{version}-%{release} +Obsoletes: %{name}-python%{?_isa} < %{version}-%{release} +Summary: Python3 tools and interfaces for libsvm +Group: Development/Libraries +BuildRequires: python3-devel gawk +#gnuplot is required by easy.py +Requires: %{name} = %{version}-%{release} +Requires: gnuplot + +%description -n python3-%{name} +Python3 tools and interfaces for libsvm. +Install this package if you want to develop +programs with libsvm in Python3. +%endif + +%if %{with java} %package java Summary: Java tools and interfaces for libsvm Group: Development/Libraries -BuildRequires: java-devel >= 1.5.0 +BuildRequires: java-devel >= 1.7.0 BuildRequires: jpackage-utils - -Requires: %{java_dependency} >= 1.5.0 +%if %{with maven} +BuildRequires: maven-local +%endif +Requires: %{java_dependency} >= 1.7.0 Requires: jpackage-utils -Requires: %{name} = %{version}-%{release} +Requires: %{name} = %{version}-%{release} %description java Java tools and interfaces for libsvm. @@ -100,26 +126,14 @@ 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 demonstration 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 demonstration program which has a gtk-GUI to -display the derived separating hyperplane. - %package svm-toy-qt Summary: QT version of svm-toy (libsvm demonstration program) Group: Development/Libraries BuildRequires: desktop-file-utils BuildRequires: pkgconfig -BuildRequires: qt4-devel -Requires: qt4 +BuildRequires: qt5-qtbase-devel +Requires: qt5 Requires: %{name} = %{version}-%{release} %description svm-toy-qt @@ -129,18 +143,20 @@ display the derived separating hyperplane. %prep %setup -q %patch0 -p0 -b .packageMain -%patch1 -p0 -b .pythonDir %patch2 -p0 -b .javaDir -%patch3 -p0 -b .svm-toy %patch4 -p0 -b .toolsDir +%patch5 -p0 -b .svm-toy-qt5 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 -%if "%{no_java}" == "FALSE" +# Fix the error: narrowing conversion +sed -i.narrowing -e "s|{x,y,v}|{x,y,(signed char) v}|" svm-toy/qt/svm-toy.cpp +sed -i -e "s|{x,y,current_value}|{x,y,(signed char) current_value}|" svm-toy/qt/svm-toy.cpp +sed -i -e "s|(double)event->y()/YLEN, current_value|(double)event->y()/YLEN,(signed char) current_value|" svm-toy/qt/svm-toy.cpp + +%if %{with maven} # Update the POM file, which is stuck on version 3.17 # pom_xpath_set does not work in rpm-4.11.1 # as it generated something like @@ -153,94 +169,96 @@ cp %{SOURCE5} %{name}-svm-toy-qt-48.png %{__sed} -e 's/%{pom_file_version}/%{version}/' %{SOURCE6} > %{name}.pom %{__sed} -i 's|http://www.csie.ntu.edu.tw/~cjlin/cgi-bin/libsvm.cgi?+http://www.csie.ntu.edu.tw/~cjlin/libsvm+tar.gz|https://github.com/cjlin1/libsvm|' %{name}.pom %{__sed} -i 's|http://www.csie.ntu.edu.tw/~cjlin/cgi-bin/libsvm.cgi?+http://www.csie.ntu.edu.tw/~cjlin/libsvm+tar.gz|scm:git:https://github.com/cjlin1/libsvm.git|' %{name}.pom + +%mvn_file %{maven_group_id}:%{name} %{maven_group_id}/%{name} %endif %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}" +make all RPM_CFLAGS="$RPM_OPT_FLAGS" LIBDIR="%{_libdir}" CPP_STD="%{cpp_std}" +%if %{with java} +make -C java +%endif 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 +%if %{with maven} +%mvn_artifact %{name}.pom java/%{name}.jar +%endif + %install rm -rf %{buildroot} -make install DESTDIR=%{buildroot} LIBDIR=%{_libdir} PYTHON_VERSION="%{pyver}" LIBSVM_VER="%{version}" NO_JAVA="%{no_java}" JAVA_TARGET_DIR="%{buildroot}/%{_javadir}" -rm -rf %{buildroot}%{_datadir}/%{name}/src +make install DESTDIR=%{buildroot} LIBDIR=%{_libdir} LIBSVM_VER="%{version}" CPP_STD="%{cpp_std}" +%if %{with java} +make -C java install JAVA_TARGET_DIR="%{buildroot}/%{_javadir}" +%endif mkdir -p %{buildroot}/%{_datadir}/icons/hicolor/48x48/apps/ -cp %{name}-svm-toy-gtk-48.png %{buildroot}/%{_datadir}/icons/hicolor/48x48/apps/ cp %{name}-svm-toy-qt-48.png %{buildroot}/%{_datadir}/icons/hicolor/48x48/apps/ mkdir -p %{buildroot}/%{_datadir}/applications -cp %{name}-svm-toy-gtk.desktop %{buildroot}/%{_datadir}/applications cp %{name}-svm-toy-qt.desktop %{buildroot}/%{_datadir}/applications %__ln_s %{name}.so.%{shver} %{buildroot}/%{_libdir}/%{name}.so +## Python2 # [Bug 521194] Python: 'import libsvm' doesn't work -mkdir -p %{buildroot}/%{libsvm_python_dir} +mkdir -p %{buildroot}/%{python2_libsvm_dir} 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"\ - > %{buildroot}/%{libsvm_python_dir}/__init__.py - -%if 0%{?with_vendor:1} -desktop-file-install --delete-original --vendor=%{with_vendor} \ - --dir=%{buildroot}%{_datadir}/applications \ - %{buildroot}/%{_datadir}/applications/%{name}-svm-toy-gtk.desktop \ - %{buildroot}/%{_datadir}/applications/%{name}-svm-toy-qt.desktop -%else -desktop-file-install --delete-original \ - --dir=%{buildroot}%{_datadir}/applications \ - %{buildroot}/%{_datadir}/applications/%{name}-svm-toy-gtk.desktop \ - %{buildroot}/%{_datadir}/applications/%{name}-svm-toy-qt.desktop -%endif - -# Python + > %{buildroot}/%{python2_libsvm_dir}/__init__.py +install -p -m 755 tools/*.py %{buildroot}/%{python2_libsvm_dir} +install -p -m 755 python/*.py %{buildroot}/%{python2_libsvm_dir} # Fix Bug 646154 - libsvm-python's pth is not set correctly -echo 'libsvm' > %{buildroot}/%{python_sitearch}/libsvm.pth -for p in %{buildroot}%{libsvm_python_dir}/*.py;do +echo 'libsvm' > %{buildroot}/%{python2_sitearch}/libsvm.pth +for p in %{buildroot}%{python2_libsvm_dir}/*.py;do sed -i -e 's|#!/usr/bin/env python|#!%{__python2}|' $p done -# Java -%if "%{no_java}" == "FALSE" -## Move jars to correct directory -mkdir -p %{buildroot}/%{_javadir}/%{maven_group_id} -mv %{buildroot}/%{_javadir}/%{name}.jar %{buildroot}/%{_javadir}/%{maven_group_id}/%{name}.jar -ln -s %{_javadir}/%{maven_group_id}/%{name}.jar %{buildroot}/%{_javadir}/%{name}.jar -## Install the Java POM -mkdir -p %{buildroot}%{_mavenpomdir} -cp -p %{name}.pom %{buildroot}%{_mavenpomdir}/%{pom_file_name} - -# RHEL6 does not support enable_add_maven_depmap -%if "%{enable_add_maven_depmap}" == "TRUE" -%add_maven_depmap %{pom_file_name} %{maven_group_id}/%{name}.jar +%if ! %{with python3} +## Use python2 when python3 is not enabled. +cd tools +for p in *.py; do + ln -s %{python2_libsvm_dir}/$p %{buildroot}/%{_bindir}/svm-$p +done +cd - %endif +## Python3 +%if %{with python3} +mkdir -p %{buildroot}/%{python3_libsvm_dir} +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"\ + > %{buildroot}/%{python2_libsvm_dir}/__init__.py +install -p -m 755 tools/*.py %{buildroot}/%{python3_libsvm_dir} +install -p -m 755 python/*.py %{buildroot}/%{python3_libsvm_dir} +echo 'libsvm' > %{buildroot}/%{python3_sitearch}/libsvm.pth +for p in %{buildroot}%{python3_libsvm_dir}/*.py;do + sed -i -e 's|#!/usr/bin/env python|#!%{__python3}|' $p +done +cd tools +for p in *.py; do + ln -s %{python3_libsvm_dir}/$p %{buildroot}/%{_bindir}/svm-$p +done +cd - %endif +# Java +%if %{with maven} +%mvn_install +%endif +# Desktop files +desktop-file-install --delete-original \ + --dir=%{buildroot}%{_datadir}/applications \ + %{buildroot}/%{_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 +%post -p /sbin/ldconfig %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 - - - %files %doc COPYRIGHT FAQ.html ChangeLog guide.pdf %{_bindir}/svm-predict @@ -255,14 +273,24 @@ fi %{_includedir}/%{name}/ %{_libdir}/%{name}.so -%files -n python2-libsvm +%files -n %{python2_package_name} %doc python/README-Python tools/README-Tools -%{libsvm_python_dir} +%{python2_libsvm_dir} +%if ! %{with python3} %{_bindir}/svm-*.py -%{python_sitearch}/libsvm.pth +%endif +%{python2_sitearch}/libsvm.pth -%if "%{no_java}" == "FALSE" -%if "%{enable_add_maven_depmap}" == "TRUE" +%if %{with python3} +%files -n python3-%{name} +%doc python/README-Python tools/README-Tools +%{python3_libsvm_dir} +%{_bindir}/svm-*.py +%{python3_sitearch}/libsvm.pth +%endif + +%if %{with java} +%if %{with maven} %files java -f .mfiles %else %files java @@ -270,18 +298,11 @@ fi %defattr(-,root,root,-) %doc java/README-Java java/test_applet.html %{_javadir}/%{name}.jar -%if "%{enable_add_maven_depmap}" == "FALSE" +%if %{with maven} %{_javadir}/%{maven_group_id}/%{name}.jar -%{_mavenpomdir}/%{pom_file_name} %endif %endif -%files svm-toy-gtk -%doc svm-toy/gtk/README -%{_bindir}/svm-toy-gtk -%{_datadir}/icons/hicolor/48x48/apps/%{name}-svm-toy-gtk-48.png -%{_datadir}/applications/*%{name}-svm-toy-gtk.desktop - %files svm-toy-qt %doc svm-toy/qt/README %{_bindir}/svm-toy-qt @@ -289,6 +310,21 @@ fi %{_datadir}/applications/*%{name}-svm-toy-qt.desktop %changelog +* Thu Jul 19 2018 Ding-Yi Chen - 3.23-1 +- Upstream update to 3.23 + + add more digits of predicted file, model file, scaled data and data + from matlab libsvmwrite: to .17g + + svm-toy-gtk is no longer supported + + Dependency qt is updated to qt5 +- probability output: + + if 2 classes, directly output the predited probabilities + rather than run the iterative algorithms for multi-class situations +- java: + + libsvm.jar generated by java 1.7 rather than 1.5 + + change the use of "_" in svm.java, which won't be allowed in later java +- python: + + split to python2 and python3 + * Fri Jul 13 2018 Fedora Release Engineering - 3.21-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild @@ -313,7 +349,7 @@ fi * Wed Jul 20 2016 Ding-Yi Chen - 3.21-1 - Upstream update to 3.21 -- Fixes Bug 1277450 - libsvm(-java) remove versioned jars from {_javadir} +- Fixes Bug 1277450 - libsvm(-java) remove versioned jars from {_javadir} * Wed Jun 17 2015 Fedora Release Engineering - 3.20-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild @@ -348,7 +384,7 @@ fi * Tue Apr 22 2014 Ding-Yi Chen - 3.18-1 - Upstream update to 3.18 - svm.cpp and svm-scale.c: check return values of fscanf -- matlab interface: Makefile no longer handles octave +- matlab interface: Makefile no longer handles octave because make.m should be used * Fri Mar 28 2014 Michael Simacek - 3.17-4 diff --git a/libsvm.svm-toy-qt5.patch b/libsvm.svm-toy-qt5.patch new file mode 100644 index 0000000..9d589c2 --- /dev/null +++ b/libsvm.svm-toy-qt5.patch @@ -0,0 +1,28 @@ +diff -up ./svm-toy/qt/Makefile.svm-toy-qt5 ./svm-toy/qt/Makefile +--- ./svm-toy/qt/Makefile.svm-toy-qt5 2018-07-16 00:16:58.000000000 +1000 ++++ ./svm-toy/qt/Makefile 2018-07-18 18:10:40.157485623 +1000 +@@ -1,13 +1,14 @@ + # use ``export QT_SELECT=qt5'' in a command window for using qt5 + # may need to adjust the path of header files + CXX? = g++ +-INCLUDE = /usr/include/x86_64-linux-gnu/qt5 +-CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtWidgets -I$(INCLUDE)/QtGui -I$(INCLUDE)/QtCore -fPIC -std=c++11 ++INCLUDE = /usr/include/qt5 ++CPP_STD ?= c++11 ++CFLAGS = ${RPM_CFLAGS} -I$(INCLUDE) -I$(INCLUDE)/QtWidgets -I$(INCLUDE)/QtGui -I$(INCLUDE)/QtCore -fPIC -std=${CPP_STD} + LIB = -lQt5Widgets -lQt5Gui -lQt5Core +-MOC = /usr/bin/moc ++MOC ?= /usr/bin/moc-qt5 + + svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o +- $(CXX) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy $(LIB) ++ $(CXX) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy-qt $(LIB) + + svm-toy.moc: svm-toy.cpp + $(MOC) svm-toy.cpp -o svm-toy.moc +@@ -16,4 +17,4 @@ svm-toy.moc: svm-toy.cpp + make -C ../.. svm.o + + clean: +- rm -f *~ svm-toy svm-toy.moc ../../svm.o ++ rm -f *~ svm-toy-qt svm-toy.moc ../../svm.o diff --git a/libsvm.svm-toy.patch b/libsvm.svm-toy.patch deleted file mode 100644 index 4fc0982..0000000 --- a/libsvm.svm-toy.patch +++ /dev/null @@ -1,67 +0,0 @@ -diff -up ./svm-toy/gtk/Makefile.svm-toy ./svm-toy/gtk/Makefile ---- ./svm-toy/gtk/Makefile.svm-toy 2015-12-14 23:49:17.000000000 +1000 -+++ ./svm-toy/gtk/Makefile 2016-07-20 11:56:30.157119649 +1000 -@@ -1,10 +1,12 @@ - CC? = gcc - CXX? = g++ --CFLAGS = -Wall -O3 -g `pkg-config --cflags gtk+-2.0` --LIBS = `pkg-config --libs gtk+-2.0` -+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 ${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,8 @@ interface.o: interface.c interface.h - callbacks.o: callbacks.cpp callbacks.h - $(CXX) $(CFLAGS) -c callbacks.cpp - --../../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 ${LOCAL_LIBDIR}/svm.o -diff -up ./svm-toy/qt/Makefile.svm-toy ./svm-toy/qt/Makefile ---- ./svm-toy/qt/Makefile.svm-toy 2016-07-20 11:56:30.157119649 +1000 -+++ ./svm-toy/qt/Makefile 2016-07-20 13:40:21.876341574 +1000 -@@ -1,17 +1,25 @@ - CXX? = g++ -+-CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtGui -lQtGui -+-MOC = /usr/bin/moc-qt4 - INCLUDE = /usr/include/qt4 --CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtGui -I$(INCLUDE)/QtCore -+SHVER?=2 -+CFLAGS = -Wall -O3 `pkg-config --cflags --libs QtGui` - LIB = -lQtGui -lQtCore --MOC = /usr/bin/moc-qt4 -+MOC=${MOC_PATH} -+LOCAL_LIBDIR=../.. -+LIBS = -L${LOCAL_LIBDIR} -lsvm -+LIBSVM_SO_SHVER=${LOCAL_LIBDIR}/libsvm.so.$(SHVER) - --svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o -- $(CXX) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy $(LIB) -+all: svm-toy-qt -+ -+svm-toy-qt: svm-toy.cpp svm-toy.moc $(LIBSVM_SO_SHVER) -+ $(CXX) $(CFLAGS) svm-toy.cpp ${LIBS} -o $@ - - svm-toy.moc: svm-toy.cpp - $(MOC) svm-toy.cpp -o svm-toy.moc - --../../svm.o: ../../svm.cpp ../../svm.h -- make -C ../.. svm.o -+$(LIBSVM_SO_SHVER): ${LOCAL_LIBDIR}/svm.cpp ${LOCAL_LIBDIR}/svm.h -+ make -C ${LOCAL_LIBDIR} lib - - clean: - rm -f *~ svm-toy svm-toy.moc ../../svm.o diff --git a/libsvm.toolsDir.patch b/libsvm.toolsDir.patch index a303895..b0375b9 100644 --- a/libsvm.toolsDir.patch +++ b/libsvm.toolsDir.patch @@ -2,7 +2,7 @@ diff -up ./tools/easy.py.toolsDir ./tools/easy.py --- ./tools/easy.py.toolsDir 2013-03-31 17:06:49.000000000 +1000 +++ ./tools/easy.py 2013-04-13 23:17:53.399526910 +1000 @@ -12,10 +12,10 @@ if len(sys.argv) <= 1: - + is_win32 = (sys.platform == 'win32') if not is_win32: - svmscale_exe = "../svm-scale" @@ -16,28 +16,6 @@ diff -up ./tools/easy.py.toolsDir ./tools/easy.py gnuplot_exe = "/usr/bin/gnuplot" else: # example for windows -@@ -47,7 +47,7 @@ if len(sys.argv) > 2: - - cmd = '{0} -s "{1}" "{2}" > "{3}"'.format(svmscale_exe, range_file, train_pathname, scaled_file) - print('Scaling training data...') --Popen(cmd, shell = True, stdout = PIPE).communicate() -+Popen(cmd, shell = True, stdout = PIPE).communicate() - - cmd = '{0} -svmtrain "{1}" -gnuplot "{2}" "{3}"'.format(grid_py, svmtrain_exe, gnuplot_exe, scaled_file) - print('Cross validation...') -@@ -70,10 +70,10 @@ print('Output model: {0}'.format(model_f - if len(sys.argv) > 2: - cmd = '{0} -r "{1}" "{2}" > "{3}"'.format(svmscale_exe, range_file, test_pathname, scaled_test_file) - print('Scaling testing data...') -- Popen(cmd, shell = True, stdout = PIPE).communicate() -+ Popen(cmd, shell = True, stdout = PIPE).communicate() - - cmd = '{0} "{1}" "{2}" "{3}"'.format(svmpredict_exe, scaled_test_file, model_file, predict_test_file) - print('Testing...') -- Popen(cmd, shell = True).communicate() -+ Popen(cmd, shell = True).communicate() - - print('Output prediction: {0}'.format(predict_test_file)) diff -up ./tools/grid.py.toolsDir ./tools/grid.py --- ./tools/grid.py.toolsDir 2013-03-31 17:06:50.000000000 +1000 +++ ./tools/grid.py 2013-04-13 23:18:53.964522769 +1000 diff --git a/log b/log index c6074b0..8531e06 100644 --- a/log +++ b/log @@ -282,4 +282,27 @@ i subroutines to get SVs pre-built windows exe files changed from 32 to 64 bit matlab interface: now use #include "../svm.h" - fix some minor issues in make.m of matlab interface \ No newline at end of file + fix some minor issues in make.m of matlab interface + +3.22: 2016/12/22 + probability output: + if 2 classes, directly output the predited probabilities + rather than run the iterative algorithms for multi-class situations + java: + libsvm.jar generated by java 1.7 rather than 1.5 + change the use of "_" in svm.java, which won't be allowed in later java + +3.23: 2018/7/15 + add more digits of predicted file, model file, scaled data and data from matlab libsvmwrite: to %.17g + revise svm-scale.c so features in test data that do not appear in training data are scaled to zero. + remove unnecessary tab or space in all files + python interface: + add Scipy support + add scaling (csr_find_scale_param and csr_scale functions) + put some utility functions identical in LIBLINEAR to commonutil.py. + functions for scaling are put in commonutil.py. + sort column indices of csr matrix before training as feature indices must be ascending + convert Qt version of svm-toy from Qt4 to Qt5 + remove gtk svm-toy because we stop maintaining this tool + minor improvement of descriptions in README + \ No newline at end of file diff --git a/sources b/sources index 46bd5da..77237b8 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -e7392f325efd1c6ddacd8e2c8bb023d1 guide.pdf -30d2a0a8043e0f66cb7903b3ce45b3bf libsvm-3.21.tar.gz +SHA512 (guide.pdf) = 5e97a7b76ad4217d7987c5c07f0420e780b61b82fb88fe0e6015681fabb5078980b280cec4a0a7208ea225b9fa84de878295039f4513df26f0d404a21812e44c +SHA512 (libsvm-3.23.tar.gz) = 15e1a22a9075d3910414b0519b2ce8a93edc42be76a034d31435dc9463b08fbc510b806a3e6f64abff4ba3da771582436182e4e7d658ed2e54f311bc8cdbc121 From 637d548baa5b4870952fc84b152f47b5866620eb Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 26 Jul 2018 14:38:35 +1000 Subject: [PATCH 129/136] Add javadoc subpackage Address bodhi comments --- libsvm-svm-toy-qt.desktop | 2 +- libsvm.spec | 38 ++++++++++++++++++++++++++++---------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/libsvm-svm-toy-qt.desktop b/libsvm-svm-toy-qt.desktop index 5c7fd2f..1835271 100644 --- a/libsvm-svm-toy-qt.desktop +++ b/libsvm-svm-toy-qt.desktop @@ -7,4 +7,4 @@ Icon=libsvm-svm-toy-qt-48 StartupNotify=true Terminal=false Type=Application -Categories=KDE;Education;Science;Math;DataVisualization +Categories=Education;Science;Math;DataVisualization;Qt diff --git a/libsvm.spec b/libsvm.spec index 5b9f40c..53d4fc5 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -9,11 +9,9 @@ %global maven_group_id tw.edu.ntu.csie %global pom_file_version 3.17 %global pom_file_name JPP.%{maven_group_id}-%{name}.pom -# el_version is RHEL major version, but empty in Fedora -%global el_version %(/usr/lib/rpm/redhat/dist.sh --el) # EL <= 6 does not have enable_maven -%if 0%{?el_version} != 0 && 0%{?el_version} <= 6 +%if 0%{?rhel} != 0 && 0%{?rhel} <= 6 %global java_dependency java %ifarch ppc64 %bcond_with java @@ -29,7 +27,7 @@ %endif # EL <= 7 python 3 is not available by default -%if 0%{?el_version} != 0 && 0%{?el_version} <= 7 +%if 0%{?rhel} != 0 && 0%{?rhel} <= 7 %global python2_package_name libsvm-python %bcond_with python3 %else @@ -40,7 +38,7 @@ Name: libsvm Version: 3.23 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -124,6 +122,16 @@ Requires: %{name} = %{version}-%{release} Java tools and interfaces for libsvm. Install this package if you want to develop programs with libsvm in Java. + +%package javadoc +Summary: Javadoc for libsvm +BuildRequires: java-devel >= 1.7.0 +BuildRequires: jpackage-utils +BuildArch: noarch +Requires: %{name}-java = %{version}-%{release} + +%description javadoc +Javadoc for libsvm %endif %package svm-toy-qt @@ -133,7 +141,7 @@ BuildRequires: desktop-file-utils BuildRequires: pkgconfig BuildRequires: qt5-qtbase-devel -Requires: qt5 +Requires: qt5-qtbase Requires: %{name} = %{version}-%{release} %description svm-toy-qt @@ -178,7 +186,7 @@ sed -i -e "s|(double)event->y()/YLEN, current_value|(double)event->y()/YLEN,(sig %{__sed} -i 's/\r//' ChangeLog make all RPM_CFLAGS="$RPM_OPT_FLAGS" LIBDIR="%{_libdir}" CPP_STD="%{cpp_std}" %if %{with java} -make -C java +make -C java all javadoc %endif mv python/README python/README-Python mv tools/README tools/README-Tools @@ -192,9 +200,6 @@ cp README svm-toy/qt %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} LIBDIR=%{_libdir} LIBSVM_VER="%{version}" CPP_STD="%{cpp_std}" -%if %{with java} -make -C java install JAVA_TARGET_DIR="%{buildroot}/%{_javadir}" -%endif mkdir -p %{buildroot}/%{_datadir}/icons/hicolor/48x48/apps/ cp %{name}-svm-toy-qt-48.png %{buildroot}/%{_datadir}/icons/hicolor/48x48/apps/ mkdir -p %{buildroot}/%{_datadir}/applications @@ -245,6 +250,12 @@ cd - %endif # Java +%if %{with java} +make -C java install JAVA_TARGET_DIR="%{buildroot}/%{_javadir}" +mkdir -p %{buildroot}/%{_javadocdir}/%{name} +cp -p -R java/docs/* %{buildroot}/%{_javadocdir}/%{name} +%endif + %if %{with maven} %mvn_install %endif @@ -301,6 +312,8 @@ desktop-file-install --delete-original \ %if %{with maven} %{_javadir}/%{maven_group_id}/%{name}.jar %endif +%files javadoc +%{_javadocdir}/%{name} %endif %files svm-toy-qt @@ -310,6 +323,11 @@ desktop-file-install --delete-original \ %{_datadir}/applications/*%{name}-svm-toy-qt.desktop %changelog +* Thu Jul 26 2018 Ding-Yi Chen - 3.23-2 +- Add -javadoc subpackage +- Use macro rhel instead of el_version +- qt5 in EL should be qt5-qtbase + * Thu Jul 19 2018 Ding-Yi Chen - 3.23-1 - Upstream update to 3.23 + add more digits of predicted file, model file, scaled data and data From 39907b427f0fe7620453740ded6309fcb1d6aaa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 28 Aug 2018 17:25:55 +0200 Subject: [PATCH 130/136] Fix Provides/Obsoletes for the old python subpackage An arch-less Provides is needed in the -python2 subpackage, but the -python3 subpackage should not Provide/Obsolete the old python subpackage. --- libsvm.spec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index 53d4fc5..2648b77 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -38,7 +38,7 @@ Name: libsvm Version: 3.23 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -74,6 +74,7 @@ Install this package if you want to develop programs with libsvm. %package -n %{python2_package_name} %{?python_provide:%python_provide python2-libsvm} Provides: %{name}-python%{?_isa} = %{version}-%{release} +Provides: %{name}-python = %{version}-%{release} Obsoletes: %{name}-python%{?_isa} < %{version}-%{release} Summary: Python2 tools and interfaces for libsvm Group: Development/Libraries @@ -90,8 +91,6 @@ programs with libsvm in Python2. %if %{with python3} %package -n python3-%{name} %{?python_provide:%python_provide python3-%{name}} -Provides: %{name}-python%{?_isa} = %{version}-%{release} -Obsoletes: %{name}-python%{?_isa} < %{version}-%{release} Summary: Python3 tools and interfaces for libsvm Group: Development/Libraries BuildRequires: python3-devel gawk @@ -323,6 +322,9 @@ desktop-file-install --delete-original \ %{_datadir}/applications/*%{name}-svm-toy-qt.desktop %changelog +* Tue Aug 28 2018 Zbigniew Jędrzejewski-Szmek - 3.23-3 +- Fix Provides/Obsoletes for old python subpackage + * Thu Jul 26 2018 Ding-Yi Chen - 3.23-2 - Add -javadoc subpackage - Use macro rhel instead of el_version From 5d6382851e5953d5a2ff0d47bb7fb3aa6a5e7d8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 15 Jan 2019 20:24:55 +0100 Subject: [PATCH 131/136] Remove Python 2 subpackage (#1655696) --- libsvm.spec | 76 ++++------------------------------------------------- 1 file changed, 5 insertions(+), 71 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index 2648b77..e97afab 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,10 +1,5 @@ %define shver 2 -# EL7 and EL6 only have python_version -%{!?python2_version: %global python2_version %{python_version}} -%{!?python2_sitearch: %global python2_sitearch %{python_sitearch}} -%{!?python2_sitelib: %global python2_sitearch %{python_sitelib}} %global libdir_libsvm %{_libdir}/libsvm -%global python2_libsvm_dir %{python2_sitearch}/libsvm %global python3_libsvm_dir %{python3_sitearch}/libsvm %global maven_group_id tw.edu.ntu.csie %global pom_file_version 3.17 @@ -26,19 +21,10 @@ %global cpp_std c++11 %endif -# EL <= 7 python 3 is not available by default -%if 0%{?rhel} != 0 && 0%{?rhel} <= 7 -%global python2_package_name libsvm-python -%bcond_with python3 -%else -%global python2_package_name python2-libsvm -%bcond_without python3 -%endif - Name: libsvm Version: 3.23 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A Library for Support Vector Machines Group: Development/Libraries @@ -71,24 +57,6 @@ Requires: %{name} = %{version}-%{release} Header file, object file of libsvm in C, C++ and Java. Install this package if you want to develop programs with libsvm. -%package -n %{python2_package_name} -%{?python_provide:%python_provide python2-libsvm} -Provides: %{name}-python%{?_isa} = %{version}-%{release} -Provides: %{name}-python = %{version}-%{release} -Obsoletes: %{name}-python%{?_isa} < %{version}-%{release} -Summary: Python2 tools and interfaces for libsvm -Group: Development/Libraries -BuildRequires: python2-devel >= 2.4 gawk -#gnuplot is required by easy.py -Requires: %{name} = %{version}-%{release} -Requires: gnuplot - -%description -n %{python2_package_name} -Python2 tools and interfaces for libsvm. -Install this package if you want to develop -programs with libsvm in Python2. - -%if %{with python3} %package -n python3-%{name} %{?python_provide:%python_provide python3-%{name}} Summary: Python3 tools and interfaces for libsvm @@ -102,7 +70,6 @@ Requires: gnuplot Python3 tools and interfaces for libsvm. Install this package if you want to develop programs with libsvm in Python3. -%endif %if %{with java} %package java @@ -206,35 +173,10 @@ cp %{name}-svm-toy-qt.desktop %{buildroot}/%{_datadir}/applications %__ln_s %{name}.so.%{shver} %{buildroot}/%{_libdir}/%{name}.so -## Python2 -# [Bug 521194] Python: 'import libsvm' doesn't work -mkdir -p %{buildroot}/%{python2_libsvm_dir} -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"\ - > %{buildroot}/%{python2_libsvm_dir}/__init__.py -install -p -m 755 tools/*.py %{buildroot}/%{python2_libsvm_dir} -install -p -m 755 python/*.py %{buildroot}/%{python2_libsvm_dir} -# Fix Bug 646154 - libsvm-python's pth is not set correctly -echo 'libsvm' > %{buildroot}/%{python2_sitearch}/libsvm.pth -for p in %{buildroot}%{python2_libsvm_dir}/*.py;do - sed -i -e 's|#!/usr/bin/env python|#!%{__python2}|' $p -done - -%if ! %{with python3} -## Use python2 when python3 is not enabled. -cd tools -for p in *.py; do - ln -s %{python2_libsvm_dir}/$p %{buildroot}/%{_bindir}/svm-$p -done -cd - -%endif - -## Python3 -%if %{with python3} mkdir -p %{buildroot}/%{python3_libsvm_dir} 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"\ - > %{buildroot}/%{python2_libsvm_dir}/__init__.py + > %{buildroot}/%{python3_libsvm_dir}/__init__.py install -p -m 755 tools/*.py %{buildroot}/%{python3_libsvm_dir} install -p -m 755 python/*.py %{buildroot}/%{python3_libsvm_dir} echo 'libsvm' > %{buildroot}/%{python3_sitearch}/libsvm.pth @@ -246,7 +188,6 @@ for p in *.py; do ln -s %{python3_libsvm_dir}/$p %{buildroot}/%{_bindir}/svm-$p done cd - -%endif # Java %if %{with java} @@ -283,21 +224,11 @@ desktop-file-install --delete-original \ %{_includedir}/%{name}/ %{_libdir}/%{name}.so -%files -n %{python2_package_name} -%doc python/README-Python tools/README-Tools -%{python2_libsvm_dir} -%if ! %{with python3} -%{_bindir}/svm-*.py -%endif -%{python2_sitearch}/libsvm.pth - -%if %{with python3} %files -n python3-%{name} %doc python/README-Python tools/README-Tools %{python3_libsvm_dir} %{_bindir}/svm-*.py %{python3_sitearch}/libsvm.pth -%endif %if %{with java} %if %{with maven} @@ -322,6 +253,9 @@ desktop-file-install --delete-original \ %{_datadir}/applications/*%{name}-svm-toy-qt.desktop %changelog +* Tue Jan 15 2019 Miro Hrončok - 3.23-4 +- Remove Python 2 subpackage (#1655696) + * Tue Aug 28 2018 Zbigniew Jędrzejewski-Szmek - 3.23-3 - Fix Provides/Obsoletes for old python subpackage From b554a6f42933fc677ecd5d202bbaab3ccb6a40da Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 22 Jan 2019 18:40:09 +0100 Subject: [PATCH 132/136] Remove obsolete ldconfig scriptlets References: https://fedoraproject.org/wiki/Changes/RemoveObsoleteScriptlets Signed-off-by: Igor Gnatenko --- libsvm.spec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index e97afab..ef2f646 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -206,9 +206,7 @@ desktop-file-install --delete-original \ %{buildroot}/%{_datadir}/applications/%{name}-svm-toy-qt.desktop -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig +%ldconfig_scriptlets %files %doc COPYRIGHT FAQ.html ChangeLog guide.pdf From 0d2c5c9c1f5925cdd04d56972820f8fd4810ebb4 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 28 Jan 2019 20:17:52 +0100 Subject: [PATCH 133/136] Remove obsolete Group tag References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag --- libsvm.spec | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libsvm.spec b/libsvm.spec index ef2f646..b7eb425 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -27,7 +27,6 @@ Version: 3.23 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: http://www.csie.ntu.edu.tw/~cjlin/libsvm/%{name}-%{version}.tar.gz @@ -49,7 +48,6 @@ 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} @@ -60,7 +58,6 @@ Install this package if you want to develop programs with libsvm. %package -n python3-%{name} %{?python_provide:%python_provide python3-%{name}} Summary: Python3 tools and interfaces for libsvm -Group: Development/Libraries BuildRequires: python3-devel gawk #gnuplot is required by easy.py Requires: %{name} = %{version}-%{release} @@ -74,7 +71,6 @@ programs with libsvm in Python3. %if %{with java} %package java Summary: Java tools and interfaces for libsvm -Group: Development/Libraries BuildRequires: java-devel >= 1.7.0 BuildRequires: jpackage-utils %if %{with maven} @@ -102,7 +98,6 @@ Javadoc for libsvm %package svm-toy-qt Summary: QT version of svm-toy (libsvm demonstration program) -Group: Development/Libraries BuildRequires: desktop-file-utils BuildRequires: pkgconfig From 647ece90d505c592d827dc2dd5afb36b7c423533 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 1 Feb 2019 08:19:08 +0000 Subject: [PATCH 134/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index b7eb425..a6f7f32 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -24,7 +24,7 @@ Name: libsvm Version: 3.23 -Release: 4%{?dist} +Release: 5%{?dist} Summary: A Library for Support Vector Machines License: BSD @@ -246,6 +246,9 @@ desktop-file-install --delete-original \ %{_datadir}/applications/*%{name}-svm-toy-qt.desktop %changelog +* Fri Feb 01 2019 Fedora Release Engineering - 3.23-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Tue Jan 15 2019 Miro Hrončok - 3.23-4 - Remove Python 2 subpackage (#1655696) From c86f450f1e06c439197682ac485e7b3058c4cace Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jul 2019 14:29:14 +0000 Subject: [PATCH 135/136] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index a6f7f32..f9f8ade 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -24,7 +24,7 @@ Name: libsvm Version: 3.23 -Release: 5%{?dist} +Release: 6%{?dist} Summary: A Library for Support Vector Machines License: BSD @@ -246,6 +246,9 @@ desktop-file-install --delete-original \ %{_datadir}/applications/*%{name}-svm-toy-qt.desktop %changelog +* Thu Jul 25 2019 Fedora Release Engineering - 3.23-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Fri Feb 01 2019 Fedora Release Engineering - 3.23-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From a1b138383ccb1bbc4268a85ae03c56dcff2a7ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 19 Aug 2019 10:18:46 +0200 Subject: [PATCH 136/136] Rebuilt for Python 3.8 --- libsvm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsvm.spec b/libsvm.spec index f9f8ade..b339b71 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -24,7 +24,7 @@ Name: libsvm Version: 3.23 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A Library for Support Vector Machines License: BSD @@ -246,6 +246,9 @@ desktop-file-install --delete-original \ %{_datadir}/applications/*%{name}-svm-toy-qt.desktop %changelog +* Mon Aug 19 2019 Miro Hrončok - 3.23-7 +- Rebuilt for Python 3.8 + * Thu Jul 25 2019 Fedora Release Engineering - 3.23-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild