rpms/libsvm/EL-5 Makefile, NONE, 1.1 import.log, NONE, 1.1 libsvm-2.89.patch, NONE, 1.1 libsvm-svm-toy-gtk.desktop, NONE, 1.1 libsvm-svm-toy-qt.desktop, NONE, 1.1 libsvm.spec, NONE, 1.1 log, NONE, 1.1 sources, NONE, 1.1

Ding-Yi Chen dchen at fedoraproject.org
Fri Sep 18 01:56:15 UTC 2009


Author: dchen

Update of /cvs/pkgs/rpms/libsvm/EL-5
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv17139/EL-5

Added Files:
	Makefile import.log libsvm-2.89.patch 
	libsvm-svm-toy-gtk.desktop libsvm-svm-toy-qt.desktop 
	libsvm.spec log sources 
Log Message:
Fixed [Bug 524108]


***** Error reading new file: [Errno 2] No such file or directory: 'Makefile'

--- NEW FILE import.log ---
libsvm-2_89-4_fc11:EL-5:libsvm-2.89-4.fc11.src.rpm:1253237689

libsvm-2.89.patch:
 Makefile                  |   98 ++++++++++++++++++++++++++++++++++++++++++++--
 java/Makefile             |   27 +++++++++++-
 java/test_applet.html     |    4 +
 python/Makefile           |   23 +++++++++-
 svm-toy/gtk/Makefile      |   22 ++++++----
 svm-toy/gtk/callbacks.cpp |    1 
 svm-toy/qt/Makefile       |   20 +++++----
 tools/easy.py             |    9 ++--
 tools/grid.py             |    3 -
 9 files changed, 176 insertions(+), 31 deletions(-)

--- NEW FILE libsvm-2.89.patch ---
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 @@
-<APPLET code="svm_toy.class" archive="libsvm.jar" width=300 height=350></APPLET>
+<html>
+<applet code="svm_toy.class" archive="libsvm.jar" width=300 height=350></applet>
+</html>
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 <stdio.h>
 #include <ctype.h>
 #include <list>
+#include <cstdlib>
 #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"


--- NEW FILE libsvm-svm-toy-gtk.desktop ---
[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


--- NEW FILE libsvm-svm-toy-qt.desktop ---
[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


--- NEW FILE libsvm.spec ---
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 <dchen at redhat.com> - 2.89-4
- Fixed [Bug 524108] put libsvm.jar into _javadir
  + Move livsvm.jar to _javadir
  + Move test_applet.html to _datadir/doc/libsvm-<version>
- 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 <dchen at redhat.com> - 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 <rel-eng at lists.fedoraproject.org> - 2.89-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Fri Apr 03 2009 Ding-Yi Chen <dchen at redhat.com> - 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 <dchen at redhat.com> - 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 <dchen at redhat.com> - 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 <dchen at redhat.com> - 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 <dchen at redhat.com> - 2.86-12
- Correct changelog date

* Thu Apr 3 2008 Ding-Yi Chen <dchen at redhat.com> - 2.86-11
- Fix the Qt path problem

* Wed Apr 2 2008 Ding-Yi Chen <dchen at redhat.com> - 2.86-4
- Support both Qt3 for F8 and earlier, and Qt4 for F9

* Tue Apr 1 2008 Ding-Yi Chen <dchen at redhat.com> - 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 <dchen at redhat.com> - 2.85-6
- Fix build error.

* Mon Mar 10 2008 Ding-Yi Chen <dchen at redhat.com> - 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 <dchen at redhat.com> - 2.85-4
- Move gnuplot from BuildRequires to Requires

* Thu Feb 07 2008 Ding-Yi Chen <dchen at redhat.com> - 2.85-3
- Fix linker name (libsvm.so)
- Linked to dynamic libraries

* Tue Feb 05 2008 Ding-Yi Chen <dchen at redhat.com> - 2.85-2
- Fix svm-toy-qt build error

* Tue Feb 05 2008 Ding-Yi Chen <dchen at redhat.com> - 2.85-1
- Fix svm-toy-gtk build error

* Mon Feb 04 2008 Ding-Yi Chen <dchen at redhat.com> - 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 <dchen at redhat.com> - 2.84-9
- [Bug 254091] Comment 19
- Fix python/Makefile

* Thu Dec 13 2007 Ding-Yi Chen <dchen at redhat.com> - 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 <dchen at redhat.com> - 2.84-7
- [Bug 254091] Review Request: libsvm - A Library for Support Vector Machines (Comment #12) 

* Thu Sep 26 2007 Ding-Yi Chen <dchen at redhat.com> - 2.84-6
- Add defattr to each subpackage
- Move libsvm.so to libsvm

* Thu Sep 24 2007 Ding-Yi Chen <dchen at redhat.com> - 2.84-5
- Split out libsvm-java
- Add libsvm.so

* Thu Aug 30 2007 Ding-Yi Chen <dchen at redhat.com> - 2.84-4
- Refined description.
- Fix the /tmp/python.ver problem

* Mon Aug 27 2007 Ding-Yi Chen <dchen at redhat.com> - 2.84-3
- Fix dependency problem

* Mon Aug 27 2007 Ding-Yi Chen <dchen at redhat.com> - 2.84-2
- Fix mock error
- Support Python 2.4 and Python 2.5

* Mon Aug 27 2007 Ding-Yi Chen <dchen at redhat.com> - 2.84-1
- Fix rpmlint error
- Move python related files to libsvm-python

* Fri Aug 17 2007 Ding-Yi Chen <dchen at redhat.com> - 2.84-0
- initial packaging



--- NEW FILE log ---
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

--- NEW FILE sources ---
aae7a8f7e357e86e1c893b706bb02a63  guide.pdf
71975f20d37b30eb13a3ec8897f4f546  libsvm-2.89.tar.gz




More information about the fedora-extras-commits mailing list