From fb0c9752cea3bc073c37810b54e9e69f59770d1a Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Thu, 21 Dec 2023 23:05:57 -0500 Subject: [PATCH] Avoid lzip dependency in RHEL builds lzip is unwanted in RHEL, but bsdtar (from libarchive) can decompress .tar.lz itself. The only complication is that we have to bypass %__rpmuncompress and handle the decompression in %setup. However, this avoids the need for the maintainer to manually repack the sources. --- ed.spec | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ed.spec b/ed.spec index 6df4445..30f6bfb 100644 --- a/ed.spec +++ b/ed.spec @@ -12,7 +12,11 @@ Source2: https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x8FE99503132D774 BuildRequires: gcc BuildRequires: make +%if 0%{?rhel} +BuildRequires: bsdtar +%else BuildRequires: lzip +%endif # for gpg verification BuildRequires: gnupg2 @@ -24,7 +28,13 @@ replaced in normal usage by full-screen editors (emacs and vi, for example). %prep %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' +%if 0%{?rhel} +# no lzip in RHEL; bsdtar can handle it but not from within %%setup. +%setup -q -c -T +bsdtar -xf %{SOURCE0} -C %{_builddir} +%else %autosetup +%endif %build %set_build_flags