# -*- rpm-spec -*- %define build_nbr 86 %define target_distro rhel4.1 %define xen_kernel_version 2.6.16 %define hg_changeset e1f6a6153052dbc45c2eeeeb7db082054601d38e %define hg_root http://hg.uk.xensource.com//xen-3.0-testing.hg %define xen_version 3.0.2.2 %define product_version %{target_distro} %define xen_kernel_subversion %{nil} %define pyver %(python -c 'import sys ; print sys.version[:3]') %define is_rhel3 %(echo %{target_distro} | grep -q "rhel3" && echo 1 || echo 0 ) %define is_rhel41 %(echo %{target_distro} | grep -q "rhel4.1" && echo 1 || echo 0 ) %define is_sles9 %(echo %{target_distro} | grep -q "sles9" && echo 1 || echo 0 ) %define is_fc4 %(echo %{target_distro} | grep -q "fc4" && echo 1 || echo 0 ) %define pkg_release 1 %define kernel_dot_org_conflicts ppp <= 2.3.15, pcmcia-cs <= 3.1.20, isdn4k-utils <= 3.0, mount < 2.10r-5, nfs-utils < 1.0.3, e2fsprogs < 1.29, util-linux < 2.10, jfsutils < 1.0.14, reiserfsprogs < 3.6.3, xfsprogs < 2.1.0, procps < 2.0.9, oprofile < 0.5.3 %define kernel_package_conflicts cipe < 1.4.5, dev < 3.2-7, iptables < 1.2.5-3, bcm5820 < 1.81, nvidia-rh72 <= 1.0 %if %{is_rhel3} %define kernel_prereq fileutils, module-init-tools, mkinitrd >= 4.1.15 %else %define kernel_prereq fileutils, module-init-tools %endif %define xen_extra xen3_%{build_nbr}.%{pkg_release}_%{product_version} %define xen_suffix -%{xen_extra} %define KVERREL %{xen_kernel_version}%{xen_suffix} %define KVERSUBREL %{xen_kernel_version}%{xen_kernel_subversion}%{xen_suffix} %define buildxen 0 %define buildxenkernel 0 %define buildsource 0 %ifarch i386 %define buildxen 1 %define buildxenkernel 0 %define buildsource 0 %endif %ifarch i686 %define buildxen 0 %define buildxenkernel 1 %define buildsource 0 %endif Summary: Xen is a virtual machine monitor Name: xen Version: %{xen_version} Release: %{build_nbr}.%{pkg_release}_%{target_distro} Group: Development/Libraries License: GPL Vendor: XenSource, Inc. URL: http://www.xensource.com Source0: xen-%{xen_version}-%{build_nbr}.tar.bz2 Source1: linux-%{xen_kernel_version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: zlib-devel curl-devel gcc-c++ python-devel ncurses-devel e2fsprogs-devel %if %{is_sles9} BuildRequires: tetex te_latex ghostscript transfig latex2html %else BuildRequires: tetex-latex tetex-dvips ghostscript transfig %endif Requires: python bridge-utils ExclusiveArch: i386 i686 %package devel Summary: Xen Utilities Requires: xen = %{version}-%{release} Group: Development/Libraries %package kernel Version: %{xen_kernel_version} Release: %{xen_extra} Summary: Xen Kernel Group: System Environment/Kernel Provides: kernel = %{KVERSUBREL} Provides: kernel-%{_target_cpu} = %{KVERSUBREL} Autoreqprov: no Prereq: %{kernel_prereq} Conflicts: %{kernel_dot_org_conflicts} Conflicts: %{kernel_package_conflicts} %description This package contains the Xen hypervisor and Xen tools, needed to run virtual machines on x86 systems, together with the kernel-xen* packages. Information on how to use Xen can be found at the Xen project pages. Virtualisation can be used to run multiple versions or multiple Linux distributions on one system, or to test untrusted applications in a sandboxed environment. Note that the Xen technology is still in development, and this RPM has received extremely little testing. Don't be surprised if this RPM eats your data, drinks your coffee or makes fun of you in front of your friends. hg_root = %{hg_root} hg_changeset = %{hg_changeset} %description devel This package contains the Xen development libraries and header files for building addon tools. %description kernel The kernel package contains the Linux kernel (vmlinuz), the core of your Red Hat Linux operating system. The kernel handles the basic functions of the operating system: memory allocation, process allocation, device input and output, etc. This kernel has been patched to be a Xen Dom0. hg_root = %{hg_root} hg_changeset = %{hg_changeset} %package kernel-sourcecode Version: %{xen_kernel_version} Release: %{xen_extra} Summary: The source code for the XenLinux kernel. Group: Development/System Prereq: fileutils Requires: make >= 3.78 Requires: gcc >= 3.2 Requires: /usr/bin/strip # for xconfig and gconfig Requires: readline-devel ncurses-devel Provides: kernel-source Obsoletes: kernel-source <= 2.6.6 %description kernel-sourcecode The xen-kernel-sourcecode package contains the source code files for the Linux kernel. The source files can be used to build a custom kernel that is smaller by virtue of only including drivers for your particular hardware, if you are so inclined (and you know what you're doing). The customisation guide in the documentation describes in detail how to do this. This package is neither needed nor usable for building external kernel modules for linking such modules into the default operating system kernels. %prep %setup -q -n xen-%{xen_version}-%{build_nbr} %build %if %{buildxen} CFLAGS="$RPM_OPT_FLAGS" %{__make} %{?_smp_mflags} xen tools docs pkgdocdir=%{_docdir}/%{name} %endif %if %{buildxenkernel} cp %{SOURCE1} . cat >buildconfigs/mk.linux-2.6%{xen_suffix} << EOF EXTRAVERSION = %{xen_extra} include buildconfigs/mk.linux-2.6-xen EOF # rename the default configs to match our extraversion cp buildconfigs/linux-defconfig_xen_x86_32 buildconfigs/linux-defconfig_%{xen_extra}_x86_32 CFLAGS="$RPM_OPT_FLAGS" %{__make} %{?_smp_mflags} linux-2.6%{xen_suffix}-build %endif %install rm -rf %{buildroot} %if %{buildxen} make DESTDIR=%{buildroot} install-xen install-tools install-docs pkgdocdir=%{_docdir}/%{name} for name in CHANGESET COPYING README; do cp -p $name $RPM_BUILD_ROOT/%{_docdir}/%{name}/ done mkdir -p %{buildroot}/var/run/xenstored mkdir -p %{buildroot}/var/lib/xenstored %endif %if %{buildxenkernel} # copy the kernel pieces install -d %{buildroot}/boot install -d %{buildroot}/lib/modules cp dist/install/boot/config-%{KVERSUBREL} %{buildroot}/boot/ cp dist/install/boot/System.map-%{KVERSUBREL} %{buildroot}/boot/ cp dist/install/boot/vmlinux-syms-%{KVERSUBREL} %{buildroot}/boot/ cp dist/install/boot/vmlinuz-%{KVERSUBREL} %{buildroot}/boot/ cp -a dist/install/lib/modules/%{KVERSUBREL} %{buildroot}/lib/modules/ ln -s vmlinuz-%{KVERSUBREL} %{buildroot}/boot/vmlinuz-2.6-xen rm %{buildroot}/lib/modules/%{KVERSUBREL}/{build,source} ln -s /usr/src/linux-%{KVERSUBREL} %{buildroot}/lib/modules/%{KVERSUBREL}/source %if %{is_fc4} mkdir -p %{buildroot}/etc/ld.so.conf.d rm -f %{buildroot}/etc/ld.so.conf.d/kernelcap-%{KVERSUBREL}.conf cat > %{buildroot}/etc/ld.so.conf.d/kernelcap-%{KVERSUBREL}.conf <<\EOF # This directive teaches ldconfig to search in nosegneg subdirectories # and cache the DSOs there with extra bit 0 set in their hwcap match # fields. In Xen guest kernels, the vDSO tells the dynamic linker to # search in nosegneg subdirectories and to match this extra hwcap bit # in the ld.so.cache file. hwcap 0 nosegneg EOF chmod 444 %{buildroot}/etc/ld.so.conf.d/kernelcap-%{KVERSUBREL}.conf %endif %endif %if %{buildsource} mkdir -p %{buildroot}/usr/src/linux-%{KVERSUBREL} chmod -R a+r * # clean up the source tree so that it is ready for users to build their own # kernel %{__make} linux-2.6%{xen_suffix}-clean # copy the source over tar --dereference -cf - -C linux-%{KVERREL} . | tar -xf - -C %{buildroot}/usr/src/linux-%{KVERSUBREL} # set the EXTRAVERSION to custom, so that people who follow a kernel building howto # don't accidentally overwrite their currently working moduleset and hose # their system perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}custom/" %{buildroot}/usr/src/linux-%{KVERSUBREL}/Makefile %endif rm -f %{buildroot}%{_includedir}/%{name}/COPYING %clean rm -rf $RPM_BUILD_ROOT %pre kernel /sbin/modprobe loop 2> /dev/null > /dev/null || exit 0 %post if [ -x /sbin/chkconfig ]; then chkconfig xend on chkconfig xendomains on fi %post kernel [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade /sbin/depmod -ae -F /boot/System.map-%{KVERSUBREL} %{KVERSUBREL} %if %{is_sles9} mkinitrd -k vmlinuz-%{KVERSUBREL} -i initrd-%{KVERSUBREL}.img -m reiserfs %else mkinitrd -f --allow-missing /boot/initrd-%{KVERSUBREL}.img %{KVERSUBREL} %endif rm -f /boot/initrd-2.6-xen.img ln -s initrd-%{KVERSUBREL}.img /boot/initrd-2.6-xen.img %preun kernel rm -f /boot/initrd-%{KVERSUBREL}.img rm -f /boot/initrd-2.6-xen.img rm -f /lib/modules/%{KVERSUBREL}/modules.* %if %{buildxen} %files %defattr(-,root,root) /boot/%{name}* %{_bindir}/* %{_sbindir}/* %{_datadir}/%{name}/* %{_mandir}/man?/*.?.gz %{_libdir}/libxenctrl*.so* %{_libdir}/libxenguest*.so* %{_libdir}/libxenstore*.so* %{_libdir}/%{name}/* %{_libdir}/python/grub %{_libdir}/python/xen %if %{is_rhel3} %{_libdir}/python/logging %endif %{_sysconfdir}/%{name}/* %{_sysconfdir}/init.d/xend %{_sysconfdir}/init.d/xendomains %{_sysconfdir}/sysconfig/xendomains %{_sysconfdir}/hotplug/xen-backend.agent %dir /var/run/xenstored %dir /var/lib/xenstored %{_docdir}/%{name}/CHANGESET %{_docdir}/%{name}/README %{_docdir}/%{name}/COPYING %endif %if %{buildxen} %files devel %defattr(-,root,root) %dir %{_includedir}/%{name} %{_libdir}/libxenctrl*.a %{_libdir}/libxenguest*.a %{_includedir}/%{name}/*.h %{_includedir}/%{name}/*/*.h %{_includedir}/*.h %{_docdir}/%{name}/html/interface/* %{_docdir}/%{name}/html/user/* %{_docdir}/%{name}/pdf/* %{_docdir}/%{name}/ps/* %endif %if %{buildxenkernel} %files kernel %defattr(-,root,root) /boot/* %dir /lib/modules/%{xen_kernel_version}*%{xen_suffix} /lib/modules/%{KVERSUBREL}/* %if %{is_fc4} /etc/ld.so.conf.d/kernelcap-%{KVERSUBREL}.conf %endif %endif %if %{buildsource} %files kernel-sourcecode %defattr(-,root,root) /usr/src/linux-%{KVERSUBREL}/ %endif %changelog * Thu Oct 13 2005 - 3.0_b2-1 - add xenU kernel * Mon Sep 12 2005 - 3.0_testing-1 - Upgrade to 3.0-testing * Thu Aug 18 2005 - 2.0.7-2 - xen-2.0.7-xfrd-hang.patch * Wed Aug 10 2005 - 2.0.7-1 - 2.0.7 - Remove stale patches * Thu Jun 30 2005 Robert Read - 2.0.6-6 - enable MULTICAST option * Wed Jun 29 2005 Robert Read - 2.0.6-5 - add infiniband modules - add smbfs and cifs modules * Wed May 25 2005 Robert Read - 2.0.6-3 - add ebtables * Wed May 25 2005 Robert Read - 2.0.6-2 - add %{xen_kernel_extra} * Tue May 24 2005 Robert Read - 2.0.6-1 - 2.0.6 * Tue May 10 2005 Sean Perry - 2.0.5-200505102 - in the xend-initd patch, use -e to check for privcmd * Mon May 9 2005 Sean Perry - 2.0.5-200505101 - backport to 2.0.5 * Thu May 5 2005 Sean Perry - 2.0.5.9-200504292 - add kernel to spec file * Fri Apr 29 2005 Robert Read - 2.0.5.9-200504291 - rebuild - add link local address in network script * Wed Mar 23 2005 2.0.5-3 - Fix init.d/xend to fail silently if kernel does not support xen * Tue Mar 22 2005 2.0.5-2 - add version to hypervisor name