######################################################################## # Top definitions from spectemplate-fonts-1-full.spec ######################################################################## Version: 4.49.1 Release: %autorelease -b 6 URL: http://terminus-font.sourceforge.net/ %global foundry %{nil} %global fontlicense OFL # # The following directives are lists of space-separated shell globs # – matching files associated with the font family, # – as they exist in the build root, # — at the end of the %%build stage: # – legal files (licensing…) %global fontlicenses OFL.txt # – exclusions from the “fontlicenses” list %global fontlicensesex %{nil} # – documentation files %global fontdocs README README-BG docs/README.fedora # – exclusions from the “fontdocs” list %global fontdocsex %{fontlicenses} %global fontfamily terminus %global fontsummary Clean fixed width font # A container for additional subpackage declarations. %global fontpkgheader %{expand: #Obsoletes: } # # More shell glob lists: # – font family files %global fonts ter-*.otb # – exclusions from the “fonts” list) %global fontsex %{nil} # – fontconfig files %global fontconfs %{SOURCE10} # – exclusions from the “fontconfs” list %global fontconfsex %{nil} # – appstream files, if any (generated automatically otherwise) %global fontappstreams %{nil} # – exclusions from the “fontappstreams” list %global fontappstreamsex %{nil} # %global fontdescription %{expand: The Terminus Font is a clean, fixed with bitmap font designed for long\ (8 and more hours per day) work with computers.\ \ I contains more than 1300 characters, covers about 120 language sets and\ supports ISO8859-1/2/5/7/9/13/15/16, Paratype-PT154/PT254, KOI8-R/U/E/F,\ Esperanto, and many IBM, Windows and Macintosh code pages, as well as\ the IBM VGA, vt100 and xterm pseudo graphic characters.\ \ The sizes present are 6x12, 8x14, 8x16, 10x18, 10x20, 11x22, 12x24,\ 14x28, and 16x32. The weights are normal and bold (except for 6x12),\ plus CRT VGA-bold for 8x14 and 8x16. } ######################################################################## # Local macro definitions (i.e. not from spectemplate-fonts-1-full.spec) ######################################################################## # The basename for upstream's source tarball %global archivename terminus-font-%{version} # Copied from the kbd package. # The %%{_exec_prefix}/lib part is correct even on x86_64. # This is where kbd data files (like console fonts) are installed. # No static libraries, shared objects, or executables are placed here. %global kbddir %{_exec_prefix}/lib/kbd # This is the directory for the actualy console fonts. %global console_fontdir %{kbddir}/consolefonts # The ExcludeArch from the grub2.spec file # # There might be a better way to detect whether this platform has # grub2 available, but this should do the job at least for the time # being. %if 0%{?fedora} >= 36 %global grub2_exclude_arches s390 s390x %{ix86} %else %if 0%{?fedora} >= 29 %global grub2_exclude_arches s390 s390x %else %global grub2_exclude_arches s390 s390x %{arm} %endif %endif # Owned by the grub2-common package %global grub2_fontdir /usr/share/grub %global legacy_x11_fontdir /usr/share/fonts/terminus-fonts-legacy-x11 # Font catalog %global catalog %{_sysconfdir}/X11/fontpath.d %if %{?epoch: 1}%{?!epoch: 0} %global evr %{epoch}:%{version}-%{release} %else %global evr %{version}-%{release} %endif # From spectemplate-fonts-1-full.spec Source0: https://downloads.sourceforge.net/terminus-font/%{archivename}.tar.gz Source10: 63-%{fontpkgname}.conf # Local definitions Source21: %{name}-console-README.fedora Source22: %{name}-legacy-x11-README.fedora Source23: %{name}-Xresources.example Source24: %{name}-README.fedora # For generating *.otb (OpenType bitmap font) files Source42: bitmapfonts2otb.py BuildRequires: make BuildRequires: /usr/bin/ftdump BuildRequires: python3 > 3.5.0 # For generating legacy fonts (*.pcf) BuildRequires: /usr/bin/bdftopcf BuildRequires: /usr/bin/mkfontdir ExcludeArch: %{grub2_exclude_arches} BuildRequires: /usr/bin/grub2-mkfont %fontpkg %package console Requires: kbd Requires: %{kbddir} Summary: Clean fixed width font (console version) License: OFL %description console %fontdescription This package contains the fonts to use with the Linux console. %ifnarch %{grub2_exclude_arches} %package grub2 Requires: grub2-common Summary: Clean fixed width font (grub2 version) License: OFL %description grub2 %fontdescription This package contains the fonts to use with the grub2 boot loader. %endif %package legacy-x11 Summary: Clean fixed width font (legacy PCF version) License: OFL # Require the fontconfig file Requires: %{name} = %{evr} %description legacy-x11 %fontdescription This package contains the font variants to use with software still relying on legacy PCF font rendering methods (e.g. GNU Emacs 26). %prep %setup -q -n %{archivename} # Convert upstream files to UTF-8 and Unix end of lines if necessary # Optional arguments: # -e [encoding] source OS encoding (auto-detected otherwise) # -n do not recode files, only adjust folding and end of lines #linuxtext *.txt cp -p "%{SOURCE42}" bin/ patch -s -p1 -b --suffix .dv1 -fuzz=0 -i alt/dv1.diff patch -s -p1 -b --suffix .ij1 -fuzz=0 -i alt/ij1.diff iconv -f WINDOWS-1251 -t utf-8 -o README-BG README-BG %build ./configure --prefix=%{_prefix} \ --x11dir=%{legacy_x11_fontdir} --psfdir=%{console_fontdir} env GZIP=--best make %{?_smp_mflags} PCF='$(PCF_10646_1) $(PCF_8BIT)' pcf psf psf-vgaw otb ls -l *.otb %ifnarch %{grub2_exclude_arches} # generate *.pf2 for the grub2 bootloader for bdf in ter-*[bn].bdf; do /usr/bin/grub2-mkfont -o "$(basename "$bdf" .bdf).pf2" "$bdf" done %endif # Fedora specific docs and examples mkdir -p docs/console docs/legacy-x11 cp -p "%{SOURCE21}" docs/console/README.fedora cp -p "%{SOURCE22}" docs/legacy-x11/README.fedora cp -p "%{SOURCE23}" docs/legacy-x11/Xresources.example cp -p "%{SOURCE24}" docs/README.fedora %fontbuild %install make DESTDIR="%{buildroot}" PCF='$(PCF_10646_1) $(PCF_8BIT)' install-psf install-psf-ref install-psf-vgaw install-pcf %ifnarch %{grub2_exclude_arches} # install *.pf2 for the grub2 bootloader install -m 0755 -d %{buildroot}%{grub2_fontdir} install -m 0644 -t %{buildroot}%{grub2_fontdir} ter-*.pf2 %endif # We cannot run mkfontdir in %%post because %%post is generated by %%_font_pkg install -m 0755 -d %{buildroot}%{catalog} ln -s %{legacy_x11_fontdir} %{buildroot}%{catalog}/%{fontfamily}:unscaled /usr/bin/mkfontdir %{buildroot}%{legacy_x11_fontdir} # Check automatic fonts do not contain unmatched wildcards font_counter=0 for fntfile in %{fonts} do if test -f "${fntfile}"; then font_counter="$(expr "${font_counter}" + 1)" else echo "Missing font file or wildcard: ${fntfile}" exit 2 fi done # Check automatic fonts are a potentially valid number of files if test "$font_counter" -lt 18 || test "$font_counter" -gt 18 then echo "Weird number of font files: $font_counter" exit 2 fi %fontinstall cat<