#42 Fix requires/provides for the non-system JDK case
Merged a month ago by jerboaa. Opened a month ago by jerboaa.
rpms/ jerboaa/java-11-openjdk master-rhbz1702324  into  master

file modified
+12 -4

@@ -253,17 +253,20 @@ 

  # main id and dir of this jdk

  %define uniquesuffix()        %{expand:%{fullversion}.%{_arch}%{?1}}

  

+ #################################################################

  # fix for https://bugzilla.redhat.com/show_bug.cgi?id=1111349

  #         https://bugzilla.redhat.com/show_bug.cgi?id=1590796#c14

  #         https://bugzilla.redhat.com/show_bug.cgi?id=1655938

- %if %is_system_jdk

  %global _privatelibs libsplashscreen[.]so.*|libawt_xawt[.]so.*|libjli[.]so.*|libattach[.]so.*|libawt[.]so.*|libextnet[.]so.*|libawt_headless[.]so.*|libdt_socket[.]so.*|libfontmanager[.]so.*|libinstrument[.]so.*|libj2gss[.]so.*|libj2pcsc[.]so.*|libj2pkcs11[.]so.*|libjaas[.]so.*|libjavajpeg[.]so.*|libjdwp[.]so.*|libjimage[.]so.*|libjsound[.]so.*|liblcms[.]so.*|libmanagement[.]so.*|libmanagement_agent[.]so.*|libmanagement_ext[.]so.*|libmlib_image[.]so.*|libnet[.]so.*|libnio[.]so.*|libprefs[.]so.*|librmi[.]so.*|libsaproc[.]so.*|libsctp[.]so.*|libsunec[.]so.*|libunpack[.]so.*|libzip[.]so.*

+ %global _publiclibs libjawt[.]so.*|libjava[.]so.*|libjvm[.]so.*|libverify[.]so.*|libjsig[.]so.*

+ %if %is_system_jdk

  %global __provides_exclude ^(%{_privatelibs})$

  %global __requires_exclude ^(%{_privatelibs})$

  %global __provides_exclude_from ^.*/%{uniquesuffix -- %{debug_suffix_unquoted}}/.*$

  %else

- %global __provides_exclude lib.*[.]so.*

- %global __requires_exclude lib.*[.]so.*

+ # Don't generate provides/requires for JDK provided shared libraries at all.

+ %global __provides_exclude ^(%{_privatelibs}|%{_publiclibs})$

+ %global __requires_exclude ^(%{_privatelibs}|%{_publiclibs})$

  %endif

  

  

@@ -946,7 +949,7 @@ 

  

  Name:    java-%{javaver}-%{origin}

  Version: %{newjavaver}.%{buildver}

- Release: 0%{?dist}

+ Release: 1%{?dist}

  # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons

  # and this change was brought into RHEL-4. java-1.5.0-ibm packages

  # also included the epoch in their virtual provides. This created a

@@ -1856,6 +1859,11 @@ 

  

  

  %changelog

+ * Tue Apr 23 2019 Severin Gehwolf <sgehwolf@redhat.com> - 1:11.0.3.7-1

+ - Fix requires/provides for the non-system JDK case. JDK 11

+   isn't a system JDK at this point.

+ - Resolves: RHBZ#1702324

+ 

  * Sun Apr 07 2019 Andrew Hughes <gnu.andrew@redhat.com> - 1:11.0.3.7-0

  - Update to shenandoah-jdk-11.0.3+7 (April 2019 GA)

  

Without this fix no lib*.so requirements are being generated.
This includes requirements for libgif and libgcc, libc, etc.

Resolves: RHBZ#1702324

rebased onto 29ac45a

a month ago

Should:

%global __provides_exclude_from ^./%{uniquesuffix -- %{debug_suffix_unquoted}}/.$

not be outside the conditional? Or is this covered some other way for !system_jdk?

Otherwise looks good and a lot clearer than before.

Should:
%global __provides_exclude_from ^./%{uniquesuffix -- %{debug_suffix_unquoted}}/.$
not be outside the conditional? Or is this covered some other way for !system_jdk?

I'd prefer to not change this with this particular fix. It's covered with %global __provides_exclude ^(%{_privatelibs}|%{_publiclibs})$ with one slight caveat. The JDK might gain additional native libraries, and requires/provides might get auto-generated for them. If the the private/public libs lists aren't updated along with it, new provides might appear. As slowdebug/product builds have the same native libraries, their requirements and provides become indistinguishable once they are generated.

So for -slowdebug packages, I'd prefer to not generate any provides/requires via %global __provides_exclude_from ^./%{uniquesuffix -- %{debug_suffix_unquoted}}/. That's acceptable IMHO as it would only exclude requires/provides from libs within /usr/lib/jvm/<NVRA>-slowdebug/. Slowdebug sub-packages are only meant for debugging purposes and they shouldn't ever provide anything. Users of slowdebug packages are expected to install the release versions first, then replace them with the slowdebug equivalents for debugging.

But I'd like to cover this via:
https://bugzilla.redhat.com/show_bug.cgi?id=1702379

Otherwise looks good and a lot clearer than before.

Thanks for the review!

With the builds above I see these requires/provides for JDK 11 (Non-system-JDK):

$ rpm -q --requires -p java-11-openjdk{,-headless,-devel}{,-slowdebug}-11.0.3.6-1.fc31.x86_64.rpm | grep ^lib | grep \.so | sort | uniq | wc -l
53
$ rpm -q --provides -p java-11-openjdk{,-headless,-devel}{,-slowdebug}-11.0.3.6-1.fc31.x86_64.rpm | grep ^lib | grep \.so | sort | uniq | wc -l
0
$ rpm -q --requires -p java-11-openjdk{,-headless,-devel}{,-slowdebug}-11.0.3.6-1.fc31.x86_64.rpm | grep -E 'libjvm.so|libverify.so|libjsig.so|libjava.so|libjawt.so'
$ rpm -q --provides -p java-11-openjdk{,-headless,-devel}{,-slowdebug}-11.0.3.6-1.fc31.x86_64.rpm | grep -E 'libjvm.so|libverify.so|libjsig.so|libjava.so|libjawt.so'

Currently it has this:

$ rpm -q --requires java-11-openjdk{,-headless,-devel} | grep ^lib | grep \.so | sort | uniq | wc -l
0

System JDK (JDK 8) has these:

$ rpm -q --provides java-1.8.0-openjdk{,-devel,-headless} | grep ^lib | grep \.so | sort | uniq | wc -l
9
$ rpm -q --requires java-1.8.0-openjdk{,-devel,-headless} | grep ^lib | grep \.so | sort | uniq | wc -l
55

$ rpm -q --provides java-1.8.0-openjdk{,-headless,-devel} | grep -E 'libjvm.so|libverify.so|libjsig.so|libjava.so|libjawt.so'
libjawt.so()(64bit)
libjawt.so(SUNWprivate_1.1)(64bit)
libjava.so()(64bit)
libjava.so(SUNWprivate_1.1)(64bit)
libjsig.so()(64bit)
libjvm.so()(64bit)
libjvm.so(SUNWprivate_1.1)(64bit)
libverify.so()(64bit)
libverify.so(SUNWprivate_1.1)(64bit)
libjawt.so()(64bit)
libjawt.so(SUNWprivate_1.1)(64bit)
$ rpm -q --requires java-1.8.0-openjdk{,-headless,-devel} | grep -E 'libjvm.so|libverify.so|libjsig.so|libjava.so|libjawt.so'
libjava.so()(64bit)
libjava.so(SUNWprivate_1.1)(64bit)
libjvm.so()(64bit)
libjvm.so(SUNWprivate_1.1)(64bit)
libjava.so()(64bit)
libjava.so(SUNWprivate_1.1)(64bit)
libjvm.so()(64bit)
libjvm.so(SUNWprivate_1.1)(64bit)
libverify.so()(64bit)
libverify.so(SUNWprivate_1.1)(64bit)
libjava.so()(64bit)
libjvm.so()(64bit)
$ rpm -q --provides java-1.8.0-openjdk{,-devel,-headless} | grep ^lib | grep \.so | sort | uniq
libjava.so()(64bit)
libjava.so(SUNWprivate_1.1)(64bit)
libjawt.so()(64bit)
libjawt.so(SUNWprivate_1.1)(64bit)
libjsig.so()(64bit)
libjvm.so()(64bit)
libjvm.so(SUNWprivate_1.1)(64bit)
libverify.so()(64bit)
libverify.so(SUNWprivate_1.1)(64bit)
$ rpm -q --requires java-1.8.0-openjdk{,-devel,-headless} | grep ^lib | grep \.so | sort | uniq
libasound.so.2()(64bit)
libasound.so.2(ALSA_0.9.0rc4)(64bit)
libasound.so.2(ALSA_0.9)(64bit)
libc.so.6()(64bit)
libc.so.6(GLIBC_2.11)(64bit)
libc.so.6(GLIBC_2.14)(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.28)(64bit)
libc.so.6(GLIBC_2.3.2)(64bit)
libc.so.6(GLIBC_2.3.4)(64bit)
libc.so.6(GLIBC_2.3)(64bit)
libc.so.6(GLIBC_2.4)(64bit)
libc.so.6(GLIBC_2.7)(64bit)
libdl.so.2()(64bit)
libdl.so.2(GLIBC_2.2.5)(64bit)
libfreetype.so.6()(64bit)
libgcc_s.so.1()(64bit)
libgcc_s.so.1(GCC_3.0)(64bit)
libgif.so.7()(64bit)
libjava.so()(64bit)
libjava.so(SUNWprivate_1.1)(64bit)
libjpeg.so.62()(64bit)
libjpeg.so.62(LIBJPEG_6.2)(64bit)
libjvm.so()(64bit)
libjvm.so(SUNWprivate_1.1)(64bit)
libm.so.6()(64bit)
libm.so.6(GLIBC_2.2.5)(64bit)
libnspr4.so()(64bit)
libnss3.so()(64bit)
libnss3.so(NSS_3.2)(64bit)
libnssutil3.so()(64bit)
libnssutil3.so(NSSUTIL_3.12)(64bit)
libplc4.so()(64bit)
libplds4.so()(64bit)
libpng16.so.16()(64bit)
libpng16.so.16(PNG16_0)(64bit)
libpthread.so.0()(64bit)
libpthread.so.0(GLIBC_2.2.5)(64bit)
libpthread.so.0(GLIBC_2.3.2)(64bit)
libpthread.so.0(GLIBC_2.3.3)(64bit)
libsmime3.so()(64bit)
libssl3.so()(64bit)
libstdc++.so.6()(64bit)
libstdc++.so.6(CXXABI_1.3)(64bit)
libstdc++.so.6(GLIBCXX_3.4)(64bit)
libthread_db.so.1()(64bit)
libthread_db.so.1(GLIBC_2.2.5)(64bit)
libverify.so()(64bit)
libverify.so(SUNWprivate_1.1)(64bit)
libX11.so.6()(64bit)
libXext.so.6()(64bit)
libXi.so.6()(64bit)
libXrender.so.1()(64bit)
libXtst.so.6()(64bit)
libz.so.1()(64bit)

Pull-Request has been merged by jerboaa

a month ago