[native-platform] Fix artifact installation for non-x86 architechures

Mikolaj Izdebski mizdebsk at fedoraproject.org
Tue Oct 21 11:13:53 UTC 2014


commit 4ae670c1d99584b0fe0fa58ebd27f7d18f3b06dc
Author: Mikolaj Izdebski <mizdebsk at redhat.com>
Date:   Tue Oct 21 12:33:46 2014 +0200

    Fix artifact installation for non-x86 architechures

 native-platform-0.10.pom             |   37 +-----------------------------
 native-platform-linux-amd64-0.10.pom |    8 ------
 native-platform-linux-i386-0.10.pom  |    8 ------
 native-platform.spec                 |   42 ++++++++-------------------------
 4 files changed, 11 insertions(+), 84 deletions(-)
---
diff --git a/native-platform-0.10.pom b/native-platform-0.10.pom
index 19a0d40..751d00b 100644
--- a/native-platform-0.10.pom
+++ b/native-platform-0.10.pom
@@ -7,42 +7,7 @@
   <dependencies>
     <dependency>
       <groupId>net.rubygrapefruit</groupId>
-      <artifactId>native-platform-osx-i386</artifactId>
-      <version>0.10</version>
-    </dependency>
-    <dependency>
-      <groupId>net.rubygrapefruit</groupId>
-      <artifactId>native-platform-osx-amd64</artifactId>
-      <version>0.10</version>
-    </dependency>
-    <dependency>
-      <groupId>net.rubygrapefruit</groupId>
-      <artifactId>native-platform-linux-amd64</artifactId>
-      <version>0.10</version>
-    </dependency>
-    <dependency>
-      <groupId>net.rubygrapefruit</groupId>
-      <artifactId>native-platform-linux-i386</artifactId>
-      <version>0.10</version>
-    </dependency>
-    <dependency>
-      <groupId>net.rubygrapefruit</groupId>
-      <artifactId>native-platform-windows-amd64</artifactId>
-      <version>0.10</version>
-    </dependency>
-    <dependency>
-      <groupId>net.rubygrapefruit</groupId>
-      <artifactId>native-platform-windows-i386</artifactId>
-      <version>0.10</version>
-    </dependency>
-    <dependency>
-      <groupId>net.rubygrapefruit</groupId>
-      <artifactId>native-platform-freebsd-i386</artifactId>
-      <version>0.10</version>
-    </dependency>
-    <dependency>
-      <groupId>net.rubygrapefruit</groupId>
-      <artifactId>native-platform-freebsd-amd64</artifactId>
+      <artifactId>native-platform-linux</artifactId>
       <version>0.10</version>
     </dependency>
   </dependencies>
diff --git a/native-platform.spec b/native-platform.spec
index f8e2368..8e89ae5 100644
--- a/native-platform.spec
+++ b/native-platform.spec
@@ -1,9 +1,5 @@
-%global bits 32
 %global debug_package %{nil}
 
-%ifarch x86_64 ppc64 s390x sparc64
-%global bits 64
-%endif
 %global namedreltag %{nil}
 %global namedversion %{version}%{?namedreltag}
 
@@ -15,8 +11,6 @@ License:       ASL 2.0
 URL:           https://github.com/adammurdoch/native-platform
 Source0:       https://github.com/adammurdoch/native-platform/archive/%{namedversion}.tar.gz
 Source1:       http://repo.gradle.org/gradle/libs-releases-local/net/rubygrapefruit/%{name}/%{namedversion}/%{name}-%{namedversion}.pom
-Source2:       http://repo.gradle.org/gradle/libs-releases-local/net/rubygrapefruit/%{name}-linux-i386/%{namedversion}/%{name}-linux-i386-%{namedversion}.pom
-Source3:       http://repo.gradle.org/gradle/libs-releases-local/net/rubygrapefruit/%{name}-linux-amd64/%{namedversion}/%{name}-linux-amd64-%{namedversion}.pom
 # From Debian
 Source4:       %{name}-0.7-Makefile
 # Try to load native library first from /usr/lib*/native-platform
@@ -31,6 +25,7 @@ BuildRequires: java-devel
 BuildRequires: javapackages-local
 BuildRequires: ncurses-devel
 BuildRequires: jopt-simple
+BuildRequires: bsh
 
 %description
 A collection of cross-platform Java APIs
@@ -57,17 +52,6 @@ find .  -name "*.class" -delete
 
 cp -p %{SOURCE1} pom.xml
 cp -p %{SOURCE4} Makefile
-%pom_remove_dep net.rubygrapefruit:%{name}-osx-i386 pom.xml
-%pom_remove_dep net.rubygrapefruit:%{name}-osx-amd64 pom.xml
-%pom_remove_dep net.rubygrapefruit:%{name}-windows-i386 pom.xml
-%pom_remove_dep net.rubygrapefruit:%{name}-windows-amd64 pom.xml
-%pom_remove_dep net.rubygrapefruit:%{name}-freebsd-i386 pom.xml
-%pom_remove_dep net.rubygrapefruit:%{name}-freebsd-amd64 pom.xml
-%if %{bits} == 64
-%pom_remove_dep net.rubygrapefruit:%{name}-linux-i386 pom.xml
-%else
-%pom_remove_dep net.rubygrapefruit:%{name}-linux-amd64 pom.xml
-%endif
 
 chmod 644 readme.md
 sed -i 's/\r//' readme.md
@@ -80,31 +64,24 @@ sed -i.javadoc8 "s|.PHONY: clean jar javadoc|.PHONY: clean jar|" Makefile
 sed -i.javadoc8 "s|jar javadoc arch-jar|jar arch-jar|" Makefile
 
 %build
-
-%if %{bits} == 64
-%mvn_file net.rubygrapefruit:%{name}-linux-amd64 %{name}-linux
-%mvn_artifact %{SOURCE3} build/%{name}-linux.jar
-%else
-%mvn_file net.rubygrapefruit:%{name}-linux-i386 %{name}-linux
-%mvn_artifact %{SOURCE2} build/%{name}-linux.jar
-%endif
-%mvn_file net.rubygrapefruit:%{name} %{name}
-%mvn_artifact pom.xml build/%{name}.jar
-
 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ;
 CPPFLAGS="${CPPFLAGS:-%optflags}" ; export CPPFLAGS ;
 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ;
 LDFLAGS="${LDFLAGS:-%__global_ldflags}"; export LDFLAGS;
 make %{?_smp_mflags} build javadoc JAVA_HOME=%{_jvmdir}/java
 
+%mvn_artifact pom.xml build/%{name}.jar
+%mvn_file net.rubygrapefruit:%{name} %{name}
+
+arch=$(echo 'print(System.getProperty("os.arch"));' | java -cp $(build-classpath bsh) bsh.Interpreter /dev/stdin)
+%mvn_file net.rubygrapefruit:%{name}-linux-amd64 %{name}-linux
+%mvn_artifact net.rubygrapefruit:%{name}-linux:%{version} build/%{name}-linux.jar
+%mvn_alias :%{name}-linux :%{name}-linux-$arch
+
 %install
 %mvn_install -J build/docs/javadoc
-mkdir -p %{buildroot}%{_libdir}/%{name}
-install -pm 0755 build/binaries/libnative-platform-curses.so %{buildroot}%{_libdir}/%{name}
-install -pm 0755 build/binaries/libnative-platform.so %{buildroot}%{_libdir}/%{name}
 
 %files -f .mfiles
-%{_libdir}/%{name}
 %doc readme.md LICENSE
 
 %files javadoc -f .mfiles-javadoc
@@ -114,6 +91,7 @@ install -pm 0755 build/binaries/libnative-platform.so %{buildroot}%{_libdir}/%{n
 * Tue Oct 21 2014 Mikolaj Izdebski <mizdebsk at redhat.com> - 0.10-1
 - Fix build
 - Re-enable javadoc package
+- Fix artifact installation for non-x86 architechures
 
 * Fri Oct 17 2014 gil cattaneo <puntogil at libero.it> 0.10-1
 - update to 0.10


More information about the scm-commits mailing list