* [Patch] improvement of "make rpm" (take2)
@ 2007-11-06 2:23 Akio Takebe
[not found] ` <7C8201C001F43takebe_akio-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Akio Takebe @ 2007-11-06 2:23 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Hi,
This patch is for improvement of "make rpm".
I updated the patch of the following thread.
http://thread.gmane.org/gmane.comp.emulators.kvm.devel/8899
Changelog:
- put back some position of definitions.
- add checking RHEL5
If you try my patch with kvm-50, you can do the below.
1. rm SOURCES
2. mkdir SOURCES
3. ./configure
4. make rpm
Signed-off-by: Akio Takebe <takebe_akio-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
Best Regards,
Akio Takebe
---
--- kvm-50.orig/kvm.spec 2007-10-31 22:50:28.000000000 +0900
+++ kvm-50/kvm.spec 2007-11-06 11:11:20.000000000 +0900
@@ -12,10 +12,23 @@ ExclusiveArch: i386 x86_64
Requires: kvm-kmod bridge-utils
-%define Distribution %(cat /etc/redhat-release | awk '{ print $1}' | tr [A-Z] [a-z])
-%define os_release %(rpm -q --qf '%%{version}' %{Distribution}-release)
+%define Distribution %(rpm -q -qf /etc/redhat-release --qf '%{name}' | cut -d"-" -f 1)
+%define os_version %(rpm -q --qf '%%{version}' %{Distribution}-release)
+%define os_release %(rpm -q --qf '%%{release}' %{Distribution}-release | cut -d"." -f 1)
-%if %{Distribution} == "fedora" && %{os_release} == 5 || %{Distribution} == "centos" && %{os_release} == 4
+%if %([ x"%{Distribution}" = x"fedora" -a x"%{os_version}" = x"5" ] && echo 1 || echo 0)
+%define require_gccver 32
+%endif
+
+%if %([ x"%{Distribution}" = x"centos" -a x"%{os_version}" = x"4" ] && echo 1 || echo 0)
+%define require_gccver 32
+%endif
+
+%if %([ x"%{Distribution}" = x"redhat" -a x"%{os_release}" = x"5" ] && echo 1 || echo 0)
+%define require_gccver 34
+%endif
+
+%if %( [ x"%{require_gccver}" = x"32" ] && echo 1 || echo 0)
BuildRequires: compat-gcc-32
%else
BuildRequires: compat-gcc-34
@@ -90,11 +103,15 @@ make DESTDIR=%{buildroot} install-rpm
%define utilsdir /etc/kvm/utils
%post
+/sbin/chkconfig --add kvm
/sbin/chkconfig --level 2345 kvm on
/sbin/chkconfig --level 16 kvm off
/usr/sbin/groupadd -fg 444 kvm
%postun
+/sbin/service kvm stop
+/sbin/chkconfig --level 2345 kvm off
+/sbin/chkconfig --del kvm
%clean
%{__rm} -rf %{buildroot}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-11-06 13:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-06 2:23 [Patch] improvement of "make rpm" (take2) Akio Takebe
[not found] ` <7C8201C001F43takebe_akio-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2007-11-06 13:17 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox