2006-12-19 00:16:50 +01:00
#
2011-01-14 15:37:37 +01:00
# spec file for package kbd
2006-12-19 00:16:50 +01:00
#
2024-03-07 21:41:36 +01:00
# Copyright (c) 2024 SUSE LLC
2006-12-19 00:16:50 +01:00
#
2008-08-18 18:44:04 +02:00
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
2020-01-03 02:29:41 +01:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2006-12-19 00:16:50 +01:00
#
2011-12-20 17:54:05 +01:00
2017-11-24 11:20:30 +01:00
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif
2024-04-09 16:48:09 +02:00
%define legacy_folders amiga,atari,include,mac,pine,ppc,sun
2020-04-23 03:07:00 +02:00
2006-12-19 00:16:50 +01:00
Name : kbd
2024-01-12 15:17:32 +01:00
Version : 2.6.4
2011-11-30 15:27:52 +01:00
Release : 0
2006-12-19 00:16:50 +01:00
Summary : Keyboard and Font Utilities
2019-09-19 18:52:27 +02:00
# git: git://git.altlinux.org/people/legion/packages/kbd.git
2023-05-02 10:39:49 +02:00
License : GPL-2.0-or-later AND GPL-3.0-or-later
2012-05-08 10:27:36 +02:00
Group : System/Console
2020-03-05 01:25:17 +01:00
URL : http://kbd-project.org/
2021-02-13 09:59:31 +01:00
# repack_kbd.sh on https://www.kernel.org/pub/linux/utils/kbd/kbd-%%{version}.tar.xz
2017-09-27 20:52:42 +02:00
Source : %{name} -%{version} -repack.tar.xz
2006-12-19 00:16:50 +01:00
Source2 : suse-add.tar.bz2
2014-08-21 11:09:03 +02:00
Source3 : README.SUSE
2017-10-19 11:32:21 +02:00
Source4 : vlock.pamd
2006-12-19 00:16:50 +01:00
Source8 : sysconfig.console
Source9 : sysconfig.keyboard
2023-03-13 14:56:50 +01:00
Source10 : autogen.sh
2008-05-07 23:13:32 +02:00
Source11 : fbtest.c
Source12 : fbtest.8
2015-08-21 14:16:43 +02:00
Source15 : cz-map.patch
2018-01-26 17:15:35 +01:00
Source20 : kbdsettings
Source21 : kbdsettings.service
Source22 : numlockbios.c
2006-12-19 00:16:50 +01:00
Source42 : convert-kbd-mac.sed
Source43 : repack_kbd.sh
2015-08-13 16:03:32 +02:00
Source44 : xml2lst.pl
Source45 : genmap4systemd.sh
2024-04-09 16:48:09 +02:00
# PATCH-FEATURE-SUSE kbd-1.15.2-unicode_scripts.patch -- To be able to use bold, only fonts with 256 glyphs can be used. Therefore we prefer the font specified in /etc/sysconfig/console.
2011-09-14 16:52:28 +02:00
Patch2 : kbd-1.15.2-unicode_scripts.patch
2024-04-09 16:48:09 +02:00
# PATCH-FIX-SUSE kbd-1.15.2-docu-X11R6-xorg.patch jw@suse.de -- Mention all X11R6 paths in the documentation. Not upstreamable, the documentation is dead and frozen.
2011-09-14 16:52:28 +02:00
Patch3 : kbd-1.15.2-docu-X11R6-xorg.patch
2024-04-09 16:48:09 +02:00
# PATCH-FIX-UPSTREAM kbd-1.15.2-sv-latin1-keycode10.patch jw@suse.de bsc280988 -- It's impossible to press [CTRL]+[]] with sv keyboard. Fix that.
2011-09-14 16:52:28 +02:00
Patch4 : kbd-1.15.2-sv-latin1-keycode10.patch
2024-04-09 16:48:09 +02:00
# PATCH-FIX-UPSTREAM kbd-2.0.2-doshell-reference.patch pgajdos@suse.cz bsc675317 -- Drop doshell reference from openvt.1 man page.
2014-09-18 13:57:55 +02:00
Patch10 : kbd-2.0.2-doshell-reference.patch
2024-04-09 16:48:09 +02:00
# PATCH-FIX-OPENSUSE kbd-2.0.2-euro-unicode.patch pgajdos@suse.cz joehtg@joehtg.co.at boo360993 -- Use Unicode Euro symbol instead of the currency symbol. Not upstreamable as it breaks 8-bit environment using false ISO-8859-1 and ISO-8859-9 naps mapping currency to euro.
2014-09-25 13:15:33 +02:00
Patch11 : kbd-2.0.2-euro-unicode.patch
2024-04-09 16:48:09 +02:00
# PATCH-FIX-OPENSUSE kbd-2.0.2-fix-bashisms.patch ledest@gmail.com -- Fix bash specific code.
2015-01-07 09:25:43 +01:00
Patch12 : kbd-2.0.2-fix-bashisms.patch
2024-04-09 16:48:09 +02:00
# PATCH-FEATURE-SUSE kbd-1.15.5-loadkeys-search-path.patch openSUSE FATE#318355 sle FATE#318426 sndirsch@suse.com -- Add xkb and legacy keymaps subdirs to loadkyes search path.
2015-08-13 16:03:32 +02:00
Patch13 : kbd-1.15.5-loadkeys-search-path.patch
2018-01-26 17:15:35 +01:00
# PATCH-FEATURE-OPENSUSE kbdsettings-nox86.patch sbrabec@suse.cz -- Disable "bios" option for NumLock settings on non x86 platforms.
Patch14 : kbdsettings-nox86.patch
2018-03-22 18:17:16 +01:00
# PATCH-FIX-SLE kbd-unicode-fxxx.patch sbrabec@suse.com bsc1085432 -- Do not cause error on UNICODE characters >= 0xF000 (e. g. ligature fi)
Patch15 : kbd-unicode-fxxx.patch
2020-09-24 02:31:03 +02:00
BuildRequires : autoconf
2012-12-06 09:14:59 +01:00
BuildRequires : automake
2011-11-30 15:27:52 +01:00
BuildRequires : bison
2014-03-11 19:50:02 +01:00
BuildRequires : check-devel
2016-07-20 08:59:39 +02:00
BuildRequires : console-setup
2020-04-23 03:07:00 +02:00
BuildRequires : fdupes
2011-11-30 15:27:52 +01:00
BuildRequires : flex
2014-03-11 19:50:02 +01:00
BuildRequires : gcc >= 4.6
2020-09-24 02:31:03 +02:00
BuildRequires : libtool
2012-12-06 09:14:59 +01:00
BuildRequires : pam-devel
2016-07-20 08:59:39 +02:00
BuildRequires : pkgconfig
2015-04-09 11:04:38 +02:00
BuildRequires : suse-module-tools
2015-08-13 16:03:32 +02:00
BuildRequires : xkeyboard-config
2016-07-20 08:59:39 +02:00
BuildRequires : xz
Requires(post) : coreutils
2024-04-09 16:48:09 +02:00
Requires(postun) : coreutils
2016-07-20 08:59:39 +02:00
Requires(pre) : %fillup_prereq
2017-09-27 20:52:42 +02:00
Provides : vlock = 2.2.3
Obsoletes : vlock <= 2.2.3
2024-04-09 16:48:09 +02:00
# Keymaps moved from kbd-legacy to kbd (bsc#1194609) after SLE15 SP6, Leap 15.6 before ALP 1.0
Conflicts : kbd-legacy < %{version}
2012-12-06 09:14:59 +01:00
2006-12-19 00:16:50 +01:00
%description
Load and save keyboard mappings. This is needed if you are not using
the US keyboard map. This package also contains utilities for changing
your console fonts. If you install this package, YaST includes an extra
menu to allow you to choose between the different fonts. This package
also includes fonts from the kbd_fonts.tar.gz package (by Paul
Gortmaker) on Sunsite.
2015-08-13 16:03:32 +02:00
%package legacy
Summary : Legacy data for kbd package
Group : System/Console
BuildArch : noarch
%description legacy
The %{name} -legacy package contains original keymaps for kbd package.
Please note that %{name} -legacy is not helpful without kbd.
2016-07-20 08:59:39 +02:00
%define kbd %{_datadir}/kbd
2007-12-03 23:16:58 +01:00
2006-12-19 00:16:50 +01:00
%prep
2024-04-09 16:48:09 +02:00
%setup -q -a 2 -n kbd-%{version}
2017-10-19 11:32:21 +02:00
2018-01-26 17:15:35 +01:00
cp -fp %{SOURCE8} .
cp -fp %{SOURCE9} .
2023-03-13 14:56:50 +01:00
cp -fp %{SOURCE10} .
2015-08-13 16:03:32 +02:00
cp -fp %{SOURCE44} .
cp -fp %{SOURCE45} .
2018-01-26 17:15:35 +01:00
cp -fp %{SOURCE20} .
cp -fp %{SOURCE21} .
cp -fp %{SOURCE22} .
2023-03-13 14:56:50 +01:00
%autopatch -p1
%ifarch %{ix86} x86_64
2024-03-01 13:34:18 +01:00
%patch -P 14 -p1 -R
2018-01-26 17:15:35 +01:00
%endif
2006-12-19 00:16:50 +01:00
%build
for i in `find data/keymaps/mac -type f` ; do
2012-12-06 09:14:59 +01:00
sed -i -f %{SOURCE42} $i
2006-12-19 00:16:50 +01:00
done
2008-11-10 15:22:02 +01:00
# workaround ambiguous keymap names
pushd data/keymaps/i386
# bnc#48301
test -f qwerty/se-latin1.map || cp qwerty/sv-latin1.map qwerty/se-latin1.map
# bnc#435121
test -f olpc/es-olpc.map || mv olpc/es.map olpc/es-olpc.map
2016-07-20 08:59:39 +02:00
# Rename conflicting keymaps, as Fedora do
2020-03-05 01:25:17 +01:00
#test -f dvorak/no.map || mv dvorak/no.map dvorak/no-dvorak.map
2016-07-20 08:59:39 +02:00
test -f fgGIod/trf.map || mv fgGIod/trf.map fgGIod/trf-fgGIod.map
test -f olpc/pt.map || mv olpc/pt.map olpc/pt-olpc.map
test -f qwerty/cz.map || mv qwerty/cz.map qwerty/cz-qwerty.map
2008-11-10 15:22:02 +01:00
popd
2023-03-13 14:56:50 +01:00
chmod 755 autogen.sh
2020-09-24 02:31:03 +02:00
./autogen.sh
2011-10-04 10:34:21 +02:00
%configure \
2016-07-20 08:59:39 +02:00
--disable-silent-rules \
2008-08-21 23:56:49 +02:00
--datadir=%{kbd} \
--enable-nls \
2016-07-20 08:59:39 +02:00
--localedir=%{_datadir} /locale \
2020-09-24 02:31:03 +02:00
--enable-optional-progs \
--disable-static
2016-07-20 08:59:39 +02:00
make %{?_smp_mflags}
2018-01-26 17:15:35 +01:00
gcc %{optflags} -o fbtest $RPM_SOURCE_DIR /fbtest.c
%ifarch %{ix86} x86_64
gcc %{optflags} -o numlockbios $RPM_SOURCE_DIR /numlockbios.c
%endif
2008-10-06 18:56:18 +02:00
# fix lat2-16.psfu (bnc#340579)
font=data/consolefonts/lat2a-16.psfu
./src/psfxtable -i $font -it data/unimaps/lat2u.uni \
-o t.psfu
mv t.psfu $font
2016-07-20 08:59:39 +02:00
make %{?_smp_mflags}
2006-12-19 00:16:50 +01:00
%install
2012-12-06 09:14:59 +01:00
mkdir -p %{buildroot} %{_sbindir}
DOC=%{buildroot} %{_defaultdocdir} /kbd
2006-12-19 00:16:50 +01:00
KBD=%{kbd}
2012-12-06 09:14:59 +01:00
K=%{buildroot} $KBD
2006-12-19 00:16:50 +01:00
mkdir -p $DOC/fonts
# Now call kbd install
2012-12-06 09:14:59 +01:00
echo " # N o w c a l l k b d i n s t a l l D E S T D I R = %{buildroot} D A T A _ D I R = %{kbd} M A N _ D I R = %{_mandir} "
make DESTDIR=%{buildroot} DATA_DIR=%{kbd} MAN_DIR=%{_mandir} install
2006-12-19 00:16:50 +01:00
# ln -s iso01-12x22.psfu $K/consolefonts/suse12x22.psfu
install -m 644 data/consolefonts/README* $DOC/fonts/
mkdir -p $DOC/doc/
2014-03-11 19:50:02 +01:00
install -m 644 docs/doc/keysyms.h.info docs/doc/kbd.FAQ.txt docs/doc/kbd.FAQ*.html docs/doc/README* docs/doc/TODO $DOC/doc/
install -m 644 docs/doc/as400.kbd docs/doc/console.docs docs/doc/repeat/set_kbd_repeat-2 $DOC/doc/
2016-07-20 08:59:39 +02:00
echo " S e e %{_datadir} / i 1 8 / c h a r m a p s f o r a d e s c r i p t i o n o f c h a r m a p s " >$DOC/doc/README.charmaps
2023-03-13 14:56:50 +01:00
install -m 644 CREDITS README $DOC/
2012-12-06 09:14:59 +01:00
install -m 644 %{SOURCE3} $DOC/
2006-12-19 00:16:50 +01:00
rm -f $K/consolefonts/README* $K/consolefonts/ERRORS.gz
if ls $K/consolefonts/Agafari-* > /dev/null 2>&1; then
echo " " ;
echo " E R R O R : E t h i o p i a n A g a f a r i f o n t s a r e f o r n o n c o m m e r c i a l d i s t r i b u t i o n o n l y . "
echo " p l e a s e r u n r e p a c k _ k b d . s h " ;
echo " " ;
exit 1
fi
ln -sf us.map.gz $K/keymaps/i386/qwerty/khmer.map.gz
2023-04-27 09:45:22 +02:00
ln -sf us.map.gz $K/keymaps/i386/qwerty/ara.map.gz
2019-09-19 18:52:27 +02:00
ln -sf us.map.gz $K/keymaps/i386/qwerty/ir.map.gz
2010-09-06 17:36:50 +02:00
ln -sf us.map.gz $K/keymaps/i386/qwerty/chinese.map.gz
ln -sf us.map.gz $K/keymaps/i386/qwerty/taiwanese.map.gz
2015-08-21 14:16:43 +02:00
ln -sf sr-cy.map.gz $K/keymaps/i386/qwerty/sr-latin.map.gz
2006-12-19 00:16:50 +01:00
# Compatability links; don't know what the first three are good for.
# The others are for yast/langselection and should be removed as soon as
# yast knows about it.
#ln -sf de-latin1-nodeadkeys.map.gz \
# $K/keymaps/i386/qwertz/de-lat1-nd.map.gz
#ln -sf ru1.map.gz $K/keymaps/i386/qwerty/russian.map.gz
#ln -sf sg-latin1-lk450.map.gz \
# $K/keymaps/i386/qwertz/sg-l1-lk450.map.gz
# The next two links are for yast-language choise; should be obsolete
# with the next yast version (on 6.1)
#ln -sf lat1-16.psfu.gz $K/consolefonts/lat1u-16.psf.gz
#ln -sf lat2-16.psfu.gz $K/consolefonts/lat2u-16.psf.gz
#
# This is for stupid default font search
rm -f $K/consolefonts/default8x16.gz
ln -sf default8x16.psfu.gz $K/consolefonts/default8x16.gz
#
rm -f $K/keymaps/i386/qwerty/*~ $K/keymaps/i386/qwerty/*,v
#
# this is until the Cyr* font are not part of the package
rm -f $K/consolefonts/Cyr_a8x14.gz
ln -sf Cyr_a8x14.psfu.gz $K/consolefonts/Cyr_a8x14.gz
rm -f $K/consolefonts/Cyr_a8x16.gz
ln -sf Cyr_a8x16.psfu.gz $K/consolefonts/Cyr_a8x16.gz
rm -f $K/consolefonts/Cyr_a8x8.gz
ln -sf Cyr_a8x8.psfu.gz $K/consolefonts/Cyr_a8x8.gz
#
find $K -name \*.orig | xargs -r rm -vf
# add some missing maps to mac and remap french board
(
cd $K/keymaps/mac/all
pwd
#ln -s mac-fr-latin1.map.gz mac-fr_CH-latin1.map.gz
#ln -s mac-fr-latin1.map.gz mac-fr.map.gz
for i in \
mac-es.map.gz \
mac-it.map.gz \
mac-pt-latin1.map.gz \
mac-br-abnt2.map.gz \
mac-gr.map.gz \
mac-dk-latin1.map.gz \
mac-no-latin1.map.gz \
mac-fi-latin1.map.gz \
mac-cz-us-qwertz.map.gz \
mac-hu.map.gz \
mac-Pl02.map.gz \
mac-ru1.map.gz \
mac-jp106.map.gz
do test -f $i || ln -sv mac-us.map.gz $i
done
)
2017-11-24 11:20:30 +01:00
FILLUP_DIR=%{buildroot} %{_fillupdir}
2006-12-19 00:16:50 +01:00
mkdir -p $FILLUP_DIR
2018-01-26 17:15:35 +01:00
install -m 644 sysconfig.console $FILLUP_DIR/sysconfig.console
install -m 644 sysconfig.keyboard $FILLUP_DIR/sysconfig.keyboard
2016-07-20 08:59:39 +02:00
%ifnarch %{ix86} x86_64
2017-10-19 11:32:21 +02:00
rm -f %{buildroot} %{_mandir} /man8/resizecons.8*
2006-12-19 00:16:50 +01:00
%endif
2016-07-20 08:59:39 +02:00
%ifarch %{sparc} m68k
2017-10-19 11:32:21 +02:00
rm -f %{buildroot} %{_mandir} /man8/getkeycodes.8*
rm -f %{buildroot} %{_mandir} /man8/setkeycodes.8*
2006-12-19 00:16:50 +01:00
%endif
2018-01-26 17:15:35 +01:00
install -m 755 fbtest %{buildroot} %{_sbindir}
%ifarch %{ix86} x86_64
install -d %{buildroot} %{_libexecdir} /%{name}
install -m 755 numlockbios %{buildroot} %{_libexecdir} /%{name}
%endif
2022-03-03 11:29:56 +01:00
%if %{defined _distconfdir}
2021-02-13 09:59:31 +01:00
rm -rf %{buildroot} %{_sysconfdir} /pam.d
2022-08-23 13:48:33 +02:00
install -d %{buildroot} %{_pam_vendordir}
install -m 644 %{SOURCE4} %{buildroot} %{_pam_vendordir} /vlock
2022-03-03 11:29:56 +01:00
%else
install -m 644 %{SOURCE4} %{buildroot} %{_sysconfdir} /pam.d/vlock
%endif
2017-10-19 11:32:21 +02:00
install -m 644 %{SOURCE12} %{buildroot} %{_mandir} /man8/
2023-01-13 08:40:23 +01:00
%if 0%{?suse_version} < 1550
2012-12-06 09:14:59 +01:00
mkdir -p %{buildroot} /bin
mkdir -p %{buildroot} /sbin
ln -s %{_bindir} /chvt %{buildroot} /bin
ln -s %{_bindir} /clrunimap %{buildroot} /bin
ln -s %{_bindir} /deallocvt %{buildroot} /bin
ln -s %{_bindir} /dumpkeys %{buildroot} /bin
ln -s %{_bindir} /fgconsole %{buildroot} /bin
ln -s %{_bindir} /getunimap %{buildroot} /bin
ln -s %{_bindir} /kbd_mode %{buildroot} /bin
ln -s %{_bindir} /kbdinfo %{buildroot} /bin
ln -s %{_bindir} /kbdrate %{buildroot} /bin
ln -s %{_bindir} /loadkeys %{buildroot} /bin
ln -s %{_bindir} /loadunimap %{buildroot} /bin
ln -s %{_bindir} /mapscrn %{buildroot} /bin
ln -s %{_bindir} /openvt %{buildroot} /bin
ln -s %{_bindir} /outpsfheader %{buildroot} /bin
ln -s %{_bindir} /psfaddtable %{buildroot} /bin
ln -s %{_bindir} /psfgettable %{buildroot} /bin
ln -s %{_bindir} /psfstriptable %{buildroot} /bin
ln -s %{_bindir} /psfxtable %{buildroot} /bin
ln -s %{_bindir} /screendump %{buildroot} /bin
ln -s %{_bindir} /setfont %{buildroot} /bin
ln -s %{_bindir} /setleds %{buildroot} /bin
ln -s %{_bindir} /setlogcons %{buildroot} /bin
ln -s %{_bindir} /setmetamode %{buildroot} /bin
ln -s %{_bindir} /setpalette %{buildroot} /bin
ln -s %{_bindir} /setvesablank %{buildroot} /bin
ln -s %{_bindir} /setvtrgb %{buildroot} /bin
ln -s %{_bindir} /showconsolefont %{buildroot} /bin
ln -s %{_bindir} /showkey %{buildroot} /bin
ln -s %{_bindir} /spawn_console %{buildroot} /bin
ln -s %{_bindir} /spawn_login %{buildroot} /bin
ln -s %{_bindir} /unicode_start %{buildroot} /bin
ln -s %{_bindir} /unicode_stop %{buildroot} /bin
ln -s %{_sbindir} /fbtest %{buildroot} /sbin
2016-07-20 08:59:39 +02:00
%ifnarch %{sparc} m68k
2012-12-06 09:14:59 +01:00
ln -s %{_bindir} /getkeycodes %{buildroot} /bin
ln -s %{_bindir} /setkeycodes %{buildroot} /bin
2012-05-08 10:27:36 +02:00
%endif
2016-07-20 08:59:39 +02:00
%ifarch %{ix86} x86_64
2012-12-06 09:14:59 +01:00
ln -s %{_bindir} /resizecons %{buildroot} /bin
2012-05-08 10:27:36 +02:00
%endif
2020-11-26 11:08:28 +01:00
%endif
2015-08-13 16:03:32 +02:00
2020-01-14 17:29:23 +01:00
# Make sure Perl has a locale where uc/lc works for unicode codepoints
# see e.g. https://perldoc.perl.org/perldiag.html#Wide-character-(U%2b%25X)-in-%25s
export LC_ALL=C.utf-8
2015-08-13 16:03:32 +02:00
# Convert X keyboard layouts to console keymaps
2017-10-19 11:32:21 +02:00
mkdir -p %{buildroot} %{kbd} /keymaps/xkb
2016-07-20 08:59:39 +02:00
perl xml2lst.pl < %{_datadir} /X11/xkb/rules/base.xml > layouts-variants.lst
2015-08-13 16:03:32 +02:00
while read line; do
XKBLAYOUT=`echo " $ l i n e " | cut -d " " -f 1`
echo " $ X K B L A Y O U T " >> layouts-list.lst
XKBVARIANT=`echo " $ l i n e " | cut -d " " -f 2`
2020-01-14 17:29:23 +01:00
ckbcomp " $ X K B L A Y O U T " " $ X K B V A R I A N T " > /tmp/" $ X K B L A Y O U T " -" $ X K B V A R I A N T " .map
2024-03-07 21:41:36 +01:00
# fix conversion of lowercase f in de-e1 keymap (boo#1207841)
if [ " $ X K B L A Y O U T - $ X K B V A R I A N T " == " d e - e 1 " ]; then
sed -i 's/^plain keycode 33 = AltGr/plain keycode 33 = +U+0066/' /tmp/" $ X K B L A Y O U T " -" $ X K B V A R I A N T " .map
fi
2020-01-14 17:29:23 +01:00
# skip converted layouts which cannot input ASCII (rh#1031848)
grep -q " U + 0 0 4 1 " /tmp/" $ X K B L A Y O U T " -" $ X K B V A R I A N T " .map && \
gzip -cn9 /tmp/" $ X K B L A Y O U T " -" $ X K B V A R I A N T " .map > %{buildroot} %{kbd} /keymaps/xkb/" $ X K B L A Y O U T " -" $ X K B V A R I A N T " .map.gz
rm /tmp/" $ X K B L A Y O U T " -" $ X K B V A R I A N T " .map
2015-08-13 16:03:32 +02:00
done < layouts-variants.lst
# Convert X keyboard layouts (plain, no variant)
cat layouts-list.lst | sort -u >> layouts-list-uniq.lst
while read line; do
2020-01-14 17:29:23 +01:00
ckbcomp " $ l i n e " > /tmp/" $ l i n e " .map
grep -q " U + 0 0 4 1 " /tmp/" $ l i n e " .map && \
gzip -cn9 /tmp/" $ l i n e " .map > %{buildroot} %{kbd} /keymaps/xkb/" $ l i n e " .map.gz
rm /tmp/" $ l i n e " .map
2015-08-13 16:03:32 +02:00
done < layouts-list-uniq.lst
# Rename the converted default fi (kotoistus) layout (rh#1117891)
2020-01-14 17:29:23 +01:00
mv %{buildroot} %{kbd} /keymaps/xkb/fi.map.gz %{buildroot} %{kbd} /keymaps/xkb/fi-kotoistus.map.gz
2015-08-13 16:03:32 +02:00
2015-08-21 14:16:43 +02:00
# Fix converted cz layout - add compose rules (rh#1181581)
2017-10-19 11:32:21 +02:00
gunzip %{buildroot} %{kbd} /keymaps/xkb/cz.map.gz
patch %{buildroot} %{kbd} /keymaps/xkb/cz.map < %{SOURCE15}
2021-10-16 11:24:39 +02:00
rm -f %{buildroot} %{kbd} /keymaps/xkb/cz.map.orig
2017-10-19 11:32:21 +02:00
gzip -n9 %{buildroot} %{kbd} /keymaps/xkb/cz.map
2015-08-21 14:16:43 +02:00
2015-08-13 16:03:32 +02:00
# Generate entries for systemd's /usr/share/systemd/kbd-model-map
2016-07-20 08:59:39 +02:00
mkdir -p %{buildroot} %{_datadir} /systemd
2022-02-01 08:40:22 +01:00
bash ./genmap4systemd.sh %{buildroot} %{kbd} /keymaps/xkb \
2016-07-20 08:59:39 +02:00
> %{buildroot} %{_datadir} /systemd/kbd-model-map.xkb-generated
2015-08-13 16:03:32 +02:00
2018-01-26 17:15:35 +01:00
install -m0755 kbdsettings %{buildroot} %{_sbindir} /
install -d %{buildroot} %{_prefix} /lib/systemd/system
install -m0644 kbdsettings.service %{buildroot} %{_prefix} /lib/systemd/system
2020-04-23 03:07:00 +02:00
%fdupes -s %{buildroot} %{_datadir}
2008-03-10 02:57:24 +01:00
%find_lang %{name}
2006-12-19 00:16:50 +01:00
2018-01-26 17:15:35 +01:00
%pre
%{service_add_pre kbdsettings.service}
2020-01-03 02:29:41 +01:00
# move outdated pam.d/*.rpmsave files away
test -f /etc/pam.d/vlock.rpmsave && mv -v /etc/pam.d/vlock.rpmsave /etc/pam.d/vlock.rpmsave.old ||:
2018-01-26 17:15:35 +01:00
2006-12-19 00:16:50 +01:00
%post
2013-04-04 09:20:40 +02:00
%{fillup_only -n console}
2007-08-16 14:06:26 +02:00
%{fillup_only -n keyboard}
2018-01-26 17:15:35 +01:00
# Variables deleted before Leap 15 and SLE 15
%{remove_and_set -n keyboard KEYTABLE COMPOSETABLE}
%ifnarch %{ix86} x86_64
# "bios" was accepted but ingnored on non-x86 platforms up to Leap 42.* and SLE 12.*
sed -i 's/^KBD_NUMLOCK="bios"/KBD_NUMLOCK="no"/' /etc/sysconfig/keyboard
%endif
%{service_add_post kbdsettings.service}
2015-04-01 20:22:10 +02:00
%{?regenerate_initrd_post}
2006-12-19 00:16:50 +01:00
2018-01-26 17:15:35 +01:00
%preun
%{service_del_preun kbdsettings.service}
2015-12-15 19:39:59 +01:00
%postun
2018-01-26 17:15:35 +01:00
%{service_del_postun kbdsettings.service}
2015-12-15 19:39:59 +01:00
%{?regenerate_initrd_post}
2015-04-01 20:22:10 +02:00
%posttrans
%{?regenerate_initrd_posttrans}
2020-01-03 02:29:41 +01:00
# Migration to /usr/etc.
test -f /etc/pam.d/vlock.rpmsave && mv -v /etc/pam.d/vlock.rpmsave /etc/pam.d/vlock ||:
2015-04-01 20:22:10 +02:00
2008-03-10 02:57:24 +01:00
%files -f %{name}.lang
2012-12-06 09:14:59 +01:00
#config(noreplace) /etc/sysconfig/console
2023-03-13 14:56:50 +01:00
%license COPYING
2006-12-19 00:16:50 +01:00
%doc %{_defaultdocdir} /kbd
2023-03-13 14:56:50 +01:00
#doc CREDITS README
2017-11-24 11:20:30 +01:00
%{_fillupdir} /sysconfig.console
%{_fillupdir} /sysconfig.keyboard
2024-04-09 16:48:09 +02:00
%dir %{kbd}
%{kbd} /consolefonts
%{kbd} /consoletrans
%dir %{kbd} /keymaps
%{kbd} /keymaps/xkb
%{kbd} /unimaps
2020-04-23 03:07:00 +02:00
%exclude %{kbd} /keymaps/{%{legacy_folders} }
2023-01-13 08:40:23 +01:00
%if 0%{?suse_version} < 1550
2008-05-07 23:13:32 +02:00
/sbin/fbtest
2006-12-19 00:16:50 +01:00
/bin/chvt
/bin/openvt
/bin/deallocvt
/bin/dumpkeys
2016-07-20 08:59:39 +02:00
%ifnarch %{sparc} m68k
2006-12-19 00:16:50 +01:00
/bin/getkeycodes
/bin/setkeycodes
%endif
/bin/fgconsole
/bin/kbd_mode
2011-09-14 16:52:28 +02:00
/bin/kbdinfo
2006-12-19 00:16:50 +01:00
/bin/loadkeys
/bin/loadunimap
/bin/mapscrn
/bin/psfaddtable
/bin/psfgettable
/bin/psfstriptable
/bin/psfxtable
2016-07-20 08:59:39 +02:00
%ifarch %{ix86} x86_64
2011-12-20 17:54:05 +01:00
/bin/resizecons
%endif
2006-12-19 00:16:50 +01:00
/bin/setfont
/bin/setleds
/bin/setmetamode
2011-09-14 16:52:28 +02:00
/bin/setvtrgb
2006-12-19 00:16:50 +01:00
/bin/showconsolefont
/bin/showkey
/bin/unicode_start
/bin/unicode_stop
/bin/kbdrate
2010-09-07 14:49:05 +02:00
/bin/clrunimap
/bin/getunimap
/bin/outpsfheader
/bin/screendump
/bin/setlogcons
/bin/setpalette
/bin/setvesablank
/bin/spawn_console
/bin/spawn_login
2020-11-26 11:08:28 +01:00
%endif
2012-05-08 10:27:36 +02:00
%{_sbindir} /fbtest
%{_bindir} /chvt
%{_bindir} /openvt
%{_bindir} /deallocvt
%{_bindir} /dumpkeys
2016-07-20 08:59:39 +02:00
%ifnarch %{sparc} m68k
2012-05-08 10:27:36 +02:00
%{_bindir} /getkeycodes
%{_bindir} /setkeycodes
%endif
%{_bindir} /fgconsole
%{_bindir} /kbd_mode
%{_bindir} /kbdinfo
%{_bindir} /loadkeys
%{_bindir} /loadunimap
%{_bindir} /mapscrn
%{_bindir} /psfaddtable
%{_bindir} /psfgettable
%{_bindir} /psfstriptable
%{_bindir} /psfxtable
2016-07-20 08:59:39 +02:00
%ifarch %{ix86} x86_64
2012-05-08 10:27:36 +02:00
%{_bindir} /resizecons
%endif
%{_bindir} /setfont
%{_bindir} /setleds
%{_bindir} /setmetamode
%{_bindir} /setvtrgb
%{_bindir} /showconsolefont
%{_bindir} /showkey
%{_bindir} /unicode_start
%{_bindir} /unicode_stop
%{_bindir} /kbdrate
%{_bindir} /clrunimap
%{_bindir} /getunimap
%{_bindir} /outpsfheader
%{_bindir} /screendump
%{_bindir} /setlogcons
%{_bindir} /setpalette
%{_bindir} /setvesablank
%{_bindir} /spawn_console
%{_bindir} /spawn_login
2017-09-27 20:52:42 +02:00
%{_bindir} /vlock
2018-01-26 17:15:35 +01:00
%ifarch %{ix86} x86_64
%dir %{_libexecdir} /%{name}
%{_libexecdir} /%{name} /numlockbios
%endif
2016-07-20 08:59:39 +02:00
%{_mandir} /man1/*
%{_mandir} /man5/keymaps.5%{ext_man}
%ifnarch %{sparc} m68k
%{_mandir} /man8/getkeycodes.8%{ext_man}
%{_mandir} /man8/setkeycodes.8%{ext_man}
2006-12-19 00:16:50 +01:00
%endif
2016-07-20 08:59:39 +02:00
%{_mandir} /man8/showconsolefont.8%{ext_man}
%{_mandir} /man8/loadunimap.8%{ext_man}
%{_mandir} /man8/mapscrn.8%{ext_man}
%ifarch %{ix86} x86_64
%{_mandir} /man8/resizecons.8%{ext_man}
2011-12-20 17:54:05 +01:00
%endif
2016-07-20 08:59:39 +02:00
%{_mandir} /man8/setfont.8%{ext_man}
%{_mandir} /man8/fbtest.8%{ext_man}
%{_mandir} /man8/kbdrate.8%{ext_man}
%{_mandir} /man8/clrunimap.8%{ext_man}
%{_mandir} /man8/getunimap.8%{ext_man}
%{_mandir} /man8/mk_modmap.8%{ext_man}
%{_mandir} /man8/setlogcons.8%{ext_man}
%{_mandir} /man8/setvesablank.8%{ext_man}
%{_mandir} /man8/setvtrgb.8%{ext_man}
%{_mandir} /man8/vcstime.8%{ext_man}
2022-03-03 11:29:56 +01:00
%if %{defined _distconfdir}
2022-08-23 13:48:33 +02:00
%{_pam_vendordir} /vlock
2022-03-03 11:29:56 +01:00
%else
%config (noreplace) %{_sysconfdir} /pam.d/vlock
%endif
2016-07-20 08:59:39 +02:00
%dir %{_datadir} /systemd
2018-01-26 17:15:35 +01:00
%{_prefix} /lib/systemd/system/kbdsettings.service
2016-07-20 08:59:39 +02:00
%{_datadir} /systemd/kbd-model-map.xkb-generated
2018-01-26 17:15:35 +01:00
%{_sbindir} /kbdsettings
2024-04-09 16:48:09 +02:00
# Move legacy keymaps that have no acceptable xkb counterpart to kbd. (bsc#1194609)
%dir %{kbd} /keymaps/i386
%dir %{kbd} /keymaps/i386/include
%dir %{kbd} /keymaps/i386/qwerty
%{kbd} /keymaps/i386/qwerty/gr.map.gz
%{kbd} /keymaps/i386/qwerty/ruwin_alt-UTF-8.map.gz
%{kbd} /keymaps/i386/qwerty/tj_alt-UTF8.map.gz
%{kbd} /keymaps/i386/qwerty/ua-utf.map.gz
%{kbd} /keymaps/i386/include/linux-keys-bare.inc
%{kbd} /keymaps/i386/include/linux-with-alt-and-altgr.inc
%{kbd} /keymaps/i386/include/compose.inc
%{kbd} /keymaps/i386/include/qwerty-layout.inc
2015-08-13 16:03:32 +02:00
%files legacy
2024-04-09 16:48:09 +02:00
%{kbd} /keymaps/{%{legacy_folders} ,i386}
%exclude %dir %{kbd} /keymaps/i386
%exclude %dir %{kbd} /keymaps/i386/include
%exclude %dir %{kbd} /keymaps/i386/qwerty
%exclude %{kbd} /keymaps/i386/qwerty/gr.map.gz
%exclude %{kbd} /keymaps/i386/qwerty/ruwin_alt-UTF-8.map.gz
%exclude %{kbd} /keymaps/i386/qwerty/tj_alt-UTF8.map.gz
%exclude %{kbd} /keymaps/i386/qwerty/ua-utf.map.gz
%exclude %{kbd} /keymaps/i386/include/linux-keys-bare.inc
%exclude %{kbd} /keymaps/i386/include/linux-with-alt-and-altgr.inc
%exclude %{kbd} /keymaps/i386/include/compose.inc
%exclude %{kbd} /keymaps/i386/include/qwerty-layout.inc
2006-12-19 00:16:50 +01:00
2007-03-29 17:13:27 +02:00
%changelog