---- efivar-0.21/src/linux.c.orig 2015-07-13 22:00:06.000000000 +0200
-+++ efivar-0.21/src/linux.c 2015-09-11 23:12:37.823596690 +0200
-@@ -847,7 +847,7 @@
- __attribute__((__visibility__ ("hidden")))
- make_mac_path(uint8_t *buf, ssize_t size, const char * const ifname)
- {
-- struct ifreq ifr = { 0, };
-+ struct ifreq ifr = { { { 0 } }, };
- struct ethtool_drvinfo drvinfo = { 0, };
- int fd, rc;
- ssize_t ret = -1, sz, off=0;
+--- efivar-0.23/src/linux.c.orig 2016-06-23 20:56:40.006600643 +0200
++++ efivar-0.23/src/linux.c 2016-06-23 20:56:49.526548896 +0200
+@@ -22,7 +22,12 @@
+ #include <inttypes.h>
+ #include <limits.h>
+ #include <linux/ethtool.h>
++#include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)
++#include <linux/nvme_ioctl.h>
++#else
+ #include <linux/nvme.h>
++#endif
+ #include <linux/sockios.h>
+ #include <net/if.h>
+ #include <scsi/scsi.h>
+--- efivar-0.23/src/Makefile.orig 2016-06-23 21:04:59.510561274 +0200
++++ efivar-0.23/src/Makefile 2016-06-23 21:08:25.262779936 +0200
+@@ -60,6 +60,7 @@
+ libefiboot.a : $(patsubst %.o,%.static.o,$(LIBEFIBOOT_OBJECTS))
+
+ libefiboot.so : $(LIBEFIBOOT_OBJECTS)
++libefiboot.so : LIBS=efivar
+
+ deps :: $(ALL_SOURCES)
+ $(MAKE) -f $(SRCDIR)/Make.deps deps SOURCES="$(ALL_SOURCES)"
---- efivar-0.21/src/Makefile.orig 2015-07-13 22:00:06.000000000 +0200
-+++ efivar-0.21/src/Makefile 2015-09-12 09:24:38.062055687 +0200
-@@ -5,11 +5,12 @@
- include $(TOPDIR)/Make.version
-
- LIBTARGETS = $(foreach x,libefivar libefiboot,$(x).so.$(VERSION) $(x).so.$(MAJOR_VERSION))
-+STATICLIBTARGETS = libefivar.a libefiboot.a
- PCTARGETS = efivar.pc efiboot.pc
- BINTARGETS = efivar
- INCTARGETS = include/efivar/efivar-guids.h
- all : $(EFIVAR_DEPS) $(INCTARGETS) deps
--all : $(LIBTARGETS) $(PCTARGETS) $(BINTARGETS) libefiboot.so
-+all : $(LIBTARGETS) $(STATICLIBTARGETS) $(PCTARGETS) $(BINTARGETS) libefiboot.so
- @$(MAKE) -C test TOPDIR=$(TOPDIR) SRCDIR=$(SRCDIR)/test $@
-
- EFIVAR_OBJECTS = dp.o dp-acpi.o dp-hw.o dp-media.o dp-message.o \
-@@ -89,6 +90,7 @@
- install : all
- $(INSTALL) -d -m 755 $(DESTDIR)$(libdir)
- $(foreach x, $(LIBTARGETS), $(INSTALL) -m 755 $(x) $(DESTDIR)$(libdir);)
+--- efivar-0.23/src/Makefile.orig 2016-06-23 20:40:50.398411788 +0200
++++ efivar-0.23/src/Makefile 2016-06-23 20:43:14.654297154 +0200
+@@ -77,6 +77,7 @@
+ $(INSTALL) -m 755 $(x) $(DESTDIR)$(libdir)/$(x).$(VERSION) ;\
+ ln -fs $(x).$(VERSION) $(DESTDIR)$(libdir)/$(x).$(MAJOR_VERSION);\
+ ln -fs $(x).$(VERSION) $(DESTDIR)$(libdir)/$(x); )
+ $(foreach x, $(STATICLIBTARGETS), $(INSTALL) -m 644 $(x) $(DESTDIR)$(libdir);)
$(INSTALL) -d -m 755 $(DESTDIR)$(PCDIR)
$(foreach x, $(PCTARGETS), $(INSTALL) -m 644 $(x) $(DESTDIR)$(PCDIR) ;)
#
# Conditional build:
-%bcond_without static_libs # don't build static libraries
+%bcond_without static # efivar-static binary (static version of efivar)
+%bcond_without static_libs # static libraries
#
Summary: Tools to manage UEFI variables
Summary(pl.UTF-8): Narzędzia do zarządzania zmiennymi UEFI
Name: efivar
-Version: 0.21
+Version: 0.23
Release: 1
License: LGPL v2.1
Group: Applications/System
-Source0: https://github.com/rhinstaller/efivar/archive/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: 9b2bc790c267614b46b9c9c6528629d6
+#Source0Download: https://github.com/rhinstaller/efivar/releases
+Source0: https://github.com/rhinstaller/efivar/releases/download/%{version}/%{name}-%{version}.tar.bz2
+# Source0-md5: bff7aa95fdb2f5d79f4aa9721dca2bbd
Patch0: %{name}-build.patch
Patch1: %{name}-static.patch
URL: https://github.com/rhinstaller/efivar
+BuildRequires: linux-libc-headers >= 7:3.3
BuildRequires: popt-devel
+%if %{with static}
+BuildRequires: glibc-static
+BuildRequires: popt-static
+%endif
Requires: %{name}-libs = %{version}-%{release}
# Beside (U)EFI architectures, additionally allow x32 userspace for x86_64 boot arch
ExclusiveArch: %{ix86} %{x8664} x32 arm aarch64 ia64
%patch1 -p1
%build
-%{__make} \
+%{__make} -j1 \
CC="%{__cc}" \
CFLAGS="%{rpmcflags}" \
+ %{!?with_static:BINTARGETS=efivar} \
%{!?with_static_libs:STATICLIBTARGETS=} \
libdir=%{_libdir}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT \
+ %{!?with_static:BINTARGETS=efivar} \
%{!?with_static_libs:STATICLIBTARGETS=} \
libdir=%{_libdir}
%defattr(644,root,root,755)
%doc README.md TODO
%attr(755,root,root) %{_bindir}/efivar
+%if %{with static}
+%attr(755,root,root) %{_bindir}/efivar-static
+%endif
%{_mandir}/man1/efivar.1*
%files libs