- Move kmod and libsymlink dependency generators here from rpm

- These are specific to Fedora so might as well live here, and
  having them here also avoids having to carry patches in rpm
  for no good reason etc
This commit is contained in:
Panu Matilainen 2014-04-15 10:08:30 +03:00
parent 2cbbbb322e
commit dd2a70568b
4 changed files with 39 additions and 2 deletions

2
kmod.attr Normal file
View File

@ -0,0 +1,2 @@
%__kmod_provides %{_rpmconfigdir}/kmod.prov
%__kmod_path ^/lib/modules/.*$

17
kmod.prov Normal file
View File

@ -0,0 +1,17 @@
#!/bin/sh +x
IFS=$'\n'
for i in $(grep -E '(/lib/modules/.*\.ko|/lib/modules/.*/modules.builtin)');
do
kmod=$(basename $i);
if [ $kmod == "modules.builtin" ]; then
for j in $(cat $i); do
j=$(basename $j);
echo "kmod($j)"
done
else
echo "kmod($kmod)"
fi
done

4
libsymlink.attr Normal file
View File

@ -0,0 +1,4 @@
# Make libfoo.so symlinks require the soname-provide of the target library
%__libsymlink_requires %{_rpmconfigdir}/elfdeps --provides --soname-only
%__libsymlink_magic ^symbolic link to `.*lib.*\.so\..*'$
%__libsymlink_exclude_path ^.*[[:digit:]]$

View File

@ -6,7 +6,7 @@
Summary: Red Hat specific rpm configuration files
Name: redhat-rpm-config
Version: 15
Version: 16
Release: 1%{?dist}
# No version specified.
License: GPL+
@ -64,6 +64,11 @@ Source403: kmodtool
Source500: config.guess
Source501: config.sub
# Dependency generators & their rules
Source600: kmod.attr
Source601: kmod.prov
Source602: libsymlink.attr
BuildArch: noarch
Requires: coreutils
Requires: perl-srpm-macros
@ -100,11 +105,15 @@ install -p -m 755 -t %{buildroot}%{rrcdir} brp-*
install -p -m 755 -t %{buildroot}%{rrcdir} find-*
mkdir -p %{buildroot}%{rrcdir}/find-provides.d
install -p -m 644 -t %{buildroot}%{rrcdir}/find-provides.d *.prov
install -p -m 644 -t %{buildroot}%{rrcdir}/find-provides.d firmware.prov modalias.prov
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
install -p -m 755 -t %{buildroot}%{_rpmconfigdir} kmod.prov
%files
%defattr(-,root,root)
%dir %{rrcdir}
@ -114,6 +123,8 @@ install -p -m 644 -t %{buildroot}%{_rpmconfigdir}/macros.d macros.*
%{rrcdir}/dist.sh
%{rrcdir}/redhat-hardened-*
%{rrcdir}/config.*
%{_fileattrsdir}/*.attr
%{_rpmconfigdir}/kmod.prov
%{_rpmconfigdir}/macros.d/macros.*-srpm
%{_rpmconfigdir}/macros.d/macros.dwz
@ -131,6 +142,9 @@ install -p -m 644 -t %{buildroot}%{_rpmconfigdir}/macros.d macros.*
%{_rpmconfigdir}/macros.d/macros.kmp
%changelog
* Tue Apr 14 2014 Panu Matilainen <pmatilai@redhat.com> - 16-1
- Move kmod and libsymlink dependency generators here from rpm
* Thu Apr 10 2014 Panu Matilainen <pmatilai@redhat.com> - 15-1
- Drop most of the script-based dependency generation bits