cvsdist 3e6a654
# Prevent stripping
947ffdf
%global __spec_install_post /usr/lib/rpm/brp-compress
cvsdist 3e6a654
# Turn off debuginfo package
947ffdf
%global debug_package %{nil}
3afed52
%global common_description %{expand:
f8eb731
Memtest86+ is a thorough stand-alone memory test for x86 and x86-64
f8eb731
architecture computers. BIOS based memory tests are only a quick
f8eb731
check and often miss many of the failures that are detected by
cvsdist 3e6a654
Memtest86+.
3afed52
}
e07dfbb
%ifarch x86_64
3afed52
%global mt_isa x64
e07dfbb
%endif
3afed52
%ifarch %{ix86}
3afed52
%global mt_isa ia32
501bcdf
%endif
cvsdist 3e6a654
e01efa4
Name:          memtest86+
e01efa4
Version:       6.20
e01efa4
Release:       %autorelease
e01efa4
Summary:       Stand-alone memory tester for x86-64 computers
e01efa4
License:       GPL-2.0-only
e01efa4
URL:           https://www.memtest.org/
e01efa4
Source0:       https://github.com/memtest86plus/memtest86plus/archive/v%{version}/memtest86-plus-%{version}.tar.gz
e01efa4
Source1:       memtest86+.kernel-install-plugin
e01efa4
e01efa4
BuildRequires: gcc, make, xorriso, dosfstools, mtools
e01efa4
Requires(pre): systemd-udev >= 252
e01efa4
ExclusiveArch: x86_64 %{ix86}
fd66414
3afed52
%description
3afed52
%wordwrap -v common_description
cvsdist 3e6a654
cvsdist 3e6a654
3afed52
%prep
3afed52
%autosetup -n memtest86plus-%{version} -p1
cvsdist 3e6a654
cvsdist 3e6a654
3afed52
%build
3afed52
pushd build%{__isa_bits}
3afed52
make
3afed52
make iso
3afed52
popd
cvsdist 3e6a654
cvsdist 3e6a654
3afed52
%install
3afed52
mkdir -p %{buildroot}%{_libdir}/%{name}
3afed52
mkdir -p %{buildroot}%{_datarootdir}/%{name}
cvsdist 3e6a654
3afed52
pushd build%{__isa_bits}
3afed52
install -m 0644 memtest.efi %{buildroot}%{_libdir}/%{name}/memtest86+%{mt_isa}.efi
3afed52
install -m 0644 memtest.bin %{buildroot}%{_libdir}/%{name}/memtest86+%{mt_isa}.bin
3afed52
install -m 0644 memtest.iso %{buildroot}%{_datarootdir}/%{name}/memtest86+%{mt_isa}.iso
e01efa4
install -m 0755 %{SOURCE1} %{buildroot}%{_libdir}/%{name}/memtest86+.kernel-install-plugin
3afed52
popd
cvsdist 3e6a654
cvsdist 3e6a654
3afed52
%files
3afed52
%license LICENSE
3afed52
%doc README.md
3afed52
%{_libdir}/%{name}/memtest86+%{mt_isa}.*
e01efa4
%{_libdir}/%{name}/memtest86+.kernel-install-plugin
3afed52
%{_datarootdir}/%{name}/memtest86+%{mt_isa}.iso
3afed52
df14656
df14656
%post
df14656
if [ $1 -gt 1 ]; then
df14656
  # cleanup upgrade BLS location changes
df14656
  if [ -d /boot/loader/entries ]; then
df14656
    rm -f /boot/loader/entries/*-0-memtest86+-6*.conf
df14656
  fi
df14656
fi
df14656
exit 0
df14656
df14656
3afed52
%posttrans
e01efa4
MEMTEST_IMAGE="memtest86+%{mt_isa}.bin"
3afed52
if [ -d /sys/firmware/efi/ ]; then
e01efa4
MEMTEST_IMAGE="memtest86+%{mt_isa}.efi"
3afed52
fi
e01efa4
KERNEL_INSTALL_PLUGINS=%{_libdir}/%{name}/memtest86+.kernel-install-plugin \
e01efa4
kernel-install add %{version} %{_libdir}/%{name}/${MEMTEST_IMAGE}
3afed52
exit 0
3afed52
e01efa4
e01efa4
%preun
3afed52
if [ $1 -eq 0 ]; then
e01efa4
KERNEL_INSTALL_PLUGINS=%{_libdir}/%{name}/memtest86+.kernel-install-plugin \
e01efa4
kernel-install remove %{version}
3afed52
fi
3afed52
exit 0
cvsdist 3e6a654
cvsdist 3e6a654
3afed52
%changelog
3afed52
%autochangelog