#
# 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.17
-# unfortunately the last tagged version is 0.15; for later, look changelog of dp branch
-%define gitref a49b223a42e07989f775aca55eb7f2e9d1b6e82b
+Version: 35
Release: 1
License: LGPL v2.1
Group: Applications/System
-Source0: https://github.com/rhinstaller/efivar/archive/%{gitref}/%{name}-%{version}.tar.gz
-# Source0-md5: 390dd8192e288116fc17597fbe4baef4
+#Source0Download: https://github.com/rhinstaller/efivar/releases
+Source0: https://github.com/rhinstaller/efivar/releases/download/%{version}/%{name}-%{version}.tar.bz2
+# Source0-md5: 53da18ea0cf7bba1fd9edf3098037edf
+Patch0: %{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
+ExclusiveArch: %{ix86} %{x8664} x32 %{arm} aarch64 ia64
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
Statyczna biblioteka efivar.
%prep
-%setup -q -n %{name}-%{gitref}
+%setup -q
+%patch0 -p1
%build
-%{__make} \
+%{__make} -j1 all static \
CC="%{__cc}" \
CFLAGS="%{rpmcflags}" \
- %{?with_static_libs:LIBTARGETS="libefivar.so.0 libefivar.a"} \
+ LDFLAGS="%{rpmldflags} -Wl,-z,muldefs" \
+ %{!?with_static:STATICBINTARGETS=} \
+ %{!?with_static_libs:STATICLIBTARGETS=} \
libdir=%{_libdir}
%install
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT \
- %{?with_static_libs:LIBTARGETS="libefivar.so.0 libefivar.a"} \
+ %{!?with_static:STATICBINTARGETS=} \
+ %{!?with_static_libs:STATICLIBTARGETS=} \
libdir=%{_libdir}
%clean
%files
%defattr(644,root,root,755)
-%doc README
+%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
%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libefivar.so.0
+%attr(755,root,root) %{_libdir}/libefiboot.so.1.*
+%attr(755,root,root) %ghost %{_libdir}/libefiboot.so.1
+%attr(755,root,root) %{_libdir}/libefivar.so.1.*
+%attr(755,root,root) %ghost %{_libdir}/libefivar.so.1
%files devel
%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libefiboot.so
%attr(755,root,root) %{_libdir}/libefivar.so
%{_includedir}/efivar
+%{_pkgconfigdir}/efiboot.pc
%{_pkgconfigdir}/efivar.pc
%{_mandir}/man3/efi_*.3*
%if %{with static_libs}
%files static
%defattr(644,root,root,755)
+%{_libdir}/libefiboot.a
%{_libdir}/libefivar.a
%endif