]> git.pld-linux.org Git - packages/refind.git/blame - refind.spec
- pl
[packages/refind.git] / refind.spec
CommitLineData
2d0e8e66 1# TODO
cacb0e42 2# - add efi-boot-update pld script support
2d0e8e66 3# - review inlined scriptlets
d99d017c
ER
4# - note: invoking efibootmgr can cause firmware corruption on some mactel firmware
5# http://www.rodsbooks.com/refind/installing.html, but then you probably won't install this tool there
2d0e8e66 6Summary: EFI boot manager software
9d74d1fa 7Summary(pl.UTF-8): Boot manager dla platform EFI
2d0e8e66 8Name: refind
d99d017c 9Version: 0.6.7
2d0e8e66
ER
10Release: 0.1
11License: GPL v3
12Group: Base
13URL: http://www.rodsbooks.com/refind/
d99d017c
ER
14Source0: https://downloads.sourceforge.net/project/refind/%{version}/%{name}-src-%{version}.zip
15# Source0-md5: f118fd9fbc88f47b804746fbcbfb22e6
cacb0e42 16BuildRequires: gnu-efi
2d0e8e66
ER
17BuildRequires: unzip
18Requires: efibootmgr
19BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20
21%define efiarch unknown
d99d017c 22%ifarch %{ix86}
2d0e8e66
ER
23%define efiarch ia32
24%endif
d99d017c 25%ifarch %{x8664}
2d0e8e66
ER
26%define efiarch x64
27%endif
28
29# Directory in which refind.key and refind.crt files are found for
30# signing of binaries. If absent, binaries are copied unsigned.
9d74d1fa 31%define keydir /mnt/refind
2d0e8e66
ER
32
33%description
34A graphical boot manager for EFI- and UEFI-based computers, such as
35all Intel-based Macs and recent (most 2011 and later) PCs. rEFInd
36presents a boot menu showing all the EFI boot loaders on the
37EFI-accessible partitions, and optionally BIOS-bootable partitions on
9d74d1fa 38Macs. EFI-compatible OSes, including Linux, provide boot loaders that
2d0e8e66
ER
39rEFInd can detect and launch. rEFInd can launch Linux EFI boot loaders
40such as ELILO, GRUB Legacy, GRUB 2, and 3.3.0 and later kernels with
41EFI stub support. EFI filesystem drivers for ext2/3/4fs, ReiserFS,
42HFS+, and ISO-9660 enable rEFInd to read boot loaders from these
43filesystems, too. rEFInd's ability to detect boot loaders at runtime
44makes it very easy to use, particularly when paired with Linux kernels
45that provide EFI stub support.
46
9d74d1fa
JB
47%description -l pl.UTF-8
48Graficzny boot manager dla komputerów opartych na EFI i UEFI, takich
49jak wszystkie komputery Mac z procesorem Intela oraz nowsze PC
50(większość wyprodukowanych od 2011 roku). rEFInd prezentuje menu
51startowe pokazujące boot loadery EFI na partycjach dostępnych dla EFI
52oraz opcjonalnie opartycje startowe BIOS-u na Makach. Systemy
53operacyjne zgodne z EFI, w tym Linux, udostępniają boot loadery, które
54rEFInd jest w stanie wykryć i uruchomić. rEFInd potrafi uruchomić
55takie programy, jak ELILO, GRUB Legacy, GRUB 2 oraz jądra Linuksa w
56wersji 3.3.0 lub nowszej z obsługą zaślepki EFI. Sterowniki EFI do
57systemów plików ext2/3/4, ReiserFS, HFS+ oraz ISO-9660 umożliwiają
58rEFIndowi uruchamianie programów także z tych systmów plików. rEFInd
59potrafi wykrywać boot loadery w czasie działania, dzięki czemu jest
60łatwy w użyciu, w szczególności w połączeniu z jądrami Linuksa z
61obsługą zaślepki EFI.
62
2d0e8e66
ER
63%prep
64%setup -q
65
66%build
f1504eb8 67%{__make} gnuefi fs_gnuefi -j1 \
2d0e8e66
ER
68 CC="%{__cc}" \
69 CXX="%{__cxx}" \
9d74d1fa
JB
70 CXXFLAGS="-fpic -D_REENTRANT -D_GNU_SOURCE -Wall %{rpmcxxflags}" \
71 GNUEFILIB=%{_libdir} \
72 EFILIB=%{_libdir} \
73 EFICRT0=%{_libdir}
2d0e8e66
ER
74
75%install
76rm -rf $RPM_BUILD_ROOT
d99d017c 77install -d $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/%{name}
2d0e8e66
ER
78
79# Copy the rEFInd binaries (rEFInd proper and drivers) to %{_datadir}/%{name}-%{version},
80# including signing the binaries if sbsign is installed and a %{keydir}/refind.key file
81# is available
82SBSign=$(which sbsign 2> /dev/null || :)
83if [ -f %{keydir}/refind.key -a -x $SBSign ] ; then
d99d017c
ER
84 $SBSign --key %{keydir}/refind.key --cert %{keydir}/refind.crt --output $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/%{name}/refind_%{efiarch}.efi refind/refind_%{efiarch}.efi
85 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/%{name}/drivers_%{efiarch}
2d0e8e66 86 for File in $(ls drivers_%{efiarch}/*_x64.efi); do
d99d017c 87 $SBSign --key %{keydir}/refind.key --cert %{keydir}/refind.crt --output $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/%{name}/$File $File
2d0e8e66
ER
88 done
89else
d99d017c
ER
90 install -Dp refind/refind*.efi $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/%{name}
91 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/%{name}/drivers_%{efiarch}
92 cp -a drivers_%{efiarch}/* $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/%{name}/drivers_%{efiarch}
2d0e8e66
ER
93fi
94
95# Copy configuration and support files to %{_datadir}/%{name}-%{version}
d99d017c
ER
96install -p refind.conf-sample $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/%{name}
97cp -a icons $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/%{name}
98install -p install.sh $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}
2d0e8e66 99
2d0e8e66
ER
100# Copy keys to %{_sysconfdir}/refind.d/keys
101install -d $RPM_BUILD_ROOT%{_sysconfdir}/refind.d/keys
d99d017c 102cp -a keys/* $RPM_BUILD_ROOT%{_sysconfdir}/refind.d/keys
2d0e8e66
ER
103
104# Copy scripts to %{_sbindir}
105install -d $RPM_BUILD_ROOT%{_sbindir}
d99d017c
ER
106install -p mkrlconf.sh $RPM_BUILD_ROOT%{_sbindir}
107install -p mvrefind.sh $RPM_BUILD_ROOT%{_sbindir}
2d0e8e66
ER
108
109# Copy banners and fonts to %{_datadir}/%{name}-%{version}
110cp -a banners $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}
111cp -a fonts $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}
112
113%clean
114rm -rf $RPM_BUILD_ROOT
115
44c450bd 116%if 0
2d0e8e66
ER
117%post
118PATH=$PATH:%{_prefix}/local/bin
119# Remove any existing NVRAM entry for rEFInd, to avoid creating a duplicate.
120ExistingEntry=$(efibootmgr | grep "rEFInd Boot Manager" | cut -c 5-8)
121if [ -n $ExistingEntry ]; then
122 efibootmgr --bootnum $ExistingEntry --delete-bootnum
123fi
124
125cd %{_datadir}/%{name}-%{version}
126
127VarFile=$(ls -d /sys/firmware/efi/vars/SecureBoot* 2> /dev/null)
128ShimFile=$(find /boot -name shim\.efi 2> /dev/null | head -n 1)
129SBSign=$(which sbsign 2> /dev/null)
130OpenSSL=$(which openssl 2> /dev/null)
131
132# Run the rEFInd installation script. Do so with the --shim option
133# if Secure Boot mode is suspected and if a shim program can be
134# found, or without it if not. If a shim installation is attempted
135# and the sbsign and openssl programs can be found, do the install
136# using a local signing key. Note that this option is undesirable
137# for a distribution, since it would then require the user to
138# enroll an extra MOK. I'm including it here because I'm NOT a
139# distribution maintainer, and I want to encourage users to use
140# their own local keys.
141if [ -n $VarFile -a -n $ShimFile ]; then
142 if [ -n $SBSign -a -n $OpenSSL ]; then
143 ./install.sh --shim $ShimFile --localkeys --yes
144 else
145 ./install.sh --shim $ShimFile --yes
146 fi
147else
148 ./install.sh --yes
149fi
150
151# CAUTION: Don't create a %preun or a %postun script that deletes the files
152# installed by install.sh, since that script will run after an update, thus
153# wiping out the just-updated files.
44c450bd 154%endif
2d0e8e66
ER
155
156%files
157%defattr(644,root,root,755)
44c450bd 158%doc NEWS.txt LICENSE.txt README.txt CREDITS.txt docs/*
2d0e8e66
ER
159%dir %{_sysconfdir}/refind.d
160%dir %{_sysconfdir}/refind.d/keys
161%{_sysconfdir}/refind.d/keys/*
d99d017c
ER
162%attr(755,root,root) %{_sbindir}/mkrlconf.sh
163%attr(755,root,root) %{_sbindir}/mvrefind.sh
164%{_datadir}/%{name}-%{version}
This page took 0.114413 seconds and 4 git commands to generate.