source: projects/specs/trunk/g/grub2/grub2-vl.spec @ 4616

Revision 4616, 4.3 KB checked in by Takemikaduchi, 13 years ago (diff)

X.Org, compiz, GNOME3, etc...

Line 
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
17Summary: grub2 - a Multiboot boot loader.
18Summary(ja): grub2 - マルチブートローダ
19Name: grub2
20Version: 1.99
21Release: 1%{?_dist_release}
22License: GPL
23Group: System Environment/Base
24URL: http://www.gnu.org/software/grub/
25
26Source0: ftp://alpha.gnu.org/gnu/grub/grub-%{version}.tar.xz
27Source1: 90_persistent
28Source2: grub.default
29
30ExclusiveArch: %{ix86} x86_64
31BuildRoot: %{_tmppath}/%{name}-%{version}-root
32Requires(pre): install-info, sed, grep
33Requires: mktemp
34BuildRequires: autogen
35BuildRequires: ncurses-devel
36BuildRequires: bison
37BuildRequires: flex
38BuildRequires: ruby
39BuildRequires: freetype2-devel
40%ifarch x86_64
41BuildRequires: compat32-glibc-devel
42%endif
43
44Vendor: Project Vine
45Distribution: Vine Linux
46
47%description
48GNU GRUB is a Multiboot boot loader.
49It was derived from GRUB, GRand Unified Bootloader, which was
50originally designed and implemented by Erich Stefan Boleyn.
51
52Briefly, bootloader is the first software program that runs when
53a computer starts. It is responsible for loading and transferring
54control to the operating system kernel software (such as the Hurd
55or the Linux). The kernel, in turn, initializes the rest of the
56operating system (usually GNU).
57
58%description -l ja
59GNU 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
74sh autogen.sh
75
76GCCVERS=$(gcc --version | head -1 | cut -d\  -f3 | cut -d. -f1)
77CFLAGS="-Os"
78if [ "$GCCVERS" == "4" ]; then
79  CFLAGS="$CFLAGS -Wno-pointer-sign"
80fi
81%ifarch x86_64
82CFLAGS="$CFLAGS -static"
83%endif
84export 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
104make %{?_smp_mflags}
105
106%install
107rm -rf $RPM_BUILD_ROOT
108make install DESTDIR=$RPM_BUILD_ROOT
109
110# Script that makes part of grub.cfg persist across updates
111install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/grub.d/
112
113# Ghost config file
114install -d $RPM_BUILD_ROOT/boot/%{name}
115touch $RPM_BUILD_ROOT/boot/%{name}/grub.cfg
116
117rm -rf $RPM_BUILD_ROOT%{_infodir}
118
119rm -rf $RPM_BUILD_ROOT%{_datadir}/locale
120
121# Defaults
122install -m 644 -D %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/default/grub
123
124
125%clean
126rm -rf $RPM_BUILD_ROOT
127
128%post
129# Determine the partition with /boot
130BOOT_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
136rm -f /boot/%{name}/*.mod
137rm -f /boot/%{name}/*.img
138rm -f /boot/%{name}/*.lst
139rm -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
Note: See TracBrowser for help on using the repository browser.