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

headersinsource macro in kernel.spec



I'm building my own patched kernel based on the 2.2.16-21 kernel from Redhat.

I can't seem to get it to build a separate kernel-headers RPM.

In the .spec file, I set this:

# define headersinsource as 1 to make the kernel-source package
# include the contents of what would otherwise be in a kernel-headers
# package; as 0 for separate packages.  Used when a separate
# kernel-headers package is required.
%define headersinsource 0

which based on the comment should be right, but I never get a separate headers 
RPM.  The value of headersinsource is checked in various different ways.  Here 
are some fragments:

...
%if %{headersinsource}
%package source
Summary: The source code for the Linux kernel.
Group: Development/System
Prereq: fileutils
%else
%package source
Requires: kernel-headers = %{kversion}
Summary: The source code for the Linux kernel.
Group: Development/System
Prereq: fileutils

%package headers
Summary: Header files for the Linux kernel.
Group: Development/System
Prereq: fileutils
%endif
...
%if ! %{headersinsource}
%description headers
Kernel-headers includes the C header files for the Linux kernel.  The
header files define structures and constants that are needed for
building most standard programs and are also needed for rebuilding the
kernel.
%endif
...
%if %{headersinsource}
%triggerpostun -n kernel-source -- kernel-headers < 2.2.16
%else
%triggerpostun -- kernel-headers < 2.2.16
%endif
...
if [ %{headersinsource} -eq 0 ] ; then
	cd /usr/include
	rm -f linux
	ln -snf ../src/linux/include/linux linux
	rm -fr asm
	rm -f asm-sparc asm-sparc64
	ln -snf ../src/linux/include/asm-sparc asm-sparc
	ln -snf ../src/linux/include/asm-sparc64 asm-sparc64
	mkdir asm
	/usr/src/linux-%{kversion}/include/asm-sparc/BuildASM /usr/include/asm
fi
...
%if %{headersinsource}
%post source
%else
%post headers
%endif
...
%if ! %{headersinsource}
%post source
cd /usr/src
rm -f linux
ln -snf linux-%{kversion} linux
%endif


So, any idea why I never get a kernel-headers package out of this?

Chris

-- 
Chris Garrigues                 http://www.DeepEddy.Com/~cwg/
virCIO                          http://www.virCIO.Com
4314 Avenue C                   
Austin, TX  78751-3709		+1 512 374 0500

  My email address is an experiment in SPAM elimination.  For an
  explanation of what we're doing, see http://www.DeepEddy.Com/tms.html 

    Nobody ever got fired for buying Microsoft,
      but they could get fired for relying on Microsoft.


Attachment: pgp00002.pgp
Description: PGP signature


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