From f4c7726e66d7fb872e0b3731e26ae327180c1075 Mon Sep 17 00:00:00 2001 From: cvs2git Date: Fri, 23 May 2008 21:24:16 +0000 Subject: [PATCH] This commit was manufactured by cvs2git to create branch 'XEN_3_0_4'. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Sprout from master 2006-06-29 13:01:04 UTC Jacek Konieczny '- patch which makes the bridge setup script work when the default route has 'onlink' attribute' Cherrypick from master 2008-05-23 21:24:16 UTC Elan Ruusamäe '- fix finding python-devel': xen-python-devel.patch -> 1.1 xen-xend.init -> 1.7 Cherrypick from XEN_3_0_2 2008-05-23 20:52:07 UTC Elan Ruusamäe '- separate python-xen; rel 3': xen-xendomains.init -> 1.2.2.1 xen.spec -> 1.34.2.11 --- xen-python-devel.patch | 15 ++ xen-xend.init | 66 ++++-- xen-xendomains.init | 493 ++++++++++++++++++++++++++++++++++------- xen.spec | 147 ++++++++---- 4 files changed, 573 insertions(+), 148 deletions(-) create mode 100644 xen-python-devel.patch diff --git a/xen-python-devel.patch b/xen-python-devel.patch new file mode 100644 index 0000000..71de729 --- /dev/null +++ b/xen-python-devel.patch @@ -0,0 +1,15 @@ +--- xen-3.0.4_1-src/tools/check/check_python_devel~ 2008-05-24 00:01:14.000000000 +0300 ++++ xen-3.0.4_1-src/tools/check/check_python_devel 2008-05-24 00:01:16.695654488 +0300 +@@ -5,9 +5,9 @@ + + python -c ' + import os.path, sys +-for p in sys.path: +- if os.path.exists(p + "/config/Makefile"): +- sys.exit(0) ++p = os.path.join(sys.prefix, sys.lib, "python%s" % sys.version[:3], "config", "Makefile") ++if os.path.exists(p): ++ sys.exit(0) + sys.exit(1) + ' || RC=1 + diff --git a/xen-xend.init b/xen-xend.init index eff8b11..3c05007 100644 --- a/xen-xend.init +++ b/xen-xend.init @@ -27,44 +27,62 @@ await_daemons_up() done } -RETVAL=0 - -case "$1" in - start) +start() { if [ ! -f /var/lock/subsys/xend ]; then - msg_starting "xend" - daemon /usr/sbin/xend start + msg_starting Xend + daemon /usr/sbin/xend start RETVAL=$? - await_daemons_up + await_daemons_up [ $RETVAL -eq 0 ] && touch /var/lock/subsys/xend else - msg_already_running xend + msg_already_running Xend fi - ;; - stop) +} + +stop() { if [ -f /var/lock/subsys/xend ]; then - msg_stopping "xend" - daemon /usr/sbin/xend stop + msg_stopping Xend + daemon /usr/sbin/xend stop rm -f /var/lock/subsys/xend >/dev/null 2>&1 else - msg_not_running "xend" + msg_not_running Xend + fi +} + +condrestart() { + if [ -f /var/lock/subsys/xend ]; then + stop + start + else + msg_not_running Xend + RETVAL=$1 fi +} + +RETVAL=0 +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + try-restart) + condrestart 0 + ;; + force-reload) + condrestart 7 ;; status) /usr/sbin/xend status ;; - restart|reload|force-reload) - msg_restarting "xend" - daemon /usr/sbin/xend restart - RETVAL=$? - await_daemons_up - ;; *) - # do not advertise unreasonable commands that there is no reason - # to use with this device - echo $"Usage: $0 {start|stop|status|restart|reload|force-reload}" - exit 1 + msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}" + exit 3 esac exit $RETVAL - diff --git a/xen-xendomains.init b/xen-xendomains.init index 4ea87e0..358aac7 100644 --- a/xen-xendomains.init +++ b/xen-xendomains.init @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # /etc/init.d/xendomains # Start / stop domains automatically when domain 0 boots / shuts down. @@ -22,101 +22,423 @@ # Should-Stop: # Default-Start: 3 4 5 # Default-Stop: 0 1 2 6 +# Default-Enabled: yes # Short-Description: Start/stop secondary xen domains -# Description: Start / stop domains automatically when domain 0 +# Description: Start / stop domains automatically when domain 0 # boots / shuts down. ### END INIT INFO +# Correct exit code would probably be 5, but it's enough +# if xend complains if we're not running as privileged domain if ! [ -e /proc/xen/privcmd ]; then exit 0 fi -RETVAL=0 - -INITD=/etc/init.d - -AUTODIR=/etc/xen/auto LOCKFILE=/var/lock/subsys/xendomains - -if [ -e /lib/lsb ]; then - # assume an LSB-compliant distro (Debian with LSB package, - # recent-enough SuSE, others...) - - . /lib/lsb/init-functions # source LSB standard functions - - on_fn_exit() +XENDOM_CONFIG=/etc/sysconfig/xendomains + +test -r $XENDOM_CONFIG || { echo "$XENDOM_CONFIG not existing"; + if [ "$1" = "stop" ]; then exit 0; + else exit 6; fi; } + +. $XENDOM_CONFIG + +# Use the SUSE rc_ init script functions; +# emulate them on LSB, RH and other systems +if test -e /etc/rc.status; then + # SUSE rc script library + . /etc/rc.status +else + _cmd=$1 + declare -a _SMSG + if test "${_cmd}" = "status"; then + _SMSG=(running dead dead unused unknown) + _RC_UNUSED=3 + else + _SMSG=(done failed failed missed failed skipped unused failed failed) + _RC_UNUSED=6 + fi + if test -e /lib/lsb/init-functions; then + # LSB + . /lib/lsb/init-functions + echo_rc() + { + if test ${_RC_RV} = 0; then + log_success_msg " [${_SMSG[${_RC_RV}]}] " + else + log_failure_msg " [${_SMSG[${_RC_RV}]}] " + fi + } + elif test -e /etc/init.d/functions; then + # REDHAT + . /etc/init.d/functions + echo_rc() + { + #echo -n " [${_SMSG[${_RC_RV}]}] " + if test ${_RC_RV} = 0; then + success " [${_SMSG[${_RC_RV}]}] " + else + failure " [${_SMSG[${_RC_RV}]}] " + fi + } + else + # emulate it + echo_rc() + { + echo " [${_SMSG[${_RC_RV}]}] " + } + fi + rc_reset() { _RC_RV=0; } + rc_failed() { - if [ $RETVAL -eq 0 ]; then - log_success_msg - else - log_failure_msg - fi + if test -z "$1"; then + _RC_RV=1; + elif test "$1" != "0"; then + _RC_RV=$1; + fi + return ${_RC_RV} } -elif [ -r $INITD/functions ]; then - # assume a Redhat-like distro - . $INITD/functions # source Redhat functions - - on_fn_exit() + rc_check() { - if [ $RETVAL -eq 0 ]; then - success - else - failure - fi - - echo + return rc_failed $? + } + rc_status() + { + rc_failed $? + if test "$1" = "-r"; then _RC_RV=0; shift; fi + if test "$1" = "-s"; then rc_failed 5; echo_rc; rc_failed 3; shift; fi + if test "$1" = "-u"; then rc_failed ${_RC_UNUSED}; echo_rc; rc_failed 3; shift; fi + if test "$1" = "-v"; then echo_rc; shift; fi + if test "$1" = "-r"; then _RC_RV=0; shift; fi + return ${_RC_RV} } -else - # none of the above - LOCKFILE=/var/lock/xendomains - - on_fn_exit() + rc_exit() { exit ${_RC_RV}; } + rc_active() { - echo + if test -z "$RUNLEVEL"; then read RUNLEVEL REST < <(/sbin/runlevel); fi + if test -e /etc/init.d/S[0-9][0-9]${1}; then return 0; fi + return 1 } fi +if ! which usleep >&/dev/null +then + usleep() + { + if [ -n "$1" ] + then + sleep $(( $1 / 1000000 )) + fi + } +fi + +# Reset status of this service +rc_reset + +## +# Returns 0 (success) if the given parameter names a directory, and that +# directory is not empty. +# +contains_something() +{ + if [ -d "$1" ] && [ `/bin/ls $1 | wc -l` -gt 0 ] + then + return 0 + else + return 1 + fi +} + +# read name from xen config file +rdname() +{ + NM=$(xm create --quiet --dryrun --defconfig "$1" | + sed -n 's/^.*(name \(.*\))$/\1/p') +} + +rdnames() +{ + NAMES= + if ! contains_something "$XENDOMAINS_AUTO" + then + return + fi + for dom in $XENDOMAINS_AUTO/*; do + rdname $dom + if test -z $NAMES; then + NAMES=$NM; + else + NAMES="$NAMES|$NM" + fi + done +} +parseln() +{ + name=`echo "$1" | cut -c0-17` + name=${name%% *} + rest=`echo "$1" | cut -c18- ` + read id mem cpu vcpu state tm < <(echo "$rest") +} -start() { - if [ -f $LOCKFILE ]; then return; fi +is_running() +{ + rdname $1 + RC=1 + while read LN; do + parseln "$LN" + if test $id = 0; then continue; fi + case $name in + ($NM) + RC=0 + ;; + esac + done < <(xm list | grep -v '^Name') + return $RC +} - echo -n $"Starting auto Xen domains:" +start() +{ + if [ -f $LOCKFILE ]; then + echo -n "xendomains already running (lockfile exists)" + return; + fi - # We expect config scripts for auto starting domains to be in - # AUTODIR - they could just be symlinks to files elsewhere - if [ -d $AUTODIR ] && [ $(ls $AUTODIR | wc -l) -gt 0 ]; then + if [ "$XENDOMAINS_RESTORE" = "true" ] && + contains_something "$XENDOMAINS_SAVE" + then + mkdir -p $(dirname "$LOCKFILE") touch $LOCKFILE - - # Create all domains with config files in AUTODIR. - for dom in $AUTODIR/*; do - xm create --quiet --defconfig $dom + echo -n "Restoring Xen domains:" + for dom in $XENDOMAINS_SAVE/*; do + echo -n " ${dom##*/}" + xm restore $dom if [ $? -ne 0 ]; then - RETVAL=$? + rc_failed $? + echo -n '!' + else + # mv $dom ${dom%/*}/.${dom##*/} + rm $dom fi done - + echo . fi - on_fn_exit + if contains_something "$XENDOMAINS_AUTO" + then + touch $LOCKFILE + echo -n "Starting auto Xen domains:" + # We expect config scripts for auto starting domains to be in + # XENDOMAINS_AUTO - they could just be symlinks to files elsewhere + + # Create all domains with config files in XENDOMAINS_AUTO. + # TODO: We should record which domain name belongs + # so we have the option to selectively shut down / migrate later + for dom in $XENDOMAINS_AUTO/*; do + echo -n " ${dom##*/}" + if is_running $dom; then + echo -n "(skip)" + else + xm create --quiet --defconfig $dom + if [ $? -ne 0 ]; then + rc_failed $? + echo -n '!' + else + usleep $XENDOMAINS_CREATE_USLEEP + fi + fi + done + fi +} + +all_zombies() +{ + while read LN; do + parseln "$LN" + if test $id = 0; then continue; fi + if test "$state" != "-b---d" -a "$state" != "-----d"; then + return 1; + fi + done < <(xm list | grep -v '^Name') + return 0 +} + +# Wait for max $XENDOMAINS_STOP_MAXWAIT for xm $1 to finish; +# if it has not exited by that time kill it, so the init script will +# succeed within a finite amount of time; if $2 is nonnull, it will +# kill the command as well as soon as no domain (except for zombies) +# are left (used for shutdown --all). +watchdog_xm() +{ + if test -z "$XENDOMAINS_STOP_MAXWAIT" -o "$XENDOMAINS_STOP_MAXWAIT" = "0"; then + exit + fi + usleep 20000 + for no in `seq 0 $XENDOMAINS_STOP_MAXWAIT`; do + # exit if xm save/migrate/shutdown is finished + PSAX=`ps axlw | grep "xm $1" | grep -v grep` + if test -z "$PSAX"; then exit; fi + echo -n "."; sleep 1 + # go to kill immediately if there's only zombies left + if all_zombies && test -n "$2"; then break; fi + done + sleep 1 + read PSF PSUID PSPID PSPPID < <(echo "$PSAX") + # kill xm $1 + kill $PSPID >/dev/null 2>&1 } stop() { + # Collect list of domains to shut down + if test "$XENDOMAINS_AUTO_ONLY" = "true"; then + rdnames + fi + echo -n "Shutting down Xen domains:" + while read LN; do + parseln "$LN" + if test $id = 0; then continue; fi + echo -n " $name" + if test "$XENDOMAINS_AUTO_ONLY" = "true"; then + case $name in + ($NAMES) + # nothing + ;; + (*) + echo -n "(skip)" + continue + ;; + esac + fi + # XENDOMAINS_SYSRQ chould be something like just "s" + # or "s e i u" or even "s e s i u o" + # for the latter, you should set XENDOMAINS_USLEEP to 1200000 or so + if test -n "$XENDOMAINS_SYSRQ"; then + for sysrq in $XENDOMAINS_SYSRQ; do + echo -n "(SR-$sysrq)" + xm sysrq $id $sysrq + if test $? -ne 0; then + rc_failed $? + echo -n '!' + fi + # usleep just ignores empty arg + usleep $XENDOMAINS_USLEEP + done + fi + if test "$state" = "-b---d" -o "$state" = "-----d"; then + echo -n "(zomb)" + continue + fi + if test -n "$XENDOMAINS_MIGRATE"; then + echo -n "(migr)" + watchdog_xm migrate & + WDOG_PID=$! + xm migrate $id $XENDOMAINS_MIGRATE + if test $? -ne 0; then + rc_failed $? + echo -n '!' + kill $WDOG_PID >/dev/null 2>&1 + else + kill $WDOG_PID >/dev/null 2>&1 + continue + fi + fi + if test -n "$XENDOMAINS_SAVE"; then + echo -n "(save)" + watchdog_xm save & + WDOG_PID=$! + mkdir -p "$XENDOMAINS_SAVE" + xm save $id $XENDOMAINS_SAVE/$name + if test $? -ne 0; then + rc_failed $? + echo -n '!' + kill $WDOG_PIG >/dev/null 2>&1 + else + kill $WDOG_PIG >/dev/null 2>&1 + continue + fi + fi + if test -n "$XENDOMAINS_SHUTDOWN"; then + # XENDOMAINS_SHUTDOWN should be "--halt --wait" + echo -n "(shut)" + watchdog_xm shutdown & + WDOG_PID=$! + xm shutdown $id $XENDOMAINS_SHUTDOWN + if test $? -ne 0; then + rc_failed $? + echo -n '!' + fi + kill $WDOG_PIG >/dev/null 2>&1 + fi + done < <(xm list | grep -v '^Name') + # NB. this shuts down ALL Xen domains (politely), not just the ones in # AUTODIR/* # This is because it's easier to do ;-) but arguably if this script is run # on system shutdown then it's also the right thing to do. + if ! all_zombies && test -n "$XENDOMAINS_SHUTDOWN_ALL"; then + # XENDOMAINS_SHUTDOWN_ALL should be "--all --halt --wait" + echo -n " SHUTDOWN_ALL " + watchdog_xm shutdown 1 & + WDOG_PID=$! + xm shutdown $XENDOMAINS_SHUTDOWN_ALL + if test $? -ne 0; then + rc_failed $? + echo -n '!' + fi + kill $WDOG_PID >/dev/null 2>&1 + fi - echo -n $"Shutting down all Xen domains:" - - xm shutdown --all --wait --halt + # Unconditionally delete lock file + rm -f $LOCKFILE +} - RETVAL=$? +check_domain_up() +{ + while read LN; do + parseln "$LN" + if test $id = 0; then continue; fi + case $name in + ($1) + return 0 + ;; + esac + done < <(xm list | grep -v "^Name") + return 1 +} - [ $RETVAL -eq 0 ] && rm -f $LOCKFILE +check_all_auto_domains_up() +{ + if ! contains_something "$XENDOMAINS_AUTO" + then + return 0 + fi + missing= + for nm in $XENDOMAINS_AUTO/*; do + rdname $nm + found=0 + if check_domain_up "$NM"; then + echo -n " $name" + else + missing="$missing $NM" + fi + done + if test -n "$missing"; then + echo -n " MISS AUTO:$missing" + return 1 + fi + return 0 +} - on_fn_exit +check_all_saved_domains_up() +{ + if ! contains_something "$XENDOMAINS_SAVE" + then + return 0 + fi + missing=`/bin/ls $XENDOMAINS_SAVE` + echo -n " MISS SAVED: " $missing + return 1 } # This does NOT necessarily restart all running domains: instead it @@ -124,47 +446,56 @@ stop() # AUTODIR. If other domains have been started manually then they will # not get restarted. # Commented out to avoid confusion! -# -#restart() -#{ -# stop -# start -#} -# same as restart for now - commented out to avoid confusion -#reload() -#{ -# restart -#} +restart() +{ + stop + start +} + +reload() +{ + restart +} case "$1" in start) start + rc_status + if test -f $LOCKFILE; then rc_status -v; fi ;; stop) stop + rc_status -v ;; -# The following are commented out to disable them by default to avoid confusion -# - see the notes above -# -# restart) -# restart -# ;; -# -# reload) -# reload -# ;; + restart) + restart + ;; + reload) + reload + ;; status) - xm list + echo -n "Checking for xendomains:" + if test ! -f $LOCKFILE; then + rc_failed 3 + else + check_all_auto_domains_up + rc_status + check_all_saved_domains_up + rc_status + fi + rc_status -v ;; *) - echo $"Usage: $0 {start|stop|status}" + echo "Usage: $0 {start|stop|restart|reload|status}" + rc_failed 3 + rc_status -v ;; esac -exit $RETVAL +rc_exit diff --git a/xen.spec b/xen.spec index b78d425..503abeb 100644 --- a/xen.spec +++ b/xen.spec @@ -6,11 +6,10 @@ %bcond_without pae # build without PAE (HIGHMEM64G) support (PLD Xen* kernels require PAE) # Summary: Xen - a virtual machine monitor -Summary(pl): Xen - monitor maszyny wirtualnej +Summary(pl.UTF-8): Xen - monitor maszyny wirtualnej Name: xen Version: 3.0.2 -Release: 0.2 -Epoch: 0 +Release: 3 License: GPL Group: Applications/System Source0: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/%{name}-%{version}-src.tgz @@ -19,12 +18,24 @@ Source1: %{name}-xend.init Source2: %{name}-xendomains.init Patch0: %{name}-python_scripts.patch Patch1: %{name}-bash_scripts.patch +Patch2: %{name}-bridge_setup.patch +Patch3: %{name}-xenstore-version.patch +Patch4: %{name}-reisermodule.patch +Patch5: %{name}-libvncserver-detect-fix.patch URL: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html +BuildRequires: SDL-devel BuildRequires: XFree86-devel +%ifarch %{ix86} +BuildRequires: bcc +%endif +BuildRequires: cpp BuildRequires: curl-devel +BuildRequires: e2fsprogs-devel BuildRequires: latex2html BuildRequires: libidn-devel +BuildRequires: libvncserver-devel BuildRequires: ncurses-devel +BuildRequires: progsreiserfs-devel BuildRequires: python-Twisted BuildRequires: python-devel BuildRequires: rpm-pythonprov @@ -36,14 +47,16 @@ BuildRequires: transfig BuildRequires: which BuildRequires: zlib-devel Requires(post,preun): /sbin/chkconfig +Requires: %{name}-libs = %{epoch}:%{version}-%{release} Requires: ZopeInterface Requires: bridge-utils +Requires: kernel(xen0) = %{version} Requires: losetup +Requires: python-%{name} = %{version}-%{release} Requires: python-TwistedWeb Requires: rc-scripts -Requires: kernel(xen) = %{version} Obsoletes: xen-doc -ExclusiveArch: %{ix86} +ExclusiveArch: %{ix86} %{x8664} BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %ifnarch i686 athlon pentium3 pentium4 @@ -63,47 +76,74 @@ 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. -%description -l pl -Ten pakiet zawiera nadzorcê oraz narzêdzia Xen, potrzebne do +%description -l pl.UTF-8 +Ten pakiet zawiera nadzorcę oraz narzędzia Xen, potrzebne do uruchamiania wirtualnych maszyn w systemach x86, wraz z pakietami -kernel-xen*. Informacje jak u¿ywaæ Xena mo¿na znale¼æ na stronach +kernel-xen*. Informacje jak używać Xena można znaleźć na stronach projektu. -Wirtualizacja mo¿e byæ u¿ywana do uruchamiania wielu wersji lub wielu +Wirtualizacja może być używana do uruchamiania wielu wersji lub wielu dystrybucji Linuksa na jednym systemie lub do testowania nie zaufanych -aplikacji w odizolowanym ¶rodowisku. Nale¿y zauwa¿yæ, ¿e technologia -Xen jest ci±gle rozwijana, a ten RPM by³ s³abo testowany. Nie nale¿y -byæ zdziwionym, je¶li ten pakiet zje dane, wypije ca³± kawê czy bêdzie -siê wy¶miewa³ w obecno¶ci przyjació³. +aplikacji w odizolowanym środowisku. Należy zauważyć, że technologia +Xen jest ciągle rozwijana, a ten RPM był słabo testowany. Nie należy +być zdziwionym, jeśli ten pakiet zje dane, wypije całą kawę czy będzie +się wyśmiewał w obecności przyjaciół. + +%package libs +Summary: xen libraries +Summary(pl.UTF-8): Biblioteki xena +Group: Libraries + +%description libs +xen libraries. + +%description libs -l pl.UTF-8 +Biblioteki xena. %package devel Summary: Header files for xen -Summary(pl): Pliki nag³ówkowe xena +Summary(pl.UTF-8): Pliki nagłówkowe xena Group: Development/Libraries -Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: %{name}-libs = %{epoch}:%{version}-%{release} %description devel Header files for xen. -%description devel -l pl -Pliki nag³ówkowe xena. +%description devel -l pl.UTF-8 +Pliki nagłówkowe xena. %package static Summary: Static xen libraries -Summary(pl): Statyczne biblioteki xena +Summary(pl.UTF-8): Statyczne biblioteki xena Group: Development/Libraries Requires: %{name}-devel = %{epoch}:%{version}-%{release} %description static Static xen libraries. -%description static -l pl +%description static -l pl.UTF-8 Statyczne biblioteki xena. +%package -n python-xen +Summary: xen Python modules +Summary(pl.UTF-8): Moduły Pythona dla xena +Group: Libraries +Conflicts: xen < 3.0.2-2.1 + +%description -n python-xen +xen Python modules. + +%description -n python-xen -l pl.UTF-8 +Moduły Pythona dla xena. + %prep %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 chmod -R u+w . @@ -129,30 +169,28 @@ install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/xend install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/xendomains install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/xend-db/{domain,vnet} +install -d $RPM_BUILD_ROOT%{_sharedstatedir}/xen/save -rm -f $RPM_BUILD_ROOT%{_includedir}/%{name}/COPYING +cp -a dist/install/etc/udev $RPM_BUILD_ROOT%{_sysconfdir} +cp -a dist/install/etc/hotplug $RPM_BUILD_ROOT%{_sysconfdir} -%{py_comp} $RPM_BUILD_ROOT%{py_sitedir} -%{py_ocomp} $RPM_BUILD_ROOT%{py_sitedir} -%{py_comp} $RPM_BUILD_ROOT%{py_sitescriptdir} -%{py_ocomp} $RPM_BUILD_ROOT%{py_sitescriptdir} +%py_comp $RPM_BUILD_ROOT%{py_sitedir} +%py_ocomp $RPM_BUILD_ROOT%{py_sitedir} - -find $RPM_BUILD_ROOT%{py_sitedir} -name '*.py' -exec rm "{}" ";" -find $RPM_BUILD_ROOT%{py_sitescriptdir} -name '*.py' -exec rm "{}" ";" -rm -rf $RPM_BUILD_ROOT/usr/share/doc/xen +%py_postclean +rm -f $RPM_BUILD_ROOT%{_includedir}/%{name}/COPYING +rm -rf $RPM_BUILD_ROOT%{_docdir}/xen rm -rf $RPM_BUILD_ROOT/etc/init.d +rm -f $RPM_BUILD_ROOT/boot/xen-3.0.gz +rm -f $RPM_BUILD_ROOT/boot/xen-3.gz %clean rm -rf $RPM_BUILD_ROOT %post -/sbin/ldconfig /sbin/chkconfig --add xend /sbin/chkconfig --add xendomains -%postun -p /sbin/ldconfig - %preun if [ "$1" = "0" ]; then %service xend stop @@ -162,6 +200,9 @@ if [ "$1" = "0" ]; then /sbin/chkconfig --del xendomains fi +%post libs -p /sbin/ldconfig +%postun libs -p /sbin/ldconfig + %files %defattr(644,root,root,755) %doc COPYING ChangeLog README docs/misc/* @@ -172,6 +213,7 @@ fi %attr(754,root,root) /etc/rc.d/init.d/* %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/* %config(noreplace) %verify(not md5 mtime size) /etc/udev/* +%attr(755,root,root) /etc/hotplug/* %dir %{_sysconfdir}/xen %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/xen/qemu-ifup %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/xen/*.* @@ -182,22 +224,14 @@ fi %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/xen/scripts/* %attr(755,root,root) %{_bindir}/* %attr(755,root,root) %{_sbindir}/* -%attr(755,root,root) %{_libdir}/lib*.so.* %dir %{_libdir}/%{name} %dir %{_libdir}/%{name}/bin %attr(744,root,root) %{_libdir}/%{name}/bin/* +%ifarch %{ix86} +%dir %{_libdir}/%{name}/boot +%attr(744,root,root) %{_libdir}/%{name}/boot/hvmloader +%endif %{_datadir}/xen -%dir %{py_sitedir}/%{name} -%dir %{py_sitedir}/%{name}/lowlevel -%{py_sitedir}/%{name}/lowlevel/*.py* -%attr(755,root,root) %{py_sitedir}/%{name}/lowlevel/*.so -%{py_sitedir}/%{name}/sv -%{py_sitedir}/%{name}/util -%{py_sitedir}/%{name}/web -%{py_sitedir}/%{name}/xend -%{py_sitedir}/%{name}/xm -%{py_sitedir}/%{name}/*.py* -%{py_sitescriptdir}/* %{_mandir}/man?/* %{_sharedstatedir}/xen %{_sharedstatedir}/xenstored @@ -205,6 +239,10 @@ fi %dir %attr(700,root,root) /var/run/xend %dir /var/run/xenstored +%files libs +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/lib*.so.* + %files devel %defattr(644,root,root,755) %attr(755,root,root) %{_libdir}/lib*.so @@ -213,3 +251,26 @@ fi %files static %defattr(644,root,root,755) %{_libdir}/lib*.a + +%files -n python-xen +%defattr(644,root,root,755) +%dir %{py_sitedir}/grub +%{py_sitedir}/grub/*.py[co] +%dir %{py_sitedir}/grub/fsys +%{py_sitedir}/grub/fsys/*.py[co] +%dir %{py_sitedir}/grub/fsys/reiser +%{py_sitedir}/grub/fsys/reiser/*.py[co] +%attr(755,root,root) %{py_sitedir}/grub/fsys/reiser/*.so +%dir %{py_sitedir}/grub/fsys/ext2 +%{py_sitedir}/grub/fsys/ext2/*.py[co] +%attr(755,root,root) %{py_sitedir}/grub/fsys/ext2/*.so +%dir %{py_sitedir}/xen +%dir %{py_sitedir}/xen/lowlevel +%{py_sitedir}/xen/lowlevel/*.py[co] +%attr(755,root,root) %{py_sitedir}/xen/lowlevel/*.so +%{py_sitedir}/xen/sv +%{py_sitedir}/xen/util +%{py_sitedir}/xen/web +%{py_sitedir}/xen/xend +%{py_sitedir}/xen/xm +%{py_sitedir}/xen/*.py[co] -- 2.44.0