Introduce stapinstall variable to set SystemTap arch directory correctly (e.g. arm64 on aarch64)

Include support for noarch for when koji creates source RPMs
This commit is contained in:
Andrew John Hughes 2020-03-31 20:19:21 +01:00
parent c20d187fd6
commit 1b1cbf2cdf

View File

@ -136,47 +136,61 @@
# In some cases, the arch used by the JDK does # In some cases, the arch used by the JDK does
# not match _arch. # not match _arch.
# Also, in some cases, the machine name used by SystemTap # Also, in some cases, the machine name used by SystemTap
# does not match that given by _build_cpu # does not match that given by _target_cpu
%ifarch x86_64 %ifarch x86_64
%global archinstall amd64 %global archinstall amd64
%global stapinstall x86_64
%endif %endif
%ifarch ppc %ifarch ppc
%global archinstall ppc %global archinstall ppc
%global stapinstall powerpc
%endif %endif
%ifarch %{ppc64be} %ifarch %{ppc64be}
%global archinstall ppc64 %global archinstall ppc64
%global stapinstall powerpc
%endif %endif
%ifarch %{ppc64le} %ifarch %{ppc64le}
%global archinstall ppc64le %global archinstall ppc64le
%global stapinstall powerpc
%endif %endif
%ifarch %{ix86} %ifarch %{ix86}
%global archinstall i386 %global archinstall i386
%global stapinstall i386
%endif %endif
%ifarch ia64 %ifarch ia64
%global archinstall ia64 %global archinstall ia64
%global stapinstall ia64
%endif %endif
%ifarch s390 %ifarch s390
%global archinstall s390 %global archinstall s390
%global stapinstall s390
%endif %endif
%ifarch s390x %ifarch s390x
%global archinstall s390x %global archinstall s390x
%global stapinstall s390
%endif %endif
%ifarch %{arm} %ifarch %{arm}
%global archinstall arm %global archinstall arm
%global stapinstall arm
%endif %endif
%ifarch %{aarch64} %ifarch %{aarch64}
%global archinstall aarch64 %global archinstall aarch64
%global stapinstall arm64
%endif %endif
# 32 bit sparc, optimized for v9 # 32 bit sparc, optimized for v9
%ifarch sparcv9 %ifarch sparcv9
%global archinstall sparc %global archinstall sparc
%global stapinstall %{_target_cpu}
%endif %endif
# 64 bit sparc # 64 bit sparc
%ifarch sparc64 %ifarch sparc64
%global archinstall sparcv9 %global archinstall sparcv9
%global stapinstall %{_target_cpu}
%endif %endif
%ifnarch %{jit_arches} # Need to support noarch for srpm build
%global archinstall %{_arch} %ifarch noarch
%global archinstall %{nil}
%global stapinstall %{nil}
%endif %endif
%ifarch %{jit_arches} %ifarch %{jit_arches}
@ -231,7 +245,7 @@
%global updatever %(VERSION=%{whole_update}; echo ${VERSION##*u}) %global updatever %(VERSION=%{whole_update}; echo ${VERSION##*u})
# eg jdk8u60-b27 -> b27 # eg jdk8u60-b27 -> b27
%global buildver %(VERSION=%{version_tag}; echo ${VERSION##*-}) %global buildver %(VERSION=%{version_tag}; echo ${VERSION##*-})
%global rpmrelease 2 %global rpmrelease 3
# Define milestone (EA for pre-releases, GA ("fcs") for releases) # Define milestone (EA for pre-releases, GA ("fcs") for releases)
# Release will be (where N is usually a number starting at 1): # Release will be (where N is usually a number starting at 1):
# - 0.N%%{?extraver}%%{?dist} for EA releases, # - 0.N%%{?extraver}%%{?dist} for EA releases,
@ -285,10 +299,10 @@
# and 32 bit architectures we place the tapsets under the arch # and 32 bit architectures we place the tapsets under the arch
# specific dir (note that systemtap will only pickup the tapset # specific dir (note that systemtap will only pickup the tapset
# for the primary arch for now). Systemtap uses the machine name # for the primary arch for now). Systemtap uses the machine name
# aka build_cpu as architecture specific directory name. # aka target_cpu as architecture specific directory name.
%global tapsetroot /usr/share/systemtap %global tapsetroot /usr/share/systemtap
%global tapsetdirttapset %{tapsetroot}/tapset/ %global tapsetdirttapset %{tapsetroot}/tapset/
%global tapsetdir %{tapsetdirttapset}/%{_build_cpu} %global tapsetdir %{tapsetdirttapset}/%{stapinstall}
%endif %endif
# not-duplicated scriptlets for normal/debug packages # not-duplicated scriptlets for normal/debug packages
@ -1462,6 +1476,14 @@ Set of links from OpenJDK-slowdebug (sdk) to normal OpenJFX. OpenJFX do not supp
%endif %endif
%prep %prep
# Using the echo macro breaks rpmdev-bumpspec, as it parses the first line of stdout :-(
%if 0%{?stapinstall:1}
echo "CPU: %{_target_cpu}, arch install directory: %{archinstall}, SystemTap install directory: %{stapinstall}"
%else
%{error:Unrecognised architecture %{_target_cpu}}
%endif
if [ %{include_normal_build} -eq 0 -o %{include_normal_build} -eq 1 ] ; then if [ %{include_normal_build} -eq 0 -o %{include_normal_build} -eq 1 ] ; then
echo "include_normal_build is %{include_normal_build}" echo "include_normal_build is %{include_normal_build}"
else else
@ -2212,6 +2234,10 @@ require "copy_jdk_configs.lua"
%endif %endif
%changelog %changelog
* Tue Mar 24 2020 Andrew John Hughes <gnu.andrew@redhat.com> - 1:1.8.0.242.b08-3
- Introduce stapinstall variable to set SystemTap arch directory correctly (e.g. arm64 on aarch64)
- Include support for noarch for when koji creates source RPMs
* Sun Mar 22 2020 Andrew John Hughes <gnu.andrew@redhat.com> - 1:1.8.0.242.b08-2 * Sun Mar 22 2020 Andrew John Hughes <gnu.andrew@redhat.com> - 1:1.8.0.242.b08-2
- Replace Bash 'if' with rpm '%if' - Replace Bash 'if' with rpm '%if'
- Resolves: rhbz#1813550 - Resolves: rhbz#1813550