efibootmgr/efibootmgr.spec
2024-02-07 22:50:56 +08:00

65 lines
1.9 KiB
RPMSpec

#
# spec file for package efibootmgr
#
# Copyright (c) 2022-2023 ZhuningOS
#
Name: efibootmgr
Version: 17
Release: 150400.3.2.2
Summary: EFI Boot Manager
License: GPL-2.0-or-later
Group: System/Boot
URL: https://github.com/rhinstaller/efibootmgr
Source: https://github.com/rhboot/efibootmgr/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: %{name}-delete-multiple.diff
BuildRequires: pkgconfig
BuildRequires: pkgconfig(efiboot) >= 31
BuildRequires: pkgconfig(efivar) >= 31
BuildRequires: pkgconfig(libpci)
BuildRequires: pkgconfig(popt)
BuildRequires: pkgconfig(zlib)
%description
The EFI Boot Manager allows the user to edit the Intel Extensible
Firmware Interface (EFI) Boot Manager variables. Additional
information about the EFI can be found at
<http://developer.intel.com/technology/efi/efi.htm>.
%prep
%autosetup -p1
%build
# removing hotfix function declaration:
# https://github.com/rhboot/efibootmgr/issues/128
sed -e '/extern int efi_set_verbose/d' -i "src/efibootmgr.c"
LOADER="grub.efi" # default loader
[ "$RPM_ARCH" != ia64 ] || LOADER="elilo.efi" # except Itanium
case "%{_repository}" in
(openSUSE*) VENDOR="openSUSE";;
(SLE_11_SP*) VENDOR="SuSE" LOADER="elilo.efi";;
(SUSE*|SLE*) VENDOR="SUSE";;
(*) VENDOR="linux";;
esac
%make_build CFLAGS="%{optflags} -flto -fPIE -pie" \
OS_VENDOR="$VENDOR" EFI_LOADER="$LOADER" EFIDIR="$VENDOR"
%install
case "%{_repository}" in
(openSUSE*) VENDOR="openSUSE";;
(SLE_11_SP*) VENDOR="SuSE" LOADER="elilo.efi";;
(SUSE*|SLE*) VENDOR="SUSE";;
(*) VENDOR="linux";;
esac
make DESTDIR=%{buildroot} sbindir=%{_sbindir} EFIDIR="$VENDOR" install
%files
%license COPYING
%doc README
%{_sbindir}/efiboot*
%{_mandir}/man8/*.gz
%changelog