From f36f7e407d50c08cdf99105e38e68466d7e6d479 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Aug 19 2022 02:44:40 +0000 Subject: Version 3.3. Convert License tag to SPDX. --- diff --git a/libsvm-3.24.pom b/libsvm-3.24.pom deleted file mode 100644 index 014b764..0000000 --- a/libsvm-3.24.pom +++ /dev/null @@ -1,186 +0,0 @@ - - - 4.0.0 - - - org.sonatype.oss - oss-parent - 9 - - - tw.edu.ntu.csie - libsvm - 3.24 - - libsvm - LIBSVM - A Library for Support Vector Machines - https://github.com/cjlin1/libsvm - - 2014 - - - - BSD 3-Clause License - http://www.csie.ntu.edu.tw/~cjlin/libsvm/COPYRIGHT - - - - - scm:git:git@github.com:cjlin1/libsvm.git - scm:git:git@github.com:cjlin1/libsvm.git - https://github.com/cjlin1/libsvm - - - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - - - 8 - 1.3 - 3.0.0 - 3.8.0 - 3.0.1 - 3.0.1 - 1.6.8 - 1.6 - 91EA7956A2DAD9CE - - - - - - org.codehaus.mojo - exec-maven-plugin - ${maven.exec.plugin.version} - - - m4 - generate-sources - - exec - - - - - m4 - - java/libsvm/svm.m4 - - target/generated-sources/libsvm/svm.java - ${project.basedir} - - - - - org.codehaus.mojo - build-helper-maven-plugin - ${build.helper.plugin.version} - - - add-source - generate-sources - - add-source - - - - ${project.basedir}/java/libsvm - ${project.basedir}/target/generated-sources/libsvm - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-plugin-version} - - ${java.version} - ${java.version} - true - UTF-8 - - - - - org.apache.maven.plugins - maven-javadoc-plugin - ${javadoc.plugin.version} - - - attach-javadocs - - jar - - - -Xdoclint:none - - - - - - org.apache.maven.plugins - maven-source-plugin - ${source.plugin.version} - - - attach-sources - package - - jar-no-fork - test-jar-no-fork - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - ${nexus.staging.plugin.version} - true - - ossrh - https://oss.sonatype.org/ - false - - - - - - - - release-sign-artifacts - - - performRelease - true - - - - - - org.apache.maven.plugins - maven-gpg-plugin - ${gpg.plugin.version} - - - sign-artifacts - verify - - sign - - - - - - - - - \ No newline at end of file diff --git a/libsvm-3.25.pom b/libsvm-3.25.pom new file mode 100644 index 0000000..62cead6 --- /dev/null +++ b/libsvm-3.25.pom @@ -0,0 +1,207 @@ + + + 4.0.0 + + + org.sonatype.oss + oss-parent + 9 + + + tw.edu.ntu.csie + libsvm + 3.25 + + libsvm + LIBSVM - A Library for Support Vector Machines + https://github.com/cjlin1/libsvm + + 2014 + + + + BSD 3-Clause License + http://www.csie.ntu.edu.tw/~cjlin/libsvm/COPYRIGHT + + + + + scm:git:git@github.com:cjlin1/libsvm.git + scm:git:git@github.com:cjlin1/libsvm.git + https://github.com/cjlin1/libsvm + + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + + + 8 + 3.0.0 + 3.0.0 + 3.8.0 + 3.2.0 + 3.2.1 + 1.6.8 + 1.6 + 91EA7956A2DAD9CE + + + + + + org.codehaus.mojo + exec-maven-plugin + ${maven.exec.plugin.version} + + + m4 + generate-sources + + exec + + + + + m4 + + java/libsvm/svm.m4 + + target/generated-sources/libsvm/svm.java + ${project.basedir} + + + + + org.codehaus.mojo + build-helper-maven-plugin + ${build.helper.plugin.version} + + + add-source + generate-sources + + add-source + + + + ${project.basedir}/java/libsvm + ${project.basedir}/target/generated-sources/libsvm + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-plugin-version} + + ${java.version} + ${java.version} + true + UTF-8 + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${javadoc.plugin.version} + + + + + foo + bar + + + + http://docs.oracle.com/javase/8/docs/api/ + + ${java.home}/bin/javadoc + utf-8 + public + false + true + true + + true + false + none + -html5 + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + ${source.plugin.version} + + + attach-sources + package + + jar-no-fork + test-jar-no-fork + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.staging.plugin.version} + true + + ossrh + https://oss.sonatype.org/ + false + + + + + + + + release-sign-artifacts + + + performRelease + true + + + + + + org.apache.maven.plugins + maven-gpg-plugin + ${gpg.plugin.version} + + + sign-artifacts + verify + + sign + + + + + + + + + \ No newline at end of file diff --git a/libsvm.matlab.patch b/libsvm.matlab.patch new file mode 100644 index 0000000..1fa4050 --- /dev/null +++ b/libsvm.matlab.patch @@ -0,0 +1,22 @@ +Fixes this GCC warning: + +libsvmread.c: In function 'mexFunction': +libsvmread.c:202:21: warning: the comparison will always evaluate as 'false' for the address of 'filename' will never be NULL [-Waddress] + 202 | if(filename == NULL) + | ^~ +libsvmread.c:191:14: note: 'filename' declared here + 191 | char filename[256]; + | ^~~~~~~~ + +diff -up matlab/libsvmread.c.orig matlab/libsvmread.c +--- matlab/libsvmread.c.orig 2022-08-10 08:06:25.000000000 -0600 ++++ matlab/libsvmread.c 2022-08-12 09:17:03.079895620 -0600 +@@ -199,7 +199,7 @@ void mexFunction( int nlhs, mxArray *plh + + mxGetString(prhs[0], filename, mxGetN(prhs[0]) + 1); + +- if(filename == NULL) ++ if(filename[0] == '\0') + { + mexPrintf("Error: filename is NULL\n"); + return; diff --git a/libsvm.packageMain.patch b/libsvm.packageMain.patch index f594c5b..7bfe158 100644 --- a/libsvm.packageMain.patch +++ b/libsvm.packageMain.patch @@ -1,25 +1,24 @@ -diff -up ./Makefile.packageMain ./Makefile ---- ./Makefile.packageMain 2013-03-31 17:06:44.000000000 +1000 -+++ ./Makefile 2013-04-13 22:59:43.796601417 +1000 -@@ -1,11 +1,45 @@ +diff -up Makefile.orig Makefile +--- Makefile.orig 2022-08-10 08:06:19.000000000 -0600 ++++ Makefile 2022-08-12 08:32:32.832261639 -0600 +@@ -1,11 +1,44 @@ CXX ?= g++ -CFLAGS = -Wall -Wconversion -O3 -fPIC +CFLAGS = ${RPM_CFLAGS} -Wconversion -fPIC - SHVER = 2 + SHVER = 3 +export SHVER OS = $(shell uname) -+MAKE = make -+DOT_LIBS=. -+LIBS= -L${DOT_LIBS} -lsvm ++DOT_LIBS = . ++LIBS = -L${DOT_LIBS} -lsvm +export LIBSVM_VER -+IS_64:=$(shell /bin/uname -i | awk '/64/ {print 64}') -+PREFIXDIR?= /usr ++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} ++LIBDIR ?= ${PREFIXDIR}/lib${IS_64} +export LIBDIR - + -lib: svm.o +DATADIR?=${PREFIXDIR}/share +export DATADIR @@ -50,9 +49,9 @@ diff -up ./Makefile.packageMain ./Makefile if [ "$(OS)" = "Darwin" ]; then \ SHARED_LIB_FLAG="-dynamiclib -Wl,-install_name,libsvm.so.$(SHVER)"; \ else \ -@@ -14,12 +48,46 @@ lib: svm.o +@@ -14,12 +47,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 diff --git a/libsvm.spec b/libsvm.spec index b042533..5b8eafa 100644 --- a/libsvm.spec +++ b/libsvm.spec @@ -1,21 +1,22 @@ -%define shver 2 +%global shver 3 +%global tarballver 3.3 %global libdir_libsvm %{_libdir}/libsvm %global python3_libsvm_dir %{python3_sitearch}/libsvm %global maven_group_id tw.edu.ntu.csie -%global pom_file_version 3.24 +%global pom_file_version 3.25 %global pom_file_name JPP.%{maven_group_id}-%{name}.pom %global octpkg %{name} -%global release_date 2021-04-14 +%global release_date 2022-08-11 %global cpp_std c++17 Name: libsvm -Version: 3.25 -Release: 8%{?dist} +Version: 3.30 +Release: 1%{?dist} Summary: A Library for Support Vector Machines -License: BSD +License: BSD-3-Clause URL: https://www.csie.ntu.edu.tw/~cjlin/libsvm/ -Source0: https://www.csie.ntu.edu.tw/~cjlin/libsvm/%{name}-%{version}.tar.gz +Source0: https://www.csie.ntu.edu.tw/~cjlin/libsvm/%{name}-%{tarballver}.tar.gz Source1: https://www.csie.ntu.edu.tw/~cjlin/libsvm/log Source2: https://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf Source3: libsvm-svm-toy-qt.desktop @@ -30,6 +31,8 @@ Patch0: %{name}.packageMain.patch Patch2: %{name}.javaDir.patch Patch4: %{name}.toolsDir.patch Patch5: %{name}.svm-toy-qt5.patch +# Fix a broken attempt to detect an empty string +Patch6: %{name}.matlab.patch # This can be removed when F40 reaches EOL %ifnarch %{java_arches} @@ -113,32 +116,19 @@ svm-toy is a libsvm demonstration program which has a qt-GUI to display the derived separating hyperplane. %prep -%autosetup -p0 +%autosetup -p0 -n %{name}-%{tarballver} cp -p %{SOURCE1} ChangeLog cp -p %{SOURCE2} %{SOURCE3} . cp -p %{SOURCE4} %{name}-svm-toy-qt-48.png -# Fix the error: narrowing conversion -sed -e "s|{x,y,v}|{x,y,(signed char) v}|" \ - -e "s|{x,y,current_value}|{x,y,(signed char) current_value}|" \ - -e "s|(double)event->y()/YLEN, current_value|(double)event->y()/YLEN,(signed char) current_value|" \ - -i.narrowing svm-toy/qt/svm-toy.cpp - %ifarch %{java_arches} -# Update the POM file, which is stuck on version 3.24 -# pom_xpath_set does not work in rpm-4.11.1 -# as it generated something like -# -# -# 3.20 -# -# -# -# Also, the latest pom added parent tags for org.sonatype.oss.oss-parent, which -# is deprecated and slated for removal from Fedora. It isn't needed, so remove -# it. -sed 's/%{pom_file_version}/%{version}/;//,/<\/parent>/d' %{SOURCE5} \ - > %{name}.pom +cp -p %{SOURCE5} pom.xml + +# org.sonatype.oss.oss-parent is deprecated and slated for removal from Fedora +%pom_remove_parent + +# Update the POM file, which is stuck on version 3.25 +%pom_xpath_set '/pom:project/pom:version' %{version} %mvn_file %{maven_group_id}:%{name} %{maven_group_id}/%{name} %endif @@ -157,7 +147,7 @@ make all RPM_CFLAGS='%{build_cflags}' LIBDIR='%{_libdir}' CPP_STD='%{cpp_std}' %ifarch %{java_arches} # Build the Java interface -%mvn_artifact %{name}.pom java/%{name}.jar +%mvn_artifact pom.xml java/%{name}.jar make -C java all javadoc %endif @@ -246,7 +236,7 @@ cp -p README java/README-Java %{_bindir}/svm-train %dir %{_datadir}/%{name}/ %{_datadir}/%{name}/examples -%{_libdir}/%{name}.so.%{shver} +%{_libdir}/%{name}.so.3 %files devel %doc README @@ -278,6 +268,10 @@ cp -p README java/README-Java %{_datadir}/applications/*%{name}-svm-toy-qt.desktop %changelog +* Thu Aug 18 2022 Jerry James - 3.30-1 +- Version 3.3 +- Convert License tag to SPDX + * Thu Jul 21 2022 Fedora Release Engineering - 3.25-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild diff --git a/libsvm.svm-toy-qt5.patch b/libsvm.svm-toy-qt5.patch index 9d589c2..15ae15e 100644 --- a/libsvm.svm-toy-qt5.patch +++ b/libsvm.svm-toy-qt5.patch @@ -1,6 +1,6 @@ -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 +diff -up svm-toy/qt/Makefile.orig svm-toy/qt/Makefile +--- svm-toy/qt/Makefile.orig 2022-08-10 08:06:28.000000000 -0600 ++++ svm-toy/qt/Makefile 2022-08-12 08:37:20.299002661 -0600 @@ -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 @@ -13,16 +13,52 @@ diff -up ./svm-toy/qt/Makefile.svm-toy-qt5 ./svm-toy/qt/Makefile 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 -up svm-toy/qt/svm-toy.cpp.orig svm-toy/qt/svm-toy.cpp +--- svm-toy/qt/svm-toy.cpp.orig 2022-08-10 08:06:28.000000000 -0600 ++++ svm-toy/qt/svm-toy.cpp 2022-08-12 09:22:09.296679615 -0600 +@@ -326,12 +326,12 @@ private slots: + double x,y; + if(sscanf(buf,"%d%*d:%lf%*d:%lf",&v,&x,&y)==3) + { +- point p = {x,y,v}; ++ point p = {x,y,(signed char) v}; + point_list.push_back(p); + } + else if(sscanf(buf,"%lf%*d:%lf",&y,&x)==2) + { +- point p = {x,y,current_value}; ++ point p = {x,y,(signed char) current_value}; + point_list.push_back(p); + } + else +@@ -375,7 +375,7 @@ SvmToyWindow::SvmToyWindow() + SLOT(button_run_clicked())); + + // don't blank the window before repainting +- setAttribute(Qt::WA_NoBackground); ++ setAttribute(Qt::WA_OpaquePaintEvent); + + icon1 = QPixmap(4,4); + icon2 = QPixmap(4,4); +@@ -413,7 +413,7 @@ SvmToyWindow::~SvmToyWindow() + + void SvmToyWindow::mousePressEvent( QMouseEvent* event ) + { +- point p = {(double)event->x()/XLEN, (double)event->y()/YLEN, current_value}; ++ point p = {(double)event->x()/XLEN, (double)event->y()/YLEN,(signed char) current_value}; + point_list.push_back(p); + draw_point(p); + } diff --git a/log b/log index 2562bfc..1cb196f 100644 --- a/log +++ b/log @@ -319,3 +319,7 @@ i subroutines to get SVs python directory reorganized python sources now in the directory python/libsvm Not adding -std=c99 to CFLAGS in generating mex (this causes MinGW to fail) + +3.3: 2022/8/11 + One-class probabilistic outputs introduced + Use numpy Use numpy stuff directly instead of mirrored ones in scipy \ No newline at end of file diff --git a/sources b/sources index 92e8419..8b9389b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (guide.pdf) = 5e97a7b76ad4217d7987c5c07f0420e780b61b82fb88fe0e6015681fabb5078980b280cec4a0a7208ea225b9fa84de878295039f4513df26f0d404a21812e44c -SHA512 (libsvm-3.25.tar.gz) = 91afbcfd204f5fc9c367df446550cecaf01d5e34770fa10fc6bb02277d79b756393f7d057290df0f72fc941faaf0f4c84a863a3bf9d8628eeff1f99b6bc57a98 +SHA512 (libsvm-3.3.tar.gz) = 705cdebffce0d9ea053cf51b2bfd46303d306b7a2c34ee46065f19e1227459fbdbe6fde6e4769935a0c225da831ec137fb9c0c28fbc2efa06724a94bdd76500d