c0bacf9
# this is to make us only expand %%{dist} if we're on a modularity build.
c0bacf9
# it's 2 macros make vim's \c not put a brace at the end of the changelog.
a0656a4
%global _dist %{expand:%{?_module_build:%%{?dist}}}
a0656a4
%global dist %{expand:%%{_dist}}
a0656a4
0abd456
Name:		shim
d369b28
Version:	15
c0bacf9
Release:	4%{?dist}
a0656a4
Summary:	First-stage UEFI bootloader
a0656a4
License:	BSD
c0bacf9
URL:		https://github.com/rhboot/shim/
c0bacf9
Requires:	efi-filesystem
a0656a4
c0bacf9
ExclusiveArch:	%{efi}
c0bacf9
# but we don't build a .i686 package, just a shim-ia32.x86_64 package
c0bacf9
ExcludeArch:	%{ix86}
c0bacf9
# and we don't have shim-unsigned-arm builds yet
c0bacf9
ExcludeArch:	%{arm}
c0bacf9
c0bacf9
Source0:	macros.shim
a0656a4
a0656a4
# keep these two lists of sources synched up arch-wise.  That is 0 and 10
a0656a4
# match, 1 and 11 match, ...
c0bacf9
Source10:	BOOTAA64.CSV
c0bacf9
Source20:	shimaa64.efi
c0bacf9
Source11:	BOOTIA32.CSV
c0bacf9
Source21:	shimia32.efi
c0bacf9
Source12:	BOOTX64.CSV
c0bacf9
Source22:	shimx64.efi
c0bacf9
#Source13:	BOOTARM.CSV
c0bacf9
#Source23:	shimarm.efi
c0bacf9
c0bacf9
# is this gross?  yes, this is gross.
c0bacf9
%if 0%{?_buildhost:1}
c0bacf9
%include %{SOURCE0}
a0656a4
%endif
c0bacf9
%if ! 0%{?found_macros_dot_shim}
c0bacf9
%include %{SOURCEURL0}
a0656a4
%endif
c0bacf9
a0656a4
BuildRequires:	pesign >= 0.112-20.fc27
c0bacf9
BuildRequires:	%{unsigned} = %{shimver}
c0bacf9
%if %{efi_has_alt_arch}
c0bacf9
BuildRequires:	%{unsignedalt} = %{shimveralt}
c0bacf9
%endif
a0656a4
a0656a4
%description
a0656a4
Initial UEFI bootloader that handles chaining to a trusted full bootloader
a0656a4
under secure boot environments. This package contains the version signed by
a0656a4
the UEFI signing service.
a0656a4
c0bacf9
%define_pkg -a %{efi_arch} -p 1
c0bacf9
%if %{efi_has_alt_arch}
c0bacf9
%define_pkg -a %{efi_alt_arch}
a0656a4
%endif
a0656a4
a0656a4
%prep
a0656a4
cd %{_builddir}
0abd456
rm -rf shim-%{version}
0abd456
mkdir shim-%{version}
a0656a4
a0656a4
%build
a0656a4
0abd456
cd shim-%{version}
c0bacf9
%if %{efi_has_alt_arch}
c0bacf9
%define_build -a %{efi_alt_arch} -A %{efi_alt_arch_upper} -i %{shimefialt} -b yes -c %{is_alt_signed} -d %{shimdiralt}
a0656a4
%endif
c0bacf9
%define_build -a %{efi_arch} -A %{efi_arch_upper} -i %{shimefi} -b yes -c %{is_signed} -d %{shimdir}
a0656a4
a0656a4
%install
a0656a4
rm -rf $RPM_BUILD_ROOT
0abd456
cd shim-%{version}
a0656a4
install -D -d -m 0755 $RPM_BUILD_ROOT/boot/
c0bacf9
install -D -d -m 0700 $RPM_BUILD_ROOT%{efi_esp_root}/
c0bacf9
install -D -d -m 0700 $RPM_BUILD_ROOT%{efi_esp_efi}/
c0bacf9
install -D -d -m 0700 $RPM_BUILD_ROOT%{efi_esp_dir}/
c0bacf9
install -D -d -m 0700 $RPM_BUILD_ROOT%{efi_esp_boot}/
c0bacf9
c0bacf9
%do_install -a %{efi_arch} -A %{efi_arch_upper} -b %{bootcsv}
c0bacf9
%if %{efi_has_alt_arch}
c0bacf9
%do_install -a %{efi_alt_arch} -A %{efi_alt_arch_upper} -b %{bootcsvalt}
a0656a4
%endif
c0bacf9
c0bacf9
%if %{provide_legacy_shim}
c0bacf9
install -m 0700 %{shimefi} $RPM_BUILD_ROOT%{efi_esp_dir}/shim.efi
a0656a4
%endif
a0656a4
c0bacf9
( cd $RPM_BUILD_ROOT ; find .%{efi_esp_root} -type f ) \
c0bacf9
  | sed -e 's/\./\^/' -e 's,^\\\./,.*/,' -e 's,$,$,' > %{__brp_mangle_shebangs_exclude_from_file}
a0656a4
c0bacf9
%define_files -a %{efi_arch} -A %{efi_arch_upper}
c0bacf9
%if %{efi_has_alt_arch}
c0bacf9
%define_files -a %{efi_alt_arch} -A %{efi_alt_arch_upper}
c0bacf9
%endif
a0656a4
c0bacf9
%ifarch x86_64
c0bacf9
%{efi_esp_dir}/BOOT.CSV
c0bacf9
%{efi_esp_dir}/MokManager.efi
c0bacf9
%{efi_esp_dir}/shim.efi
c0bacf9
%{efi_esp_boot}/fallback.efi
a0656a4
%endif
a0656a4
%ifarch aarch64
c0bacf9
%{efi_esp_dir}/shim.efi
a0656a4
%endif
a0656a4
a0656a4
%changelog
c0bacf9
* Thu May 03 2018 Peter Jones <pjones@redhat.com> - 15-4
c0bacf9
- Rework the .spec to use efi-rpm-macros.
c0bacf9
240d9ca
* Mon Apr 30 2018 Peter Jones <pjones@redhat.com> - 15-3
240d9ca
- Pick a release value that'll be higher than what's in F28.
240d9ca
eb9b071
* Mon Apr 30 2018 Peter Jones <pjones@redhat.com> - 15-1
eb9b071
- Fix BOOT*.CSV and update release to -1
eb9b071
eb9b071
* Tue Apr 24 2018 Peter Jones <pjones@redhat.com> - 15-0.1
d369b28
- Update to shim 15.
d369b28
- more reproduceable build
d369b28
- better checking for bad linker output
d369b28
- flicker-free console if there's no error output
d369b28
- improved http boot support
d369b28
- better protocol re-installation
d369b28
- dhcp proxy support
d369b28
- tpm measurement even when verification is disabled
d369b28
- more reproducable builds
d369b28
- measurement of everything verified through shim_verify()
d369b28
- coverity and scan-build checker make targets
d369b28
- misc cleanups
d369b28
acc5812
* Tue Mar 06 2018 Peter Jones <pjones@redhat.com> - 13-5
acc5812
- Back off to the thing we had in 13-0.8 until I get new signatures.
acc5812
99b1d68
* Wed Feb 28 2018 Peter Jones <pjones@redhat.com> - 13-4
99b1d68
- Fix an inverted test that crept in in the signing macro.  (Woops.)
99b1d68
0abd456
* Wed Feb 28 2018 Peter Jones <pjones@redhat.com> - 13-2
0abd456
- Pivot the shim-signed package to be here.
0abd456
a0656a4
* Wed Nov 01 2017 Peter Jones <pjones@redhat.com> - 13-1
a0656a4
- Now with the actual signed 64-bit build of shim 13 for x64 as well.
a0656a4
- Make everything under /boot/efi be mode 0700, since that's what FAT will
a0656a4
  show anyway, so that rpm -V is correct.
a0656a4
  Resolves: rhbz#1508516
a0656a4
a0656a4
* Tue Oct 24 2017 Peter Jones <pjones@redhat.com> - 13-0.8
a0656a4
- Now with signed 32-bit x86 build.
a0656a4
  Related: rhbz#1474861
a0656a4
a0656a4
* Wed Oct 04 2017 Peter Jones <pjones@redhat.com> - 13-0.7
a0656a4
- Make /boot/efi/EFI/fedora/shim.efi still exist on aarch64 as well.
a0656a4
  Resolves: rhbz#1497854
a0656a4
a0656a4
* Tue Sep 19 2017 Peter Jones <pjones@redhat.com> - 13-0.6
a0656a4
- Fix binary format issue on Aarch64
a0656a4
  Resolves: rhbz#1489604
a0656a4
a0656a4
* Tue Sep 05 2017 Peter Jones <pjones@redhat.com> - 13-0.5
a0656a4
- Make /boot/efi/EFI/fedora/shim.efi still exist on x86_64, since some
a0656a4
  machines have boot entries that point to it.
a0656a4
a0656a4
* Tue Aug 29 2017 Peter Jones <pjones@redhat.com> - 13-0.4
a0656a4
- Make our provides not get silently ignore by rpmbuild...
a0656a4
a0656a4
* Fri Aug 25 2017 Peter Jones <pjones@redhat.com> - 13-0.3
a0656a4
- x64: use the new fbx64.efi and mm64.efi as fallback.efi and MokManager.efi
a0656a4
- Provide: "shim" in x64 and aa64 builds
a0656a4
a0656a4
* Thu Aug 24 2017 Peter Jones <pjones@redhat.com> - 13-0.2
a0656a4
- Obsolete old shim builds.
a0656a4
a0656a4
* Tue Aug 22 2017 Peter Jones <pjones@redhat.com> - 13-0.1
a0656a4
- Initial (partially unsigned) build for multi-arch support on x64/ia32.
a0656a4
a0656a4
* Thu Mar 23 2017 Petr Ĺ abata <contyk@redhat.com> - 0.8-9
a0656a4
- Re-enable dist tag for module builds
a0656a4
a0656a4
* Tue Feb 17 2015 Peter Jones <pjones@redhat.com> - 0.8-8
a0656a4
- Don't dual-sign shim-%%{efidir}.efi either.
a0656a4
  Resolves: rhbz#1184765
a0656a4
a0656a4
* Tue Feb 17 2015 Peter Jones <pjones@redhat.com> - 0.8-8
a0656a4
- Require dbxtool
a0656a4
a0656a4
* Wed Dec 17 2014 Peter Jones <pjones@redhat.com> - 0.8-7
a0656a4
- Wrong -signed changes got built for aarch64 last time, for dumb reasons.
a0656a4
  Related: rhbz#1170289
a0656a4
a0656a4
* Fri Dec 05 2014 Peter Jones <pjones@redhat.com> - 0.8-6
a0656a4
- Rebuild once more so we can use a different -unsigned version on different
a0656a4
  arches (because we can't tag a newer build into aarch64 without an x86
a0656a4
  update to match.)
a0656a4
  Related: rhbz#1170289
a0656a4
a0656a4
* Wed Dec 03 2014 Peter Jones <pjones@redhat.com> - 0.8-5
a0656a4
- Rebuild for aarch64 path fixes
a0656a4
  Related: rhbz#1170289
a0656a4
a0656a4
* Thu Oct 30 2014 Peter Jones <pjones@redhat.com> - 0.8-2
a0656a4
- Remove the dist tag so people don't complain about what it says.
a0656a4
a0656a4
* Fri Oct 24 2014 Peter Jones <pjones@redhat.com> - 0.8-1
a0656a4
- Update to shim 0.8
a0656a4
  rhbz#1148230
a0656a4
  rhbz#1148231
a0656a4
  rhbz#1148232
a0656a4
- Handle building on aarch64 as well
a0656a4
a0656a4
* Fri Jul 18 2014 Peter Jones <pjones@redhat.com> - 0.7-2
a0656a4
- Don't do multi-signing; too many machines screw up verification.
a0656a4
  Resolves: rhbz#1049749
a0656a4
a0656a4
* Wed Nov 13 2013 Peter Jones <pjones@redhat.com> - 0.7-1
a0656a4
- Update to shim 0.7
a0656a4
  Resolves: rhbz#1023767
a0656a4
a0656a4
* Thu Oct 24 2013 Peter Jones <pjones@redhat.com> - 0.5-1
a0656a4
- Update to shim 0.5
a0656a4
a0656a4
* Thu Jun 20 2013 Peter Jones <pjones@redhat.com> - 0.4-1
a0656a4
- Provide a fallback for uninitialized Boot#### and BootOrder
a0656a4
  Resolves: rhbz#963359
a0656a4
- Move all signing from shim-unsigned to here
a0656a4
- properly compare our generated hash from shim-unsigned with the hash of
a0656a4
  the signed binary (as opposed to doing it manually)
a0656a4
a0656a4
* Fri May 31 2013 Peter Jones <pjones@redhat.com> - 0.2-4.4
a0656a4
- Re-sign to get alignments that match the new specification.
a0656a4
  Resolves: rhbz#963361
a0656a4
a0656a4
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2-4.3
a0656a4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
a0656a4
a0656a4
* Wed Jan 02 2013 Peter Jones <pjones@redhat.com> - 0.2-3.3
a0656a4
- Add obsoletes and provides for earlier shim-signed packages, to cover
a0656a4
  the package update cases where previous versions were installed.
a0656a4
  Related: rhbz#888026
a0656a4
a0656a4
* Mon Dec 17 2012 Peter Jones <pjones@redhat.com> - 0.2-3.2
a0656a4
- Make the shim-unsigned dep be on the subpackage.
a0656a4
a0656a4
* Sun Dec 16 2012 Peter Jones <pjones@redhat.com> - 0.2-3.1
a0656a4
- Rebuild to provide "shim" package directly instead of just as a Provides:
a0656a4
a0656a4
* Sat Dec 15 2012 Peter Jones <pjones@redhat.com> - 0.2-3
a0656a4
- Also provide shim-fedora.efi, signed only by the fedora signer.
a0656a4
- Fix the fedora signature on the result to actually be correct.
a0656a4
- Update for shim-unsigned 0.2-3
a0656a4
a0656a4
* Mon Dec 03 2012 Peter Jones <pjones@redhat.com> - 0.2-2
a0656a4
- Initial build