]> git.ipfire.org Git - ipfire-3.x.git/blobdiff - grub/grub.nm
json-c: Update to version 0.17-20230812
[ipfire-3.x.git] / grub / grub.nm
index b3a0c6d334199f6f1b004ecef94ebe6ef2c25211..263a36d56bad95249413406d4b4302f47e4a449b 100644 (file)
@@ -4,13 +4,12 @@
 ###############################################################################
 
 name       = grub
-version    = 1.99
-release    = 5
-sup_arches = x86_64 i686
+version    = 2.06
+release    = 2
 
 groups     = System/Boot
-url        = http://www.gnu.org/software/grub/
-license    = GPLv2+
+url        = https://www.gnu.org/software/grub/
+license    = GPLv3
 summary    = Grand Unified Boot Loader.
 
 description
@@ -20,157 +19,111 @@ description
        systems.
 end
 
-source_dl  = http://ftp.gnu.org/gnu/grub/
+source_dl  = https://ftp.gnu.org/gnu/grub/
+sources    = %{thisapp}.tar.xz
 
 build
+       arches = aarch64 x86_64
+
        requires
                autoconf
-               autogen
                automake
                bison
+               bzip2-devel
                flex
                freetype-devel
                gettext
+               gettext-devel
                libdevmapper-devel
                ncurses-devel
+               python3
                zlib-devel
        end
 
-       prepare_cmds
-               # Replace pkglib_DATA (automake 1.11.2 incompatibility)
-               sed -i -e "s/pkglib_DATA/pkgdata_DATA/g" \
-                       -e "s/pkglib_SCRIPTS/pkgdata_SCRIPTS/g" \
-                       Makefile* */Makefile* \
-                       gentpl.py util/grub-*.in
+       # Don't leak our CFLAGS to boot code
+       export HOST_CFLAGS  = %{CFLAGS}
+       export HOST_LDFLAGS = %{LDFLAGS}
+
+       platforms = efi
+
+       if "%{DISTRO_PLATFORM}" == "x86"
+               platforms += pc
+       end
 
-               ./autogen.sh
+       prepare_cmds
+               PYTHON=%{python3} ./autogen.sh
 
-               # Create a copy of the source tree to build
-               # an EFI enabled version of grub.
-               cp -R . %{DIR_SRC}/%{thisapp}-efi
+               for platform in %{platforms}; do
+                       cp -r %{DIR_APP} %{DIR_APP}-${platform}
+               done
        end
 
        # As the modules contain always 32 bit code, they
        # should be living in /usr/lib.
        libdir = %{prefix}/lib
 
-       configure_options += \
-               --target="i386" \
-               --sbindir=/sbin \
-               --datadir=%{libdir} \
-               --with-platform=pc \
-               --program-transform-name=s,grub,grub, \
-               --disable-werror \
-               CFLAGS="$(echo %{CFLAGS} | sed \
-                       -e 's/-fstack-protector//g' \
-                       -e 's/--param=ssp-buffer-size=4//g' \
-                       -e 's/-mregparm=3/-mregparm=4/g' \
-                       -e 's/-fexceptions//g' \
-                       -e 's/-m64//g' \
-                       -e 's/-fasynchronous-unwind-tables//g' )"
-
-       build_cmds
-               cd ../%{thisapp}-efi
-               ./configure \
-                       %{configure_options} \
-                       --with-platform=efi \
-                       --program-transform-name=s,grub,grub-efi, \
-                       CFLAGS="$(echo %{CFLAGS} | sed \
-                               -e 's/-O.//g' \
-                               -e 's/-fstack-protector//g' \
-                               -e 's/--param=ssp-buffer-size=4//g' \
-                               -e 's/-mregparm=3/-mregparm=4/g' \
-                               -e 's/-fexceptions//g' \
-                               -e 's/-m64//g' \
-                               -e 's/-fasynchronous-unwind-tables//g' )"
-
-               make %{PARALLELISMFLAGS}
-
-               ./grub-mkimage \
-                       -O i386-efi \
-                       -p /EFI/%{DISTRO_SNAME}/grub-efi \
-                       -o grub.efi \
-                       -d grub-core part_gpt hfsplus fat ext2 btrfs normal chain \
-                       boot configfile linux appleldr minicmd loadbios reboot halt \
-                       search font gfxterm echo video efi_gop efi_uga
+       build
+               for platform in %{platforms}; do
+                       pushd %{DIR_APP}-${platform}
+                       ./configure \
+                               %{configure_options} \
+                               --with-platform=${platform} \
+                               --disable-werror \
+                               CFLAGS= LDFLAGS=
+
+                       make %{PARALLELISMFLAGS}
+                       popd
+               done
        end
 
        install
-               cd ../%{thisapp}-efi
-               make install DESTDIR=%{BUILDROOT}
-
-               mv -v %{BUILDROOT}/etc/bash_completion.d/grub{,-efi}
-               sed -e "s,grub/grub-mkconfig_lib,grub-efi/grub-mkconfig_lib," \
-                       -i %{BUILDROOT}/sbin/grub-efi-mkconfig
-
-               install -m 755 -d %{BUILDROOT}/boot/efi/EFI/%{DISTRO_SNAME}/
-               install -d %{BUILDROOT}/boot/efi/EFI/%{DISTRO_SNAME}/grub-efi
-               touch %{BUILDROOT}/boot/efi/EFI/%{DISTRO_SNAME}/grub-efi/grub.cfg
-               ln -svf ../boot/efi/EFI/%{DISTRO_SNAME}/grub-efi/grub.cfg %{BUILDROOT}/etc/grub-efi.cfg
-               install -m 755 grub.efi %{BUILDROOT}/boot/efi/EFI/%{DISTRO_SNAME}/grub-efi/grub.efi
-
-               cd -
-               make install DESTDIR=%{BUILDROOT}
-
-               # Install theme file
-               install -m 0744 %{DIR_SOURCE}/05_theme %{BUILDROOT}/etc/grub.d/
-
-               # Install splash background
-               mkdir -pv %{BUILDROOT}/boot/grub
-               install %{DIR_SOURCE}/splash.png %{BUILDROOT}/boot/grub
+               for platform in %{platforms}; do
+                       pushd %{DIR_APP}-${platform}
+                       make install DESTDIR=%{BUILDROOT}
+                       popd
+               done
 
                # Install empty configuration file.
+               mkdir -pv %{BUILDROOT}/boot/grub
                touch %{BUILDROOT}/boot/grub/grub.cfg
-       end
-end
-
-quality-agent
-       whitelist_nx
-               /sbin/*|/usr/bin/*
+               ln -svf ../boot/grub/grub.cfg %{BUILDROOT}%{sysconfdir}/grub2.cfg
+
+               # Don't ship the default theme, replace it by our own one.
+               rm -rfv %{BUILDROOT}/boot/grub/themes/starfield \
+                       %{datadir}/grub/themes
+               mkdir -pv %{BUILDROOT}/boot/grub/themes/system
+               cp -rfv %{DIR_SOURCE}/theme/* \
+                       %{BUILDROOT}/boot/grub/themes/system/
+
+               # Prepare the fonts.
+               mkdir -pv %{BUILDROOT}/boot/grub/themes/system
+               pushd %{BUILDROOT}/boot/grub/themes/system/
+               %{BUILDROOT}%{bindir}/grub-mkfont -o DejaVuSans-10.pf2 -s 10 \
+                       %{datadir}/fonts/dejavu/DejaVuSans.ttf
+               %{BUILDROOT}%{bindir}/grub-mkfont -o DejaVuSans-12.pf2 -s 12 \
+                       %{datadir}/fonts/dejavu/DejaVuSans.ttf
+               %{BUILDROOT}%{bindir}/grub-mkfont -o DejaVuSans-Bold-14.pf2 \
+                       -s 14 %{datadir}/fonts/dejavu/DejaVuSans-Bold.ttf
+               popd
        end
 end
 
 packages
        package %{name}
                requires
+                       efibootmgr
                        gettext
-                       os-prober
-                       /usr/share/X11/fonts/misc/unifont.pcf.gz
-               end
-
-               configfiles
-                       /boot/grub/grub.cfg
-                       /etc/default/grub
-               end
-
-               # Generate grub compatible font for graphical boot menu
-               # This only converts Latin-1, Latin Extended A+B, Arrows, Box and Block characters
-               script postin
-                       /usr/bin/grub-mkfont --output /boot/grub/unifont.pf2 \
-                               --range=0x0000-0x0241,0x2190-0x21FF,0x2500-0x259f \
-                               /usr/share/X11/fonts/misc/unifont.pcf.gz
+                       system-logos >= 2
                end
-       end
 
-       package %{name}-efi
-               description
-                       EFI version of GRUB, the Grand Unified Boot Loader.
+               # An EFI version of grub does not exist any more.
+               obsoletes
+                       grub-efi <= 2.0.0-2
                end
-               summary = %{description}
-
-               requires += grub = %{thisver}
 
                configfiles
-                       /boot/efi/EFI/%{DISTRO_SNAME}/grub-efi/grub.cfg
-               end
-
-               files
-                       /boot/efi
-                       /etc/bash_completion.d/grub-efi
-                       /etc/grub-efi.cfg
-                       /sbin/grub-efi-*
-                       /usr/bin/grub-efi-*
-                       /usr/lib/grub-efi
+                       /boot/grub/grub.cfg
+                       /etc/default/grub
                end
        end