aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMike Marciniszyn <mike.marciniszyn@intel.com>2013-07-08 13:14:06 -0400
committerMichal Marek <mmarek@suse.cz>2013-07-23 08:36:44 -0400
commit2174d2920151a572df7c9da2946afbc3f84e3191 (patch)
tree98726dfac6bb7b274d69b7f316771b4e6e9f8ef7 /scripts
parent41612378da980cd98a0191c1307ff62d4ee20fb8 (diff)
rpm-pkg: add generation of kernel-devel
Change the spec file to generate a kernel-devel module allowing for compilation of external kernel modules. This patch requires a new minimum RPM level of 4.0.3. Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/package/mkspec28
1 files changed, 26 insertions, 2 deletions
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index 514aeb2bb422..13957602f7ca 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -1,7 +1,7 @@
1#!/bin/sh 1#!/bin/sh
2# 2#
3# Output a simple RPM spec file that uses no fancy features requiring 3# Output a simple RPM spec file.
4# RPM v4. This is intended to work with any RPM distro. 4# This version assumes a minimum of RPM 4.0.3.
5# 5#
6# The only gothic bit here is redefining install_post to avoid 6# The only gothic bit here is redefining install_post to avoid
7# stripping the symbols from files in the kernel which we want 7# stripping the symbols from files in the kernel which we want
@@ -59,6 +59,14 @@ echo "header files define structures and constants that are needed for"
59echo "building most standard programs and are also needed for rebuilding the" 59echo "building most standard programs and are also needed for rebuilding the"
60echo "glibc package." 60echo "glibc package."
61echo "" 61echo ""
62echo "%package devel"
63echo "Summary: Development package for building kernel modules to match the $__KERNELRELEASE kernel"
64echo "Group: System Environment/Kernel"
65echo "AutoReqProv: no"
66echo "%description -n kernel-devel"
67echo "This package provides kernel headers and makefiles sufficient to build modules"
68echo "against the $__KERNELRELEASE kernel package."
69echo ""
62 70
63if ! $PREBUILT; then 71if ! $PREBUILT; then
64echo "%prep" 72echo "%prep"
@@ -109,6 +117,14 @@ echo 'mv vmlinux.bz2 $RPM_BUILD_ROOT'"/boot/vmlinux-$KERNELRELEASE.bz2"
109echo 'mv vmlinux.orig vmlinux' 117echo 'mv vmlinux.orig vmlinux'
110echo "%endif" 118echo "%endif"
111 119
120echo 'rm -f $RPM_BUILD_ROOT'"/lib/modules/$KERNELRELEASE/{build,source}"
121echo "mkdir -p "'$RPM_BUILD_ROOT'"/usr/src/kernels/$KERNELRELEASE"
122echo "EXCLUDES=\"$RCS_TAR_IGNORE --exclude .tmp_versions --exclude=*vmlinux* --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation --exclude=firmware --exclude .config.old --exclude .missing-syscalls.d\""
123echo "tar "'$EXCLUDES'" -cf- . | (cd "'$RPM_BUILD_ROOT'"/usr/src/kernels/$KERNELRELEASE;tar xvf -)"
124echo 'cd $RPM_BUILD_ROOT'"/lib/modules/$KERNELRELEASE"
125echo "ln -sf /usr/src/kernels/$KERNELRELEASE build"
126echo "ln -sf /usr/src/kernels/$KERNELRELEASE source"
127
112echo "" 128echo ""
113echo "%clean" 129echo "%clean"
114echo 'rm -rf $RPM_BUILD_ROOT' 130echo 'rm -rf $RPM_BUILD_ROOT'
@@ -126,6 +142,8 @@ echo "%files"
126echo '%defattr (-, root, root)' 142echo '%defattr (-, root, root)'
127echo "%dir /lib/modules" 143echo "%dir /lib/modules"
128echo "/lib/modules/$KERNELRELEASE" 144echo "/lib/modules/$KERNELRELEASE"
145echo "%exclude /lib/modules/$KERNELRELEASE/build"
146echo "%exclude /lib/modules/$KERNELRELEASE/source"
129echo "/lib/firmware/$KERNELRELEASE" 147echo "/lib/firmware/$KERNELRELEASE"
130echo "/boot/*" 148echo "/boot/*"
131echo "" 149echo ""
@@ -133,3 +151,9 @@ echo "%files headers"
133echo '%defattr (-, root, root)' 151echo '%defattr (-, root, root)'
134echo "/usr/include" 152echo "/usr/include"
135echo "" 153echo ""
154echo "%files devel"
155echo '%defattr (-, root, root)'
156echo "/usr/src/kernels/$KERNELRELEASE"
157echo "/lib/modules/$KERNELRELEASE/build"
158echo "/lib/modules/$KERNELRELEASE/source"
159echo ""