aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am1
-rwxr-xr-xfind-provides.in5
-rwxr-xr-xkmod.prov13
3 files changed, 19 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 31bc3fd..32b8587 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -25,6 +25,7 @@ pkg_scripts = \
http.req \
magic.prov \
magic.req \
+ kmod.prov \
perl.prov \
perl.req \
php.prov \
diff --git a/find-provides.in b/find-provides.in
index 105af38..d45d44a 100755
--- a/find-provides.in
+++ b/find-provides.in
@@ -64,6 +64,11 @@ done | sort -u
echo "$filelist" | tr '[:blank:]' \\n | @RPMVENDORDIR@/php.prov | sort -u
#
+# --- Kernel modules.
+[ -x @RPMVENDORDIR@/php.prov ] &&
+ echo "$filelist" | tr '[:blank:]' \\n | @RPMVENDORDIR@/kmod.prov | sort -u
+
+#
# --- Pkgconfig deps
[ -x @RPMVENDORDIR@/pkgconfigdeps.sh ] &&
echo "$filelist" | tr '[:blank:]' \\n | @RPMVENDORDIR@/pkgconfigdeps.sh -P | sort -u
diff --git a/kmod.prov b/kmod.prov
new file mode 100755
index 0000000..f378ec3
--- /dev/null
+++ b/kmod.prov
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+provideslist=`sed "s/['\"]/\\\&/g"`
+modulelist=$(echo "$provideslist" | egrep '^.*(/lib/modules/|/var/lib/dkms/).*\.ko(\.gz)?$')
+echo $modulelist | xargs -r /sbin/modinfo | \
+ perl -lne '
+$name = $1 if m!^filename:.*\b([^/]+)\.k?o!;
+$ver = $1 if /^version:\s*[a-zA-Z]{0,6}\-?(\d+[\.\:\-\[\]]?\d*[\.\:\-\[\]]?\d*[\.\:\-\[\]]?\d*[\.\:\-\[\]]?\d*-?[a-zA-Z]{0,6}\d?).*/;
+if (/^srcversion:/) {
+ print "kmod\($name\) = $ver" if $name && $ver;
+ undef $name, $ver;
+}
+'