#18 Restore java package generation
Merged 2 years ago by smani. Opened 2 years ago by gforeau.
rpms/ gforeau/gdal epel8  into  epel8

file modified
+4 -22
@@ -75,6 +75,7 @@ 

  BuildRequires: gcc

  BuildRequires: gcc-c++

  BuildRequires: libtool

+ BuildRequires: make

  BuildRequires: automake

  BuildRequires: autoconf

  BuildRequires: ant
@@ -97,17 +98,15 @@ 

  BuildRequires: hdf-devel

  BuildRequires: hdf-static

  BuildRequires: hdf5-devel

- # No complete java yet in EL8

  %if 0%{?rhel} < 8

  BuildRequires: java-devel >= 1:1.6.0

+ %else

+ BuildRequires: java-1.8.0-openjdk-devel

  %endif

  BuildRequires: jasper-devel

  BuildRequires: jpackage-utils

- # No complete java yet in EL8

- %if 0%{?rhel} < 8

- # For 'mvn_artifact' and 'mvn_install'

+ # For 'mvn_artifact'

  BuildRequires: javapackages-local

- %endif

  BuildRequires: json-c-devel

  BuildRequires: libgeotiff-devel

  # No libgta in EL5
@@ -210,8 +209,6 @@ 

  This package contains the GDAL file format library.

  

  

- # No complete java yet in EL8

- %if 0%{?rhel} < 8

  %package java

  Summary:        Java modules for the GDAL file format library

  Requires:       jpackage-utils
@@ -228,7 +225,6 @@ 

  

  %description javadoc

  This package contains the API documentation for %{name}.

- %endif

  

  

  %package perl
@@ -351,9 +347,7 @@ 

  	--with-hdf4                 \

  	--with-hdf5                 \

  	--with-jasper               \

- %if 0%{?rhel} < 8

  	--with-java                 \

- %endif

  	--with-jpeg                 \

  	--with-libjson-c            \

  	--without-jpeg12            \
@@ -388,15 +382,12 @@ 

  make -C ogr/ogrsf_frmts/s57 all

  make -C frmts/iso8211 all

  

- # No complete java yet in EL8

- %if 0%{?rhel} < 8

  # Make Java module and documentation

  pushd swig/java

    make

    ant maven

  popd

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

- %endif

  

  # Make Python modules

  pushd swig/python
@@ -461,8 +452,6 @@ 

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

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

  

- # No complete java yet in EL8

- %if 0%{?rhel} < 8

  # install Java plugin

  %mvn_install -J swig/java/java

  
@@ -477,7 +466,6 @@ 

  # Install Java API documentation in the designated place

  mkdir -p %{buildroot}%{_javadocdir}/%{name}

  cp -pr swig/java/java/org %{buildroot}%{_javadocdir}/%{name}

- %endif

  

  # Install refmans

  for docdir in %{docdirs}; do
@@ -553,8 +541,6 @@ 

  rm %{buildroot}%{_datadir}/%{name}/LICENSE.TXT

  

  

- # No complete java yet in EL8

- %if 0%{?rhel} < 8

  %check

  %if %{run_tests}

  for i in -I/usr/lib/jvm/java/include{,/linux}; do
@@ -584,7 +570,6 @@ 

  	# Run tests but force normal exit in the end

  	./run_all.py || true

  popd

- %endif

  #%%{run_tests}

  

  
@@ -645,15 +630,12 @@ 

  %{_libdir}/*.so

  %{_libdir}/pkgconfig/%{name}.pc

  

- # No complete java yet in EL8

- %if 0%{?rhel} < 8

  # Can I even have a separate Java package anymore?

  %files java -f .mfiles

  %doc swig/java/apps

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

  

  %files javadoc -f .mfiles-javadoc

- %endif

  

  %files perl

  %doc swig/perl/README

The aim is to start building gdal-java RPMs again (removed in 1118824 at the time the move to EPEL8 occured). The tools are available and provided by RedHat but hidden due to poor modularisation.
Compiled, installed, and ran with a GeoServer on a CentOS 8 container.

Installing javapackages-local requires to set module_hotfixes=true on the repository that hosts the javapackages-tools module (ex with CentOS 8: dnf install -y --setopt=powertools.module_hotfixes=true 'javapackages-local').
I added make as a build requirement as it did not seem to be installed by any of the other dependencies when I tried to compile.

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

Pull-Request has been merged by smani

2 years ago
Metadata