diff --git a/.gitignore b/.gitignore index 7050abc..5e9e976 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ grubby-*.tar.bz2 clog *.rpm /8.40-1.tar.gz +.build*log +grubby-*/ diff --git a/grubby.in b/grubby.in new file mode 100644 index 0000000..f0036e9 --- /dev/null +++ b/grubby.in @@ -0,0 +1,8 @@ +#!/bin/bash +if [[ -x @@LIBEXECDIR@@/grubby-bls ]] ; then + exec @@LIBEXECDIR@@/grubby-bls "${@}" +elif [[ -x @@LIBEXECDIR@@/grubby ]] ; then + exec @@LIBEXECDIR@@/grubby "${@}" +fi +echo "Grubby is not installed correctly." >>/dev/stderr +exit 1 diff --git a/grubby.spec b/grubby.spec index d202663..3a4f7d0 100644 --- a/grubby.spec +++ b/grubby.spec @@ -4,15 +4,13 @@ Release: 15%{?dist} Summary: Command line tool for updating bootloader configs License: GPLv2+ URL: https://github.com/rhinstaller/grubby -Obsoletes: %{name} <= 8.40-14 -Obsoletes: %{name}-bls <= 8.40-14 - # we only pull git snaps at the moment # git clone git@github.com:rhinstaller/grubby.git # git archive --format=tar --prefix=grubby-%%{version}/ HEAD |bzip2 > grubby-%%{version}.tar.bz2 # Source0: %%{name}-%%{version}.tar.bz2 Source0: https://github.com/rhboot/grubby/archive/%{version}-1.tar.gz Source1: grubby-bls +Source2: grubby.in Patch1: drop-uboot-uImage-creation.patch Patch2: 0001-Change-return-type-in-getRootSpecifier.patch Patch3: 0002-Add-btrfs-subvolume-support-for-grub2.patch @@ -20,8 +18,9 @@ Patch4: 0003-Add-tests-for-btrfs-support.patch Patch5: 0004-Use-system-LDFLAGS.patch Patch6: 0004-Honor-sbindir.patch +BuildRequires: gcc BuildRequires: pkgconfig glib2-devel popt-devel -BuildRequires: libblkid-devel git-core +BuildRequires: libblkid-devel git-core sed # for make test / getopt: BuildRequires: util-linux-ng %ifarch aarch64 i686 x86_64 %{power64} @@ -65,19 +64,42 @@ make test %install make install DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} sbindir=%{_sbindir} -rm %{buildroot}%{_sbindir}/installkernel -rm %{buildroot}%{_sbindir}/new-kernel-pkg -cp %{SOURCE1} %{buildroot}%{_sbindir}/grubby +mkdir -p %{buildroot}%{_libexecdir}/grubby/ %{buildroot}%{_sbindir}/ +mv -v %{buildroot}%{_sbindir}/grubby %{buildroot}%{_libexecdir}/grubby/grubby +cp -v %{SOURCE1} %{buildroot}%{_libexecdir}/grubby/ +sed -e "s,@@LIBEXECDIR@@,%{_libexecdir},g" %{SOURCE2} \ + > %{buildroot}%{_sbindir}/grubby + +%package bls +Summary: Command line tool for updating BootLoaderSpec files +Conflicts: %{name} <= 8.40-13 +BuildArch: noarch + +%description bls +This package provides a grubby wrapper that manages BootLoaderSpec files and is +meant to only be used for legacy compatibility users with existing grubby users. %files %{!?_licensedir:%global license %%doc} %license COPYING +%dir %{_libexecdir}/grubby +%{_libexecdir}/grubby/grubby +%{_sbindir}/grubby +%{_sbindir}/installkernel +%{_sbindir}/new-kernel-pkg +%{_mandir}/man8/*.8* + +%files bls +%{!?_licensedir:%global license %%doc} +%license COPYING +%dir %{_libexecdir}/grubby +%{_libexecdir}/grubby/grubby-bls %{_sbindir}/grubby %{_mandir}/man8/*.8* %changelog -* Wed Jul 18 2018 Peter Jones - 8.40-15 -- Move grubby-bls to grubby and obsolete the old grubby package +* Fri Jul 13 2018 Javier Martinez Canillas - 8.40-15 +- Add a grubby-bls package that conflicts with grubby * Fri Jul 13 2018 Fedora Release Engineering - 8.40-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild