Several small changes:

- Modify several conditionals to support RHEL 9+ and drop ancient Fedora 17
- Add explicit conflict with older lua-devel
- Require rpm, not redhat-rpm-config
This commit is contained in:
Miro Hrončok 2020-09-01 10:48:49 +02:00
parent 2165bb7a44
commit 89a57c128a
2 changed files with 19 additions and 5 deletions

View File

@ -1,12 +1,18 @@
%if 0%{?el8}
# RHEL's lua-devel ships macros.lua and lua.attr
# RHEL8's lua-devel ships macros.lua and lua.attr
# skip shipping lua-rpm-macros so we don't conflict
%bcond_with rpm_macros
%else
%bcond_without rpm_macros
%endif
%if 0%{?fedora} >= 33
# Versions of lua-devel where the macros were removed
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
%global lua_conflict 5.4.0-7
%endif
# TODO add new versions if this gets backported
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
# requires RPM >= 4.16
%bcond_without requires_generator
%else
@ -15,7 +21,7 @@
Name: lua-rpm-macros
Version: 1
Release: 2%{?dist}
Release: 3%{?dist}
Summary: The common Lua RPM macros
License: MIT
@ -35,6 +41,9 @@ BuildArch: noarch
# for lua_libdir and lua_pkgdir
Requires: lua-srpm-macros = %{version}-%{release}
# files were moved from here
%{?lua_conflict:Conflicts: lua-devel < %{lua_conflict}}
%description
This package contains Lua RPM macros.
@ -45,7 +54,7 @@ You should not need to install this package manually as lua-devel requires it.
Summary: RPM macros for building Lua source packages
# For directory structure
Requires: redhat-rpm-config
Requires: rpm
%description -n lua-srpm-macros
RPM macros for building Lua source packages.
@ -85,6 +94,11 @@ install -Dpm 0644 lua.attr %{buildroot}/%{_fileattrsdir}/lua.attr
%changelog
* Tue Sep 01 2020 Miro Hrončok <mhroncok@redhat.com> - 1-3
- Modify several conditionals to support RHEL 9+ and drop ancient Fedora 17
- Add explicit conflict with older lua-devel
- Require rpm, not redhat-rpm-config
* Mon Aug 31 2020 Michel Alexandre Salim <salimma@fedoraproject.org> - 1-2
- Also move lua.attr requires generator

View File

@ -1,7 +1,7 @@
%lua_version %{lua: print(string.sub(_VERSION, 5))}
%lua_requires \
%if 0%{?fedora} >= 16 || 0%{?rhel} >= 7 \
%if 0%{?fedora} || 0%{?rhel} >= 7 \
Requires: lua(abi) = %{lua_version} \
%else \
Requires: lua >= %{lua_version} \