SPECS: VirtualBox.spec - proper way to build kernel modules - clea...
zbyniu
zbyniu at pld-linux.org
Fri Feb 29 16:21:12 CET 2008
Author: zbyniu Date: Fri Feb 29 15:21:12 2008 GMT
Module: SPECS Tag: HEAD
---- Log message:
- proper way to build kernel modules
- cleaned up BRs marsh
---- Files affected:
SPECS:
VirtualBox.spec (1.64 -> 1.65)
---- Diffs:
================================================================
Index: SPECS/VirtualBox.spec
diff -u SPECS/VirtualBox.spec:1.64 SPECS/VirtualBox.spec:1.65
--- SPECS/VirtualBox.spec:1.64 Wed Feb 27 17:46:25 2008
+++ SPECS/VirtualBox.spec Fri Feb 29 16:21:07 2008
@@ -46,6 +46,7 @@
Patch3: %{pname}-disable-xclient-build.patch
Patch4: %{pname}-configure-spaces.patch
URL: http://www.virtualbox.org/
+%if %{with userspace}
BuildRequires: SDL-devel
BuildRequires: alsa-lib-devel
BuildRequires: bash
@@ -53,7 +54,9 @@
BuildRequires: bin86
BuildRequires: gcc >= 5:3.2.3
BuildRequires: iasl
-%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.7}
+%endif
+%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20}
+%if %{with userspace}
BuildRequires: libIDL-devel
BuildRequires: libuuid-devel
BuildRequires: libxslt-progs
@@ -61,7 +64,9 @@
BuildRequires: pulseaudio-devel
BuildRequires: qt-devel >= 6:3.3.6
BuildRequires: qt-linguist
-BuildRequires: rpmbuild(macros) >= 1.329
+%endif
+BuildRequires: rpmbuild(macros) >= 1.379
+%if %{with userspace}
BuildRequires: which
BuildRequires: xalan-c-devel >= 1.10.0
BuildRequires: xerces-c-devel >= 2.6.0
@@ -72,6 +77,7 @@
BuildRequires: libstdc++-multilib-devel
# TODO: How to add glibc-devel.i686 here ?
%endif
+%endif
Requires(post,preun): /sbin/chkconfig
Requires(postun): /usr/sbin/groupdel
Requires(pre): /usr/bin/getgid
@@ -244,45 +250,24 @@
install %{SOURCE1} .
-# XXX: why this copying is needed? it writes there?
-install -d kernel
-cp -a %{_kernelsrcdir}/include kernel
-%ifarch %{x8664} %{ix86}
-if [ -d kernel/include/asm-x86 ]; then
- ln -sf asm-x86 kernel/include/asm
-else
-%ifarch %{x8664}
- ln -sf asm-x86_64 kernel/include/asm
-%else
- ln -sf asm-i386 kernel/include/asm
-%endif
-fi
-%endif
-
-%if %{with dist_kernel}
-ln -sf autoconf-dist.h kernel/include/linux/autoconf.h
-%else
-ln -sf autoconf-nondist.h kernel/include/linux/autoconf.h
-%endif
+rm -rf PLD-MODULE-BUILD && mkdir PLD-MODULE-BUILD && cd PLD-MODULE-BUILD
+../src/VBox/Additions/linux/export_modules modules.tar.gz
+ tar -zxf modules.tar.gz && rm -f modules.tar.gz
+../src/VBox/HostDrivers/Support/linux/export_modules modules.tar.gz && \
+ tar -zxf modules.tar.gz && rm -f modules.tar.gz
%build
+%if %{with userspace}
./configure \
--with-gcc="%{__cc}" \
--with-g++="%{__cxx}" \
--with-linux="%{_builddir}/%{buildsubdir}/kernel"
-%if %{with userspace}
. ./env.sh && kmk -j1
%endif
%if %{with kernel}
-rm -rf PLD-MODULE-BUILD && mkdir PLD-MODULE-BUILD && cd PLD-MODULE-BUILD
-
-../src/VBox/HostDrivers/Support/linux/export_modules modules.tar.gz && \
- tar -zxf modules.tar.gz && rm -f modules.tar.gz
-../src/VBox/Additions/linux/export_modules modules.tar.gz
- tar -zxf modules.tar.gz && rm -f modules.tar.gz
-
+cd PLD-MODULE-BUILD
%ifarch %{x8664}
# HACK, is this really safe on x86_64?
sed -i -e 's:#.*define.*RTMEMALLOC_EXEC_HEAP::g' vboxadd/r0drv/linux/alloc-r0drv-linux.c vboxvfs/r0drv/linux/alloc-r0drv-linux.c
@@ -291,7 +276,7 @@
%build_kernel_modules -m vboxadd -C vboxadd
%build_kernel_modules -m vboxdrv -C vboxdrv
cp -a vboxadd/Module.symvers vboxvfs
-%build_kernel_modules -m vboxvfs -C vboxvfs
+%build_kernel_modules -m vboxvfs -C vboxvfs -c
cd ..
%endif
@@ -348,15 +333,9 @@
%endif
%if %{with kernel}
-cd PLD-MODULE-BUILD
-for MODULE in *; do
- [ ! -d $MODULE ] && continue;
-
- cd $MODULE
- %install_kernel_modules -m $MODULE -d misc
- cd ..
-done
-cd ..
+%install_kernel_modules -m PLD-MODULE-BUILD/vboxadd/vboxadd -d misc
+%install_kernel_modules -m PLD-MODULE-BUILD/vboxdrv/vboxdrv -d misc
+%install_kernel_modules -m PLD-MODULE-BUILD/vboxvfs/vboxvfs -d misc
%endif
%clean
@@ -492,6 +471,10 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.65 2008-02-29 15:21:07 zbyniu
+- proper way to build kernel modules
+- cleaned up BRs marsh
+
Revision 1.64 2008-02-27 16:46:25 glen
- accept spaces in configure args
- prep source in %prep
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/VirtualBox.spec?r1=1.64&r2=1.65&f=u
More information about the pld-cvs-commit
mailing list