from localhost (jalapeno [127.0.0.1])
	by jmason.org (Postfix) with ESMTP id C19D816F16
	for <jm@localhost>; Wed,  2 Oct 2002 21:15:46 +0100 (IST)
from jalapeno [127.0.0.1]
	by localhost with IMAP (fetchmail-5.9.0)
	for jm@localhost (single-drop); Wed, 02 Oct 2002 21:15:46 +0100 (IST)
from egwn.net (ns2.egwn.net [193.172.5.4]) by
    dogma.slashnull.org (8.11.6/8.11.6) with ESMTP id g92JeNK24434 for
    <jm-rpm@jmason.org>; Wed, 2 Oct 2002 20:40:23 +0100
from taz.localdomain (adsl-66-124-59-34.dsl.anhm01.pacbell.net
    [66.124.59.34]) by egwn.net (8.11.6/8.11.6/EGWN) with ESMTP id
    g92Jbkf24533 for <rpm-list@freshrpms.net>; Wed, 2 Oct 2002 21:37:46 +0200
by taz.localdomain (Postfix, from userid 500) id BBD8189D0;
    Wed,  2 Oct 2002 12:36:02 -0700 (PDT)
No, hits=-8.4 required=5.0
	tests=EMAIL_ATTRIBUTION,IN_REP_TO,KNOWN_MAILING_LIST,
	      PATCH_UNIFIED_DIFF,REFERENCES,REPLY_WITH_QUOTES,USER_AGENT,
	      USER_AGENT_MUTT
	version=2.50-cvs
From rpm-list-admin@freshrpms.net  Wed Oct  2 21:15:48 2002

On Wed, Oct 02, 2002 at 10:09:19AM +0200, Matthias Saou wrote:
> Well, I don't really find it consistent at all to use an rpm package built
> against something that wasn't installed through rpm :-/
Following that reasoning, I've been installing all my custom-built
kernels through rpm recently. I find it annoying, though, that
alsa-kernel, and similar packages, will only build for the currently
running kernel.
So I've attached a patch to specify an alternate kernel by setting the
"TARGET_KERNEL" environment variable before running rpmbuild. You
still need to have the rpm for the specified kernel installed, but at
least it doesn't have to be currently running. It's kinda hackish, so
if someone has a better way to do this, let me know.
gary

# Comma separated list of cards for which to compile a driver
-%define	kversion	%(echo $(uname -r) | sed -e s/smp// -)
+%if %(printenv TARGET_KERNEL >/dev/null && echo -n 1 || echo -n 0)
+%define usekernel	%(echo -n $TARGET_KERNEL)
+%define	kunamer		%{!?usekernel: %(uname -r)}%{?usekernel}
+%define	kversion	%(echo %{kunamer} | sed -e s/smp// -)
%define	karch		%(rpm -q --qf '%%{arch}' kernel%{?ksmp}-%{kversion})
+/sbin/depmod -a -F /boot/System.map-%{kunamer} %{kunamer}