From: Akio Takebe <takebe_akio-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [Patch] improvement of "make rpm" (take2)
Date: Tue, 06 Nov 2007 11:23:21 +0900 [thread overview]
Message-ID: <7C8201C001F43takebe_akio@jp.fujitsu.com> (raw)
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/
next reply other threads:[~2007-11-06 2:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-06 2:23 Akio Takebe [this message]
[not found] ` <7C8201C001F43takebe_akio-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2007-11-06 13:17 ` [Patch] improvement of "make rpm" (take2) Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7C8201C001F43takebe_akio@jp.fujitsu.com \
--to=takebe_akio-+cum20s59erqfuhtdcdx3a@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox