From mboxrd@z Thu Jan 1 00:00:00 1970 From: Akio Takebe Subject: [Patch] improvement of "make rpm" (take2) Date: Tue, 06 Nov 2007 11:23:21 +0900 Message-ID: <7C8201C001F43takebe_akio@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org 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 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/