Blame SPECS/fwupdate.spec

ab37a0
%global efivar_version 35-1
ab37a0
%global efibootmgr_version 16-1
ab37a0
%global gnu_efi_version 3.0.8-1
ab37a0
%undefine _debuginfo_subpackages
ab37a0
ab37a0
Name:           fwupdate
ab37a0
Version:        11
ab37a0
Release:        3%{?dist}
ab37a0
Summary:        Tools to manage UEFI firmware updates
ab37a0
License:        GPLv2+
ab37a0
URL:            https://github.com/rhinstaller/fwupdate
ab37a0
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
ab37a0
BuildRequires:  efivar-devel >= %{efivar_version}
ab37a0
BuildRequires:  gnu-efi >= %{gnu_efi_version}
ab37a0
BuildRequires:  gnu-efi-devel >= %{gnu_efi_version}
ab37a0
BuildRequires:  pesign
ab37a0
BuildRequires:  elfutils popt-devel git gettext pkgconfig
ab37a0
BuildRequires:  systemd
ab37a0
BuildRequires:  libabigail
ab37a0
%ifarch x86_64
ab37a0
BuildRequires: libsmbios-devel
ab37a0
%endif
ab37a0
ExclusiveArch:  x86_64 aarch64
ab37a0
Source0:        https://github.com/rhinstaller/fwupdate/releases/download/%{name}-%{version}/%{name}-%{version}.tar.bz2
ab37a0
Source1:        find-debuginfo-efi.sh
ab37a0
Source2:        securebootca.cer
ab37a0
Source3:        secureboot.cer
ab37a0
ab37a0
Patch0001: Fix-dependency-chain-for-a-parallel-make-issue.patch
ab37a0
ab37a0
%global __os_install_post %{expand:\
ab37a0
  %{?__debug_package:%{__debug_install_post}} \
ab37a0
  %{SOURCE1} \
ab37a0
  %{__arch_install_post} \
ab37a0
  %{__os_install_post} \
ab37a0
  %{nil}}%{nil}
ab37a0
ab37a0
%ifarch x86_64
ab37a0
%global efiarch x64
ab37a0
%global efialtarch ia32
ab37a0
%endif
ab37a0
%ifarch aarch64
ab37a0
%global efiarch aa64
ab37a0
%endif
ab37a0
ab37a0
# Figure out the right file path to use
ab37a0
%global efidir %(eval echo $(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/'))
ab37a0
ab37a0
%description
ab37a0
fwupdate provides a simple command line interface to the UEFI firmware updates.
ab37a0
ab37a0
%package libs
ab37a0
Summary: Library to manage UEFI firmware updates
ab37a0
%ifnarch %{ix86}
ab37a0
Requires: shim
ab37a0
%endif
ab37a0
Requires: %{name}-efi = %{version}-%{release}
ab37a0
ab37a0
%description libs
ab37a0
Library to allow for the simple manipulation of UEFI firmware updates.
ab37a0
ab37a0
%package devel
ab37a0
Summary: Development headers for libfwup
ab37a0
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
ab37a0
Requires: efivar-devel >= %{efivar_version}
ab37a0
ab37a0
%description devel
ab37a0
development headers required to use libfwup.
ab37a0
ab37a0
%package efi
ab37a0
Summary: UEFI binaries used by libfwup
ab37a0
Requires: %{name}-libs = %{version}-%{release}
ab37a0
ab37a0
%description efi
ab37a0
UEFI binaries used by libfwup.
ab37a0
ab37a0
%package efi-debuginfo
ab37a0
Summary: debuginfo for UEFI binaries used by libfwup
ab37a0
Requires: %{name}-efi = %{version}-%{release}
ab37a0
AutoReq: 0
ab37a0
AutoProv: 1
ab37a0
ab37a0
%description efi-debuginfo
ab37a0
debuginfo for UEFI binaries used by libfwup.
ab37a0
ab37a0
%prep
ab37a0
%setup -q -n %{name}-%{version}
ab37a0
git init
ab37a0
git config user.email "%{name}-owner@fedoraproject.org"
ab37a0
git config user.name "Fedora Ninjas"
ab37a0
git add .
ab37a0
mkdir build-%{efiarch}
ab37a0
%ifarch x86_64
ab37a0
mkdir build-%{efialtarch}
ab37a0
%endif
ab37a0
git commit -a -q -m "%{version} baseline."
ab37a0
git am %{patches} 
ab37a0
git config --unset user.email
ab37a0
git config --unset user.name
ab37a0
git config fwupdate.efidir %{efidir}
ab37a0
ab37a0
%build
ab37a0
cd build-%{efiarch}
ab37a0
make TOPDIR=.. -f ../Makefile OPT_FLAGS="$RPM_OPT_FLAGS" \
ab37a0
     libdir=%{_libdir} bindir=%{_bindir} \
ab37a0
     EFIDIR=%{efidir} %{?_smp_mflags}
ab37a0
mv -v efi/fwup%{efiarch}.efi efi/fwup%{efiarch}.unsigned.efi
ab37a0
%pesign -s -i efi/fwup%{efiarch}.unsigned.efi -o efi/fwup%{efiarch}.efi -a %{SOURCE2} -n redhatsecureboot301 -c %{SOURCE3}
ab37a0
cd ..
ab37a0
ab37a0
%ifarch x86_64
ab37a0
cd build-%{efialtarch}
ab37a0
setarch linux32 -B make TOPDIR=.. -f ../Makefile ARCH=%{efialtarch} \
ab37a0
                        OPT_FLAGS="$RPM_OPT_FLAGS" \
ab37a0
                        libdir=%{_libdir} bindir=%{_bindir} \
ab37a0
                        EFIDIR=%{efidir} %{?_smp_mflags}
ab37a0
mv -v efi/fwup%{efialtarch}.efi efi/fwup%{efialtarch}.unsigned.efi
ab37a0
%pesign -s -i efi/fwup%{efialtarch}.unsigned.efi -o efi/fwup%{efialtarch}.efi -a %{SOURCE2} -n redhatsecureboot301 -c %{SOURCE3}
ab37a0
cd ..
ab37a0
%endif
ab37a0
ab37a0
%install
ab37a0
rm -rf $RPM_BUILD_ROOT
ab37a0
cd build-%{efiarch}
ab37a0
%make_install TOPDIR=.. -f ../Makefile \
ab37a0
              EFIDIR=%{efidir} RPMARCH=%{_arch} RELEASE=%{RELEASE} \
ab37a0
              libdir=%{_libdir} bindir=%{_bindir} mandir=%{_mandir} \
ab37a0
              localedir=%{_datadir}/locale/ includedir=%{_includedir} \
ab37a0
              libexecdir=%{_libexecdir} datadir=%{_datadir} \
ab37a0
              sharedstatedir=%{_sharedstatedir}
ab37a0
cd ..
ab37a0
ab37a0
%ifarch x86_64
ab37a0
cd build-%{efialtarch}
ab37a0
setarch linux32 -B %make_install ARCH=%{efialtarch} TOPDIR=.. -f ../Makefile \
ab37a0
                                 EFIDIR=%{efidir} RPMARCH=%{_arch} \
ab37a0
                                 RELEASE=%{RELEASE} libdir=%{_libdir} \
ab37a0
                                 bindir=%{_bindir} mandir=%{_mandir} \
ab37a0
                                 localedir=%{_datadir}/locale/ \
ab37a0
                                 includedir=%{_includedir} \
ab37a0
                                 libexecdir=%{_libexecdir} \
ab37a0
                                 datadir=%{_datadir} \
ab37a0
                                 sharedstatedir=%{_sharedstatedir}
ab37a0
cd ..
ab37a0
%endif
ab37a0
ab37a0
%post libs
ab37a0
/sbin/ldconfig
ab37a0
%systemd_post fwupdate-cleanup.service
ab37a0
ab37a0
%preun libs
ab37a0
%systemd_preun fwupdate-cleanup.service
ab37a0
ab37a0
%postun libs
ab37a0
/sbin/ldconfig
ab37a0
%systemd_postun_with_restart pesign.service
ab37a0
ab37a0
%check
ab37a0
%ifarch x86_64
ab37a0
make abicheck
ab37a0
%endif
ab37a0
ab37a0
%files
ab37a0
%defattr(-,root,root,-)
ab37a0
%{!?_licensedir:%global license %%doc}
ab37a0
%license COPYING
ab37a0
# %%doc README
ab37a0
%{_bindir}/fwupdate
ab37a0
%{_datadir}/locale/en/fwupdate.po
ab37a0
%doc %{_mandir}/man1/*
ab37a0
%dir %{_datadir}/bash-completion/completions
ab37a0
%{_datadir}/bash-completion/completions/fwupdate
ab37a0
ab37a0
%files devel
ab37a0
%defattr(-,root,root,-)
ab37a0
%doc %{_mandir}/man3/*
ab37a0
%{_includedir}/*
ab37a0
%{_libdir}/*.so
ab37a0
%{_libdir}/pkgconfig/*.pc
ab37a0
ab37a0
%files libs
ab37a0
%defattr(-,root,root,-)
ab37a0
%{_libdir}/*.so.*
ab37a0
%{_datadir}/locale/en/libfwup.po
ab37a0
%{_unitdir}/fwupdate-cleanup.service
ab37a0
%attr(0755,root,root) %dir %{_sharedstatedir}/fwupdate/
ab37a0
%config(noreplace) %ghost %{_sharedstatedir}/fwupdate/done
ab37a0
%attr(0755,root,root) %dir %{_libexecdir}/fwupdate/
ab37a0
%{_libexecdir}/fwupdate/cleanup
ab37a0
ab37a0
%files efi
ab37a0
%dir %attr(0700,root,root) /boot/efi
ab37a0
%dir %attr(0700,root,root) /boot/efi/EFI/%{efidir}/
ab37a0
%dir %attr(0700,root,root) /boot/efi/EFI/%{efidir}/fw/
ab37a0
%attr (0700,root,root) /boot/efi/EFI/%{efidir}/fwup%{efiarch}.efi
ab37a0
%ifarch x86_64
ab37a0
%attr (0700,root,root) /boot/efi/EFI/%{efidir}/fwup%{efialtarch}.efi
ab37a0
%endif
ab37a0
ab37a0
%files efi-debuginfo -f debugfiles-efi.list
ab37a0
%defattr(-,root,root)
ab37a0
ab37a0
%changelog
ab37a0
* Thu Feb 21 2019 Javier Martinez Canillas <javierm@redhat.com> 11-3
ab37a0
- Fix dependency chain issue when doing a parallel make
ab37a0
  Related: rhbz#1677579
ab37a0
ab37a0
* Thu Feb 21 2019 Peter Jones <pjones@redhat.com> 11-3
ab37a0
- Fix secure boot signing for RHEL 8
ab37a0
  Resolves: rhbz#1677579
ab37a0
ab37a0
* Thu Feb 21 2019 Javier Martinez Canillas <javierm@redhat.com> 11-2
ab37a0
- Rebuild for signing with the proper key.
ab37a0
  Resolves: rhbz#1677579
ab37a0
ab37a0
* Mon Apr 09 2018 Peter Jones <pjones@redhat.com> - 11-1
ab37a0
- Update to fwupdate 11
ab37a0
ab37a0
* Thu Mar 01 2018 Peter Jones <pjones@redhat.com> - 10-6
ab37a0
- Fix fwup.pc
ab37a0
ab37a0
* Tue Feb 27 2018 Peter Jones <pjones@redhat.com> - 10-5
ab37a0
- Rebuild because I forgot to make sure efivar-34 was already in the
ab37a0
  buildroot.
ab37a0
ab37a0
* Tue Feb 27 2018 Peter Jones <pjones@redhat.com> - 10-4
ab37a0
- Roll in some bugfixes that'll be in fwupdate-11 upstream.
ab37a0
  This helps fix a couple of vendors machines.
ab37a0
ab37a0
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 10-3
ab37a0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
ab37a0
ab37a0
* Thu Jan 18 2018 Peter Jones <pjones@redhat.com> - 10-2
ab37a0
- Make really sure everything in /boot/efi is 0700 so we don't conflict with
ab37a0
  the grub packages.
ab37a0
ab37a0
* Mon Jan 08 2018 Peter Jones <pjones@redhat.com> - 10-1
ab37a0
- Update to the final released version 10.
ab37a0
- Make everything under /boot/efi be mode 0700, since that's what FAT will
ab37a0
  show anyway.
ab37a0
ab37a0
* Tue Sep 12 2017 Peter Jones <pjones@redhat.com> - 10-0.2
ab37a0
- Update for version 10
ab37a0
- test release for ux capsule support; to enable UX capsules define
ab37a0
  LIBFWUP_ADD_UX_CAPSULE=1 in your environment.
ab37a0
ab37a0
* Thu Aug 24 2017 Peter Jones <pjones@redhat.com> - 9-0.2
ab37a0
- Rebuild for aarch64 .reloc fix.
ab37a0
ab37a0
* Tue Aug 22 2017 Peter Jones <pjones@redhat.com> - 9-0.1
ab37a0
- Update to fwupdate 9
ab37a0
- Support ia32
ab37a0
ab37a0
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 8-7
ab37a0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
ab37a0
ab37a0
* Wed Jul 26 2017 Peter Jones <pjones@redhat.com> - 8-6
ab37a0
- Try to make debuginfo generation work with rpm-4.13.0.1-38.fc27.x86_64
ab37a0
ab37a0
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 8-5
ab37a0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
ab37a0
ab37a0
* Sat Jul 08 2017 Peter Jones <pjones@redhat.com> - 8-4
ab37a0
- Rebuild for efivar-31-1.fc26
ab37a0
  Related: rhbz#1468841
ab37a0
- Fix some gcc 7 quirks
ab37a0
ab37a0
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 8-3
ab37a0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
ab37a0
ab37a0
* Tue Sep 27 2016 Peter Jones <pjones@redhat.com> - 8-2
ab37a0
- Rebuild for efivar 30.
ab37a0
ab37a0
* Fri Aug 19 2016 Peter Jones <pjones@redhat.com> - 8-1
ab37a0
- Update to fwupdate 8
ab37a0
- Fix some i686 build errors
ab37a0
- Be less stupid about SONAMEs so in the future we'll only have to rebuild
ab37a0
  dependent things on actual ABI changes.
ab37a0
- Only depend on libsmbios on x86, for now, because it hasn't been ported to
ab37a0
  Aarch64.
ab37a0
ab37a0
* Wed Aug 17 2016 Peter Jones <pjones@redhat.com> - 7-1
ab37a0
- Update to fwupdate 7
ab37a0
- Fix the fix for ae7b85
ab37a0
- fix one place where a second "rc" varibale is clobbering a result.
ab37a0
ab37a0
* Tue Aug 16 2016 Peter Jones <pjones@redhat.com> - 6-1
ab37a0
- Update to fwupdate 6
ab37a0
- lots of build fixes for newer compilers and such
ab37a0
- Use libsmbios on some systems to enable firmware updates (Mario Limonciello)
ab37a0
- Use the correct reset type from the QueryCapsuleInfo data
ab37a0
- Lots of fixes from auditing
ab37a0
- Use efivar's error reporting infrastructure
ab37a0
ab37a0
* Fri Aug 12 2016 Adam Williamson <awilliam@redhat.com> - 0.5-5
ab37a0
- backport a couple of commits to fix build against efivar 26
ab37a0
ab37a0
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-4
ab37a0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
ab37a0
ab37a0
* Wed Nov 18 2015 Peter Jones <pjones@redhat.com> - 0.5-3
ab37a0
- Temporarily don't require shim on i?86 - we've never built it there, and
ab37a0
  libfwup knows how to handle it not being there just fine.
ab37a0
ab37a0
* Wed Nov 18 2015 Peter Jones <pjones@redhat.com> - 0.5-2
ab37a0
- Fix missing -libs Requires: due to editing error
ab37a0
ab37a0
* Wed Nov 18 2015 Peter Jones <pjones@redhat.com> - 0.5-1
ab37a0
- Rebase to 0.5
ab37a0
- Highlights in 0.5:
ab37a0
  - fwupdate.efi is called fwup$EFI_ARCH.efi now so weird platforms can have
ab37a0
    them coexist.  "Platform" here might mean "distro tools that care about
ab37a0
    multilib".  Anyway, it's needed to support things like baytrail.
ab37a0
  - Worked around shim command line bug where we need to treat LOAD_OPTIONS
ab37a0
    differently if we're invoked from the shell vs BDS
ab37a0
  - various debug features - SHIM_DEBUG and FWUPDATE_VERBOSE UEFI variables
ab37a0
    that'll let you get some debugging info some times
ab37a0
  - oh yeah, the actual debuginfo is useful
ab37a0
  - Automatically cleans up old instances on fresh OS installs
ab37a0
  - valgrind --leak-check=full on fwupdate doesn't show any errors at all
ab37a0
  - covscan shows only two things; one *really* doesn't matter, the other is
ab37a0
    because it doesn't understand our firmware variable data structure and
ab37a0
    can't work out that we have guaranteed the length of some data in a code
ab37a0
    path it isn't considering.
ab37a0
  - fwup_set_up_update() API improvements
ab37a0
  - killed fwup_sterror() and friends entirely
ab37a0
  - Should work on x64, ia32, and aarch64.
ab37a0
ab37a0
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-2
ab37a0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
ab37a0
ab37a0
* Tue Jun 02 2015 Peter Jones <pjones@redhat.com> - 0.4-1
ab37a0
- Update to 0.4
ab37a0
- Set DESTDIR so it's more consistently respected
ab37a0
- Always use upper case for Boot#### names.
ab37a0
- Create abbreviated device paths for our BootNext entry.
ab37a0
- Make subdir Makefiles get the version right.
ab37a0
- Fix ucs2len() to handle max=-1 correctly.
ab37a0
- Compare the right blobs when we're searching old boot entries.
ab37a0
- Fix .efi generation on non-x86 platforms.
ab37a0
- Use a relative path for fwupdate.efi when launched from shim.
ab37a0
- Show fewer debugging messages.
ab37a0
- Set BootNext when we find an old Boot#### variable as well.
ab37a0
- Add fwup_get_fw_type().
ab37a0
ab37a0
* Mon Jun 01 2015 Peter Jones <pjones@redhat.com> - 0.3-4
ab37a0
- Make abbreviated device paths work in the BootNext entry.
ab37a0
- Fix a ucs2 parsing bug.
ab37a0
ab37a0
* Mon Jun 01 2015 Peter Jones <pjones@redhat.com> - 0.3-3
ab37a0
- Always use abbreviated device paths for Boot#### entries.
ab37a0
ab37a0
* Mon Jun 01 2015 Peter Jones <pjones@redhat.com> - 0.3-2
ab37a0
- Fix boot entry naming.
ab37a0
ab37a0
* Thu May 28 2015 Peter Jones <pjones@redhat.com> - 0.3-1
ab37a0
- Here we go again.
ab37a0
ab37a0
# vim:expandtab