Blame SPECS/fwupdate.spec

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