|
|
453bef |
%global efivar_version 31-1
|
|
|
453bef |
%global efibootmgr_version 15-1
|
|
|
453bef |
%global gnu_efi_version 1:3.0.5-9
|
|
|
453bef |
%global pesign_version 0.109-10
|
|
|
453bef |
|
|
|
453bef |
Name: fwupdate
|
|
|
453bef |
Version: 9
|
|
|
453bef |
Release: 8%{?dist}
|
|
|
453bef |
Summary: Tools to manage UEFI firmware updates
|
|
|
453bef |
License: GPLv2+
|
|
|
453bef |
URL: https://github.com/rhinstaller/fwupdate
|
|
|
453bef |
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
|
|
453bef |
BuildRequires: efivar-devel >= %{efivar_version}
|
|
|
453bef |
BuildRequires: gnu-efi >= %{gnu_efi_version}
|
|
|
453bef |
BuildRequires: gnu-efi-devel >= %{gnu_efi_version}
|
|
|
453bef |
BuildRequires: pesign >= %{pesign_version}
|
|
|
453bef |
BuildRequires: elfutils popt-devel git gettext pkgconfig
|
|
|
453bef |
BuildRequires: systemd
|
|
|
453bef |
ExclusiveArch: x86_64 aarch64
|
|
|
453bef |
Source0: https://github.com/rhinstaller/fwupdate/releases/download/%{name}-%{version}/%{name}-%{version}.tar.bz2
|
|
|
453bef |
Source1: securebootca.cer
|
|
|
453bef |
Source2: secureboot.cer
|
|
|
453bef |
Patch0001: 0001-Make-SUBDIRS-overrideable.patch
|
|
|
453bef |
Patch0002: 0002-efi-fwupdate-make-our-mult-wrapper-get-the-type-of-U.patch
|
|
|
453bef |
Patch0003: 0003-Nerf-SMBIOS-functions-out-of-fwupdate.patch
|
|
|
453bef |
Patch0004: 0004-libfwup-get_info-return-whatever-a-second-call-to-ge.patch
|
|
|
453bef |
Patch0005: 0005-read_file_at-don-t-initialize-saved_errno-if-we-re-n.patch
|
|
|
453bef |
Patch0006: 0006-fwup_set_up_update-don-t-lseek-on-our-error-path.patch
|
|
|
453bef |
Patch0007: 0007-add_to_boot_order-actually-always-pass-in-attributes.patch
|
|
|
453bef |
Patch0008: 0008-fwup_resource_iter_create-make-the-error-path-actual.patch
|
|
|
453bef |
Patch0009: 0009-add_to_boot_order-set-the-new-BootOrder-entry-at-the.patch
|
|
|
453bef |
Patch0010: 0010-fwup_set_up_update-check-lseek-s-return-value.patch
|
|
|
453bef |
Patch0011: 0011-put_info-try-to-limit-bounds-of-our-duplicated-devic.patch
|
|
|
453bef |
Patch0012: 0012-Try-harder-to-satisfy-coverity-about-the-structure-o.patch
|
|
|
453bef |
Patch0013: 0013-Add-coverity-makefile-bits.patch
|
|
|
453bef |
Patch0014: 0014-Don-t-free-alloca-d-memory.patch
|
|
|
453bef |
Patch0015: 0015-Fix-uninitialized-variable.patch
|
|
|
453bef |
|
|
|
453bef |
%ifarch x86_64
|
|
|
453bef |
%global efiarch x64
|
|
|
453bef |
%endif
|
|
|
453bef |
%ifarch aarch64
|
|
|
453bef |
%global efiarch aa64
|
|
|
453bef |
%endif
|
|
|
453bef |
|
|
|
453bef |
# Figure out the right file path to use
|
|
|
453bef |
%global efidir %(eval echo $(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/'))
|
|
|
453bef |
|
|
|
453bef |
%description
|
|
|
453bef |
fwupdate provides a simple command line interface to the UEFI firmware updates.
|
|
|
453bef |
|
|
|
453bef |
%package libs
|
|
|
453bef |
Summary: Library to manage UEFI firmware updates
|
|
|
453bef |
Requires: %{name}-efi = %{version}-%{release}
|
|
|
453bef |
|
|
|
453bef |
%description libs
|
|
|
453bef |
Library to allow for the simple manipulation of UEFI firmware updates.
|
|
|
453bef |
|
|
|
453bef |
%package devel
|
|
|
453bef |
Summary: Development headers for libfwup
|
|
|
453bef |
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
|
|
453bef |
Requires: efivar-devel >= %{efivar_version}
|
|
|
453bef |
|
|
|
453bef |
%description devel
|
|
|
453bef |
development headers required to use libfwup.
|
|
|
453bef |
|
|
|
453bef |
%package efi
|
|
|
453bef |
Summary: UEFI binaries used by libfwup
|
|
|
453bef |
Requires: shim
|
|
|
453bef |
|
|
|
453bef |
%description efi
|
|
|
453bef |
UEFI binaries used by libfwup.
|
|
|
453bef |
|
|
|
453bef |
%prep
|
|
|
453bef |
%setup -q -n %{name}-%{version}
|
|
|
453bef |
git init
|
|
|
453bef |
git config user.email "%{name}-owner@fedoraproject.org"
|
|
|
453bef |
git config user.name "Fedora Ninjas"
|
|
|
453bef |
git add .
|
|
|
453bef |
git commit -a -q -m "%{version} baseline."
|
|
|
453bef |
git am %{patches}
|
|
|
453bef |
git config --unset user.email
|
|
|
453bef |
git config --unset user.name
|
|
|
453bef |
|
|
|
453bef |
%build
|
|
|
453bef |
git config --local --add fwupdate.efidir '%{efidir}'
|
|
|
453bef |
%ifarch x86_64
|
|
|
453bef |
setarch linux32 -B make CFLAGS="$RPM_OPT_FLAGS" libdir=%{_libdir} \
|
|
|
453bef |
bindir=%{_bindir} EFIDIR=%{efidir} %{?_smp_mflags} \
|
|
|
453bef |
SUBDIRS=efi ARCH=ia32
|
|
|
453bef |
mv -v efi/fwupia32.efi fwupia32.unsigned.efi
|
|
|
453bef |
%pesign -s -i fwupia32.unsigned.efi -o fwupia32.efi -a %{SOURCE1} -c %{SOURCE2} -n redhatsecureboot301
|
|
|
453bef |
make clean
|
|
|
453bef |
%endif
|
|
|
453bef |
make CFLAGS="$RPM_OPT_FLAGS" libdir=%{_libdir} bindir=%{_bindir} \
|
|
|
453bef |
EFIDIR=%{efidir} %{?_smp_mflags}
|
|
|
453bef |
mv -v efi/fwup%{efiarch}.efi efi/fwup%{efiarch}.unsigned.efi
|
|
|
453bef |
%pesign -s -i efi/fwup%{efiarch}.unsigned.efi -o efi/fwup%{efiarch}.efi -a %{SOURCE1} -c %{SOURCE2} -n redhatsecureboot301
|
|
|
453bef |
|
|
|
453bef |
%install
|
|
|
453bef |
rm -rf $RPM_BUILD_ROOT
|
|
|
453bef |
install -d -m 0755 $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/
|
|
|
453bef |
%make_install EFIDIR=%{efidir} libdir=%{_libdir} \
|
|
|
453bef |
bindir=%{_bindir} mandir=%{_mandir} localedir=%{_datadir}/locale/ \
|
|
|
453bef |
includedir=%{_includedir} libexecdir=%{_libexecdir} \
|
|
|
453bef |
datadir=%{_datadir}
|
|
|
453bef |
%ifarch x86_64
|
|
|
453bef |
mv fwupia32.efi $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/
|
|
|
453bef |
%endif
|
|
|
453bef |
|
|
|
453bef |
%ifnarch %{ix86}
|
|
|
453bef |
%post libs
|
|
|
453bef |
/sbin/ldconfig
|
|
|
453bef |
%systemd_post fwupdate-cleanup.service
|
|
|
453bef |
|
|
|
453bef |
%preun libs
|
|
|
453bef |
%systemd_preun fwupdate-cleanup.service
|
|
|
453bef |
|
|
|
453bef |
%postun libs
|
|
|
453bef |
/sbin/ldconfig
|
|
|
453bef |
%systemd_postun_with_restart pesign.service
|
|
|
453bef |
|
|
|
453bef |
%files
|
|
|
453bef |
%defattr(-,root,root,-)
|
|
|
453bef |
%{!?_licensedir:%global license %%doc}
|
|
|
453bef |
%license COPYING
|
|
|
453bef |
# %%doc README
|
|
|
453bef |
%{_bindir}/fwupdate
|
|
|
453bef |
%{_datadir}/locale/en/fwupdate.po
|
|
|
453bef |
%doc %{_mandir}/man1/*
|
|
|
453bef |
%dir %{_datadir}/bash-completion/completions
|
|
|
453bef |
%{_datadir}/bash-completion/completions/fwupdate
|
|
|
453bef |
|
|
|
453bef |
%files devel
|
|
|
453bef |
%defattr(-,root,root,-)
|
|
|
453bef |
%doc %{_mandir}/man3/*
|
|
|
453bef |
%{_includedir}/*
|
|
|
453bef |
%{_libdir}/*.so
|
|
|
453bef |
%{_libdir}/pkgconfig/*.pc
|
|
|
453bef |
|
|
|
453bef |
%files libs
|
|
|
453bef |
%defattr(-,root,root,-)
|
|
|
453bef |
%{_libdir}/*.so.*
|
|
|
453bef |
%{_datadir}/locale/en/libfwup.po
|
|
|
453bef |
%{_unitdir}/fwupdate-cleanup.service
|
|
|
453bef |
%attr(0755,root,root) %dir %{_datadir}/fwupdate/
|
|
|
453bef |
%config(noreplace) %ghost %{_datadir}/fwupdate/done
|
|
|
453bef |
%attr(0755,root,root) %dir %{_libexecdir}/fwupdate/
|
|
|
453bef |
%{_libexecdir}/fwupdate/cleanup
|
|
|
453bef |
%endif
|
|
|
453bef |
|
|
|
453bef |
%files efi
|
|
|
453bef |
%defattr(-,root,root,-)
|
|
|
453bef |
%attr(0700,root,root) %dir /boot/efi
|
|
|
453bef |
%dir /boot/efi/EFI/%{efidir}/
|
|
|
453bef |
%dir /boot/efi/EFI/%{efidir}/fw/
|
|
|
453bef |
/boot/efi/EFI/%{efidir}/fwup*.efi
|
|
|
453bef |
|
|
|
453bef |
%changelog
|
|
|
453bef |
* Fri May 19 2017 Peter Jones <pjones@redhat.com> - 9-8
|
|
|
453bef |
- Hopefully the last TPS related rebuild.
|
|
|
453bef |
Related: rhbz#1380825
|
|
|
453bef |
|
|
|
453bef |
* Fri May 19 2017 Peter Jones <pjones@redhat.com> - 9-7
|
|
|
453bef |
- One more TPS related rebuild...
|
|
|
453bef |
Related: rhbz#1380825
|
|
|
453bef |
|
|
|
453bef |
* Wed May 17 2017 Peter Jones <pjones@redhat.com> - 9-6
|
|
|
453bef |
- Rebuild to make some dependencies versioned, in order to make TPS's really
|
|
|
453bef |
broken builder setup work.
|
|
|
453bef |
Related: rhbz#1380825
|
|
|
453bef |
|
|
|
453bef |
* Tue May 09 2017 Peter Jones <pjones@redhat.com> - 9-5
|
|
|
453bef |
- Fix some more coverity issues
|
|
|
453bef |
Related: rhbz#1380825
|
|
|
453bef |
|
|
|
453bef |
* Mon May 08 2017 Peter Jones <pjones@redhat.com> - 9-4
|
|
|
453bef |
- Fix some more coverity issues
|
|
|
453bef |
Related: rhbz#1380825
|
|
|
453bef |
|
|
|
453bef |
* Mon Apr 03 2017 Peter Jones <pjones@redhat.com> - 9-3
|
|
|
453bef |
- Fix CFLAGS on make invocation
|
|
|
453bef |
Related: rhbz#1380825
|
|
|
453bef |
|
|
|
453bef |
* Tue Mar 28 2017 Peter Jones <pjones@redhat.com> - 9-2
|
|
|
453bef |
- Fix a pile of coverity issues.
|
|
|
453bef |
Related: rhbz#1380825
|
|
|
453bef |
|
|
|
453bef |
* Mon Mar 13 2017 Peter Jones <pjones@redhat.com> - 9-1
|
|
|
453bef |
- First build in RHEL 7
|
|
|
453bef |
Resolves: rhbz#1380825
|