[libsvm: 1/2] Fix for RHEL6

Ding-Yi Chen dchen at fedoraproject.org
Tue Jan 20 06:44:09 UTC 2015


commit c4a36f638bb59d40d4d217674b87d4bcc97b1843
Author: Ding-Yi Chen <dingyichen at gmail.com>
Date:   Tue Jan 20 16:44:07 2015 +1000

    Fix for RHEL6

 libsvm.spec |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/libsvm.spec b/libsvm.spec
index 01fc8f7..54c67fd 100644
--- a/libsvm.spec
+++ b/libsvm.spec
@@ -5,6 +5,7 @@
 %define libsvm_python_dir %{python_sitearch}/libsvm
 %global maven_group_id tw.edu.ntu.csie
 %global pom_file_version 3.17
+%global pom_file_name "JPP.%{maven_group_id}-%{name}.pom"
 
 Name:           libsvm
 Version:        3.20
@@ -29,7 +30,6 @@ Patch4:         %{name}-%{version}.toolsDir.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
 BuildRequires:  grep
 
-%global pom_file_name "JPP.%{maven_group_id}-%{name}.pom"
 %if 0%{?rhel} != 0 && 0%{?rhel} <= 5
 %define moc_path %{_libdir}/qt4/bin/moc
 %define with_vendor "fedora"
@@ -37,6 +37,14 @@ BuildRequires:  grep
 %define moc_path %{_bindir}/moc-qt4
 %endif
 
+# RHEL6 does not have add_maven_depmap
+%if 0%{?rhel} != 0 && 0%{?rhel} <=6
+%define no_add_maven_depmap TRUE
+%else
+%define no_add_maven_depmap FALSE
+%endif
+
+
 %ifnarch ppc ppc64
 %define no_java FALSE
 %if 0%{?rhel} <= 6
@@ -46,6 +54,7 @@ BuildRequires:  grep
 %endif
 %else
 %define no_java NO_JAVA
+%define no_add_maven_depmap no_add_maven_depmap
 Obsoletes: libsvm-java < 2.88-1
 %endif
 
@@ -135,7 +144,6 @@ cp %{SOURCE4} .
 cp %{SOURCE5} %{name}-svm-toy-gtk-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
@@ -149,7 +157,6 @@ cp %{SOURCE5} %{name}-svm-toy-qt-48.png
 %{__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
@@ -204,10 +211,13 @@ 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}
+%endif
+
+# RHEL6 does not support add_maven_depmap
+%if "%{no_add_maven_depmap}" == "FALSE"
 %add_maven_depmap %{pom_file_name} %{maven_group_id}/%{name}.jar
 %endif
 
@@ -281,6 +291,9 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Tue Jan 20 2015 Ding-Yi Chen <dchen at redhat.com> - 3.20-3
+- Fix for RHEL6
+
 * Tue Jan 20 2015 Ding-Yi Chen <dchen at redhat.com> - 3.20-2
 - Upstream update to 3.20
 


More information about the scm-commits mailing list