Fixed Bug 521194

epel8
Ding-Yi Chen 16 years ago
parent fb5d7698ea
commit 9ef4f9ec97

@ -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

@ -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 @@
-<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.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 <stdio.h>
#include <ctype.h>
@ -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')

@ -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 <dchen@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@lists.fedoraproject.org> - 2.89-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

Loading…
Cancel
Save