grub-vl.spec 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. %define efi_support 1
  2. %ifarch %{ix86}
  3. %define _host_cpu i386
  4. %else
  5. %define _host_cpu %{_arch}
  6. %endif
  7. %define defshell defaultmenu.sh
  8. Summary: grub - a Multiboot boot loader.
  9. Summary(ja): grub - マルチブートローダ
  10. Name: grub
  11. Version: 0.97
  12. Release: 6%{?_dist_release}
  13. License: GPL
  14. Group: System Environment/Base
  15. URL: http://www.gnu.org/software/grub/
  16. Source0: ftp://alpha.gnu.org/gnu/grub/%{name}-%{version}.tar.gz
  17. Source1: %{defshell}
  18. # This is from
  19. # http://git.kernel.org/?p=boot/grub-fedora/grub-fedora.git;a=summary
  20. Patch0: grub-fedora-18.patch
  21. Patch1: 0001-Fix-strange-compilation-problem.patch
  22. Patch2: 0003-Move_network-disable-earlier.patch
  23. Patch3: 0005-Fix-Apple-CD-fixup.patch
  24. Patch4: 0006-Avoid-broken-uefi-fs.patch
  25. Patch5: 0007-fix-uefi-stride.patch
  26. Patch6: 0008-fix-gop.patch
  27. # for Vine
  28. Patch1000: grub-fedora-18-uninitialized.patch
  29. Patch1001: grub-fedora-18-static-efi.patch
  30. Patch1002: grub-0.97-grub-install-vine.patch
  31. ExclusiveArch: %{ix86} x86_64
  32. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  33. Requires(post): install-info, sed, grep, coreutils
  34. Requires(preun): install-info
  35. Requires: mktemp
  36. Requires: util-linux
  37. BuildRequires: ncurses-devel >= 5.6
  38. BuildRequires: glibc-static
  39. %ifarch x86_64
  40. BuildRequires: compat32-glibc-devel
  41. BuildRequires: compat32-glibc-static
  42. %endif
  43. %if %{efi_support}
  44. BuildRequires: gnu-efi >= 3.0e-9
  45. %endif
  46. BuildRequires: texinfo
  47. %description
  48. GNU GRUB is a Multiboot boot loader.
  49. It was derived from GRUB, GRand Unified Bootloader, which was
  50. originally designed and implemented by Erich Stefan Boleyn.
  51. Briefly, bootloader is the first software program that runs when
  52. a computer starts. It is responsible for loading and transferring
  53. control to the operating system kernel software (such as the Hurd
  54. or the Linux). The kernel, in turn, initializes the rest of the
  55. operating system (usually GNU).
  56. %description -l ja
  57. GNU GRUB はマルチブートローダです。
  58. この名前は GRand Unified Bootloader (壮大な 統一されたブート
  59. ローダ) に由来し、元来は Erich Stefan Boleyn によって、設計・
  60. 実装されたものです。
  61. 手短に言えば、ブートローダとはコンピュータが起動する際に最初
  62. に実行されるプログラムで、(Hurd や Linux のような) オペレー
  63. ティングシステムのカーネルをディスクから読み込んで制御を渡す
  64. 作業を担当します。カーネルは、それを受けて、オペレーティング
  65. システムの他の部分 (通常は GNU) を初期化します。
  66. %prep
  67. %setup -q
  68. %patch0 -p1
  69. %patch1 -p1
  70. %patch2 -p1
  71. %patch3 -p1
  72. %patch4 -p1
  73. %patch5 -p1
  74. %patch6 -p1
  75. %patch1000 -p1
  76. %patch1001 -p1
  77. %patch1002 -p1
  78. # Modify grub to show the full version number
  79. sed -i 's/0\.97/%{version}-%{release}/' configure.ac
  80. %build
  81. autoreconf -if
  82. GCCVERS=$(gcc --version | head -1 | cut -d\ -f3 | cut -d. -f1)
  83. # add "-fno-reorder-functions"
  84. # https://bugzilla.redhat.com/show_bug.cgi?id=718722
  85. # https://bugs.launchpad.net/ubuntu/+source/grub/+bug/837815
  86. CFLAGS="-Os -g -fno-strict-aliasing -Wall -Werror -Wno-shadow -Wno-unused -fno-reorder-functions"
  87. if [ "$GCCVERS" == "4" ]; then
  88. CFLAGS="$CFLAGS -Wno-pointer-sign"
  89. fi
  90. export CFLAGS
  91. %if %{efi_support}
  92. %configure --sbindir=/sbin \
  93. --disable-auto-linux-mem-opt \
  94. --datarootdir=%{_datadir} \
  95. --with-platform=efi
  96. %__make
  97. mv efi/grub.efi .
  98. make clean
  99. %endif
  100. autoreconf -if
  101. CFLAGS="$CFLAGS -static"
  102. export CFLAGS
  103. %configure --sbindir=/sbin \
  104. --datarootdir=%{_datadir} \
  105. --disable-auto-linux-mem-opt
  106. %__make
  107. %install
  108. rm -rf $RPM_BUILD_ROOT
  109. %makeinstall sbindir=${RPM_BUILD_ROOT}/sbin
  110. mkdir -p ${RPM_BUILD_ROOT}/boot/grub
  111. %if %{efi_support}
  112. mkdir -m 0755 -p ${RPM_BUILD_ROOT}/boot/efi/EFI/vine/
  113. install -m 755 grub.efi ${RPM_BUILD_ROOT}/boot/efi/EFI/vine/grub.efi
  114. %endif
  115. %{__install} -p -m 644 docs/menu.lst %{buildroot}%{_datadir}/grub/%{_host_cpu}-%{_target_vendor}
  116. %{__install} -p -m 744 %{SOURCE1} %{buildroot}%{_datadir}/grub/%{_host_cpu}-%{_target_vendor}
  117. # create compat links
  118. mkdir -p ${RPM_BUILD_ROOT}/%{_sbindir}
  119. for i in grub grub-install grub-set-default grub-md5-crypt grub-terminfo ;do
  120. ln -sf ../../sbin/$i ${RPM_BUILD_ROOT}/%{_sbindir}/$i
  121. done
  122. mkdir -p ${RPM_BUILD_ROOT}/%{_libdir}
  123. mv ${RPM_BUILD_ROOT}/%{_datadir}/grub ${RPM_BUILD_ROOT}/%{_libdir}/grub
  124. ln -sf ../%{_lib}/grub ${RPM_BUILD_ROOT}/%{_datadir}/grub
  125. rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir
  126. %clean
  127. rm -rf $RPM_BUILD_ROOT
  128. %post
  129. /sbin/install-info %{_infodir}/grub.info.gz %{_infodir}/dir
  130. /sbin/install-info %{_infodir}/multiboot.info.gz %{_infodir}/dir
  131. %{_datadir}/grub/%{_host_cpu}-%{_target_vendor}/%{defshell}
  132. %preun
  133. if [ $1 = 0 ]; then
  134. /sbin/install-info --delete %{_infodir}/grub.info.gz %{_infodir}/dir
  135. /sbin/install-info --delete %{_infodir}/multiboot.info.gz %{_infodir}/dir
  136. fi
  137. %files
  138. %defattr(-,root,root)
  139. %doc COPYING INSTALL README AUTHORS BUGS ChangeLog NEWS THANKS TODO MAINTENANCE
  140. /boot/grub
  141. %if %{efi_support}
  142. %attr(0755,root,root) /boot/efi/EFI/vine
  143. %endif
  144. %{_syssbindir}/*
  145. %{_sbindir}/*
  146. %{_bindir}/*
  147. %{_datadir}/grub
  148. %{_libdir}/grub
  149. %{_infodir}/*.info*
  150. %{_mandir}/man*/*
  151. %changelog
  152. * Sun Aug 16 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.97-6
  153. - add Patch 2,3,4,5,6 from fedora
  154. - add Requires: util-linux
  155. - update Patch1002 (grub-0.97-grub-install-vine.patch)
  156. * Sun Jun 14 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.97-5
  157. - add BuildRequires: texinfo,gnu-efi
  158. - update Patch0 from fedora
  159. - add Patch1 from fedora
  160. - add Patch1000,1001,1002
  161. * Fri May 27 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.97-4
  162. - switch to grub-fedora.git to support new features (ext4/efi/...)
  163. * Wed Mar 23 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.97-3
  164. - add Patch110 to support ext4 filesystem
  165. - add Patch120 to build with current binutils
  166. - add Patch130 to build with ncurses-5.6
  167. - add R(post): install-info, grep, sed, coreutils
  168. - add R(preun): install-info
  169. - add BR: compat32-glibc-{devel,static} for x86_64
  170. - add BR: glibc-static
  171. * Wed Jan 21 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.97-2
  172. - add patch100 to support newer e2fsprogs
  173. * Fri Aug 15 2008 Shu KONNO <owa@bg.wakwak.com> 0.97-1vl5
  174. - applied new versioning policy, spec in utf-8
  175. * Tue May 22 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 0.97-0vl8
  176. - fix _host_cpu trick
  177. * Tue May 22 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 0.97-0vl7
  178. - add x86_64 to ExclusiveArch:
  179. - add BuildRequires: compat32-glibc-devel for x86_64
  180. - add "-static" to CFLAGS for x86_64
  181. - use special CFLAGS
  182. - add Patch10 to run configure with new binutils
  183. * Thu Sep 07 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 0.97-0vl6
  184. - add PreReq: grep, sed for defaultmenu.sh
  185. * Tue Sep 5 2006 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 0.97-0vl5
  186. - add initrd in menu.lst file created by defaultmenu.sh
  187. * Mon Jun 26 2006 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 0.97-0vl4
  188. - fix date of previous changelog entry
  189. - escape macro of past changelog entries
  190. - change Source1: menu.lst.vine to defautmenu.sh
  191. - invoke defaultmenu.sh on %%post scriptlet
  192. * Wed Jun 21 2006 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 0.97-0vl3
  193. - remove Requires: ncurses, gpm, bash
  194. * Thu May 12 2005 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 0.97-0vl2
  195. - upstream release
  196. - add MAINTENANCE to %%doc
  197. - drop Patch0 (merged in upstream source)
  198. * Sun Mar 20 2005 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 0.96-0vl3
  199. - savedefault patch from upstream CVS: http://savannah.gnu.org/cgi-bin/viewcvs/grub/grub/stage2/stage2.c.diff?r1=1.45&r2=1.46&diff_format=u
  200. stage2/stage2.c (cmain): Initialize DEFAULT_FILE to an empty
  201. string. Reported by NATORI Shin <natori@adm.s.u-tokyo.ac.jp>.
  202. * Sun Feb 20 2005 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 0.96-0vl2
  203. - upstream release
  204. - drop Patch0 (merged)
  205. - added sample file /usr/lib/grub/i386-pc/menu.lst.vine
  206. - change installation destination of menu.lst from %%datadir to %%libdir
  207. * Wed Jan 19 2005 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 0.95-0vl3
  208. - applied Patch0 from upstream CVS:
  209. http://savannah.gnu.org/cgi-bin/viewcvs/grub/grub/util/grub-install.in.diff?r1=1.46&r2=1.47&diff_format=u
  210. util/grub-install.in (convert): Fix the sed statement for
  211. Linux. The expression was ambigious in some cases.
  212. * Wed Aug 18 2004 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 0.95-0vl2
  213. - catch up to upstream release
  214. - delete %%_target_platform macro
  215. - delete gzip info files from %%install macro
  216. - add BuildRequires: ncurses-devel
  217. - add Requires: ncurses, gpm, mktemp, bash
  218. - add PreReq: install-info
  219. - %%configure with --disable-auto-linux-mem-opt option
  220. * Thu Jul 12 2001 <sagami@vinelinux.org>
  221. - 0.90-0vl1: %%configure with a trick for _host_cpu, %%makeinstall
  222. * Tue Apr 24 2001 <sagami@vinelinux.org>
  223. - 0.5.96-0vl1: use some macros
  224. * Wed Oct 11 2000 Yoshihiro Kajiki <kajiki@ylug.org> [0vl2]
  225. - build for Vine 2.1beta
  226. * Tue Oct 10 2000 Yoshihiro Kajiki <kajiki@ylug.org> [0vl1]
  227. - update to 0.5.95 and build for Vine 2.0
  228. - add Japanese summary and description
  229. - based on grub-0.5.94-2, Kondara Zoo
  230. * Sun Jun 4 2000 AYUHANA Tomonori <l@kondara.org>
  231. * /usr/doc/grub-*/menu.lst -> /usr/share/grub/i386-pc/menu.lst
  232. * Thu May 18 2000 AYUHANA Tomonori <l@kondara.org>
  233. - upgrade to 0.5.93.1 to 0.5.94