grub2-vl.spec 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. %ifarch %{ix86}
  2. %define _host_cpu i386
  3. %else
  4. %define _host_cpu %{_arch}
  5. %endif
  6. # 64bit intel machines use 32bit boot loader
  7. # (We cannot just redefine _target_cpu, as we'd get i386.rpm packages then)
  8. %ifarch x86_64
  9. %define _target_platform i386-%{_vendor}-%{_target_os}%{?_gnu}
  10. %define _libdir %{_prefix}/lib
  11. %define _lib lib
  12. %endif
  13. %define defshell defaultmenu.sh
  14. Summary: grub2 - a Multiboot boot loader.
  15. Summary(ja): grub2 - マルチブートローダ
  16. Name: grub2
  17. Version: 1.99
  18. Release: 1%{?_dist_release}
  19. License: GPL
  20. Group: System Environment/Base
  21. URL: http://www.gnu.org/software/grub/
  22. Source0: ftp://alpha.gnu.org/gnu/grub/grub-%{version}.tar.xz
  23. Source1: 90_persistent
  24. Source2: grub.default
  25. ExclusiveArch: %{ix86} x86_64
  26. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  27. Requires(pre): install-info, sed, grep
  28. Requires: mktemp
  29. BuildRequires: autogen
  30. BuildRequires: ncurses-devel
  31. BuildRequires: bison
  32. BuildRequires: flex
  33. BuildRequires: ruby
  34. BuildRequires: freetype2-devel
  35. %ifarch x86_64
  36. BuildRequires: compat32-glibc-devel
  37. %endif
  38. Vendor: Project Vine
  39. Distribution: Vine Linux
  40. %description
  41. GNU GRUB is a Multiboot boot loader.
  42. It was derived from GRUB, GRand Unified Bootloader, which was
  43. originally designed and implemented by Erich Stefan Boleyn.
  44. Briefly, bootloader is the first software program that runs when
  45. a computer starts. It is responsible for loading and transferring
  46. control to the operating system kernel software (such as the Hurd
  47. or the Linux). The kernel, in turn, initializes the rest of the
  48. operating system (usually GNU).
  49. %description -l ja
  50. GNU GRUB はマルチブートローダです。
  51. この名前は GRand Unified Bootloader (壮大な 統一されたブート
  52. ローダ) に由来し、元来は Erich Stefan Boleyn によって、設計・
  53. 実装されたものです。
  54. 手短に言えば、ブートローダとはコンピュータが起動する際に最初
  55. に実行されるプログラムで、(Hurd や Linux のような) オペレー
  56. ティングシステムのカーネルをディスクから読み込んで制御を渡す
  57. 作業を担当します。カーネルは、それを受けて、オペレーティング
  58. システムの他の部分 (通常は GNU) を初期化します。
  59. %prep
  60. %setup -q -n grub-%{version}
  61. %build
  62. sh autogen.sh
  63. GCCVERS=$(gcc --version | head -1 | cut -d\ -f3 | cut -d. -f1)
  64. CFLAGS="-Os"
  65. if [ "$GCCVERS" == "4" ]; then
  66. CFLAGS="$CFLAGS -Wno-pointer-sign"
  67. fi
  68. %ifarch x86_64
  69. CFLAGS="$CFLAGS -static"
  70. %endif
  71. export CFLAGS
  72. %configure \
  73. CFLAGS="$(echo $RPM_OPT_FLAGS | sed \
  74. -e 's/-fstack-protector//g' \
  75. -e 's/--param=ssp-buffer-size=4//g' \
  76. -e 's/-mregparm=3/-mregparm=4//g' \
  77. -e 's/-fasynchronous-unwind-tables//g' )"\
  78. TARGET_LDFLAGS=-static \
  79. %ifarch x86_64
  80. --host=i686-pc-linux-gnu \
  81. %endif
  82. --with-platform=pc \
  83. --program-transform-name=s,grub,%{name}, \
  84. --disable-efiemu \
  85. --disable-grub-emu-usb \
  86. --disable-grub-emu-sdl \
  87. --disable-grub-emu-pci \
  88. --enable-grub-fstest \
  89. --enable-grub-mkfont
  90. make %{?_smp_mflags}
  91. %install
  92. rm -rf $RPM_BUILD_ROOT
  93. make install DESTDIR=$RPM_BUILD_ROOT
  94. # Script that makes part of grub.cfg persist across updates
  95. install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/grub.d/
  96. # Ghost config file
  97. install -d $RPM_BUILD_ROOT/boot/%{name}
  98. touch $RPM_BUILD_ROOT/boot/%{name}/grub.cfg
  99. rm -rf $RPM_BUILD_ROOT%{_infodir}
  100. rm -rf $RPM_BUILD_ROOT%{_datadir}/locale
  101. # Defaults
  102. install -m 644 -D %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/default/grub
  103. %clean
  104. rm -rf $RPM_BUILD_ROOT
  105. %post
  106. # Determine the partition with /boot
  107. BOOT_PARTITION=$(df -h /boot |(read; awk '{print $1; exit}'))
  108. # Generate core.img, but don't let it be installed in boot sector
  109. #%{name}-install --grub-setup=/bin/true $BOOT_PARTITION
  110. %preun
  111. # XXX Ugly
  112. rm -f /boot/%{name}/*.mod
  113. rm -f /boot/%{name}/*.img
  114. rm -f /boot/%{name}/*.lst
  115. rm -f /boot/%{name}/device.map
  116. %files
  117. %defattr(-,root,root)
  118. %doc COPYING INSTALL README AUTHORS ChangeLog NEWS THANKS TODO
  119. %{_bindir}/*
  120. %{_sbindir}/*
  121. %{_prefix}/lib/grub
  122. %{_prefix}/lib/%{name}
  123. %{_sysconfdir}/bash_completion.d/grub
  124. %{_sysconfdir}/default/grub
  125. %{_sysconfdir}/grub.d
  126. %dir /boot/%{name}
  127. # Actually, this is replaced by update-grub from scriptlets,
  128. # but it takes care of modified persistent part
  129. %config(noreplace) /boot/%{name}/grub.cfg
  130. %exclude %{_mandir}
  131. %changelog
  132. * Wed Aug 17 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.99-1
  133. - initial build for Vine Linux