2011-05-16 18:07:44 +02:00
|
|
|
--- ./macros.in.orig 2011-05-11 14:57:08.000000000 +0000
|
|
|
|
+++ ./macros.in 2011-05-11 15:01:39.000000000 +0000
|
|
|
|
@@ -470,14 +470,18 @@ print (t)\
|
2008-11-28 14:34:30 +01:00
|
|
|
#
|
|
|
|
# Path to scripts to autogenerate package dependencies,
|
|
|
|
#
|
|
|
|
+%__set_helper_env %{lua:
|
|
|
|
+posix.setenv("RPMBUILD_SPECFILE",rpm.expand("%?_specfile"));
|
|
|
|
+posix.setenv("RPMBUILD_SOURCEDIR",rpm.expand("%?_sourcedir"));
|
|
|
|
+}
|
|
|
|
# Note: Used iff _use_internal_dependency_generator is zero.
|
2009-08-28 15:54:03 +02:00
|
|
|
#%__find_provides %{_rpmconfigdir}/rpmdeps --provides
|
|
|
|
#%__find_requires %{_rpmconfigdir}/rpmdeps --requires
|
|
|
|
-%__find_provides %{_rpmconfigdir}/find-provides %name
|
|
|
|
-%__find_requires %{_rpmconfigdir}/find-requires %name
|
|
|
|
+%__find_provides %{__set_helper_env}%{_rpmconfigdir}/find-provides %name
|
|
|
|
+%__find_requires %{__set_helper_env}%{_rpmconfigdir}/find-requires %name
|
2008-09-12 20:37:28 +02:00
|
|
|
#%__find_conflicts ???
|
|
|
|
#%__find_obsoletes ???
|
|
|
|
-#%__find_supplements ???
|
2009-08-28 15:54:03 +02:00
|
|
|
+%__find_supplements %{__set_helper_env}%{_rpmconfigdir}/find-supplements %name
|
2008-09-12 20:37:28 +02:00
|
|
|
#%__find_enhances ???
|
|
|
|
|
2011-05-16 18:07:44 +02:00
|
|
|
#
|
|
|
|
--- ./scripts/find-supplements.ksyms.orig 2011-05-11 15:01:39.000000000 +0000
|
|
|
|
+++ ./scripts/find-supplements.ksyms 2011-05-11 15:01:39.000000000 +0000
|
2006-12-19 00:17:44 +01:00
|
|
|
@@ -0,0 +1,56 @@
|
|
|
|
+#! /bin/sh
|
|
|
|
+
|
|
|
|
+IFS=$'\n'
|
|
|
|
+
|
|
|
|
+case "$1" in
|
|
|
|
+kernel-module-*) ;; # Fedora kernel module package names start with
|
|
|
|
+ # kernel-module.
|
|
|
|
+kernel*) is_kernel_package=1 ;;
|
|
|
|
+esac
|
|
|
|
+
|
|
|
|
+if ! [ -z "$is_kernel_package" ]; then
|
|
|
|
+ cat > /dev/null
|
|
|
|
+ exit 0
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+print_modaliases() {
|
|
|
|
+ declare class=$1 variants=$2 pos=$3
|
|
|
|
+ if [ -n "$variants" ]; then
|
|
|
|
+ echo "${class:0:pos}[$variants]${class:pos+1}"
|
|
|
|
+ else
|
|
|
|
+ [ -z "$class" ] || echo "$class"
|
|
|
|
+ fi
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+combine_modaliases() {
|
|
|
|
+ declare tag class variants pos n
|
|
|
|
+ read class
|
|
|
|
+ while read tag; do
|
|
|
|
+ for ((n=0; n<${#class}; n++)); do
|
|
|
|
+ if [ "*" != "${class:n:1}" -a \
|
|
|
|
+ "${class:0:n}" = "${tag:0:n}" -a \
|
|
|
|
+ "${class:n+1}" = "${tag:n+1}" ] &&
|
|
|
|
+ ( [ -z "$pos" ] || [ $n = $pos ] ); then
|
|
|
|
+ variants="${variants:-${class:n:1}}${tag:n:1}"
|
|
|
|
+ pos=$n
|
|
|
|
+ break
|
|
|
|
+ fi
|
|
|
|
+ done
|
|
|
|
+ if [ $n -eq ${#class} ]; then
|
|
|
|
+ print_modaliases "$class" "$variants" "$pos"
|
|
|
|
+ variants=
|
|
|
|
+ pos=
|
|
|
|
+ class=$tag
|
|
|
|
+ fi
|
|
|
|
+ done
|
|
|
|
+ print_modaliases "$class" "$variants" "$pos"
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+for module in $(grep -E '/lib/modules/.+\.ko$'); do
|
|
|
|
+ vermagic=$(/sbin/modinfo -F vermagic "$module")
|
|
|
|
+ krel=${vermagic%% *}
|
|
|
|
+ /sbin/modinfo -F alias "$module" \
|
|
|
|
+ | sed -nre "s,(.+:.+),modalias(kernel-${krel##*-}:\\1),p"
|
|
|
|
+done \
|
|
|
|
+| sort -u \
|
|
|
|
+| combine_modaliases
|
2011-05-16 18:07:44 +02:00
|
|
|
--- ./scripts/find-supplements.orig 2011-05-11 15:01:39.000000000 +0000
|
|
|
|
+++ ./scripts/find-supplements 2011-05-11 15:01:39.000000000 +0000
|
|
|
|
@@ -0,0 +1,14 @@
|
|
|
|
+#!/bin/bash
|
|
|
|
+
|
|
|
|
+# This script reads filenames from STDIN and outputs any relevant provides
|
|
|
|
+# information that needs to be included in the package.
|
|
|
|
+IFS=$'\n'
|
|
|
|
+filelist=($(cat))
|
|
|
|
+
|
|
|
|
+#
|
|
|
|
+# --- Kernel module hardware identifiers
|
|
|
|
+# (e.g., modalias(pci:v0000109Ed00000878sv00000070sd0000FF01bc*sc*i*)
|
|
|
|
+[ -x /usr/lib/rpm/find-supplements.ksyms ] &&
|
|
|
|
+ printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/find-supplements.ksyms "$@"
|
|
|
|
+
|
|
|
|
+exit 0
|