|
|
@ -3,10 +3,12 @@
|
|
|
|
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
|
|
|
|
%{!?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 libdir_libsvm %{_libdir}/libsvm
|
|
|
|
%define libsvm_python_dir %{python_sitearch}/libsvm
|
|
|
|
%define libsvm_python_dir %{python_sitearch}/libsvm
|
|
|
|
|
|
|
|
%global maven_group_id tw.edu.ntu.csie
|
|
|
|
|
|
|
|
%global pom_file_version 3.17
|
|
|
|
|
|
|
|
|
|
|
|
Name: libsvm
|
|
|
|
Name: libsvm
|
|
|
|
Version: 3.18
|
|
|
|
Version: 3.20
|
|
|
|
Release: 6%{?dist}
|
|
|
|
Release: 1%{?dist}
|
|
|
|
Summary: A Library for Support Vector Machines
|
|
|
|
Summary: A Library for Support Vector Machines
|
|
|
|
|
|
|
|
|
|
|
|
Group: Development/Libraries
|
|
|
|
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
|
|
|
|
Source3: libsvm-svm-toy-gtk.desktop
|
|
|
|
Source4: libsvm-svm-toy-qt.desktop
|
|
|
|
Source4: libsvm-svm-toy-qt.desktop
|
|
|
|
Source5: LibSVM-svm-toy-48.png
|
|
|
|
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
|
|
|
|
Patch0: %{name}-%{version}.packageMain.patch
|
|
|
|
Patch1: %{name}-%{version}.pythonDir.patch
|
|
|
|
Patch1: %{name}-%{version}.pythonDir.patch
|
|
|
|
Patch2: %{name}-%{version}.javaDir.patch
|
|
|
|
Patch2: %{name}-%{version}.javaDir.patch
|
|
|
@ -26,6 +29,7 @@ Patch4: %{name}-%{version}.toolsDir.patch
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
|
|
|
BuildRequires: grep
|
|
|
|
BuildRequires: grep
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%global pom_file_name "JPP.%{maven_group_id}-%{name}.pom"
|
|
|
|
%if 0%{?rhel} != 0 && 0%{?rhel} <= 5
|
|
|
|
%if 0%{?rhel} != 0 && 0%{?rhel} <= 5
|
|
|
|
%define moc_path %{_libdir}/qt4/bin/moc
|
|
|
|
%define moc_path %{_libdir}/qt4/bin/moc
|
|
|
|
%define with_vendor "fedora"
|
|
|
|
%define with_vendor "fedora"
|
|
|
@ -131,6 +135,23 @@ cp %{SOURCE4} .
|
|
|
|
cp %{SOURCE5} %{name}-svm-toy-gtk-48.png
|
|
|
|
cp %{SOURCE5} %{name}-svm-toy-gtk-48.png
|
|
|
|
cp %{SOURCE5} %{name}-svm-toy-qt-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
|
|
|
|
|
|
|
|
# <version>
|
|
|
|
|
|
|
|
# <!-- begin of code added by maintainer -->
|
|
|
|
|
|
|
|
# 3.20
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
# <!-- end of code added by maintainer -->
|
|
|
|
|
|
|
|
# </version>
|
|
|
|
|
|
|
|
%{__sed} -e 's/%{pom_file_version}/%{version}/' %{SOURCE6} > %{name}.pom
|
|
|
|
|
|
|
|
%{__sed} -i 's|<url>http://www.csie.ntu.edu.tw/~cjlin/cgi-bin/libsvm.cgi?+http://www.csie.ntu.edu.tw/~cjlin/libsvm+tar.gz</url>|<url>https://github.com/cjlin1/libsvm</url>|' %{name}.pom
|
|
|
|
|
|
|
|
%{__sed} -i 's|<connection>http://www.csie.ntu.edu.tw/~cjlin/cgi-bin/libsvm.cgi?+http://www.csie.ntu.edu.tw/~cjlin/libsvm+tar.gz</connection>|<connection>scm:git:https://github.com/cjlin1/libsvm.git</connection>|' %{name}.pom
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
%build
|
|
|
|
%{__sed} -i 's/\r//' FAQ.html
|
|
|
|
%{__sed} -i 's/\r//' FAQ.html
|
|
|
|
%{__sed} -i 's/\r//' ChangeLog
|
|
|
|
%{__sed} -i 's/\r//' ChangeLog
|
|
|
@ -142,38 +163,54 @@ cp README svm-toy/gtk
|
|
|
|
cp README svm-toy/qt
|
|
|
|
cp README svm-toy/qt
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
%install
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
rm -rf %{buildroot}
|
|
|
|
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}"
|
|
|
|
make install DESTDIR=%{buildroot} LIBDIR=%{_libdir} PYTHON_VERSION="%{pyver}" LIBSVM_VER="%{version}" NO_JAVA="%{no_java}" JAVA_TARGET_DIR="%{buildroot}/%{_javadir}"
|
|
|
|
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/src
|
|
|
|
rm -rf %{buildroot}%{_datadir}/%{name}/src
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/48x48/apps/
|
|
|
|
mkdir -p %{buildroot}/%{_datadir}/icons/hicolor/48x48/apps/
|
|
|
|
cp %{name}-svm-toy-gtk-48.png $RPM_BUILD_ROOT/%{_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 $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/48x48/apps/
|
|
|
|
cp %{name}-svm-toy-qt-48.png %{buildroot}/%{_datadir}/icons/hicolor/48x48/apps/
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/applications
|
|
|
|
mkdir -p %{buildroot}/%{_datadir}/applications
|
|
|
|
cp %{name}-svm-toy-gtk.desktop $RPM_BUILD_ROOT/%{_datadir}/applications
|
|
|
|
cp %{name}-svm-toy-gtk.desktop %{buildroot}/%{_datadir}/applications
|
|
|
|
cp %{name}-svm-toy-qt.desktop $RPM_BUILD_ROOT/%{_datadir}/applications
|
|
|
|
cp %{name}-svm-toy-qt.desktop %{buildroot}/%{_datadir}/applications
|
|
|
|
|
|
|
|
|
|
|
|
%__ln_s %{name}.so.%{shver} $RPM_BUILD_ROOT/%{_libdir}/%{name}.so
|
|
|
|
%__ln_s %{name}.so.%{shver} %{buildroot}/%{_libdir}/%{name}.so
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# [Bug 521194] Python: 'import libsvm' doesn't work
|
|
|
|
# [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\
|
|
|
|
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"\
|
|
|
|
# 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}
|
|
|
|
%if 0%{?with_vendor:1}
|
|
|
|
desktop-file-install --delete-original --vendor=%{with_vendor} \
|
|
|
|
desktop-file-install --delete-original --vendor=%{with_vendor} \
|
|
|
|
--dir=${RPM_BUILD_ROOT}%{_datadir}/applications \
|
|
|
|
--dir=%{buildroot}%{_datadir}/applications \
|
|
|
|
${RPM_BUILD_ROOT}/%{_datadir}/applications/%{name}-svm-toy-gtk.desktop \
|
|
|
|
%{buildroot}/%{_datadir}/applications/%{name}-svm-toy-gtk.desktop \
|
|
|
|
${RPM_BUILD_ROOT}/%{_datadir}/applications/%{name}-svm-toy-qt.desktop
|
|
|
|
%{buildroot}/%{_datadir}/applications/%{name}-svm-toy-qt.desktop
|
|
|
|
%else
|
|
|
|
%else
|
|
|
|
desktop-file-install --delete-original \
|
|
|
|
desktop-file-install --delete-original \
|
|
|
|
--dir=${RPM_BUILD_ROOT}%{_datadir}/applications \
|
|
|
|
--dir=%{buildroot}%{_datadir}/applications \
|
|
|
|
${RPM_BUILD_ROOT}/%{_datadir}/applications/%{name}-svm-toy-gtk.desktop \
|
|
|
|
%{buildroot}/%{_datadir}/applications/%{name}-svm-toy-gtk.desktop \
|
|
|
|
${RPM_BUILD_ROOT}/%{_datadir}/applications/%{name}-svm-toy-qt.desktop
|
|
|
|
%{buildroot}/%{_datadir}/applications/%{name}-svm-toy-qt.desktop
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
# Fix Bug 646154 - libsvm-python's pth is not set correctly
|
|
|
|
# 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
|
|
|
|
%post -p /sbin/ldconfig
|
|
|
|
|
|
|
|
|
|
|
@ -194,7 +231,7 @@ fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%clean
|
|
|
|
%clean
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
rm -rf %{buildroot}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
%files
|
|
|
@ -221,11 +258,11 @@ rm -rf $RPM_BUILD_ROOT
|
|
|
|
%{python_sitearch}/libsvm.pth
|
|
|
|
%{python_sitearch}/libsvm.pth
|
|
|
|
|
|
|
|
|
|
|
|
%if "%{no_java}" == "FALSE"
|
|
|
|
%if "%{no_java}" == "FALSE"
|
|
|
|
%files java
|
|
|
|
%files java -f .mfiles
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%doc java/README-Java java/test_applet.html
|
|
|
|
%doc java/README-Java java/test_applet.html
|
|
|
|
%{_javadir}/%{name}.jar
|
|
|
|
%{_javadir}/%{name}.jar
|
|
|
|
#%{_datadir}/javadoc/%{name}-%{version}
|
|
|
|
%{_javadir}/%{maven_group_id}/%{name}-%{version}.jar
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
%files svm-toy-gtk
|
|
|
|
%files svm-toy-gtk
|
|
|
@ -244,6 +281,12 @@ rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
%changelog
|
|
|
|
|
|
|
|
* Tue Jan 20 2015 Ding-Yi Chen <dchen@redhat.com> - 3.20-1
|
|
|
|
|
|
|
|
- Upstream update to 3.20
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Fri Dec 19 2014 Jerry James <loganjerry@gmail.com> - 3.18-7
|
|
|
|
|
|
|
|
- Install maven POM and depmaps (bz 1175898)
|
|
|
|
|
|
|
|
|
|
|
|
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.18-6
|
|
|
|
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.18-6
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
|
|