#49 Handle milestone as variables so we can alter it easily and set the docs zip filename appropriately.
Merged 2 months ago by ahughes. Opened 2 months ago by ahughes.
rpms/ ahughes/java-11-openjdk master  into  master

file modified
+28 -4

@@ -231,6 +231,7 @@ 

  %global top_level_dir_name   %{origin}

  %global minorver        0

  %global buildver        7

+ %global rpmrelease      6

  #%%global tagsuffix      ""

  # priority must be 8 digits in total; untill openjdk 1.8 we were using 18..... so when moving to 11 we had to add another digit

  %if %is_system_jdk

@@ -243,6 +244,23 @@ 

  

  %global javaver         %{majorver}

  

+ # Define milestone (EA for pre-releases, GA for releases)

+ # Release will be (where N is usually a number starting at 1):

+ # - 0.N%%{?extraver}%%{?dist} for EA releases,

+ # - N%%{?extraver}{?dist} for GA releases

+ %global is_ga           1

+ %if %{is_ga}

+ %global ea_designator ""

+ %global ea_designator_zip ""

+ %global extraver %{nil}

+ %global eaprefix %{nil}

+ %else

+ %global ea_designator ea

+ %global ea_designator_zip -%{ea_designator}

+ %global extraver .%{ea_designator}

+ %global eaprefix 0.

+ %endif

+ 

  # parametrized macros are order-sensitive

  %global compatiblename  java-%{majorver}-%{origin}

  %global fullversion     %{compatiblename}-%{version}-%{release}

@@ -953,7 +971,7 @@ 

  

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

  Version: %{newjavaver}.%{buildver}

- Release: 5%{?dist}

+ Release: %{?eaprefix}%{rpmrelease}%{?extraver}%{?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

@@ -1396,7 +1414,7 @@ 

      --with-jobs=1 \

  %endif

      --with-version-build=%{buildver} \

-     --with-version-pre="" \

+     --with-version-pre="%{ea_designator}" \

      --with-version-opt=%{lts_designator} \

      --with-vendor-version-string="%{vendor_version_string}" \

      --with-boot-jdk=/usr/lib/jvm/java-%{buildjdkver}-openjdk \

@@ -1465,7 +1483,7 @@ 

  

  export JAVA_HOME=$(pwd)/%{buildoutputdir -- $suffix}/images/%{jdkimage}

  

- #check sheandoah is enabled

+ #check Shenandoah is enabled

  %if %{use_shenandoah_hotspot}

  $JAVA_HOME//bin/java -XX:+UseShenandoahGC -version

  %endif

@@ -1621,7 +1639,7 @@ 

    # Install Javadoc documentation

    install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}

    cp -a %{buildoutputdir -- $suffix}/images/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}

-   cp -a %{buildoutputdir -- $suffix}/bundles/jdk-%{newjavaver}+%{buildver}%{lts_designator_zip}-docs.zip $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}.zip

+   cp -a %{buildoutputdir -- $suffix}/bundles/jdk-%{newjavaver}%{ea_designator_zip}+%{buildver}%{lts_designator_zip}-docs.zip $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}.zip

  fi

  

  # Install icons and menu entries

@@ -1834,6 +1852,12 @@ 

  

  

  %changelog

+ * Fri Jun 21 2019 Severin Gehwolf <sgehwolf@redhat.com> - 1:11.0.3.7-6

+ - Include 'ea' designator in Release when appropriate.

+ 

+ * Wed May 22 2019 Andrew Hughes <gnu.andrew@redhat.com> - 1:11.0.3.7-6

+ - Handle milestone as variables so we can alter it easily and set the docs zip filename appropriately.

+ 

  * Tue May 14 2019 Severin Gehwolf <sgehwolf@redhat.com> - 1:11.0.3.7-5

  - Bump release for rebuild.

  

Include 'ea' designator in Release when appropriate.

This is a combination of my work in RHEL on OpenJDK 8 to handle RHEL, and Severin's PR (https://src.fedoraproject.org/rpms/java-11-openjdk/pull-request/48)

We can easily flip between GA and EA builds by setting 'is_ga'. The next PR will do this for the first EA build of 11.0.4.

Unfortunately this breaks rpmdev-bumpspec java-11-openjdk.spec behaviour:

diff --git a/java-11-openjdk.spec b/java-11-openjdk.spec
index 5477864..50c6380 100644
--- a/java-11-openjdk.spec
+++ b/java-11-openjdk.spec
@@ -971,7 +971,7 @@ Provides: java-src%{?1} = %{epoch}:%{version}-%{release}

 Name:    java-%{javaver}-%{origin}
 Version: %{newjavaver}.%{buildver}
-Release: %{?eaprefix}%{rpmrelease}%{?extraver}%{?dist}
+Release: %{?eaprefix}%{rpmrelease}%{?extraver}%{?dist}.1
 # 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
@@ -1852,6 +1852,9 @@ require "copy_jdk_configs.lua"


 %changelog
+* Thu Jul 04 2019 Severin Gehwolf <sgehwolf@redhat.com> - 1:11.0.3.7-6.1
+- rebuilt
+
 * Fri Jun 21 2019 Severin Gehwolf <sgehwolf@redhat.com> - 1:11.0.3.7-6
 - Include 'ea' designator in Release when appropriate.

{?dist} should be last.

Yeah, I know. That tool isn't very clever.

It doesn't work with Release: %{?eaprefix}5%{?extraver}%{?dist} either. Suggestions welcome.

This should work on top of you changes:
https://src.fedoraproject.org/fork/jerboaa/rpms/java-11-openjdk/c/2d64d9cdac32e6e257f155207aa620ad37ead19c?branch=pr49

All that should be remembered when flipping is to use 0.X release numbers for EA, X release numbers for GA. That's acceptable, I think.

That seems more prone to error than just manually removing the '.1', which is precisely why I made the changes I did.

Most of the time, for me, what rpmdev-bumpspec does is wrong even before this change (and always on java-1.7.0-openjdk, where it similarly can't handle the IcedTea version being there).

Fair enough. I won't insist. We'll have to manually fix mass rebuilds which may get pushed that way. Feel free to ship it then.

Metadata Update from @jerboaa:
- Request assigned

2 months ago

Thanks. Maybe worth filing a bug against that tool? It should be able to skip leading text before the first digit.

rebased onto d8d7f03

2 months ago

Pull-Request has been merged by ahughes

2 months ago

Thanks. Maybe worth filing a bug against that tool? It should be able to skip leading text before the first digit.

As usual mileages may vary. Feel free to comment on:
https://pagure.io/rpmdevtools/issue/18