%define grub2dir /boot/grub2 %define themedir %{grub2dir}/themes Name: grub2-mageia3-theme-dejavu Version: 1.0 Release: %mkrel 6 Summary: Alternative Mageia GRUB2 theme using the DejaVu font Group: System/Boot and Init License: GPLv2 and Bitstream Vera Fonts Copyright Source0: theme.txt Source1: Mageia3-grub2-1024x768.png Source2: http://unifoundry.com/unifont-5.1.20080820.pcf.gz Source3: LICENSE Requires: grub2bootloader Conflicts: grub2-mageia-theme BuildArch: noarch BuildRequires: grub2 BuildRequires: fonts-ttf-dejavu %description This package provides a GRUB2 custom Mageia theme using the DejaVu font. This is an alternative to the default theme (which uses a custom Mageia font). %prep cp %{SOURCE2} . cp %{SOURCE3} . gunzip unifont-5.1.20080820.pcf.gz %build %install install -d %{buildroot}%{grub2dir}/fonts install -d %{buildroot}%{themedir}/mga3-dejavu install -D %{SOURCE0} %{buildroot}%{themedir}/mga3-dejavu install -D %{SOURCE1} %{buildroot}%{themedir}/mga3-dejavu # Create dejavu pf2 fonts for i in 14 18 20 24; do /bin/grub2-mkfont --output=%{buildroot}%{themedir}/mga3-dejavu/DejaVuSans-Bold-$i.pf2 \ --size=$i --range=0x0-0x7f /usr/share/fonts/TTF/dejavu/DejaVuSans-Bold.ttf done # Create unicode.pf2 font /bin/grub2-mkfont --output=%{buildroot}%{grub2dir}/fonts/unicode.pf2 \ --size=16 unifont-5.1.20080820.pcf %post # Don't install if updating if [ $1 -eq 1 ] ; then # Check for other themes and remove them sed -i '/GRUB_THEME=\/boot\/grub2/d' %{_sysconfdir}/default/grub # Check that /etc/default/grub ends in a linefeed [ "$(tail -n 1 %{_sysconfdir}/default/grub | wc --lines)" = "1" ] || echo >> %{_sysconfdir}/default/grub # Add mga3-dejavu theme echo "GRUB_THEME=%{themedir}/mga3-dejavu/theme.txt" >> %{_sysconfdir}/default/grub fi %postun exec > /var/log/grub2_theme_postun.log 2>&1 # Only if uninstalling mga3-dejavu theme if [ $1 -eq 0 ]; then # Remove mga3-dejavu theme from config sed -i '/GRUB_THEME=\/boot\/grub2\/themes\/mga3-dejavu\/theme.txt/d' %{_sysconfdir}/default/grub fi %files %doc LICENSE %{grub2dir}/fonts/unicode.pf2 %dir %{themedir}/mga3-dejavu %{themedir}/mga3-dejavu/* %changelog * Wed Oct 15 2014 umeabot <umeabot> 1.0-6.mga5 + Revision: 747717 - Second Mageia 5 Mass Rebuild * Tue Sep 16 2014 umeabot <umeabot> 1.0-5.mga5 + Revision: 679955 - Mageia 5 Mass Rebuild * Tue Nov 12 2013 barjac <barjac> 1.0-4.mga4 + Revision: 550653 - drop virtual provide * Sun Nov 10 2013 tmb <tmb> 1.0-3.mga4 + Revision: 550415 - dont conflict own virtual provide * Sat Oct 19 2013 umeabot <umeabot> 1.0-2.mga4 + Revision: 529095 - Mageia 4 Mass Rebuild * Thu Jul 04 2013 barjac <barjac> 1.0-1.mga4 + Revision: 450002 - New package