diff --git a/kbd-2.4.0.tar.xz b/kbd-2.4.0.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..c9c5581ee793e18a90f126b8dbaa73f6095f2949 Binary files /dev/null and b/kbd-2.4.0.tar.xz differ diff --git a/kbd.spec b/kbd.spec new file mode 100644 index 0000000000000000000000000000000000000000..c9975a32c234ea3ecac57f9f546ffbcf7798f784 --- /dev/null +++ b/kbd.spec @@ -0,0 +1,141 @@ +%define anolis_release 1 +# {_exec_prefix}/lib/kbd is correct even on x86_64. +# It is traditionally used for kdb data (console fonts, keymaps, ...). +# It is not used for any shared objects/executables. +%global kbd_datadir %{_exec_prefix}/lib/kbd + +Name: kbd +Version: 2.4.0 +Release: %{anolis_release}%{?dist} +Summary: Tools for configuring the console (keyboard, virtual terminals, etc.) +License: GPLv2+ +URL: http://www.kbd-project.org/ + +Source0: https://mirrors.edge.kernel.org/pub/linux/utils/kbd/kbd-2.4.0.tar.xz + +BuildRequires: gcc, bison, flex, gettext, pam-devel, check-devel, automake +BuildRequires: console-setup, xkeyboard-config +Requires: %{name}-misc = %{version}-%{release} +# Be sure that system is after UsrMove +Conflicts: filesystem < 3 +Provides: vlock = %{version} +Conflicts: vlock <= 1.3 + +%description +The %{name} package contains tools for managing a Linux +system's console's behavior, including the keyboard, the screen +fonts, the virtual terminals and font files. + +%package misc +Summary: Data for kbd package +BuildArch: noarch + +%description misc +The %{name}-misc package contains data for kbd package - console fonts, +keymaps etc. Please note that %{name}-misc is not helpful without kbd. + +%package legacy +Summary: Legacy data for kbd package +BuildArch: noarch + +%description legacy +The %{name}-legacy package contains original keymaps for kbd package. +Please note that %{name}-legacy is not helpful without kbd. + +%prep +%setup -q +aclocal +autoconf + +# 7-bit maps are obsolete; so are non-euro maps +pushd data/keymaps/i386 +cp qwerty/pt-latin9.map qwerty/pt.map +cp qwerty/sv-latin1.map qwerty/se-latin1.map + +mv azerty/fr.map azerty/fr-old.map +cp azerty/fr-latin9.map azerty/fr.map + +cp azerty/fr-latin9.map azerty/fr-latin0.map # legacy alias + +# Rename conflicting keymaps +mv fgGIod/trf.map fgGIod/trf-fgGIod.map +mv olpc/es.map olpc/es-olpc.map +mv olpc/pt.map olpc/pt-olpc.map +mv qwerty/cz.map qwerty/cz-qwerty.map +popd + +# remove obsolete "gr" translation +pushd po +rm -f gr.po gr.gmo +popd + +# Convert to utf-8 +iconv -f iso-8859-1 -t utf-8 < "ChangeLog" > "ChangeLog_" +mv "ChangeLog_" "ChangeLog" + +%build +%configure --prefix=%{_prefix} --datadir=%{kbd_datadir} --mandir=%{_mandir} --localedir=%{_datadir}/locale --enable-nls +%make_build + +%install +%make_install + +# ro_win.map.gz is useless +rm -f $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/i386/qwerty/ro_win.map.gz + +# Create additional name for Serbian latin keyboard +ln -s sr-cy.map.gz $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/i386/qwerty/sr-latin.map.gz + +# The rhpl keyboard layout table is indexed by kbd layout names, so we need a +# Korean keyboard +ln -s us.map.gz $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/i386/qwerty/ko.map.gz + +# Some microoptimization +sed -i -e 's,\,%{_bindir}/kbd_mode,g;s,\,%{_bindir}/setfont,g' \ + $RPM_BUILD_ROOT%{_bindir}/unicode_start + +# Move original keymaps to legacy directory +mkdir -p $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/legacy +mv $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/{amiga,atari,i386,include,mac,ppc,sun} $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/legacy + +# Convert X keyboard layouts (plain, no variant) +cat layouts-list.lst | sort -u >> layouts-list-uniq.lst +while read line; do + ckbcomp "$line" | gzip > $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/"$line".map.gz +done < layouts-list-uniq.lst + +# wipe converted layouts which cannot input ASCII (#1031848) +zgrep -L "U+0041" $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/* | xargs rm -f + +# Rename the converted default fi (kotoistus) layout (#1117891), if exists +if [ -f "$RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/fi.map.gz" ]; then + gunzip $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/fi.map.gz + mv $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/fi.map $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/fi-kotoistus.map + gzip $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/fi-kotoistus.map +fi + +%find_lang %{name} + +%check +make check + +%files -f %{name}.lang +%license COPYING +%doc ChangeLog AUTHORS README docs/doc/kbd.FAQ*.html docs/doc/font-formats/*.html docs/doc/utf/utf* docs/doc/dvorak/* +%{_bindir}/* +%{_mandir}/*/* +%config(noreplace) %{_sysconfdir}/pam.d/vlock +# library used only for tests +%exclude %{_libdir}/libtswrap* +%exclude %{_prefix}/lib/debug/%{_libdir}/libtswrap* + +%files misc +%{kbd_datadir} +%exclude %{kbd_datadir}/keymaps/legacy + +%files legacy +%{kbd_datadir}/keymaps/legacy + +%changelog +* Tue Mar 8 2022 Liwei Ge - 2.4.0-1 +- Init version from upstream v2.4.0