[ATrpms-devel] latest kmdl macros
Axel Thimm
Axel.Thimm at atrpms.net
Fri Jun 17 10:54:13 CEST 2005
On Tue, Jun 14, 2005 at 10:38:22AM +1000, Peter Tiggerdine wrote:
> On Mon, 2005-06-13 at 07:12 -0400, Paulo Cavalcanti wrote:
> > If you guide me and possibly send me an updated version of the
> > atrpms macros to my email only (I promiss no to slip then to
> > anyone), I will be glad to help.
It is not about slipping a company secret, the macros are being posted
on atrpms-devel.
> Why is it that the atrpms.macro isin't distributed for all to use??
> It would certainly make it _alot_ easier to contribute to this great
> project.
There is significant parts of a proper infrastructure missing that
need to be modelled manually. That's probably the cause of the kernel/kmdl
mismatches for 2.4 kernels. So the macros are very nice to have, but
you'll fall into the false impression that "now it should work".
It doesn't and as a proof of that here are the latest macros I use on
my buildserver.
What I want to avoid at all costs are users thinking they can rebuild
kmdls for their even possibly unpackaged kernel by simply plugging in
these macros. After banging their head against a wall for a couple of
days, they will course on ATrpms. ...
#
# Please distribute *only* with this comment block.
#
# These are the macros used in ATrpms' build machine. They may or may
# not work in your setup, but you will get the idea and adapt them to
# your setup or vice-versa.
#
# If you think that these macros are all you need for rebuilding kmdl
# rpms you are in error, you also need a working kernel source tree
# infrastructure to point these macros to.
#
# E.g. perform the same steps the Red Hat kernel specfiles do for
# setting up a kernel. You only need to go as far as
# configuring/preparing the tree. Building the kernel/kernel module
# themselves is overkill.
%_kernel %(uname -r)
%kmdl_kernelsrcdir /lib/modules/%{_kernel}/build
%kmdl_userland %(test "%{_kernel}" = none && echo 1 || echo 0)
%_kflavour %(echo %{_kernel} | grep -E '(smp|enterprise|bigmem)' | sed -e's/^.*\\(smp\\|enterprise\\|bigmem\\).*$/\\1/')
%_kversion %(echo %{_kernel} | sed -e's/^\\(.*\\)\\(smp\\|enterprise\\|bigmem\\).*$/\\1/')
%_krelver %(echo %{_kversion} | sed -e's/-/_/')
# The name of the kernel with flavour ("kernel", "kernel-smp", ...)
%_kname %(echo kernel-%{_kflavour} | sed -e's/-$//')
# A very old naming scheme
#_kname2 %(echo kmodule-%{_kflavour} | sed -e's/-$//')
# The old ATrpms naming scheme ("kmdl", "kmdl-smp")
%_kname3 %(echo kmdl-%{_kflavour} | sed -e's/-$//')
%_modflags -include /tmp/atrpms-mykernel-%{_kernel}-%{_target_cpu}.h -DMODULE -DMODVERSIONS -include %{_kernelsrcdir}/include/linux/modversions.h
# "kernel": the output of "uname -r" of the kernel to build for
# (default: the running one)
# "_kernelsrcdir": The directory of the sources used to build "kernel"
# (default: /lib/modules/%{_kernel}/build)
%kmdl_name %{_kpkgname}-kmdl-%{_kernel}
%kmdl_nameof() %1-kmdl-%{_kernel}
%kmdl_namepure %{_kpkgname}-kmdl
%kmdl_namepureof() %1-kmdl
#
%kmdl_name_old kernel-module-%{_kpkgname}-%{_kernel}
%kmdl_nameof_old() kernel-module-%1-%{_kernel}
%kmdl_namepure_old kernel-module-%{_kpkgname}
%kmdl_namepureof_old() kernel-module-%1
#_kmdl_name_old %{_kpkgname}-kmdl-%{_kernel}
#_kmdl_nameof_old() %1-kmdl-%{_kernel}
#_kmdl_name_old %{_kpkgname}-%{_kname3}-%{_kversion}
#_kmdl_nameof_old() %1-%{_kname3}-%{_kversion}
#_kmdl_namepure_old %{_kpkgname}-kmdl
#_kmdl_namepureof_old() %1-kmdl
%_kernelbuildreq %{nil}
%kmdl() \
%{expand:%%global _kpkgname %1} \
%_kernelbuildreq \
%{nil}
%kmdl_parentdependencies\
Requires: %{kmdl_namepure}-%{evr}
%kmdl_dependencies\
#Requires: atrpms-kmdl-helper \
#Requires: strictdep-%{_kname}-%{_target_cpu} = %{_kversion}\
Requires: /boot/vmlinuz-%{_kernel}\
Requires: %{_kname} = %{_kversion}, /sbin/depmod, modutils >= 2.4.14\
BuildRequires: %_kernelcompiler\
Provides: %kmdl_namepure-%{evr}\
Provides: %kmdl_namepure-%_kernel = %{evr}\
#\
# backward compatibility kernel-module-foo\
#Provides: %kmdl_namepure_old-%{evr}\
#Provides: %kmdl_namepure_old-%_kernel = %{evr}\
Obsoletes: %kmdl_namepure_old-%{evr}, %kmdl_namepure_old-%_kernel <= %{evr}
## backward compatibility foo-kmdl-smp\
#Provides: %{_kpkgname}-%{_kname3}-%{_kversion} = %{evr}\
#Provides: %{_kpkgname}-kmdl\
## backward compatibility with foo-kernel-...\
#Provides: %{_kpkgname}-kernel\
#%{?_kflavour:Provides: %{_kpkgname}-%{_kname}}\
#Provides: %{_kpkgname}-%{_kname}-%{_kversion} = %{evr}\
#Provides: %{_kpkgname}-%{_kname}-%{_kversion}-%{_target_cpu} = %{evr}\
## backward compatibility with unversioned kernel-module-foo\
#Provides: kernel-module-%{_kpkgname}\
#%{?_kflavour:Provides: %{_kname}-module-%{_kpkgname}}\
%_kernelcompiler_el4 /usr/bin/gcc
%_kernelcompiler_el3 /usr/bin/gcc
%_kernelcompiler_fc4 /usr/bin/gcc
%_kernelcompiler_fc3 /usr/bin/gcc
%_kernelcompiler_fc2 /usr/bin/gcc
%_kernelcompiler_fc1 /usr/bin/gcc32
%_kernelcompiler_rh9 /usr/bin/gcc
%_kernelcompiler_rh8_0 /usr/bin/gcc
%_kernelcompiler_rh7_3 /usr/bin/gcc
%_kernelcompiler %{expand:%%_kernelcompiler_%{disttag3}}
%kmdl_moduledir /lib/modules/%{_kernel}/updates
%kmdl_config\
export CC=%_kernelcompiler
%kmdl_desc\
This package contains the %kmdl_name kernel modules for the Linux kernel package:\
%{_kname}-%{_kversion}.%{_target_cpu}.rpm.
%_kernelname %{_kname}-%{_kversion}.%{_target_cpu}.rpm
%kmdl_install\
#%{_datadir}/atrpms/addcustomkmdl '/lib/modules/`uname -r`/updates'\
depmod -ae -F /boot/System.map-%{_kernel} %{_kernel} > /dev/null 2>&1 || :
%kmdl_remove\
depmod -ae -F /boot/System.map-%{_kernel} %{_kernel} > /dev/null 2>&1 || :
--
Axel.Thimm at ATrpms.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.atrpms.net/pipermail/atrpms-devel/attachments/20050617/11c6a91f/attachment.bin
More information about the atrpms-devel
mailing list