forked from rpms/glibc
Use %{expand} and %global
Our packaging guidelines say that %global is preferred, and with %{expand} the line continuations can be removed.
This commit is contained in:
parent
a0bdca4f3f
commit
4f7d89c5d3
101
glibc.spec
101
glibc.spec
@ -1,5 +1,5 @@
|
|||||||
%define glibcsrcdir glibc-2.35.9000-44-g3d9f171bfb
|
%global glibcsrcdir glibc-2.35.9000-44-g3d9f171bfb
|
||||||
%define glibcversion 2.35.9000
|
%global glibcversion 2.35.9000
|
||||||
# Pre-release tarballs are pulled in from git using a command that is
|
# Pre-release tarballs are pulled in from git using a command that is
|
||||||
# effectively:
|
# effectively:
|
||||||
#
|
#
|
||||||
@ -84,25 +84,25 @@
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
# Any architecture/kernel combination that supports running 32-bit and 64-bit
|
# Any architecture/kernel combination that supports running 32-bit and 64-bit
|
||||||
# code in userspace is considered a biarch arch.
|
# code in userspace is considered a biarch arch.
|
||||||
%define biarcharches %{ix86} x86_64 s390 s390x
|
%global biarcharches %{ix86} x86_64 s390 s390x
|
||||||
|
|
||||||
# Avoid generating a glibc-headers package on architectures which are
|
# Avoid generating a glibc-headers package on architectures which are
|
||||||
# not biarch.
|
# not biarch.
|
||||||
%ifarch %{biarcharches}
|
%ifarch %{biarcharches}
|
||||||
%define need_headers_package 1
|
%global need_headers_package 1
|
||||||
%if 0%{?rhel} > 0
|
%if 0%{?rhel} > 0
|
||||||
%define headers_package_name glibc-headers
|
%global headers_package_name glibc-headers
|
||||||
%else
|
%else
|
||||||
%ifarch %{ix86} x86_64
|
%ifarch %{ix86} x86_64
|
||||||
%define headers_package_name glibc-headers-x86
|
%global headers_package_name glibc-headers-x86
|
||||||
%endif
|
%endif
|
||||||
%ifarch s390 s390x
|
%ifarch s390 s390x
|
||||||
%define headers_package_name glibc-headers-s390
|
%global headers_package_name glibc-headers-s390
|
||||||
%endif
|
%endif
|
||||||
%dnl !rhel
|
%dnl !rhel
|
||||||
%endif
|
%endif
|
||||||
%else
|
%else
|
||||||
%define need_headers_package 0
|
%global need_headers_package 0
|
||||||
%dnl !biarcharches
|
%dnl !biarcharches
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -110,41 +110,40 @@
|
|||||||
# Utility functions for pre/post scripts. Stick them at the beginning of
|
# Utility functions for pre/post scripts. Stick them at the beginning of
|
||||||
# any lua %pre, %post, %postun, etc. sections to have them expand into
|
# any lua %pre, %post, %postun, etc. sections to have them expand into
|
||||||
# those scripts. It only works in lua sections and not anywhere else.
|
# those scripts. It only works in lua sections and not anywhere else.
|
||||||
%define glibc_post_funcs() \
|
%global glibc_post_funcs %{expand:
|
||||||
-- We use lua posix.exec because there may be no shell that we can \
|
-- We use lua posix.exec because there may be no shell that we can run
|
||||||
-- run during glibc upgrade. We used to implement much of %%post as a \
|
-- during glibc upgrade. We used to implement much of %%post as a C
|
||||||
-- C program, but from an overall maintenance perspective the lua in \
|
-- program, but from an overall maintenance perspective the lua in the
|
||||||
-- the spec file was simpler and safer given the operations required. \
|
-- spec file was simpler and safer given the operations required.
|
||||||
-- All lua code will be ignored by rpm-ostree; see: \
|
-- All lua code will be ignored by rpm-ostree; see:
|
||||||
-- https://github.com/projectatomic/rpm-ostree/pull/1869 \
|
-- https://github.com/projectatomic/rpm-ostree/pull/1869
|
||||||
-- If we add new lua actions to the %%post code we should coordinate \
|
-- If we add new lua actions to the %%post code we should coordinate
|
||||||
-- with rpm-ostree and ensure that their glibc install is functional. \
|
-- with rpm-ostree and ensure that their glibc install is functional.
|
||||||
function post_exec (program, ...) \
|
function post_exec (program, ...)
|
||||||
local pid = posix.fork () \
|
local pid = posix.fork ()
|
||||||
if pid == 0 then \
|
if pid == 0 then
|
||||||
posix.exec (program, ...) \
|
posix.exec (program, ...)
|
||||||
assert (nil) \
|
assert (nil)
|
||||||
elseif pid > 0 then \
|
elseif pid > 0 then
|
||||||
posix.wait (pid) \
|
posix.wait (pid)
|
||||||
end \
|
end
|
||||||
end \
|
end
|
||||||
\
|
|
||||||
function update_gconv_modules_cache () \
|
function update_gconv_modules_cache ()
|
||||||
local iconv_dir = "%{_libdir}/gconv" \
|
local iconv_dir = "%{_libdir}/gconv"
|
||||||
local iconv_cache = iconv_dir .. "/gconv-modules.cache" \
|
local iconv_cache = iconv_dir .. "/gconv-modules.cache"
|
||||||
local iconv_modules = iconv_dir .. "/gconv-modules" \
|
local iconv_modules = iconv_dir .. "/gconv-modules"
|
||||||
if (posix.utime (iconv_modules) == 0) then \
|
if (posix.utime (iconv_modules) == 0) then
|
||||||
if (posix.utime (iconv_cache) == 0) then \
|
if (posix.utime (iconv_cache) == 0) then
|
||||||
post_exec ("%{_prefix}/sbin/iconvconfig", \
|
post_exec ("%{_prefix}/sbin/iconvconfig",
|
||||||
"-o", iconv_cache, \
|
"-o", iconv_cache,
|
||||||
"--nostdlib", \
|
"--nostdlib",
|
||||||
iconv_dir) \
|
iconv_dir)
|
||||||
else \
|
else
|
||||||
io.stdout:write ("Error: Missing " .. iconv_cache .. " file.\n") \
|
io.stdout:write ("Error: Missing " .. iconv_cache .. " file.\n")
|
||||||
end \
|
end
|
||||||
end \
|
end
|
||||||
end \
|
end}
|
||||||
%{nil}
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# %%package glibc - The GNU C Library (glibc) core package.
|
# %%package glibc - The GNU C Library (glibc) core package.
|
||||||
@ -208,7 +207,7 @@ rpm.define("__debug_install_post bash " .. wrapper
|
|||||||
|
|
||||||
# The wrapper script relies on the fact that debugedit does not change
|
# The wrapper script relies on the fact that debugedit does not change
|
||||||
# build IDs.
|
# build IDs.
|
||||||
%define _no_recompute_build_ids 1
|
%global _no_recompute_build_ids 1
|
||||||
%undefine _unique_build_ids
|
%undefine _unique_build_ids
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
@ -293,14 +292,14 @@ BuildRequires: python3 python3-devel
|
|||||||
|
|
||||||
# This GCC version is needed for -fstack-clash-protection support.
|
# This GCC version is needed for -fstack-clash-protection support.
|
||||||
BuildRequires: gcc >= 7.2.1-6
|
BuildRequires: gcc >= 7.2.1-6
|
||||||
%define enablekernel 3.2
|
%global enablekernel 3.2
|
||||||
Conflicts: kernel < %{enablekernel}
|
Conflicts: kernel < %{enablekernel}
|
||||||
%define target %{_target_cpu}-redhat-linux
|
%global target %{_target_cpu}-redhat-linux
|
||||||
%ifarch %{arm}
|
%ifarch %{arm}
|
||||||
%define target %{_target_cpu}-redhat-linuxeabi
|
%global target %{_target_cpu}-redhat-linuxeabi
|
||||||
%endif
|
%endif
|
||||||
%ifarch ppc64le
|
%ifarch ppc64le
|
||||||
%define target ppc64le-redhat-linux
|
%global target ppc64le-redhat-linux
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# GNU make 4.0 introduced the -O option.
|
# GNU make 4.0 introduced the -O option.
|
||||||
@ -1123,8 +1122,8 @@ BuildFlagsNonshared="-fplugin=annobin -fplugin-arg-annobin-disable -Wa,--generat
|
|||||||
# Special flag to enable annobin annotations for statically linked
|
# Special flag to enable annobin annotations for statically linked
|
||||||
# assembler code. Needs to be passed to make; not preserved by
|
# assembler code. Needs to be passed to make; not preserved by
|
||||||
# configure.
|
# configure.
|
||||||
%define glibc_make_flags_as ASFLAGS="-g -Wa,--generate-missing-build-notes=yes"
|
%global glibc_make_flags_as ASFLAGS="-g -Wa,--generate-missing-build-notes=yes"
|
||||||
%define glibc_make_flags %{glibc_make_flags_as}
|
%global glibc_make_flags %{glibc_make_flags_as}
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# %%build - Generic options.
|
# %%build - Generic options.
|
||||||
@ -1195,7 +1194,7 @@ build
|
|||||||
# For a system glibc that subdirectory is "/" (the root of the filesystem).
|
# For a system glibc that subdirectory is "/" (the root of the filesystem).
|
||||||
# This is called a sysroot (system root) and can be changed if we have a
|
# This is called a sysroot (system root) and can be changed if we have a
|
||||||
# distribution that supports multiple installed glibc versions.
|
# distribution that supports multiple installed glibc versions.
|
||||||
%define glibc_sysroot $RPM_BUILD_ROOT
|
%global glibc_sysroot $RPM_BUILD_ROOT
|
||||||
|
|
||||||
# Remove existing file lists.
|
# Remove existing file lists.
|
||||||
find . -type f -name '*.filelist' -exec rm -rf {} \;
|
find . -type f -name '*.filelist' -exec rm -rf {} \;
|
||||||
|
Loading…
Reference in New Issue
Block a user