grub-vl.spec 9.3 KB

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