%global build_ldflags %{nil}

Summary: EFI Boot Manager
Name: efibootmgr
Version: 17
Release: 1%{?_dist_release}
Group: System Environment/Base
Vendor: Project Vine
Distribution: Vine Linux
Packager: tomop

License: GPLv2+
URL: https://github.com/rhboot/efibootmgr/
BuildRequires: git popt-devel
BuildRequires: efivar-libs >= 37
BuildRequires: efivar-devel >= 37
BuildRequires: efi-srpm-macros >= 3-2
BuildRequires: efi-filesystem
Requires: efi-filesystem
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXXXX)
# EFI/UEFI don't exist on PPC
ExclusiveArch: %{ix86} x86_64 aarch64

Source0: https://github.com/rhboot/efibootmgr/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz

%description
%{name} displays and allows the user to edit the Intel Extensible
Firmware Interface (EFI) Boot Manager variables.  Additional
information about EFI can be found at
http://developer.intel.com/technology/efi/efi.htm and http://uefi.org/.

%prep
%autosetup -S git
git config --local --add efibootmgr.efidir %{efi_vendor}

%ifarch x86_64
sed -i -e "s/grub\.efi/grubx64.efi/" Make.defaults
%endif

sed -i \
	-e "/extern int efi_set_verbose/d" \
	src/efibootmgr.c


%build
%make_build CFLAGS='%{optflags} -Wno-pointer-sign' LDFLAGS='%{build_ldflags}'

%install
rm -rf %{buildroot}
%make_install libdir=%{_libdir} bindir=%{_bindir} mandir=%{_mandir} \
              localedir=%{_datadir}/locale/ includedir=%{_includedir} \
              libexecdir=%{_libexecdir} datadir=%{_datadir}

%clean
rm -rf %{buildroot}

%files
%{!?_licensedir:%global license %%doc}
%license COPYING
%{_sbindir}/*
%{_mandir}/*/*.?.gz
%doc README
    
%changelog
* Wed Jul 29 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 17-1
- new upstream release.

* Sat Sep 14 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 16-1
- new upstream release.

* Tue Dec 15 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 0.12-3
- initial build for Vine Linux.

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu May 28 2015 Peter Jones <pjones@redhat.com> - 0.12-1
- Update to 0.12
- use libefiboot and libefivar to make device paths and load options
- don't depend on -lz or -lpci any more

* Tue Oct 21 2014 Peter Jones <pjones@redhat.com> - 0.11.0-1
- Fix "-n" and friends not being assigned/checked right sometimes from 0.10.0-1
- Generate more archives to avoid people using github's, because they're just
  bad.

* Mon Oct 20 2014 Peter Jones <pjones@redhat.com> - 0.10.0-1
- Make -o parameter validation work better and be more informative
- Better exit values
- Fix a segfault with appending ascii arguments.

* Tue Sep 09 2014 Peter Jones <pjones@redhat.com> - 0.8.0-1
- Release 0.8.0

* Mon Jan 13 2014 Peter Jones <pjones@redhat.com> - 0.6.1-1
- Release 0.6.1

* Mon Jan 13 2014 Jared Dominguez <Jared_Dominguez@dell.com>
- new home https://github.com/vathpela/efibootmgr

* Thu Jan  3 2008 Matt Domsch <Matt_Domsch@dell.com> 0.5.4-1
- split efibootmgr into its own RPM for Fedora/RHEL.

* Tue Aug 24 2004 Matt Domsch <Matt_Domsch@dell.com>
- new home linux.dell.com

* Fri May 18 2001 Matt Domsch <Matt_Domsch@dell.com>
- See doc/ChangeLog
