rpms/xen/devel xen.spec,1.198,1.199

Daniel P. Berrange (berrange) fedora-extras-commits at redhat.com
Thu Dec 13 21:43:49 UTC 2007


Author: berrange

Update of /cvs/pkgs/rpms/xen/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20566

Modified Files:
	xen.spec 
Log Message:
Refactor to make it easier to test xen-unstable trees. Include HV build if doing a dev tree


Index: xen.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xen/devel/xen.spec,v
retrieving revision 1.198
retrieving revision 1.199
diff -u -r1.198 -r1.199
--- xen.spec	7 Dec 2007 21:36:36 -0000	1.198
+++ xen.spec	13 Dec 2007 21:43:13 -0000	1.199
@@ -1,13 +1,62 @@
 %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
 
+# For official stable release, use these two tags
+%define base_version 3.1.2
+%define base_release 3
+%define base_hv_abi  3.1
+
+# For testing upstream dev trees run either
+#    hg archive -t tgz ../xen-unstable-[changeset].tgz
+# Or
+#    hg archive -t tgz ../xen-3.1-testing-[changeset].tgz
+#
+# And then set....
+
+# The version that the dev tree will become when released
+#define base_version 3.2.0
+
+# The changeset synced to
+#define changeset 16606
+
+# Name of the tree (ie the arg to hg archive, without .tgz suffix)
+#define tree unstable
+#define tree 3.1-testing
+
+# If upstream tree is also in release candidate stage, add this tag
+#define relcandidate 1
+
+
+
+# Don't change the following - they're all set based on the above params
+#
+# For prod RPMs we end up with a
+#    xen-3.1.2-1.fc9.i686.rpm
+#
+# For dev RPMs we end up with a
+#    xen-3.2.0-0.fc9.rc1.dev16606.i686.rpm
+#
+# NB, the leading '0' in the release ensures it is older than
+# the first prod RPM for 3.2.0
+
+
+%define release_prefix %{?changeset:0}%{!?changeset:%{base_release}}
+%define release_postfix %{?changeset:%{?relcandidate:.rc%{relcandidate}}.dev%{changeset}}
+%define hv_build %{?changeset:1}%{!?changeset:0}
+%define hv_abi %{?changeset:%{base_version}-%{changeset}}%{!?changeset:%{base_hv_abi}}
+%define version_tag %{base_version}
+%define release_tag %{release_prefix}%{?dist}%{release_postfix}
+%define directory_tag xen-%{?changeset:%{tree}-%{changeset}}%{!?tree:%{base_version}-src}
+%define source_tag %{directory_tag}.tgz
+
+
 Summary: Xen is a virtual machine monitor
 Name:    xen
-Version: 3.1.2
-Release: 2%{?dist}
+Version: %{version_tag}
+Release: %{release_tag}
 Group:   Development/Libraries
 License: GPL
 URL:     http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html
-Source0: %{name}-%{version}-src.tgz
+Source0: %{source_tag}
 Source2: %{name}.modules
 Source3: %{name}.sysconfig
 Source4: %{name}.logrotate
@@ -68,7 +117,7 @@
 Requires: xen-libs = %{version}-%{release}
 # Ensure we at least have a suitable kernel installed, though we can't
 # force user to actually boot it.
-Requires: xen-hypervisor-abi = 3.1
+Requires: xen-hypervisor-abi = %{hv_abi}
 # Not strictly a dependency, but kpartx is by far the most useful tool right
 # now for accessing domU data from within a dom0 so bring it in when the user
 # installs xen.
@@ -96,6 +145,16 @@
 This package contains the libraries needed to run applications to manage 
 Xen virtual machines.
 
+%if %{hv_build}
+%package hypervisor
+Summary: Libraries for Xen tools
+Group: Development/Libraries
+Provides: xen-hypervisor-abi = %{hv_abi}
+
+%description hypervisor
+This package contains the Xen hypervisor
+%endif
+
 %package devel
 Summary: Development libraries for Xen tools
 Group: Development/Libraries
@@ -106,7 +165,7 @@
 virtual machines. 
 
 %prep
-%setup -q -n %{name}-%{version}-src
+%setup -q -n %{directory_tag}
 %patch1 -p1 -b .init
 %patch3 -p1 -b .compile
 %patch6 -p1
@@ -146,7 +205,11 @@
 %patch280 -p1
 
 %build
+%if %{hv_build}
+CFLAGS="$RPM_OPT_FLAGS" %{__make} XENFB_TOOLS=y XEN_PYTHON_NATIVE_INSTALL=1 DESTDIR=%{buildroot} tools docs xen
+%else
 CFLAGS="$RPM_OPT_FLAGS" %{__make} XENFB_TOOLS=y XEN_PYTHON_NATIVE_INSTALL=1 DESTDIR=%{buildroot} tools docs
+%endif
 
 %install
 rm -rf %{buildroot}
@@ -167,6 +230,13 @@
 install -m 644 xen/include/public/arch-x86/*.h %{buildroot}%{_includedir}/xen/arch-x86
 install -m 644 xen/include/public/*.h %{buildroot}%{_includedir}/xen/
 
+%if %{hv_build}
+# install the hypervisor
+install -d 755 %{buildroot}/boot/
+install -m 644 xen/xen.gz %{buildroot}/boot/xen-%{version}-%{release}.gz
+install -m 644 xen/xen-syms %{buildroot}/boot/xen-syms-%{version}-%{release}
+%endif
+
 ### fixing start-script dir
 mkdir -p %{buildroot}%{_sysconfdir}/rc.d
 mv -f %{buildroot}%{_sysconfdir}/init.d %{buildroot}%{_sysconfdir}/rc.d/
@@ -259,6 +329,13 @@
 %{_libdir}/*.so.*
 %{_libdir}/fs/*
 
+%if %{hv_build}
+%files hypervisor
+%defattr(-,root,root)
+/boot/xen-syms-*
+/boot/xen-*.gz
+%endif
+
 %files devel
 %defattr(-,root,root)
 %{_includedir}/*.h
@@ -268,7 +345,11 @@
 %{_libdir}/*.a
 
 %changelog
-* Fri Dec 07 2007 Release Engineering <rel-eng at fedoraproject dot org> - 3.1.2-2
+* Thu Dec 13 2007 Daniel P. Berrange <berrange at redhat.com> - 3.1.2-3.fc9
+- Re-factor to make it easier to test dev trees in RPMs
+- Include hypervisor build if doing a dev RPM
+
+* Fri Dec 07 2007 Release Engineering <rel-eng at fedoraproject.org> - 3.1.2-2.fc9
 - Rebuild for deps
 
 * Sat Dec  1 2007 Daniel P. Berrange <berrange at redhat.com> - 3.1.2-1.fc9




More information about the fedora-extras-commits mailing list