Fixed post and preun sections of the spec file.

This commit is contained in:
Paulo Roma Cavalcanti 2009-03-31 14:46:05 +00:00
parent 331d278737
commit fc4e404fd0
2 changed files with 22 additions and 35 deletions

View File

@ -1 +1,2 @@
memtest86+-2_11-4_fc10:HEAD:memtest86+-2.11-4.fc10.src.rpm:1236973348
memtest86+-2_11-5_fc10:HEAD:memtest86+-2.11-5.fc10.src.rpm:1238510694

View File

@ -2,12 +2,12 @@
%define __spec_install_post /usr/lib/rpm/brp-compress
# Turn off debuginfo package
%define debug_package %{nil}
%bcond_with update-grub.conf
%bcond_with update_grub
Summary: Stand-alone memory tester for x86 and x86-64 computers
Name: memtest86+
Version: 2.11
Release: 4%{?dist}
Release: 5%{?dist}
License: GPLv2
ExclusiveArch: %{ix86} x86_64
Group: System Environment/Base
@ -15,11 +15,13 @@ Source0: http://www.memtest.org/download/%{version}/%{name}-%{version}.tar.gz
URL: http://www.memtest.org
Source1: new-memtest-pkg
Source2: memtest-setup
Requires(preun): coreutils
# require glibc-devel.i386 via this file:
BuildRequires: %{_includedir}/gnu/stubs-32.h
BuildRequires: compat-gcc-34
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: /sbin/grubby
Requires(preun): coreutils
Requires(post): coreutils
%description
Memtest86+ is a thorough stand-alone memory test for x86 and x86-64
@ -56,14 +58,8 @@ install -m755 %{SOURCE2} %{buildroot}%{_sbindir}/memtest-setup
sed -i 's/\r//' $RPM_BUILD_DIR/%{name}-%{version}/README
%post
%if %{with update-grub.conf}
if [ -x /sbin/grubby ] ; then
/sbin/grubby \
--add-kernel="/boot/%{name}-%{version}" \
--title "Memtest86+ (%{version})"
sed -i -e's,kernel /%{name}-%{version},kernel --type=netbsd /%{name}-%{version},' /boot/grub/grub.conf
fi
%if %{with update_grub}
/usr/sbin/memtest-setup
%else
cat << EOF
@ -76,23 +72,9 @@ cat << EOF
EOF
%endif
%postun
%if %{with update-grub.conf}
if [ -x /sbin/grubby ] ; then
%preun
sed -i -e's,kernel --type=netbsd /%{name}-%{version},kernel /%{name}-%{version},' /boot/grub/grub.conf
/sbin/grubby --remove-kernel="/boot/%{name}-%{version}"
fi
%else
cat << EOF
************************************************
* REMINDER: Please update your /etc/grub.conf *
* file and remove any memtest86+ boot entry. *
************************************************
EOF
%endif
/sbin/new-memtest-pkg --remove %{version}
%clean
rm -rf %{buildroot}
@ -105,6 +87,10 @@ rm -rf %{buildroot}
%{_sbindir}/memtest-setup
%changelog
* Mon Mar 31 2009 Paulo Roma <roma@lcg.ufrj.br> - 2.11-5
- Changed postun for preun.
- Calling memtest-setup in case of updating grub.conf
* Mon Mar 11 2009 Paulo Roma <roma@lcg.ufrj.br> - 2.11-4
- Updated to 2.11
- Patched for booting from grub.