Autoselect kernel-smp-devel or kernel-devel in BuildRequires

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

New to the list. Hope to learn a bit how the pros do this rpm magic. I'm
trying to create a specfile that builds some kernel modules across
different distro's (FC4, FC5, RHEL, CentOS) and UP or SMP platforms. The
problem I have is that I need to be able to set the BuildRequires to
either kernel-smp-devel or kernel-devel (and similar for Requires).
I have tried a zillion things but lack the voodoo required. One of the
things I tried which failed was:

%{!?kvers:      %{expand: %%define kvers %(uname -r)}}
%define is_smp %(uname -r | grep -c smp && echo 1 || echo 0)

%if %{is_smp} = 1
%define kvers %(uname -r | cut -d s -f 1)
%endif

%package modules-%{kvers}
Summary: Zaptel kernel modules
Group: System Environment/Kernel

%if %{is_smp} == 1
BuildRequires: kernel-smp-devel = %{kvers}
Requires: kernel-smp = %{kvers}
%else
BuildRequires: kernel-devel = %{kvers}
Requires: kernel = %{kvers}
%endif

Anyone have an idea how I can set the proper kernel BuildRequires and
Requires during the rpmbuild process?

Thanks and regards,
Patrick

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux