File grubby.spec of Package grubby.19443

# spec file for package grubby
# Copyright (c) 2021 SUSE LLC
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           grubby
Version:        20200210.99d10a3
Release:        0
Summary:        Command line tool for updating bootloader configs
License:        GPL-2.0-or-later
Group:          System/Base
Source0:        %{name}-%{version}.tar.xz
# for make test / getopt:
BuildRequires:  grub2
BuildRequires:  pkgconfig
BuildRequires:  util-linux
BuildRequires:  pkgconfig(blkid)
BuildRequires:  pkgconfig(popt)
%ifarch s390 s390x
Requires:       s390-tools
%ifarch %{arm}
Requires:       u-boot-tools

grubby is a command line tool for updating and displaying information about
the configuration files for the grub, lilo, elilo (ia64), yaboot (powerpc)
and zipl (s390) boot loaders. It is primarily designed to be used from scripts
which install new kernels and need to find information about the current boot

%autosetup -p1

sed -i~ '
' Makefile
diff -u "$_"~ "$_" && exit 1
CFLAGS="%{optflags} -std=gnu99 $(pkg-config --cflags blkid popt)"
grubby_LIBS="$(pkg-config --libs blkid popt)"
%make_build CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" grubby_LIBS="${grubby_LIBS}" VERSION='%{version}'

%ifnarch aarch64
sed -i~ '
' test/results/add/g2-1.16
diff -u "$_"~ "$_" && exit 1
%make_build test VERBOSE_TEST="-b grub2"

make install DESTDIR=%{buildroot} mandir="%{_mandir}"
# Remove installkernel as it is provided with mkinitrd package
rm %{buildroot}/sbin/installkernel
rm %{buildroot}/%{_mandir}/man8/installkernel.8

%license COPYING

openSUSE Build Service is sponsored by