#9 gdal-java: modernize a bit
Closed 5 years ago by praiskup. Opened 5 years ago by praiskup.
rpms/ praiskup/gdal java-packaging  into  master

file removed
-6
@@ -1,6 +0,0 @@ 

- <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

-   <modelVersion>4.0.0</modelVersion>

-   <groupId>org.gdal</groupId>

-   <artifactId>gdal-java-bindings</artifactId>

-   <version></version>

- </project>

file modified
+12 -22
@@ -64,7 +64,7 @@ 

  

  Name:		gdal

  Version:	2.3.2

- Release:	5%{?dist}%{?bootstrap:.%{bootstrap}.bootstrap}

+ Release:	6%{?dist}%{?bootstrap:.%{bootstrap}.bootstrap}

  Summary:	GIS file format library

  License:	MIT

  URL:		http://www.gdal.org
@@ -73,7 +73,6 @@ 

  

  Source0:	%{name}-%{version}-fedora.tar.xz

  Source1:	http://download.osgeo.org/%{name}/%{testversion}/%{name}autotest-%{testversion}.tar.gz

- Source2:	%{name}.pom

  

  # Cleaner script for the tarball

  Source3:	%{name}-cleaner.sh
@@ -122,7 +121,7 @@ 

  BuildRequires:	java-devel >= 1:1.6.0

  BuildRequires:	jasper-devel

  BuildRequires:	jpackage-utils

- # add_maven_depmap macro moved into this package in F27, it seems like

+ # For 'mvn_artifact' and 'mvn_install'

  BuildRequires:	javapackages-local

  BuildRequires:	json-c-devel

  BuildRequires:	libgeotiff-devel
@@ -515,9 +514,11 @@ 

  # Make Java module and documentation

  pushd swig/java

    make

-   ./make_doc.sh

+   ant maven

  popd

  

+ %mvn_artifact swig/java/build/maven/gdal-%version.pom swig/java/build/maven/gdal-%version.jar

+ 

  # Make Python modules

  pushd swig/python

    %{?with_python2:%py2_build}
@@ -601,21 +602,8 @@ 

  find %{buildroot}%{perl_vendorarch} -name "*.so" -exec chmod 755 '{}' \;

  find %{buildroot}%{perl_vendorarch} -name "*.pm" -exec chmod 644 '{}' \;

  

- #TODO: JAR files that require JNI shared objects MUST be installed in %%{_libdir}/%%{name}. The JNI shared objects themselves must also be installed in %%{_libdir}/%%{name}.

- #Java programs that wish to make calls into native libraries do so via the Java Native Interface (JNI). A Java package uses JNI if it contains a .so

- #If the JNI-using code calls System.loadLibrary you'll have to patch it to use System.load, passing it the full path to the dynamic shared object. If the package installs a wrapper script you'll need to manually add %%{_libdir}/%%{name}/<jar filename> to CLASSPATH. If you are depending on a JNI-using JAR file, you'll need to add it manually -- build-classpath will not find it.

- touch -r NEWS swig/java/gdal.jar

- mkdir -p %{buildroot}%{_javadir}

- cp -p swig/java/gdal.jar  \

-     %{buildroot}%{_javadir}/%{name}.jar

- 

- # Install Maven pom and update version number

- install -dm 755 %{buildroot}%{_mavenpomdir}

- install -pm 644 %{SOURCE2} %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom

- sed -i 's|<version></version>|<version>%{version}</version>|' %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom

- 

- # Create depmap fragment

- %add_maven_depmap JPP-%{name}.pom %{name}.jar

+ # install Java plugin

+ %mvn_install -J swig/java/java

  

  # 775 on the .so?

  # copy JNI libraries and links, non versioned link needed by JNI
@@ -834,10 +822,9 @@ 

  # Can I even have a separate Java package anymore?

  %files java -f .mfiles

  %doc swig/java/apps

- %{_jnidir}/%{name}/

+ %{_jnidir}/%{name}/libgdalalljni.so*

  

- %files javadoc

- %{_javadocdir}/%{name}

+ %files javadoc -f .mfiles-javadoc

  

  %files perl

  %doc swig/perl/README
@@ -896,6 +883,9 @@ 

  #Or as before, using ldconfig

  

  %changelog

+ * Mon Feb 04 2019 Pavel Raiskup <praiskup@redhat.com> - 2.3.2-6

+ - modernize java packaging (PR#9)

+ 

  * Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.2-5

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

  

%add_maven_depmap got deprecated long time ago, and RPM keeps
warning about that.
According to guidelines, we should ship pom file that is provided
by the package. There's pom.xml, which is substitued by
'ant maven' command ( https://github.com/OSGeo/gdal/pull/879).

It's 6 months and no response, I'm going to merge (with slight update regarding version expansion).

rebased onto 40142de

5 years ago

Pull-Request has been closed by praiskup

5 years ago