From 0e984c3ce46c713a10b04d576c4607565ab79041 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 1 Feb 2022 15:29:55 -0800 Subject: [PATCH] Initial import - review: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=2049236 --- .gitignore | 1 + sources | 1 + xterm-console.spec | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 .gitignore create mode 100644 sources create mode 100644 xterm-console.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7df184f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/xterm_console-1.1.tar.gz diff --git a/sources b/sources new file mode 100644 index 0000000..eb5cf2f --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (xterm_console-1.1.tar.gz) = 7aadd1968cf4984790ebb98ffeb57a90900c009ce8d9f53ea854c7c45fb472e5879cb257388cac1cb9084b3d577aa8cb2fea18ab0f47f07245453f69031d6547 diff --git a/xterm-console.spec b/xterm-console.spec new file mode 100644 index 0000000..461cd3d --- /dev/null +++ b/xterm-console.spec @@ -0,0 +1,76 @@ +# Fedora spec initially based on upstream spec file from OBS: +# https://build.opensuse.org/package/view_file/devel:openQA:tested/xterm-console/xterm-console.spec +# License: MIT + +%global github_owner os-autoinst +%global github_name xterm_console +%global github_version 1.1 + +Name: xterm-console +Version: %{github_version} +Release: %{autorelease} +Summary: A Linux vt console look-alike xterm wrapper +License: MIT +URL: https://github.com/%{github_owner}/%{github_name} +Source: https://github.com/%{github_owner}/%{github_name}/archive/%{version}/%{github_name}-%{github_version}.tar.gz +BuildArch: noarch +BuildRequires: bdftopcf +# the original consolefonts: +BuildRequires: kbd-misc +# For psf2bdf.pl +BuildRequires: perl-interpreter + +Requires: xterm +Requires(post): mkfontscale +Requires(postun): mkfontscale + +# svirt, eg. s390x, xen +Supplements: os-autoinst + +%description +xterm-console runs an xterm that tries to look as much as possible +like a console. It reads the current color configuration from the +kernel, and the package includes copies of the system console fonts +converted to the PCF format for xterm to use. + +%prep +%autosetup -p1 -n %{github_name}-%{github_version} + +%build +chmod +x ./psf2bdf.pl + +for font in %{_prefix}/lib/kbd/consolefonts/*.psfu.gz; do + fontname="${font##*/}" + fontname="${fontname%.psfu.gz}" + gunzip -c $font | ./psf2bdf.pl | sed -e "s,FONT \+-psf-,FONT ${fontname}," > "$fontname".bdf +done + +for i in *.bdf; do + bdftopcf "$i" | gzip -9 >"${i%.bdf}.pcf.gz" +done + +%install +mkdir -p %{buildroot}%{_bindir} +mkdir -p %{buildroot}%{_datadir}/X11/fonts/misc/ + +install -m 0755 xterm-console %{buildroot}%{_bindir} +install -m 0644 *.pcf.gz %{buildroot}%{_datadir}/X11/fonts/misc/ + +%post +mkfontdir %{_datadir}/X11/fonts/misc + +%postun +if [ -d %{_datadir}/X11/fonts/misc ]; then + mkfontdir %{_datadir}/X11/fonts/misc +fi + +%files +%license LICENSE +%doc README.md +%{_bindir}/xterm-console +%dir %{_datadir}/X11/fonts +%dir %{_datadir}/X11/fonts/misc +%{_datadir}/X11/fonts/misc/*.pcf.gz + +%changelog +%{autochangelog}