%define grub2dir /boot/grub2 %define themedir %{grub2dir}/themes Name: grub2-mageia4-theme-dejavu Version: 1.0 Release: %mkrel 3 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: Mageia4-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}/mga4-dejavu install -D %{SOURCE0} %{buildroot}%{themedir}/mga4-dejavu install -D %{SOURCE1} %{buildroot}%{themedir}/mga4-dejavu # Create dejavu pf2 fonts for i in 14 18 20 24; do /bin/grub2-mkfont --output=%{buildroot}%{themedir}/mga4-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 mga4-dejavu theme echo "GRUB_THEME=%{themedir}/mga4-dejavu/theme.txt" >> %{_sysconfdir}/default/grub fi %postun exec > /var/log/grub2_theme_postun.log 2>&1 # Only if uninstalling mga4-dejavu theme if [ $1 -eq 0 ]; then # Remove mga4-dejavu theme from config sed -i '/GRUB_THEME=\/boot\/grub2\/themes\/mga4-dejavu\/theme.txt/d' %{_sysconfdir}/default/grub fi %files %doc LICENSE %{grub2dir}/fonts/unicode.pf2 %dir %{themedir}/mga4-dejavu %{themedir}/mga4-dejavu/* %changelog * Wed Oct 15 2014 umeabot <umeabot> 1.0-3.mga5 + Revision: 742223 - Second Mageia 5 Mass Rebuild * Tue Sep 16 2014 umeabot <umeabot> 1.0-2.mga5 + Revision: 679956 - Mageia 5 Mass Rebuild * Mon Jan 27 2014 barjac <barjac> 1.0-1.mga4 + Revision: 568393 - imported package grub2-mageia4-theme-dejavu