Add support for LTS versioned sub-packages

This change allows you to use one common spec file for two purposes:

1. If the name is set to "make" you get the same make-X.Y packages
as before.

2. If the name is set to "make-latest" you get a make-latest
meta-package and a makeXY subpackage on which it depends.  The
subpackage installs in /opt (or elsewhere) to avoid conflict with an
installed make-X.Y.  In this case, the user should edit:

  %global make make43   <-- to match the version being installed
  %global _prefix /opt/rh/%{make}  <-- to where you want it
This commit is contained in:
DJ Delorie 2022-06-01 16:42:04 -04:00
parent 00a29b7cdd
commit b3884b6199
1 changed files with 42 additions and 10 deletions

View File

@ -1,13 +1,31 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
Summary: A GNU tool which simplifies the build process for users # This decides the SRPM name. Set to "make" for a rolling release
# (like Fedora) or "make-latest" for a long term release that needs
# optional versioned updates.
Name: make Name: make
Epoch: 1 Epoch: 1
Version: 4.3 Version: 4.3
Release: 8%{?dist} Release: 9%{?dist}
License: GPLv3+ License: GPLv3+
URL: http://www.gnu.org/software/make/ URL: http://www.gnu.org/software/make/
Source: ftp://ftp.gnu.org/gnu/make/make-%{version}.tar.gz Source: ftp://ftp.gnu.org/gnu/make/make-%{version}.tar.gz
%if "%{name}" != "make"
# Set this to the sub-package base name, for "make-latest"
%global make make43
%if 0%{?rhel} > 0
%global _prefix /opt/rh/%{make}
%else
# We intentionally do not define a case for Fedora, as it should not
# need this functionality, and letting it error avoids accidents.
%{error:"Each downstream must specify its own /opt namespace"}
%endif
Summary: Meta package to include latest version of make
%else
%global make %{name}
Summary: A GNU tool which simplifies the build process for users
%endif
%if 0%{?rhel} > 0 %if 0%{?rhel} > 0
# This gives the user the option of saying --with guile, but defaults to WITHOUT # This gives the user the option of saying --with guile, but defaults to WITHOUT
%bcond_with guile %bcond_with guile
@ -46,7 +64,18 @@ BuildRequires: pkgconfig(guile-2.2)
%endif %endif
BuildRequires: gcc BuildRequires: gcc
%description %if "%{name}" != "make"
# We're still on the make-latest package
Requires: %{make}
%description -n make-latest
The latest GNU Make, with a version-specific install
%files -n make-latest
%package -n %{make}
Summary: A GNU tool which simplifies the build process for users
%endif
%description -n %{make}
A GNU tool for controlling the generation of executables and other A GNU tool for controlling the generation of executables and other
non-source files of a program from the program's source files. Make non-source files of a program from the program's source files. Make
allows users to build and install packages without any significant allows users to build and install packages without any significant
@ -54,14 +83,14 @@ knowledge about the details of the build process. The details about
how the program should be built are provided for make in the program's how the program should be built are provided for make in the program's
makefile. makefile.
%package devel %package -n %{make}-devel
Summary: Header file for externally visible definitions Summary: Header file for externally visible definitions
%description devel %description -n %{make}-devel
The make-devel package contains gnumake.h. The %{make}-devel package contains gnumake.h.
%prep %prep
%autosetup -p1 %autosetup -n make-%{version} -p1
rm -f tests/scripts/features/parallelism.orig rm -f tests/scripts/features/parallelism.orig
@ -83,14 +112,14 @@ ln -sf make ${RPM_BUILD_ROOT}/%{_bindir}/gmake
ln -sf make.1 ${RPM_BUILD_ROOT}/%{_mandir}/man1/gmake.1 ln -sf make.1 ${RPM_BUILD_ROOT}/%{_mandir}/man1/gmake.1
rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir
%find_lang %name %find_lang make
%check %check
echo ============TESTING=============== echo ============TESTING===============
/usr/bin/env LANG=C make check && true /usr/bin/env LANG=C make check && true
echo ============END TESTING=========== echo ============END TESTING===========
%files -f %{name}.lang %files -n %{make} -f make.lang
%license COPYING %license COPYING
%doc NEWS README AUTHORS %doc NEWS README AUTHORS
%{_bindir}/* %{_bindir}/*
@ -98,10 +127,13 @@ echo ============END TESTING===========
%{_infodir}/*.info* %{_infodir}/*.info*
%{_includedir}/gnumake.h %{_includedir}/gnumake.h
%files devel %files -n %{make}-devel
%{_includedir}/gnumake.h %{_includedir}/gnumake.h
%changelog %changelog
* Wed Jun 29 2022 DJ Delorie <dj@redhat.com> - 1:4.3-9
- Enable long-term supported builds.
* Fri Apr 8 2022 DJ Delorie <dj@redhat.com> - 1:4.3-8 * Fri Apr 8 2022 DJ Delorie <dj@redhat.com> - 1:4.3-8
- Rewrite filter/filter-out to avoid large stack usage. BZ #2010506 - Rewrite filter/filter-out to avoid large stack usage. BZ #2010506
- Require perl core modules for testsuite - Require perl core modules for testsuite