]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blobdiff - grub/grub.nm
grub: Installation fails because of hardening.
[people/ms/ipfire-3.x.git] / grub / grub.nm
index 6b9ab693b7764bc1701359c489fe8dfd1758018d..59893e2bcc3bcf27e1c2b26b316465395950caf5 100644 (file)
 ###############################################################################
 
 name       = grub
-version    = 1.99
-release    = 2
-sup_arches = i686
+version    = 2.00
+release    = 4
+sup_arches = x86_64 i686
 
-groups     = Base System/Boot
+groups     = System/Boot
 url        = http://www.gnu.org/software/grub/
 license    = GPLv2+
 summary    = Grand Unified Boot Loader.
 
 description
-       GRUB (Grand Unified Boot Loader) is an experimental boot loader \
-       capable of booting into most free operating systems - Linux, FreeBSD, \
-       NetBSD, GNU Mach, and others as well as most commercial operating \
+       GRUB (Grand Unified Boot Loader) is an experimental boot loader
+       capable of booting into most free operating systems - Linux, FreeBSD,
+       NetBSD, GNU Mach, and others as well as most commercial operating
        systems.
 end
 
-source_dl  = http://ftp.gnu.org/gnu/grub/
+source_dl  = http://ftp.gnu.org/gnu/grub/ ftp://alpha.gnu.org/gnu/grub/
+sources    = %{thisapp}.tar.xz
+
+# Unifont
+unifont = /usr/share/X11/fonts/misc/unifont.pcf.gz
 
 build
        requires
                autoconf
+               autogen
                automake
                bison
+               bzip2-devel
+               dejavu-fonts-sans-fonts
                flex
                freetype-devel
                gettext
+               libdevmapper-devel
                ncurses-devel
+               paxctl
                zlib-devel
+               %{unifont}
        end
 
-       # Can only use very basic CFLAGS.
-       export CFLAGS = -O2 -pipe
-       export CXXFLAGS = %{CFLAGS}
-
-       configure_options += \
-               --sysconfdir=/etc \
-               --sbindir=/sbin \
-               --with-platform=pc
-
-       install
-               make install DESTDIR=%{BUILDROOT}
-
-               # Install theme file
-               install -m 0744 %{DIR_SOURCE}/05_theme %{BUILDROOT}/etc/grub.d/
+       prepare_cmds
+               cp -vf %{unifont} unifont.pcf.gz
+               ./autogen.sh
+       end
 
-               # Install splash background
-               mkdir -pv %{BUILDROOT}/boot/grub
-               install %{DIR_SOURCE}/splash.png %{BUILDROOT}/boot/grub
+       # As the modules contain always 32 bit code, they
+       # should be living in /usr/lib.
+       libdir = %{prefix}/lib
 
+       configure_options += \
+               --target="i386" \
+               --with-platform=pc \
+               --program-transform-name=s,grub,grub, \
+               --disable-werror \
+               CFLAGS="$(echo %{CFLAGS} | sed \
+                       -e 's/-Wp,-D_FORTIFY_SOURCE=2//g' \
+                       -e 's/-fstack-protector-all//g' \
+                       -e 's/-fstack-protector//g' \
+                       -e 's/-fPIC//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' )"
+
+       install_cmds
                # Install empty configuration file.
+               mkdir -pv %{BUILDROOT}/boot/grub
                touch %{BUILDROOT}/boot/grub/grub.cfg
+               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
+
+               # Disable hardening.
+               paxctl -mpes \
+                       %{BUILDROOT}%{sbindir}/grub-bios-setup \
+                       %{BUILDROOT}%{sbindir}/grub-probe
        end
+
+       debuginfo_strict_build_id = false
 end
 
 quality-agent
        whitelist_nx
-               /sbin/*|/usr/bin/*
+               %{bindir}/*|%{sbindir}/*
        end
 end
 
@@ -69,20 +113,18 @@ packages
                requires
                        gettext
                        os-prober
-                       /usr/share/X11/fonts/misc/unifont.pcf.gz
+                       system-logos >= 2
+               end
+
+               # An EFI version of grub does not exist any more.
+               obsoletes
+                       grub-efi <= 2.0.0-2
                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
-               end
        end
 
        package %{name}-debuginfo