[redhat-rpm-config] - Move kmod and libsymlink dependency generators here from rpm - These are specific to Fedora so mig
Panu Matilainen
pmatilai at fedoraproject.org
Tue Apr 15 07:11:44 UTC 2014
commit dd2a70568b1b73fea9d07bf3690a2fb3abb241f4
Author: Panu Matilainen <pmatilai at redhat.com>
Date: Tue Apr 15 10:08:30 2014 +0300
- 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
kmod.attr | 2 ++
kmod.prov | 17 +++++++++++++++++
libsymlink.attr | 4 ++++
redhat-rpm-config.spec | 18 ++++++++++++++++--
4 files changed, 39 insertions(+), 2 deletions(-)
---
diff --git a/kmod.attr b/kmod.attr
new file mode 100644
index 0000000..f2a50d0
--- /dev/null
+++ b/kmod.attr
@@ -0,0 +1,2 @@
+%__kmod_provides %{_rpmconfigdir}/kmod.prov
+%__kmod_path ^/lib/modules/.*$
diff --git a/kmod.prov b/kmod.prov
new file mode 100644
index 0000000..82633e9
--- /dev/null
+++ b/kmod.prov
@@ -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
diff --git a/libsymlink.attr b/libsymlink.attr
new file mode 100644
index 0000000..8bb6404
--- /dev/null
+++ b/libsymlink.attr
@@ -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:]]$
diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec
index b59004d..672275e 100644
--- a/redhat-rpm-config.spec
+++ b/redhat-rpm-config.spec
@@ -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 at redhat.com> - 16-1
+- Move kmod and libsymlink dependency generators here from rpm
+
* Thu Apr 10 2014 Panu Matilainen <pmatilai at redhat.com> - 15-1
- Drop most of the script-based dependency generation bits
More information about the scm-commits
mailing list