---
kernel-source.changes | 1 +
rpm/group-source-files | 33 ++++++++++++++++++++++++++++++
rpm/kernel-binary.spec.in | 6 ++--
rpm/kernel-source.spec.in | 48 ++++++++++++++++++++++++++++++++++++++++++++-
rpm/kernel-syms.spec.in | 4 +-
5 files changed, 86 insertions(+), 6 deletions(-)
create mode 100755 rpm/group-source-files
diff --git a/kernel-source.changes b/kernel-source.changes
index 959ec1f..2159ede 100644
--- a/kernel-source.changes
+++ b/kernel-source.changes
@@ -3,6 +3,7 @@ Fri Feb 5 07:47:40 UTC 2010 - jengelh@medozas.de
- use standard short options in tar commands
- rpm/kernel-source.spec.in: use macros in a few more places
+- rpm/kernel-source.spec.in: split devel files and full source
-------------------------------------------------------------------
Thu Feb 4 13:23:57 CET 2010 - knikanth@suse.de
diff --git a/rpm/group-source-files b/rpm/group-source-files
new file mode 100755
index 0000000..1511609
--- /dev/null
+++ b/rpm/group-source-files
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+loc="$1";
+if [[ -z "$loc" ]]; then
+ echo "Need to specify the location of the tree to be trimmed.";
+ exit 1;
+fi;
+
+exec 7> >(sort -u > FL-devel-dirs.raw);
+for i in ` (
+ find "$loc" -type f \( \
+ -iname "Kconfig*" -o -iname "Kbuild*" -o \
+ -iname "Makefile*" \);
+ find "$loc"/{include/*,scripts} "$loc"/arch/*/include \
+ ! -type d; ) |
+ sort -u`; do
+
+ i="${i#$loc/}";
+ d="${i%/*}";
+ [[ "$i" != "$d" ]] && echo "$loc/$d" >&7;
+ echo "$loc/$i";
+done | sort -u >FL-devel-files.raw;
+
+find "$loc" -type d | sort -u | perl -pe 's{^}{%dir /}' >FL-all-dirs.rpm;
+diff -dpru <(find "$loc" ! -type d | sort) FL-devel-files.raw |
+ tail -n +4 | grep ^- | cut -b 2- >FL-all-files.raw;
+
+perl -pe 's{^}{%dir /}' FL-devel-dirs.rpm;
+perl -pe 's{^}{/}' FL-devel-files.rpm;
+perl -pe 's{^}{/}' FL-all-files.rpm;
+
+comm FL-all-files.raw FL-devel-files.raw | \
+ pcregrep '^[^\t]' >FL-nondevel-files.raw;
diff --git a/rpm/kernel-binary.spec.in b/rpm/kernel-binary.spec.in
index 93d61dd..c68e2dc 100644
--- a/rpm/kernel-binary.spec.in
+++ b/rpm/kernel-binary.spec.in
@@ -346,7 +346,7 @@ fi
export NO_BRP_STRIP_DEBUG=true
# /lib/modules/%kernelrelease-%build_flavor/build will be a stale symlink until the
-# kernel-source package is installed. Don't check for stale symlinks
+# kernel-devel package is installed. Don't check for stale symlinks
# in the brp-symlink check:
export NO_BRP_STALE_LINK_ERROR=yes
@@ -516,7 +516,7 @@ if [ %CONFIG_MODULES = y ]; then
%endif
# Also put the resulting file in %rpm_install_dir/%cpu_arch/%build_flavor
- # so that kernel-source + kernel-%build_flavor is sufficient for building
+ # so that kernel-devel + kernel-%build_flavor is sufficient for building
# modules that have modversions as well.
mkdir -p %rpm_install_dir/%cpu_arch/%build_flavor
cp Module.symvers %rpm_install_dir/%cpu_arch/%build_flavor
@@ -775,7 +775,7 @@ License: GPL v2 only
Group: Development/Sources
Provides: multiversion(kernel)
Provides: %name-devel = %version-%source_rel
-Requires: kernel-source%variant = %version-%source_rel
+Requires: kernel-devel%variant = %version-%source_rel
Supplements: packageand(%name:kernel-source)
AutoReqProv: on
diff --git a/rpm/kernel-source.spec.in b/rpm/kernel-source.spec.in
index 3395d0a..3492ec4 100644
--- a/rpm/kernel-source.spec.in
+++ b/rpm/kernel-source.spec.in
@@ -18,6 +18,8 @@
# norootforbuild
# icecream 0
+%define huge_package 0
+
%define srcversion @SRCVERSION@
%define patchversion @PATCHVERSION@
%define variant @VARIANT@%{nil}
@@ -27,6 +29,7 @@
%define src_install_dir usr/src/linux-%kernelrelease%variant
%define obj_install_dir /%src_install_dir-obj
%define rpm_install_dir %buildroot%real_install_dir
+%define fullsrc_install_dir usr/src/linux-src-%kernelrelease%variant
Name: kernel-source@VARIANT@
Summary: The Linux Kernel Sources
@@ -41,7 +44,7 @@ Group: Development/Sources
Url: http://www.kernel.org/
AutoReqProv: off
BuildRequires: coreutils sed
-BuildRequires: fdupes
+BuildRequires: fdupes pcre-tools
Requires(post): coreutils sed
Provides: multiversion(kernel)
Provides: linux
@@ -62,6 +65,7 @@ Source21: config.conf
Source23: supported.conf
Source33: check-for-config-changes
Source34: check-supported-list
+Source35: group-source-files
Source37: README.SUSE
Source38: README.KSYMS
Source40: source-timestamp
@@ -114,6 +118,19 @@ Linux kernel sources with many fixes and improvements.
%source_timestamp
+%package -n kernel-devel
+Summary: Development files needed for building kernel modules
+License: GPL v2 only
+Group: Development/Sources
+AutoReqProv: off
+Provides: multiversion(kernel)
+
+%description -n kernel-devel
+Kernel-level headers and Makefiles required for development of
+external kernel modules.
+
+%source_timestamp
+
%package vanilla
Summary: Vanilla Linux kernel sources with minor build fixes.
License: GPL v2 only
@@ -192,9 +209,38 @@ for script in post; do
%_sourcedir/source-$script.sh > %name-$script.sh
done
+pushd "%buildroot"
+%if %huge_package
+cp -a "%src_install_dir" "%fullsrc_install_dir"
+echo "-%release-LOCAL" >"%fullsrc_install_dir/localversion"
+%endif
+
+# Remove files that are unneeded for KMP building
+"%_sourcedir/group-source-files" "%src_install_dir"
+xargs -a FL-nondevel-files.raw rm -f
+cat FL-devel-{dirs,files}.rpm >>"$OLDPWD/master.files"
+mv FL-* "%_sourcedir/"
+find "%src_install_dir" -type d -print0 | sort -rz | \
+ xargs -0 rmdir 2>/dev/null || :
+find "%src_install_dir" -type d | sort | \
+ perl -pe 's{^}{%%dir /}' >>"$OLDPWD/master.files"
+popd
%post -f %name-post.sh
+
+# Need a near-empty kernel-source package for the time being, or
+# Build will pick an older kernel-source that will then - naturally -
+# clash with kernel-devel.
%files
+%defattr(-,root,root)
+%if %huge_package
+/%fullsrc_install_dir
+%else
+# Need something, or rpmlint will delete the package.
+%dir /usr/src
+%endif
+
+%files -n kernel-devel
%defattr(-, root, root)
%ghost /usr/src/linux%variant
/usr/share/doc/packages/%name
diff --git a/rpm/kernel-syms.spec.in b/rpm/kernel-syms.spec.in
index 693727e..fcfcc18 100644
--- a/rpm/kernel-syms.spec.in
+++ b/rpm/kernel-syms.spec.in
@@ -27,7 +27,7 @@ Version: @RPMVERSION@
%if %using_buildservice
Release: @RELEASE_PREFIX@<RELEASE>
%else
-%define kernel_source_release %(LC_ALL=C rpm -q kernel-source%variant-%version --qf "%{RELEASE}" | grep -v 'not installed' || echo 0)
+%define kernel_source_release %(LC_ALL=C rpm -q kernel-devel%variant-%version --qf "%{RELEASE}" | grep -v 'not installed' || echo 0)
Release: %kernel_source_release
%endif
License: GPL v2 only
@@ -38,7 +38,7 @@ BuildRequires: coreutils
@REQUIRES@
Provides: multiversion(kernel)
Source: README.KSYMS
-Requires: kernel-source%variant = %version-%source_rel
+Requires: kernel-devel%variant = %version-%source_rel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: @ARCHS@
Prefix: /usr/src
--
1.6.6.1
--
To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-kernel+help@opensuse.org