Add kmod.attr from redhat-rpm-config
This file is currently shipped via the binary redhat-rpm-config package itself, so we need an explicit Conflicts to avoid broken upgrades, as well as actually remove the file from the next redhat-rpm-config build, which we'll also do.
This commit is contained in:
parent
33b5f1bcf4
commit
101692ba47
@ -9,6 +9,8 @@ Summary: RPM macros that list arches the full kernel is built on
|
|||||||
License: MIT
|
License: MIT
|
||||||
URL: https://src.fedoraproject.org/rpms/kernel-srpm-macros
|
URL: https://src.fedoraproject.org/rpms/kernel-srpm-macros
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
# We are now the ones shipping kmod.attr
|
||||||
|
Conflicts: redhat-rpm-config <= 186
|
||||||
|
|
||||||
# Macros
|
# Macros
|
||||||
Source0: macros.kernel-srpm
|
Source0: macros.kernel-srpm
|
||||||
@ -20,10 +22,13 @@ Source101: find-requires.ksyms
|
|||||||
Source102: firmware.prov
|
Source102: firmware.prov
|
||||||
Source103: modalias.prov
|
Source103: modalias.prov
|
||||||
|
|
||||||
|
# Dependency generators & their rules
|
||||||
|
Source200: kmod.attr
|
||||||
|
|
||||||
# Misc helper scripts
|
# Misc helper scripts
|
||||||
Source200: kmodtool
|
Source300: kmodtool
|
||||||
Source201: rpmsort
|
Source301: rpmsort
|
||||||
Source202: symset-table
|
Source302: symset-table
|
||||||
|
|
||||||
%global rrcdir /usr/lib/rpm/redhat
|
%global rrcdir /usr/lib/rpm/redhat
|
||||||
|
|
||||||
@ -67,10 +72,12 @@ install -p -m 755 -t %{buildroot}%{rrcdir} kmodtool rpmsort symset-table
|
|||||||
install -p -m 755 -t %{buildroot}%{rrcdir} find-provides.ksyms find-requires.ksyms
|
install -p -m 755 -t %{buildroot}%{rrcdir} find-provides.ksyms find-requires.ksyms
|
||||||
install -p -m 644 -t %{buildroot}%{rrcdir}/find-provides.d firmware.prov modalias.prov
|
install -p -m 644 -t %{buildroot}%{rrcdir}/find-provides.d firmware.prov modalias.prov
|
||||||
install -p -m 644 -t %{buildroot}%{_rpmconfigdir}/macros.d macros.kmp
|
install -p -m 644 -t %{buildroot}%{_rpmconfigdir}/macros.d macros.kmp
|
||||||
|
install -p -m 644 -t %{buildroot}%{_fileattrsdir} kmod.attr
|
||||||
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%{_rpmconfigdir}/macros.d/macros.kernel-srpm
|
%{_rpmconfigdir}/macros.d/macros.kernel-srpm
|
||||||
|
%{_fileattrsdir}/kmod.attr
|
||||||
|
|
||||||
%files -n kernel-rpm-macros
|
%files -n kernel-rpm-macros
|
||||||
%{_rpmconfigdir}/macros.d/macros.kmp
|
%{_rpmconfigdir}/macros.d/macros.kmp
|
||||||
@ -85,7 +92,7 @@ install -p -m 644 -t %{buildroot}%{_rpmconfigdir}/macros.d macros.kmp
|
|||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Thu Jun 03 2021 Michal Domonkos <mdomonko@redhat.com> - 1.0-5
|
* Thu Jun 03 2021 Michal Domonkos <mdomonko@redhat.com> - 1.0-5
|
||||||
- Adopt kernel-rpm-macros subpackage from redhat-rpm-config
|
- Adopt kernel-rpm-macros & kmod.attr subpackage from redhat-rpm-config
|
||||||
|
|
||||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-4
|
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-4
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||||
|
21
kmod.attr
Normal file
21
kmod.attr
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
%__kmod_path ^/lib/modules/.*/(modules.builtin|.*ko)
|
||||||
|
%__kmod_provides() %{lua:
|
||||||
|
function basename(fn)
|
||||||
|
return string.gsub(fn, "(.*/)(.*)", "%2")
|
||||||
|
end
|
||||||
|
function printdep(mod)
|
||||||
|
print("kmod("..mod..")")
|
||||||
|
end
|
||||||
|
local fn = rpm.expand("%{1}")
|
||||||
|
local bn = basename(fn)
|
||||||
|
if bn == "modules.builtin" then
|
||||||
|
for l in io.lines(fn) do
|
||||||
|
printdep(basename(l))
|
||||||
|
end
|
||||||
|
else
|
||||||
|
local mod = string.match(bn, "%g+.ko")
|
||||||
|
if mod then
|
||||||
|
printdep(mod)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user