Aug 12

[原]RDAC的spec生成rpm脚本 不指定

linuxing , 10:29 , 基础知识 » RPM , 评论(0) , 引用(0) , 阅读(39159) , Via 本站原创 | |

五、spec脚本
引用
# $Id$
# Authority: linuxing

%{!?kernel:%define kernel %(rpm -qa kernel-smp --qf '%{RPMTAG_VERSION}-%{RPMTAG_RELEASE}\\n' | tail -n 1)}
%{?kernel:%define kernel_devel %(rpm -qa kernel-devel --qf '%{RPMTAG_VERSION}-%{RPMTAG_RELEASE}\\n' | tail -n 1)}
%{!?with_smp:%define with_smp 0}
%{!?with_largesmp:%define with_largesmp 0}
%{!?with_hugemem:%define with_hugemem 0}
%if %{with_smp}
%define kernel %{kernel_smp}smp
%endif
%if %{with_largesmp}
%define kernel %{kernel_largesmp}largesmp
%endif
%if %{with_hugemem}
%define kernel %{kernel_hugemem}hugemem
%endif

Summary: MPP multipath driver (RDAC)
Name: kernel-module-mpp-%{kernel}
%define real_name linuxrdac
%define real_version 09.01.B5.55
Version: %{real_version}
Release: 1.qk
License: GPL
Group: System Environment/Kernel
Packager: Hyphen Wang
Vendor: Hyphen Wang
URL: http://www.engenio.com/rdac/

Source: http://www.engenio.com/rdac/rdac-LINUX-%{real_version}.tar.gz
BuildRoot: %{_tmppath}/root-%{name}-%{version}-%{release}

%if ! %{with_smp}
%if ! %{with_largesmp}
%if ! %{with_hugemem}
BuildRequires: kernel-devel = %{kernel_devel}
%endif
%endif
%endif

%if %{with_smp}
BuildRequires: kernel-smp-devel = %{kernel_smp}
%endif

%if %{with_largesmp}
BuildRequires: kernel-largesmp-devel = %{kernel_largesmp}
%endif
#%{?with_largesmp=1:BuildRequires: kernel-largesmp-devel = %{kernel_largesmp}}

%if %{with_hugemem}
BuildRequires: kernel-hugemem-devel = %{kernel_hugemem}
%endif
#%{?with_hugemem=1:BuildRequires: kernel-hugemem-devel = %{kernel_hugemem}}

%if ! %{with_smp}
%if ! %{with_largesmp}
%if ! %{with_hugemem}
Requires: kernel = %{kernel},
%endif
%endif
%endif

%if %{with_smp}
Requires: kernel-smp = %{kernel_smp},
%endif

%if %{with_largesmp}
Requires: kernel-largesmp = %{kernel_largesmp},
%endif
#%{?with_largesmp=1:Requires: kernel-largesmp = %{kernel_largesmp},}

%if %{with_hugemem}
Requires: kernel-hugemem = %{kernel_hugemem},
%endif
#%{?with_hugemem=1:Requires: kernel-hugemem = %{kernel_hugemem},}

Obsoletes: linuxrdac

%description
MPP multipath driver (RDAC).

This package is compiled against kernel %{kernel}.

%package -n mpp-utils
Summary: MPP multipath utilities
Group: System Environment/Kernel

Obsoletes: linuxrdac

%description -n mpp-utils
MPP multipath utilities.

%prep
%setup -n linuxrdac-%{real_version}

%build
%{__make} RPM_OPT_FLAGS="%{optflags}" \
 OS_VER="%{kernel}"

%install
%{__rm} -rf %{buildroot}
%{__make} copyfiles copyrpmfiles \
 DEST_DIR="%{buildroot}" \
 OS_VER="%{kernel}"

### Create dummy initrd
%{__install} -d -m0755 %{buildroot}/boot/
touch %{buildroot}/boot/mpp-%{kernel}.img

%post
/opt/mpp/.mppLnx_rpm_helpers/setupDriver.REDHAT

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-, root, root, 0755)
/lib/modules/%{kernel}/kernel/drivers/scsi/mppVhba.ko
/lib/modules/%{kernel}/kernel/drivers/scsi/mppUpper.ko

%files -n mpp-utils
%defattr(-, root, root, 0755)
%doc License.txt Readme.txt mpp.conf
%doc %{_mandir}/man1/mpp*.1.gz
%doc %{_mandir}/man9/RDAC.9.gz
%config(noreplace) /etc/mpp.conf
%{_sbindir}/mpp*
/opt/mpp/
%ghost /boot/mpp-%{kernel}.img

%changelog
* Sun Aug 14 2007 Hyphen Wang - 09.01.B5.55_%{kernel}-1.qk
- Fit for smp hugemem largesmp kernel for  RedFlag DC Server 5.0.

* Sun Aug 11 2007 Hyphen Wang - 09.01.B5.55_%{kernel}-1.qk
- Made for  RedFlag DC Server 5.0.

* Mon Oct 24 2005 Dag Wieers - 09.01.B5.07_193smp-2.dag
- Made mpp.conf config noreplace.

* Mon Oct 24 2005 Dag Wieers - 09.01.B5.07_193smp-1.dag
- Initial package.


五、下载
修改过的RDAC源码下载:
版本:rdac-LINUX-09.01.B5.55

脚本下载:

红旗DC Server 5.0 sp2对应的rdac驱动rpm包:

(包括单核心、smp、hugemem核心)

六、修改
修改spec脚本,使其同时适应单核心、smp核心、hugemem核心以及largesmp核心。
依赖下述的变量:
引用
with_smp kernel_smp  <-对应smp核心
with_largesmp kernel_largesmp  <-对应largesmp核心
with_hugemem kernel_hugemem  <-对应hugemem核心
内文分页: [1] [2]
Tags: ,
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]