Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mike Marciniszyn and committed by
Michal Marek
2174d292 41612378

+26 -2
+26 -2
scripts/package/mkspec
··· 1 1 #!/bin/sh 2 2 # 3 - # Output a simple RPM spec file that uses no fancy features requiring 4 - # RPM v4. This is intended to work with any RPM distro. 3 + # Output a simple RPM spec file. 4 + # This version assumes a minimum of RPM 4.0.3. 5 5 # 6 6 # The only gothic bit here is redefining install_post to avoid 7 7 # stripping the symbols from files in the kernel which we want ··· 59 59 echo "building most standard programs and are also needed for rebuilding the" 60 60 echo "glibc package." 61 61 echo "" 62 + echo "%package devel" 63 + echo "Summary: Development package for building kernel modules to match the $__KERNELRELEASE kernel" 64 + echo "Group: System Environment/Kernel" 65 + echo "AutoReqProv: no" 66 + echo "%description -n kernel-devel" 67 + echo "This package provides kernel headers and makefiles sufficient to build modules" 68 + echo "against the $__KERNELRELEASE kernel package." 69 + echo "" 62 70 63 71 if ! $PREBUILT; then 64 72 echo "%prep" ··· 117 109 echo 'mv vmlinux.orig vmlinux' 118 110 echo "%endif" 119 111 112 + echo 'rm -f $RPM_BUILD_ROOT'"/lib/modules/$KERNELRELEASE/{build,source}" 113 + echo "mkdir -p "'$RPM_BUILD_ROOT'"/usr/src/kernels/$KERNELRELEASE" 114 + echo "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\"" 115 + echo "tar "'$EXCLUDES'" -cf- . | (cd "'$RPM_BUILD_ROOT'"/usr/src/kernels/$KERNELRELEASE;tar xvf -)" 116 + echo 'cd $RPM_BUILD_ROOT'"/lib/modules/$KERNELRELEASE" 117 + echo "ln -sf /usr/src/kernels/$KERNELRELEASE build" 118 + echo "ln -sf /usr/src/kernels/$KERNELRELEASE source" 119 + 120 120 echo "" 121 121 echo "%clean" 122 122 echo 'rm -rf $RPM_BUILD_ROOT' ··· 142 126 echo '%defattr (-, root, root)' 143 127 echo "%dir /lib/modules" 144 128 echo "/lib/modules/$KERNELRELEASE" 129 + echo "%exclude /lib/modules/$KERNELRELEASE/build" 130 + echo "%exclude /lib/modules/$KERNELRELEASE/source" 145 131 echo "/lib/firmware/$KERNELRELEASE" 146 132 echo "/boot/*" 147 133 echo "" 148 134 echo "%files headers" 149 135 echo '%defattr (-, root, root)' 150 136 echo "/usr/include" 137 + echo "" 138 + echo "%files devel" 139 + echo '%defattr (-, root, root)' 140 + echo "/usr/src/kernels/$KERNELRELEASE" 141 + echo "/lib/modules/$KERNELRELEASE/build" 142 + echo "/lib/modules/$KERNELRELEASE/source" 151 143 echo ""