From e15721acd357a56ed76e9d3b1438d9351d4cdfa5 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Tue, 5 Feb 2019 08:52:01 +0100 Subject: [PATCH] gdal-java: modernize a bit %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 substituted by 'ant maven' command (https://github.com/OSGeo/gdal/pull/879). Version: 2.3.2-6 --- gdal.pom | 6 ------ gdal.spec | 32 +++++++++++--------------------- 2 files changed, 11 insertions(+), 27 deletions(-) delete mode 100644 gdal.pom diff --git a/gdal.pom b/gdal.pom deleted file mode 100644 index 95bf86f..0000000 --- a/gdal.pom +++ /dev/null @@ -1,6 +0,0 @@ - - 4.0.0 - org.gdal - gdal-java-bindings - - diff --git a/gdal.spec b/gdal.spec index 06b265c..05113e0 100644 --- a/gdal.spec +++ b/gdal.spec @@ -73,7 +73,6 @@ URL: http://www.gdal.org 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: hdf5-devel 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 @@ popd # 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 @@ rm %buildroot%_mandir/man1/{pct2rgb,rgb2pct}.1 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}/ 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}|' %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom - -# Create depmap fragment -%add_artifact 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 @@ popd # 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 @@ popd #Or as before, using ldconfig %changelog +* Mon Feb 04 2019 Pavel Raiskup - 2.3.2-6 +- modernize java packaging (PR#9) + * Mon Feb 04 2019 Devrim Gündüz - 2.3.2-6 - Rebuild for new GeOS and Proj