%define _trivial .0 %define _buildid .3 # TO WHOM IT MAY CONCERN # # 1) Don't add patches, this git repository is the upstream source. # 2) When making Amazon changes, bump Release. # This is because there's some packages that require redhat-rpm-config # based on version number, and let's not muck that up, but rather gracefully # error if we end up bringing in a package that needs a newer version. # baserelease is the Fedora upstream version %global baserelease 343 # Amazon Specific: # - This is forked from the Fedora package. # - Note the "Provides: redhat-rpm-config" # - thus be careful of rebasing # # Don't include rpmautospec for now as we don't ship the python-rpmautospec # package yet due to a dependency on Koji which we also don't ship as a package %bcond_with autospec # Don't include ansible macros for now as we don't ship ansible %bcond_with ansible # Include package notes macros %bcond_without package_notes # These macros rely on rpm 4.17 features %bcond_with build-constraints-macros Summary: Amazon Linux specific rpm configuration files Name: amazon-rpm-config Version: %{baserelease} Release: 1%{?dist}%{?_trivial}%{?_buildid} # FIXME: does not exist yet. URL: https://github.com/amazonlinux/pkg-amazon-rpm-config # config.guess, config.sub are GPL-3.0-or-later WITH Autoconf-exception-generic License: GPL-1.0-or-later AND GPL-2.0-or-later AND GPL-3.0-or-later WITH Autoconf-exception-generic # Core rpm settings Source0: macros Source1: rpmrc # gcc specs files for hardened builds Source50: redhat-hardened-cc1 Source51: redhat-hardened-ld Source52: redhat-hardened-ld-errors # clang config spec files Source53: redhat-hardened-clang.cfg Source54: redhat-hardened-clang-ld.cfg # gcc specs files for annobin builds Source60: redhat-annobin-cc1 Source61: redhat-annobin-select-gcc-built-plugin Source62: redhat-annobin-select-annobin-built-plugin Source63: redhat-annobin-plugin-select.sh # The macros defined by these files are for things that need to be defined # at srpm creation time when it is not feasible to require the base packages # that would otherwise be providing the macros. other language/arch specific # macros should not be defined here but instead in the base packages that can # be pulled in at rpm build time, this is specific for srpm creation. Source100: macros.fedora-misc-srpm Source102: macros.mono-srpm Source103: macros.nodejs-srpm Source104: macros.ldc-srpm Source105: macros.valgrind-srpm Source108: macros.dotnet-srpm Source109: macros.hare-srpm # Other misc macros Source150: macros.build-constraints Source151: macros.dwz Source152: macros.fedora-misc Source155: macros.ldconfig Source156: macros.vpath Source157: macros.shell-completions Source158: macros.rpmautospec # Build policy scripts # this comes from https://github.com/rpm-software-management/rpm/pull/344 # added a python -> python2 conversion for fedora with warning # and an echo when the mangling happens Source201: brp-mangle-shebangs # Dependency generator scripts (deprecated) Source300: find-provides Source304: find-requires # Misc helper scripts Source400: dist.sh # Snapshots from http://git.savannah.gnu.org/gitweb/?p=config.git Source500: https://git.savannah.gnu.org/cgit/config.git/plain/config.guess Source501: https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # Dependency generators & their rules Source602: libsymlink.attr # BRPs Source700: brp-ldconfig Source701: brp-strip-lto # Convenience lua functions Source800: common.lua # Documentation Source900: buildflags.md BuildArch: noarch BuildRequires: perl-generators Requires: coreutils Requires: efi-srpm-macros Requires: fonts-srpm-macros # ↓ Provides macros.forge and forge.lua originally shipped by us Requires: forge-srpm-macros Requires: gap-srpm-macros Requires: go-srpm-macros Requires: java-srpm-macros # ↓ Provides kmod.attr originally shipped by us Requires: kernel-srpm-macros >= 1.0-12 Requires: lua-srpm-macros Requires: ocaml-srpm-macros Requires: openblas-srpm-macros Requires: perl-srpm-macros # ↓ Has Python BRPs originaly present in redhat-rpm-config # HACK: Temporarily remove python3.11 requirement while bootstrapping Requires: python-srpm-macros >= 3.9 %if ! 0%{?amzn} Requires: qt6-srpm-macros %endif Requires: rust-srpm-macros Requires: package-notes-srpm-macros Requires: pyproject-srpm-macros # ↓ Create compat Provides/Requires when things move around in filesystem Requires: filesystem-srpm-macros %if ! 0%{?rhel} && ! 0%{?amzn} Requires: ansible-srpm-macros Requires: fpc-srpm-macros Requires: ghc-srpm-macros Requires: gnat-srpm-macros Requires: tree-sitter-srpm-macros Requires: qt5-srpm-macros Requires: zig-srpm-macros Requires: build-reproducibility-srpm-macros %endif Requires: rpm >= 4.19.91 Requires: dwz >= 0.4 Requires: zip Requires: (annobin-plugin-gcc if gcc) Requires: (gcc-plugin-annobin if gcc) # ↓ to not break packages that buildrequire GnuPG but use it through GPGverify Requires: (gpgverify if gnupg2) # for brp-mangle-shebangs Requires: %{_bindir}/find Requires: %{_bindir}/file Requires: %{_bindir}/grep Requires: %{_bindir}/sed Requires: %{_bindir}/xargs # -fstack-clash-protection and -fcf-protection require GCC 8. Conflicts: gcc < 8.0.1-0.22 # Replaced by macros.rpmautospec shipped by us Obsoletes: rpmautospec-rpm-macros < 0.6.3-2 Provides: system-rpm-config = %{version}-%{release} Provides: redhat-rpm-config = %{version}-%{release} Obsoletes: redhat-rpm-config < 182-2 %global rrcdir /usr/lib/rpm/redhat %global amazon_rrcdir /usr/lib/rpm/amazon %description Amazon linux specific rpm configuration files. Heavily derived from redhat-rpm-config in Fedora. %prep # Not strictly necessary but allows working on file names instead # of source numbers in install section %setup -c -T cp -p %{sources} . %install mkdir -p %{buildroot}%{rrcdir} install -p -m 644 -t %{buildroot}%{rrcdir} macros rpmrc install -p -m 444 -t %{buildroot}%{rrcdir} redhat-hardened-* install -p -m 444 -t %{buildroot}%{rrcdir} redhat-annobin-* install -p -m 755 -t %{buildroot}%{rrcdir} config.* install -p -m 755 -t %{buildroot}%{rrcdir} dist.sh install -p -m 755 -t %{buildroot}%{rrcdir} brp-* install -p -m 755 -t %{buildroot}%{rrcdir} find-* install -p -m 755 -t %{buildroot}%{rrcdir} brp-* mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d install -p -m 644 -t %{buildroot}%{_rpmconfigdir}/macros.d macros.* mkdir -p %{buildroot}%{_fileattrsdir} install -p -m 644 -t %{buildroot}%{_fileattrsdir} *.attr mkdir -p %{buildroot}%{_rpmluadir}/fedora/{rpm,srpm} install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora common.lua %if %{without build-constraints-macros} rm -f %{buildroot}%{_rpmconfigdir}/macros.d/macros.build-constraints %endif # This trigger is used to decide which version of the annobin plugin for gcc # should be used. See comments in the script for full details. # # Note - whilst "gcc-plugin-annobin" requires "gcc" and hence in theory we # do not need to trigger on "gcc", the redhat-annobin-plugin-select.sh # script invokes gcc to determine the version of the gcc plugin, and this # can be significant. # # For example, suppose that version N of gcc is installed and that annobin # version A (built by gcc version N) is also installed. Then a new version # of gcc is released. If the rpms are updated in this order: # gcc-plugin-annobin # gcc # then when the trigger for gcc-plugin-annobin is run, the script will see # (the not yet updated) gcc is currently version N, which matches the current # annobin plugin A, so no changes are necessary. Then gcc is updated and, # if the trigger below did not include "gcc", the script would not run again # and so now you would have an out of date version of the annobin plugin. # # Alternatively imagine installing gcc and annobin for the first time. # If the installation order is: # gcc # annobin-plugin-gcc # gcc-plugin-annobin # then the installation of gcc will not cause the gcc-plugin-annobin to be # selected, since it does not exist yet. Then annobin-plugin-gcc is installed # and since it is the only plugin, it will be selected. Then # gcc-plugin-annobin is installed, and if the trigger below was not set to # run on gcc-plugin-annobin, it would pass unnoticed. # # Hence it is necessary to trigger on both gcc and gcc-plugin-annobin. %triggerin -- annobin-plugin-gcc gcc-plugin-annobin gcc %{rrcdir}/redhat-annobin-plugin-select.sh %end # We also trigger when an annobin plugin is uninstalled. This allows us to # switch over to the other version of the plugin. Note - we do not bother # triggering on the uninstallation of "gcc", since if that is removed, the # plugins are rendered useless. %triggerpostun -- annobin-plugin-gcc gcc-plugin-annobin %{rrcdir}/redhat-annobin-plugin-select.sh %end %files %dir %{rrcdir} %{rrcdir}/brp-ldconfig %{rrcdir}/brp-mangle-shebangs %{rrcdir}/brp-strip-lto %{rrcdir}/config.* %{rrcdir}/dist.sh %{rrcdir}/find-provides %{rrcdir}/find-requires %{rrcdir}/macros %{rrcdir}/redhat-hardened-* %{rrcdir}/rpmrc %{_fileattrsdir}/*.attr %{_rpmconfigdir}/macros.d/macros.*-srpm %if %{with build-constraints-macros} %{_rpmconfigdir}/macros.d/macros.build-constraints %endif %{_rpmconfigdir}/macros.d/macros.dwz %{_rpmconfigdir}/macros.d/macros.fedora-misc %{_rpmconfigdir}/macros.d/macros.ldconfig %{_rpmconfigdir}/macros.d/macros.rpmautospec %{_rpmconfigdir}/macros.d/macros.shell-completions %{_rpmconfigdir}/macros.d/macros.vpath %dir %{_rpmluadir}/fedora %dir %{_rpmluadir}/fedora/srpm %dir %{_rpmluadir}/fedora/rpm %{_rpmluadir}/fedora/*.lua %attr(0755,-,-) %{rrcdir}/redhat-annobin-plugin-select.sh %verify(owner group mode) %{rrcdir}/redhat-annobin-cc1 %{rrcdir}/redhat-annobin-select-gcc-built-plugin %{rrcdir}/redhat-annobin-select-annobin-built-plugin %doc buildflags.md %post # Earlier versions of this package created a bogus link if [ -L "%{rrcdir}/redhat" ] ; then rm "%{rrcdir}/redhat" fi # Create the amazon symlink if it doesn't already exist if [ ! -e "%{amazon_rrcdir}" ] ; then ln -rsT "%{rrcdir}" "%{amazon_rrcdir}" fi %changelog * Mon Dec 01 2025 Stewart Smith None-703 - HACK: Temporarily remove python3.11 requirement * Fri Nov 28 2025 Stewart Smith - 343-1.amzn2027.0.2 - skip qt6-srpm-macros on Amazon Linux * Fri Nov 28 2025 Stewart Smith - 343-1.aln5.0.3 - HACK: remove python rpm macro 3.11 requirement for aln5 * Fri Nov 28 2025 Stewart Smith None-702 - no qt6 on Amazon Linux * Wed Nov 26 2025 Stewart Smith - 343-1.amzn2027.0.1 - First AL2027 RPM macros update - Merge from Fedora 43 (redhat-rpm-config v343) - from f43: "macros: Add runstatedir option to configure" - from f43: "forge macros: Support Sourcehut" - from f43: "Set -g when building Vala applications" - from f43: "Add _configure_use_runstatedir to macro disable --runstatedir" - from f43: "Add conditional support for always including frame pointers" - from f43: "Enable _FORTIFY_SOURCE=3 by default" - from f43: "Enable frame pointers by default" - from f43: "Use Fat LTO with Clang", superceding "Make -flto=thin the default lto flag for clang" - from f43: "Add pyproject-srpm-macros to the default buildroot" - from f43: "gnuconfig: sync with upstream git" - from f43: _distro_extra_ macros (renamed from pkg_extra_), see https://fedoraproject.org/wiki/Changes/RPMMacrosForBuildFlags - from f43: "Enable PIC mode for assembler files" - from f43: "Implement the build_type_safety_c macro" and enable it, see https://fedoraproject.org/wiki/Changes/GNUToolchainF39 - from f43: "Add macros.rpmautospec" - from f43: "Add support for x86_64_v2, x86_64_v3, x86_64_v4" - from f43: "Split out forge macros to forge-srpm-macros package" - from f43: "Pack relative ELF relocations by default" - from f43: "Switch C type safety level to 3 (GCC 14 default), and adjust for GCC 14" - from f43: "Add redhat-hardened-ld-errors file" - from f43: "Define dotnet_arches with a list of .NET-compatible architectures" - from f43: "Enable TLS descriptors on x86-64 (GCC only)" - from f43: "Pull in build-reproducibility-srpm-macros" - from f43: "Add redhat-hardened-clang-ld.cfg to pass -pie when linking with clang" - from f43: "Enable DT_RELR for aarch64" - from f43: "Pull in filesystem-macro package for sbin merge" - from f43: "Add -mbranch-protection=standard to extension builder flags" - from f43: "Split out GPGverify" - from f43: java_arches has moved to java-srpm-macros - from f43: "Enable -mtls-dialect=gnu2 with clang" - from f43: "Enable -fstack-clash-protection on aarch64 with clang" - from f43: Add '_pkg_extra_***flags' macros for package-specific build flag changes, see https://fedoraproject.org/wiki/Changes/Package-specific_RPM_Macros_For_Build_Flags * Wed Nov 26 2025 Stewart Smith None-701 - RPMAUTOSPEC: unresolvable merge * Tue Apr 15 2025 Josiah Vehrs - 228-9.amzn2023.0.1 - Fixup gcc14 toolchain macros - Add clang18 toolchain macros * Thu Apr 03 2025 Josiah Vehrs - 228-8.amzn2023.0.1 - Add gcc14 toolchain macros * Wed Feb 26 2025 Benjamin Herrenschmidt - 228-7.amzn2023.0.1 - Fix creation of /usr/lib/rpm/amazon symlink * Mon Dec 2 2024 Benjamin Herrenschmidt - 228-6.amzn2023.0.1 - Fix Requires: for gcc-plugin-annobin and gcc 11.5.0 onwards * Wed Nov 27 2024 Benjamin Herrenschmidt - 228-5.amzn2023.0.1 - Fix debuginfo extra opts name to move annobin data to debug package - Backport "Correct advise for disabling debuginfo packages" - Add macros.rpmautospec to provide default "basic" autospec behaviour - Backport "brp-mangle-shebangs: Strip env flags when mangling shebangs" - Backport "Fix automatic soname requires on non-versioned symlink targets" - Backport "Enable PIC mode for assembler files" - Backport "Change clang LTO default to ThinLTO" from c9s - Backport "Fix brp-llvm-compile-lto-elf parallelism with hardlinks" - Backport "Fix the fix for brp-llvm-compile-lto-elf" - Backport "Use correct format specifier in brp-llvm-compile-lto-elf" * Thu Oct 31 2024 Benjamin Herrenschmidt - 228-4.amzn2023.0.1 - Fix rust and vala macros for packages not using %cargo_build * Sat Jan 28 2023 Stewart Smith - 228-3.amzn2023.0.2 - Mass rebuild for AL2023 * Mon Jan 09 2023 Amit Shah - 228-3.amzn2022.0.1 - Remove the llvm_arches macro -- we will re-enable i686 compiles * Tue Dec 13 2022 Benjamin Herrenschmidt - 228-2.amzn2022.0.1 - Remove qt5 * Fri Dec 09 2022 Benjamin Herrenschmidt - 228-1.amzn2022.0.1 - Update to f37 level * Tue Dec 06 2022 Amit Shah - 221-14.amzn2022.0.1 - Add macros.llvm-srpm to limit llvm-15+ builds to x86-64 and aarch64 * Thu Nov 03 2022 Amit Shah - 221-13.amzn2022.0.3 - Revert previous date-munging patch * Thu Nov 03 2022 Amit Shah - 221-13.amzn2022.0.2 - Add /usr/lib/rpm/amazon as a symlink for macro lookup paths * Thu Sep 29 2022 Stewart Smith - 221-13.amzn2022.0.1 - AL2022 pre-GA mass rebuild * Thu Sep 1 2022 Stewart Smith - 221-13 - Limit java_arches to aarch64 and x86_64 * Wed Aug 31 2022 Amit Shah - 221-12 - Bump up release to get a unique nvr for the next build. * Thu Jul 28 2022 Amit Shah - 221-10 - Use 'amazon' as vendor * Fri Jul 15 2022 Benjamin Herrenschmidt - 221-9 - Avoid repoclosure complaints related to annobin and gcc 12 * Wed Jul 6 2022 Amit Shah - 221-8 - Re-add clang ldflags for -fno-openmp-implicit-rpath, now that we have clang14 * Wed Jul 6 2022 Benjamin Herrenschmidt - 221-7 - Fixup package notes dependency * Wed Jul 6 2022 Benjamin Herrenschmidt - 221-6 - Re-enable package notes * Wed Jul 6 2022 Benjamin Herrenschmidt - 221-5 - Set default tuning on aarch64 CFLAGS as well * Tue Jul 5 2022 Amit Shah - 221-4 - Remove clang ldflags for -fno-openmp-implicit-rpath, clang13 does not recognize this option. * Tue Jul 5 2022 Benjamin Herrenschmidt - 221-3 - Merge 221 from Fedora 36 and adjust for AL2022 * Tue Jul 5 2022 Benjamin Herrenschmidt - 201-2 - Merge 201 from Fedora 35 and adjust for AL2022 * Tue Sep 14 2021 Stewart Smith - 182-2 - Optimize with -ftree-vectorize in CFLAGS - Fork for Amazon Linux 2022