rpms/libsvm/F-7 libsvm-2.84-2.patch, NONE, 1.1 libsvm.spec, NONE, 1.1 sources, 1.1, 1.2

Ding-Yi Chen (dchen) fedora-extras-commits at redhat.com
Wed Aug 29 23:37:43 UTC 2007


Author: dchen

Update of /cvs/pkgs/rpms/libsvm/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5041

Modified Files:
	sources 
Added Files:
	libsvm-2.84-2.patch libsvm.spec 
Log Message:
cp libsvm* and source from devel


libsvm-2.84-2.patch:

--- NEW FILE libsvm-2.84-2.patch ---
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 @@
 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-27 11:11:38.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> /tmp/python.ver ; cat /tmp/python.ver | awk 'BEGIN {FS= "[ .]"} {printf("%s.%s",$$2,$$3)}'; rm -f /tmp/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 @@ 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-28 11:48:03.000000000 +1000
+++ ./tools/grid.py	2007-08-28 11:58:22.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-28 11:47:53.000000000 +1000
+++ ./tools/easy.py	2007-08-28 12:13:58.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 -up ./tools/subset.py.orig ./tools/subset.py


--- NEW FILE libsvm.spec ---
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 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 
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 <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



Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/libsvm/F-7/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	29 Aug 2007 01:27:43 -0000	1.1
+++ sources	29 Aug 2007 23:37:11 -0000	1.2
@@ -0,0 +1 @@
+a7bd21b21510e9634950715c2b4a4ce9  libsvm-2.84.tar.gz




More information about the fedora-extras-commits mailing list