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