linux spec,RPM SPEC文件编写通用规范

Name: grub

Version: 0.93

Release: 5

Summary: GRUB - the Grand Unified Boot Loader.

Group: System Environment/Base

License: GPL

URL: http://www.gnu.org/software/%{name}/

Source0: ftp://alpha.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz

# let‘s have some sort of organization for the patches

# patches 0-19 are for config file related changes (menu.lst->grub.conf)

Patch0: grub-0.93-configfile.patch

Patch1: grub-0.90-symlinkmenulst.patch

# patches 20-39 are for grub-install bits

Patch20: grub-0.90-install.in.patch

Patch21: grub-0.90-installcopyonly.patch

Patch22: grub-0.90-addsyncs.patch

# patches 40-59 are for miscellaneous build related patches

# link against curses statically

Patch40: grub-0.90-staticcurses.patch

# compatibility for automake 1.6

Patch41: grub-0.92-automake16.patch

# patches submitted upstream and pending approval

# change the message so that how to accept changes is clearer (#53846)

Patch81: grub-0.93-endedit.patch

# support large disks (#80980, #63848) (applied upstream)

Patch82: grub-0.93-largedisk.patch

# patches 100-199 are for features proposed but not accepted upstream

# add support for appending kernel arguments

Patch100: grub-0.90-append.patch

# add support for lilo -R-esque select a new os to boot into

Patch101: grub-0.91-bootonce.patch

# patches 200-299 are for graphics mode related patches

Patch200: grub-0.93-graphics.patch

Patch201: grub-0.91-splashimagehelp.patch

Patch202: grub-0.93-graphics-bootterm.patch

# patches 300-399 are for things already upstream

Patch300: grub-0.93-serial-terminfo.patch

# patches 500+ are for miscellaneous little things

# support for non-std devs (eg cciss, etc)

Patch500: grub-0.93-special-device-names.patch

# support for building on x86_64

Patch501: grub-0.92-hammer.patch

ExclusiveArch: i386 x86_64

BuildRequires: binutils >= 2.9.1.0.23

PreReq: /sbin/install-info

Requires: mktemp

BuildRoot: %{_tmppath}/%{name}-%{version}-root

%description

GRUB (Grand Unified Boot Loader) is an experimental boot loader

capable of booting into most free operating systems - Linux, FreeBSD,

NetBSD, GNU Mach, and others as well as most commercial operating

systems.

%prep

%setup -q

%patch0 -p1 -b .config

%patch1 -p1 -b .menulst

%patch20 -p1 -b .install

%patch21 -p1 -b .copyonly

%patch22 -p1 -b .addsync

%patch40 -p1 -b .static

%patch41 -p1 -b .automake16

%patch81 -p0 -b .endedit

%patch82 -p0 -b .largedisk

%patch100 -p1 -b .append

%patch101 -p1 -b .bootonce

%patch200 -p1 -b .graphics

%patch201 -p1 -b .splashhelp

%patch202 -p1 -b .bootterm

%patch300 -p0 -b .terminfo

%patch500 -p1 -b .raid

%patch501 -p1 -b .hammer

%build

autoreconf --install --force

%ifarch x86_64

LDFLAGS="-Wl,-static" ; export LDFLAGS

%endif

CFLAGS="-Os -g" ; export CFLAGS

%configure --sbindir=/sbin --disable-auto-linux-mem-opt

make

%install

rm -fr $RPM_BUILD_ROOT

%makeinstall sbindir=${RPM_BUILD_ROOT}/sbin

mkdir -p ${RPM_BUILD_ROOT}/boot/grub

rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir

%clean

rm -fr $RPM_BUILD_ROOT

%post

if [ "$1" = 1 ]; then

/sbin/install-info --info-dir=%{_infodir} %{_infodir}/grub.info.gz

/sbin/install-info --info-dir=%{_infodir} %{_infodir}/multiboot.info.gz

fi

%preun

if [ "$1" = 0 ] ;then

/sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/grub.info.gz

/sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/multiboot.info.gz

fi

%files

%defattr(-,root,root)

%doc AUTHORS ChangeLog NEWS README COPYING TODO docs/menu.lst

/boot/grub

/sbin/grub

/sbin/grub-install

/sbin/grub-terminfo

/sbin/grub-md5-crypt

%{_bindir}/mbchk

%{_infodir}/grub*

%{_infodir}/multiboot*

%{_mandir}/man*/*

%{_datadir}/grub

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值