# vim: syn=sh ft=sh et sw=2 sts=2 ts=2 tw=0: #Packager: Cyrille Pontvieux pkgname=grub pkgver=2.00 _patchesver=1.0 _intelresver=r9 _luaver=r24 _ntldrver=r21 _evalver=1.0 _getdatever=1.0 _gettextvarver=1.0 _unifontver=5.1.20080820 _dejavuver=2.33 pkgrel=5cp source=( "grub-default" "salix.png" "salix.xcf.xz" "update-grub" "setup.grubconfig" "grubconfig" "initrd_naming.patch.gz" "txtHRnXiHYUrM.patch.gz" "grub.dejavusansmono.gfxterm.font.patch.gz" "grub.e75fdee4.terminate.efi.several.times.patch.gz" "grub.color.patch.gz" "ftp://ftp.gnu.org/gnu/${pkgname}/${pkgname}-$pkgver.tar.xz" "ftp://ftp.archlinux.org/other/grub2/grub2_extras_915resolution_$_intelresver.tar.xz" "ftp://ftp.archlinux.org/other/grub2/grub2_extras_lua_$_luaver.tar.xz" "ftp://ftp.archlinux.org/other/grub2/grub2_extras_ntldr-img_$_ntldrver.tar.xz" "http://git.enialis.net/download/grub2-patches/grub2-patches-$_patchesver.tar.xz" "http://git.enialis.net/download/grub2-eval/grub2-eval-$_evalver.tar.xz" "http://git.enialis.net/download/grub2-getdate/grub2-getdate-$_getdatever.tar.xz" "http://git.enialis.net/download/grub2-gettextvar/grub2-gettextvar-$_gettextvarver.tar.xz" "http://unifoundry.com/unifont-$_unifontver.pcf.gz" "http://sourceforge.net/projects/dejavu/files/dejavu/$_dejavuver/dejavu-sans-ttf-$_dejavuver.zip" ) sourcetemplate=http://people.salixos.org/jrd/salix/$pkgname/$pkgver-\$arch-$pkgrel/ docs=("readme" "install" "copying" "changelog" "authors" "news" "todo") url=http://www.gnu.org/software/grub/ options=('noextract' 'nostrip' 'noautodotnew') dotnew=('etc/default/grub' 'etc/grub.d/00_header' 'etc/grub.d/10_linux' 'etc/grub.d/20_linux_xen' 'etc/grub.d/30_os-prober' 'etc/grub.d/40_custom' 'etc/grub.d/41_custom') slackdesc=\ ( #|-----handy-ruler------------------------------------------------------| "$pkgname (the second GNU GRand Unified Bootloader)" "GRUB 2 has been rewritten from scratch to clean up everything for" "modularity and portability." "Features are: Scripting support, Graphical interface, Rescue mode," "cross-platform and many more" "Briefly, boot loader is the first software program that runs when a" "computer starts. It is responsible for loading and transferring" "control to the operating system kernel software (such as the Hurd or" "the Linux). The kernel initializes the rest of the operating system." "* gettextvar, eval, getdate commands added." ) build() { # CFLAGS and CXXFLAGS should not contains fPIC or compile will fail export CFLAGS=$(echo "$CFLAGS"|sed 's/-fPIC/-fno-PIC/') export CXXFLAGS=$(echo "$CXXFLAGS"|sed 's/-fPIC/-fno-PIC/') cd $SRC || return 1 tar xf grub-$pkgver.tar.xz || return 1 unzip $SRC/dejavu-sans-ttf-$_dejavuver.zip || return 1 cd grub-$pkgver || return 1 # Use /boot/initrd.gz as a valid initrd name: zcat $SRC/initrd_naming.patch.gz | patch -p1 || return 1 # Patch for recent glibc: zcat $SRC/txtHRnXiHYUrM.patch.gz | patch -p0 || return 1 # Support DejaVuSansMono font (dejavusansmono.pf2) by default: zcat $SRC/grub.dejavusansmono.gfxterm.font.patch.gz | patch -p1 || return 1 # Terminate EFI several times. This is a workaround for broken UEFI firmware. zcat $SRC/grub.e75fdee4.terminate.efi.several.times.patch.gz | patch -p1 || return 1 # patch to define menu colors in default/grub (get from Arch Linux) zcat $SRC/grub.color.patch.gz | patch -p1 || return 1 # other patches tar xf $SRC/grub2-patches-$_patchesver.tar.xz -C "$SRC" || return 1 # patch to customize the title text and position in normal and theme mode. patch -p1 -i $SRC/grub2-patches-$_patchesver/grub2-title_menu.patch || return 1 # grub extras mkdir grub-extras export GRUB_CONTRIB="$PWD/grub-extras/" tar xf $SRC/grub2_extras_915resolution_$_intelresver.tar.xz -C "$GRUB_CONTRIB" || return 1 tar xf $SRC/grub2_extras_lua_$_luaver.tar.xz -C "$GRUB_CONTRIB" || return 1 tar xf $SRC/grub2_extras_ntldr-img_$_ntldrver.tar.xz -C "$GRUB_CONTRIB" || return 1 tar xf $SRC/grub2-eval-$_evalver.tar.xz -C "$GRUB_CONTRIB" || return 1 mv "$GRUB_CONTRIB"/grub2-eval-$_evalver "$GRUB_CONTRIB"/eval || return 1 tar xf $SRC/grub2-getdate-$_getdatever.tar.xz -C "$GRUB_CONTRIB" || return 1 mv "$GRUB_CONTRIB"/grub2-getdate-$_getdatever "$GRUB_CONTRIB"/getdate || return 1 tar xf $SRC/grub2-gettextvar-$_gettextvarver.tar.xz -C "$GRUB_CONTRIB" || return 1 mv "$GRUB_CONTRIB"/grub2-gettextvar-$_gettextvarver "$GRUB_CONTRIB"/gettextvar || return 1 cp $SRC/unifont-$_unifontver.pcf.gz unifont.pcf.gz || return 1 cp $SRC/dejavu-sans-ttf-$_dejavuver/ttf/DejaVuSans.ttf . || return 1 ./autogen.sh ./configure \ --with-platform="pc" \ --target="i386" \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --localstatedir=/var \ --sysconfdir=/etc \ --mandir=/usr/man \ --infodir=/usr/share/info \ --docdir=/usr/doc/$pkgname-$pkgver \ --program-prefix= \ --enable-cache-stats \ --enable-boot-time \ --enable-device-mapper \ $([ $ARCH = x86_64 ] && echo '--enable-efiemu' || echo '--disable-efiemu') \ --enable-grub-emu-usb \ --enable-grub-mkfont \ --enable-grub-mount \ --enable-nls \ --with-bootdir="/boot" \ --with-grubdir="grub" \ --disable-silent-rules \ --disable-werror \ --build=$arch-slackware-linux || return 1 make -j $numjobs || return 1 make install DESTDIR=$PKG || return 1 # EFI compilation ./configure \ --with-platform="efi" \ --target=$(echo $ARCH | grep -q "i.86" && echo "i386" || echo $ARCH) \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --localstatedir=/var \ --sysconfdir=/etc \ --mandir=/usr/man \ --infodir=/usr/share/info \ --docdir=/usr/doc/$pkgname-$pkgver \ --program-prefix= \ --disable-efiemu \ --enable-cache-stats \ --enable-boot-time \ --enable-device-mapper \ --enable-grub-emu-usb \ --enable-grub-mkfont \ --enable-grub-mount \ --enable-nls \ --with-bootdir="/boot" \ --with-grubdir="grub" \ --disable-silent-rules \ --disable-werror \ --build=$arch-slackware-linux || return 1 make clean || return 1 make -j $numjobs || return 1 make install DESTDIR=$PKG || return 1 install -D -m644 $SRC/grub-default $PKG/etc/default/grub || return 1 install -D -m644 $SRC/salix.png $PKG/boot/grub/salix.png || return 1 install -D -m755 $SRC/update-grub $PKG/usr/sbin/update-grub || return 1 install -D -m755 $SRC/grubconfig $PKG/sbin/grubconfig || return 1 install -D -m755 $SRC/setup.grubconfig $PKG/var/log/setup/setup.grubconfig || return 1 }