SPECS: qemu.spec - separated kernel modules + bconds - updated BRs

charles charles at pld-linux.org
Sat Aug 20 07:55:01 CEST 2005


Author: charles                      Date: Sat Aug 20 05:55:01 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- separated kernel modules + bconds
- updated BRs

---- Files affected:
SPECS:
   qemu.spec (1.32 -> 1.33) 

---- Diffs:

================================================================
Index: SPECS/qemu.spec
diff -u SPECS/qemu.spec:1.32 SPECS/qemu.spec:1.33
--- SPECS/qemu.spec:1.32	Thu Aug 18 13:13:13 2005
+++ SPECS/qemu.spec	Sat Aug 20 07:54:55 2005
@@ -7,19 +7,24 @@
 %bcond_with	kqemu			# with QEMU accelerator module
 %bcond_with	cflags_passing		# with passing rpmcflags to Makefiles
 %bcond_with	nosdlgui		# do not use SDL gui (use X11 instead)
+%bcond_without	dist_kernel		# without distribution kernel
+%bcond_without	kernel			# don't build kernel modules
+%bcond_without	smp			# don't build SMP module
+%bcond_without	userspace		# don't build userspace utilities
 #
 Summary:	QEMU CPU Emulator
 Summary(pl):	QEMU - emulator procesora
 Name:		qemu
 Version:	0.7.1
-Release:	1
+%define		_rel	1
+Release:	%{_rel}%{?with_kqemu:k}
 License:	GPL
 Group:		Applications/Emulators
 #Source0Download: http://fabrice.bellard.free.fr/qemu/download.html
 Source0:	http://fabrice.bellard.free.fr/qemu/%{name}-%{version}.tar.gz
 # Source0-md5:	b0c80d2c082049a5b8ccbc7f55fe165b
 %if %{with kqemu}
-Source1:	http://fabrice.bellard.free.fr/qemu/kqemu-0.7.1-1.tar.gz
+Source1:	http://fabrice.bellard.free.fr/qemu/kqemu-%{version}-1.tar.gz
 # NoSource1-md5:	012498dac620eb8c212bf5f622414dd0
 NoSource:	1
 %endif
@@ -33,12 +38,13 @@
 Patch7:		%{name}-parallel.patch
 Patch8:		%{name}-nosdlgui.patch
 URL:		http://fabrice.bellard.free.fr/qemu/
-Requires:	SDL >= 1.2.1
 BuildRequires:	SDL-devel >= 1.2.1
-BuildRequires:	sed >= 4.0
-%if %{with kqemu}
-BuildRequires: kernel-source
+%if %{with kqemu} && %{with dist_kernel}
+BuildRequires:	kernel-module-build >= 2.6.7
 %endif
+BuildRequires:	rpmbuild(macros) >= 1.217
+BuildRequires:	sed >= 4.0
+Requires:	SDL >= 1.2.1
 ExclusiveArch:	%{ix86} %{x8664} ppc
 # sparc is currently unsupported (missing cpu_get_real_ticks() impl in vl.c)
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -46,6 +52,10 @@
 # some SPARC boot image in ELF format
 %define		_noautostrip	.*%{_datadir}/qemu/proll.elf
 
+%if !%{with kqemu}
+%undefine	with_kernel
+%endif
+
 %description
 QEMU is a FAST! processor emulator. By using dynamic translation it
 achieves a reasonnable speed while being easy to port on new host
@@ -78,6 +88,34 @@
   Może być także używane do wirtualnego hostowania kilku wirtualnych 
   pecetów na pojedynczym serwerze.
 
+%package -n kernel-misc-kqemu
+Summary:	kqemu - kernel module
+Summary(pl):	kqemu - moduł jądra
+Release:	%{_rel}@%{_kernel_ver_str}
+Group:		Base/Kernel
+%{?with_dist_kernel:%requires_releq_kernel_up}
+Requires(post,postun):	/sbin/depmod
+
+%description -n kernel-misc-kqemu
+kqemu - kernel module.
+
+%description -n kernel-misc-kqemu -l pl
+kqemu - moduł jądra.
+
+%package -n kernel-smp-misc-kqemu
+Summary:	kqemu - SMP kernel module
+Summary(pl):	kqemu - moduł jądra SMP
+Release:	%{_rel}@%{_kernel_ver_str}
+Group:		Base/Kernel
+%{?with_dist_kernel:%requires_releq_kernel_up}
+Requires(post,postun):	/sbin/depmod
+
+%description -n kernel-smp-misc-kqemu
+kqemu - SMP kernel module.
+
+%description -n kernel-smp-misc-kqemu -l pl
+kqemu - moduł jądra SMP.
+
 %prep
 %setup -q %{?with_kqemu:-a1}
 %patch0 -p1
@@ -91,6 +129,7 @@
 %{?with_nosdlgui:%patch8 -p1}
 
 %{__sed} -i -e 's/sdl_static=yes/sdl_static=no/' configure
+%{__sed} -i 's/.*MAKE) -C kqemu$//' Makefile
 
 # cannot use optflags on x86 - they cause "no register to spill" errors
 %if %{with cflags_passing}
@@ -100,43 +139,56 @@
 %{?with_kqemu:echo -n > kqemu/install.sh}
 
 %build
-
-%if %{with kqemu}
-cp -rdp %{_kernelsrcdir}/ .
-rm -f linux/.config
-cp -f linux/config-smp linux/.config
-make -C linux modules_prepare
+%if %{with kernel}
+cd kqemu
+for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
+	if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
+		exit 1
+	fi
+	rm -rf include
+	install -d include/{linux,config}
+	ln -sf %{_kernelsrcdir}/config-$cfg .config
+	ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h include/linux/autoconf.h
+	ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
+%if %{without dist_kernel}
+	ln -sf %{_kernelsrcdir}/scripts
+%endif
+	touch include/config/MARKER
+	%{__make} -C %{_kernelsrcdir} clean \
+		RCS_FIND_IGNORE="-name 'kqemu-mod-*.*' -o" \
+		M=$PWD O=$PWD
+	%{__make} -C %{_kernelsrcdir} modules \
+		M=$PWD O=$PWD
+	mv kqemu.ko kqemu-mod-$cfg.ko
+done
+cd -
 %endif
 
+%if %{with userspace}
 # --extra-cflags don't work (overridden by CFLAGS in Makefile*)
 # they can be passed if the cflags_passing bcond is used
 ./configure \
 	--prefix=%{_prefix} \
 	--cc="%{__cc}" \
-  %if %{with kqemu}
-	--enable-kqemu }\
-	--kernel-path=`pwd`/linux \
-  %endif
+	%{!?with_kqemu:--disable-kqemu} \
 	--make="%{__make}"
-
-%{__make} 
-
-%if %{with kqemu}
-mv kqemu/kqemu.ko kqemu/kqemu.smp
-cp -f linux/config-up linux/.config
-make -C linux modules_prepare
+%{__make}
 %endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with userspace}
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
+%endif
 
-%if %{with kqemu}
+%if %{with kernel}
 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
-install kqemu/kqemu.smp $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/kqemu.ko
-install kqemu/kqemu.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc
+install kqemu/kqemu-mod-up.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/kqemu.ko
+%if %{with smp} && %{with dist_kernel}
+install kqemu/kqemu-mod-smp.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/kqemu.ko
+%endif
 %endif
 
 # This dir is unneeded
@@ -145,23 +197,28 @@
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post
 %if %{with kqemu}
-%depmod
-
+%post
 %banner %{name} -e << EOF
-To enable qemu accelerator (kqemu), You must manually create device for it:
-mknod /dev/kqemu c 250 0
-chmod 666 /dev/kqemu
-
-And before start qemu, the kqemu kernel module must be loaded:
+To enable qemu accelerator (kqemu), the kqemu kernel module must be loaded:
 modprobe kqemu
 EOF
 %endif
 
-%postun
-%{?with_kqemu: %depmod}
+%post	-n kernel-misc-kqemu
+%depmod %{_kernel_ver}
+
+%postun -n kernel-misc-kqemu
+%depmod %{_kernel_ver}
 
+%post	-n kernel-smp-misc-kqemu
+%depmod %{_kernel_ver}smp
+
+%postun -n kernel-smp-misc-kqemu
+%depmod %{_kernel_ver}smp
+
+
+%if %{with userspace}
 %files
 %defattr(644,root,root,755)
 %doc README qemu-doc.html qemu-tech.html
@@ -169,7 +226,23 @@
 %{_datadir}/qemu
 %{_mandir}/man1/qemu.1*
 %{_mandir}/man1/qemu-img.1*
-%{?with_kqemu: /lib/*}
+# FIXME: maybe better moved this into dev.spec
+%if %{with kqemu}
+%dev(c,250,0) %attr(666,root,root) /dev/kqemu
+%endif
+%endif
+
+%if %{with kernel}
+%files -n kernel-misc-kqemu
+%defattr(644,root,root,755)
+/lib/modules/%{_kernel_ver}/misc/kqemu.ko*
+
+%if %{with smp} && %{with dist_kernel}
+%files -n kernel-smp-misc-kqemu
+%defattr(644,root,root,755)
+/lib/modules/%{_kernel_ver}smp/misc/kqemu.ko*
+%endif
+%endif
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -177,6 +250,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.33  2005/08/20 05:54:55  charles
+- separated kernel modules + bconds
+- updated BRs
+
 Revision 1.32  2005/08/18 11:13:13  qboosh
 - use NoSource1-md5 again
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/qemu.spec?r1=1.32&r2=1.33&f=u




More information about the pld-cvs-commit mailing list