File efibootmgr.spec of Package efibootmgr

%define realname efibootmgr
%define srcext   tar.bz2

%define so_ver   1

# Common info
Name:          %{realname}
Version:       0
Release:       wiz%{?extraver:0.}1%{?dist}
License:       GPL-2.0
Group:         Hardware/Other
URL:           https://github.com/rhboot/efibootmgr
Summary:       Tool to modify the Intel Extensible Firmware Interface (EFI) Boot Manager

# Build-time parameters
BuildRequires: pkg-config
BuildRequires: pkgconfig(efivar) pkgconfig(efiboot)
BuildRequires: pkgconfig(popt)
BuildRoot:     %{_tmppath}/%{name}-root
Source:        %{realname}-%{version}.%{srcext}
# remove extra decl (efi_set_verbose)
Patch:         https://github.com/rhboot/efibootmgr/commit/99b578501643377e0b1994b2a068b790d189d5ad.patch

%description
This is efibootmgr, a Linux user-space application to modify
the Intel Extensible Firmware Interface (EFI) Boot Manager.
This application can create and destroy boot entries, change
the boot order, change the next running boot option, and more.

# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{version}%{?extraver}
%patch -p1

# Build step (compile/build binaries, documentation, etc)
%build
%{__make} %{?_smp_mflags} \
 EFIDIR=boot \
 \
 CFLAGS='%{optflags} %{?gcc_lto}' \
 LDFLAGS='-Wl,--as-needed -Wl,--strip-all %{?gcc_lto}'

# Install built stuff
%install
%{__make} install DESTDIR=%{buildroot} \
 EFIDIR=boot \
 prefix=%{_prefix} \
 libdir=%{_libdir} \
 mandir=%{_mandir}

# Cleanup
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

# Files list for the main package
%files
%defattr(-,root,root)
%doc AUTHORS COPYING README.md
%{_sbindir}/*
%doc %{_mandir}/man8/*

%changelog
openSUSE Build Service is sponsored by