update to 2.4.0

This commit is contained in:
wangkerong 2021-12-07 16:41:32 +08:00
parent f4dac02c2f
commit db2c2abe82
8 changed files with 126 additions and 150 deletions

View File

@ -1,7 +1,9 @@
diff -up kbd-2.0.4/docs/man/man1/showkey.1.orig kbd-2.0.4/docs/man/man1/showkey.1 diff -c -r old/docs/man/man1/showkey.1 kbd-2.4.0/docs/man/man1/showkey.1
--- kbd-2.0.4/docs/man/man1/showkey.1.orig 2016-10-31 16:56:02.000000000 +0100 *** old/docs/man/man1/showkey.1 2020-12-15 22:32:21.000000000 +0800
+++ kbd-2.0.4/docs/man/man1/showkey.1 2017-01-11 10:45:03.763312393 +0100 --- kbd-2.4.0/docs/man/man1/showkey.1 2021-12-03 22:01:27.702550615 +0800
@@ -84,6 +84,19 @@ corresponds to what the keyboard hardwar ***************
*** 84,89 ****
--- 84,102 ----
to know the scan codes sent by various keys it is better to boot a to know the scan codes sent by various keys it is better to boot a
2.4 kernel. Since 2.6.9 there also is the boot option atkbd.softraw=0 2.4 kernel. Since 2.6.9 there also is the boot option atkbd.softraw=0
that tells the 2.6 kernel to return the actual scan codes. that tells the 2.6 kernel to return the actual scan codes.
@ -21,13 +23,15 @@ diff -up kbd-2.0.4/docs/man/man1/showkey.1.orig kbd-2.0.4/docs/man/man1/showkey.
.SH "SEE ALSO" .SH "SEE ALSO"
.BR loadkeys (1), .BR loadkeys (1),
.BR dumpkeys (1), .BR dumpkeys (1),
diff -up kbd-2.0.4/docs/man/man8/setkeycodes.8.orig kbd-2.0.4/docs/man/man8/setkeycodes.8 diff -c -r old/docs/man/man8/setkeycodes.8 kbd-2.4.0/docs/man/man8/setkeycodes.8
--- kbd-2.0.4/docs/man/man8/setkeycodes.8.orig 2016-10-31 16:56:02.000000000 +0100 *** old/docs/man/man8/setkeycodes.8 2020-12-15 22:32:21.000000000 +0800
+++ kbd-2.0.4/docs/man/man8/setkeycodes.8 2017-01-11 10:45:03.763312393 +0100 --- kbd-2.4.0/docs/man/man8/setkeycodes.8 2021-12-03 22:02:45.193516342 +0800
@@ -38,6 +38,10 @@ to showkey(1), the command ***************
.RE *** 42,47 ****
will assign the keycode 112 to it, and then loadkeys(1) can be used --- 42,51 ----
to define the function of this key. will assign the keycode 112 to it, and then
.BR loadkeys (1)
can be used to define the function of this key.
+ +
+ USB keyboards have standardized keycodes and + USB keyboards have standardized keycodes and
+ .B setkeycodes + .B setkeycodes
@ -35,7 +39,9 @@ diff -up kbd-2.0.4/docs/man/man8/setkeycodes.8.orig kbd-2.0.4/docs/man/man8/setk
.LP .LP
Some older kernels might hardwire a low scancode range to the Some older kernels might hardwire a low scancode range to the
equivalent keycodes; setkeycodes will fail when you try to remap equivalent keycodes; setkeycodes will fail when you try to remap
@@ -56,6 +60,14 @@ None. ***************
*** 60,65 ****
--- 64,77 ----
.SH BUGS .SH BUGS
The keycodes of X have nothing to do with those of Linux. The keycodes of X have nothing to do with those of Linux.
Unusual keys can be made visible under Linux, but not under X. Unusual keys can be made visible under Linux, but not under X.
@ -48,5 +54,6 @@ diff -up kbd-2.0.4/docs/man/man8/setkeycodes.8.orig kbd-2.0.4/docs/man/man8/setk
+ cannot change the mapping of other devices than the "first" one. + cannot change the mapping of other devices than the "first" one.
+ +
.SH "SEE ALSO" .SH "SEE ALSO"
.I "dumpkeys (1), loadkeys (1), showkey (1), getkeycodes (8)" .BR dumpkeys (1),
.BR loadkeys (1),
~

View File

@ -1,18 +1,24 @@
diff -up kbd-2.1.0/src/loadkeys.c.orig kbd-2.1.0/src/loadkeys.c diff -Nur kbd-2.4.0/src/loadkeys.c kbd-2.4.0-new/src/loadkeys.c
--- kbd-2.1.0/src/loadkeys.c.orig 2019-07-15 10:57:18.000000000 +0200 --- kbd-2.4.0/src/loadkeys.c 2020-06-02 18:16:45.000000000 +0800
+++ kbd-2.1.0/src/loadkeys.c 2019-07-17 14:34:51.224525616 +0200 +++ kbd-2.4.0-new/src/loadkeys.c 2021-12-07 16:02:44.873000000 +0800
@@ -24,7 +24,7 @@ @@ -27,9 +27,11 @@
#include "paths.h"
#include "keymap.h"
-static const char *const dirpath1[] = { "", DATADIR "/" KEYMAPDIR "/**", KERNDIR "/", 0 }; static const char *const dirpath1[] = {
+static const char *const dirpath1[] = { "", DATADIR "/" KEYMAPDIR "/**", DATADIR "/" XKBKEYMAPDIR "/", DATADIR "/" LEGACYKEYMAPDIR "/**", KERNDIR "/", 0 }; "",
static const char *const suffixes[] = { "", ".kmap", ".map", 0 }; - DATADIR "/" KEYMAPDIR "/**",
- KERNDIR "/",
static void __attribute__((noreturn)) - NULL
diff -up kbd-2.1.0/src/paths.h.orig kbd-2.1.0/src/paths.h + DATADIR "/" KEYMAPDIR "/**",
--- kbd-2.1.0/src/paths.h.orig 2019-05-07 11:21:10.000000000 +0200 + DATADIR "/" XKBKEYMAPDIR "/",
+++ kbd-2.1.0/src/paths.h 2019-07-17 14:35:13.870574558 +0200 + DATADIR "/" LEGACYKEYMAPDIR "/**",
+ KERNDIR "/",
+ 0
};
static const char *const suffixes[] = {
"",
diff -Nur kbd-2.4.0/src/paths.h kbd-2.4.0-new/src/paths.h
--- kbd-2.4.0/src/paths.h 2020-04-27 23:53:01.000000000 +0800
+++ kbd-2.4.0-new/src/paths.h 2021-12-07 16:03:15.780000000 +0800
@@ -5,6 +5,8 @@ @@ -5,6 +5,8 @@
* The following five subdirectories are defined: * The following five subdirectories are defined:
*/ */

View File

@ -1,23 +1,13 @@
diff -up kbd-2.1.0/src/kdmapop.c.orig kbd-2.1.0/src/kdmapop.c diff -Nur kbd-2.4.0/src/libkfont/kdmapop.c kbd-2.4.0-new/src/libkfont/kdmapop.c
--- kbd-2.1.0/src/kdmapop.c.orig 2019-05-07 11:21:10.000000000 +0200 --- kbd-2.4.0/src/libkfont/kdmapop.c 2020-04-27 23:53:01.000000000 +0800
+++ kbd-2.1.0/src/kdmapop.c 2019-07-17 14:38:15.799967669 +0200 +++ kbd-2.4.0-new/src/libkfont/kdmapop.c 2021-12-07 16:18:53.166000000 +0800
@@ -155,6 +155,7 @@ int getunimap(int fd, struct unimapdesc @@ -166,7 +166,8 @@
}
if (ioctl(fd, GIO_UNIMAP, &ud)) { if (ioctl(fd, GIO_UNIMAP, &ud)) {
perror("GIO_UNIMAP"); KFONT_ERR(ctx, "ioctl(GIO_UNIMAP): %m");
- return -1;
+ free(ud.entries); + free(ud.entries);
return -1; + return -1;
} }
if (ct != ud.entry_ct) if (ct != ud.entry_ct)
diff -up kbd-2.1.0/src/setfont.c.orig kbd-2.1.0/src/setfont.c KFONT_ERR(ctx, _("strange... ct changed from %d to %d"), ct, ud.entry_ct);
--- kbd-2.1.0/src/setfont.c.orig 2019-06-25 18:14:32.000000000 +0200
+++ kbd-2.1.0/src/setfont.c 2019-07-17 14:39:57.928188355 +0200
@@ -323,6 +323,8 @@ do_loadfont(int fd, char *inbuf, int wid
if (putfont(fd, buf, fontsize, width, hwunit))
exit(EX_OSERR);
+
+ free(buf);
}
static void

View File

@ -1,16 +0,0 @@
diff -up kbd-2.2.0/configure.ac.orig kbd-2.2.0/configure.ac
--- kbd-2.2.0/configure.ac.orig 2019-08-28 11:07:00.787173606 +0200
+++ kbd-2.2.0/configure.ac 2019-08-28 11:08:07.217317151 +0200
@@ -72,9 +72,9 @@ if test "$enable_code_coverage" = yes; t
fi
case "$GCC,$ac_cv_prog_cc_g" in
- yes,yes) CFLAGS="-g $CC_O_LEVEL $FORTIFY_SOURCE" ;;
- yes,) CFLAGS="$CC_O_LEVEL $FORTIFY_SOURCE" ;;
- ,yes) CFLAGS="-g" ;;
+ yes,yes) CFLAGS="$CC_O_LEVEL $FORTIFY_SOURCE $CFLAGS" ;;
+ yes,) CFLAGS="$CC_O_LEVEL $FORTIFY_SOURCE $CFLAGS" ;;
+ ,yes) CFLAGS="$CFLAGS" ;;
esac
CC_CHECK_CFLAGS_APPEND([\

View File

@ -1,14 +0,0 @@
diff -up kbd-2.2.0/src/libkeymap/analyze.l.orig kbd-2.2.0/src/libkeymap/analyze.l
--- kbd-2.2.0/src/libkeymap/analyze.l.orig 2019-06-25 11:41:55.000000000 +0200
+++ kbd-2.2.0/src/libkeymap/analyze.l 2019-10-17 08:39:01.924605478 +0200
@@ -463,7 +463,10 @@ To to|To|TO
strerror_r(errno, buf, sizeof(buf));
+ /* workaround -Werror=format-security error
ERR(yyextra, buf);
+ */
+ ERR(yyextra, _("unknown error"));
return(ERROR);
}

Binary file not shown.

BIN
kbd-2.4.0.tar.xz Normal file

Binary file not shown.

View File

@ -1,11 +1,13 @@
%global kbd_datadir %{_exec_prefix}/lib/kbd
Name: kbd Name: kbd
Version: 2.2.0 Version: 2.4.0
Release: 2 Release: 1
Summary: Tools for managing Linux console(keyboard, virtual terminals, etc.) Summary: Tools for managing Linux console(keyboard, virtual terminals, etc.)
License: GPLv2+ License: GPLv2+
URL: https://www.kbd-project.org/ URL: https://www.kbd-project.org/
Source0: http://ftp.altlinux.org/pub/people/legion/%{name}/%{name}-%{version}.tar.xz Source0: https://mirrors.edge.kernel.org/pub/linux/utils/kbd/%{name}-%{version}.tar.xz
Source1: kbd-latsun-fonts.tar.bz2 Source1: kbd-latsun-fonts.tar.bz2
Source2: kbd-latarcyrheb-32.tar.bz2 Source2: kbd-latarcyrheb-32.tar.bz2
Source3: xml2lst.pl Source3: xml2lst.pl
@ -21,8 +23,6 @@ Patch4: kbd-1.15.5-sg-decimal-separator.patch
Patch5: kbd-1.15.5-loadkeys-search-path.patch Patch5: kbd-1.15.5-loadkeys-search-path.patch
Patch6: kbd-2.0.2-unicode-start-font.patch Patch6: kbd-2.0.2-unicode-start-font.patch
Patch7: kbd-2.0.4-covscan-fixes.patch Patch7: kbd-2.0.4-covscan-fixes.patch
Patch8: kbd-2.2.0-fix-flags.patch
Patch9: kbd-2.2.0-format-security.patch
BuildRequires: bison flex gettext pam-devel check-devel BuildRequires: bison flex gettext pam-devel check-devel
BuildRequires: gcc console-setup xkeyboard-config automake BuildRequires: gcc console-setup xkeyboard-config automake
@ -66,8 +66,7 @@ cp -fp %{SOURCE6} .
%patch5 -p1 -b .loadkeys-search-path %patch5 -p1 -b .loadkeys-search-path
%patch6 -p1 -b .unicode-start-font %patch6 -p1 -b .unicode-start-font
%patch7 -p1 -b .covscan-fixes.patch %patch7 -p1 -b .covscan-fixes.patch
%patch8 -p1 -b .fix-flags.patch aclocal
%patch9 -p1 -b .format-security.patch
autoconf autoconf
pushd data/keymaps/i386 pushd data/keymaps/i386
@ -93,76 +92,77 @@ iconv -f iso-8859-1 -t utf-8 < "ChangeLog" > "ChangeLog_"
mv "ChangeLog_" "ChangeLog" mv "ChangeLog_" "ChangeLog"
%build %build
%configure --prefix=%{_prefix} --datadir=/lib/%{name} --mandir=%{_mandir} --localedir=%{_datadir}/locale --enable-nls %configure --prefix=%{_prefix} --datadir=%{kbd_datadir} --mandir=%{_mandir} --localedir=%{_datadir}/locale --enable-nls
%make_build %make_build
%install %install
%make_install %make_install
rm -f %{buildroot}/lib/%{name}/keymaps/i386/qwerty/ro_win.map.gz rm -f $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/i386/qwerty/ro_win.map.gz
ln -s sr-cy.map.gz %{buildroot}/lib/%{name}/keymaps/i386/qwerty/sr-latin.map.gz ln -s sr-cy.map.gz $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/i386/qwerty/sr-latin.map.gz
ln -s us.map.gz %{buildroot}/lib/%{name}/keymaps/i386/qwerty/ko.map.gz ln -s us.map.gz $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/i386/qwerty/ko.map.gz
mkdir -p %{buildroot}/bin ln -s fa.map.gz $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/i386/qwerty/ara.map.gz
for binary in setfont dumpkeys %{name}_mode unicode_start unicode_stop loadkeys ; do
mv %{buildroot}%{_bindir}/$binary %{buildroot}/bin/
done
sed -i -e 's,\<%{name}_mode\>,/bin/%{name}_mode,g;s,\<setfont\>,/bin/setfont,g' \ sed -i -e 's,\<kbd_mode\>,%{_bindir}/kbd_mode,g;s,\<setfont\>,%{_bindir}/setfont,g' \
%{buildroot}/bin/unicode_start $RPM_BUILD_ROOT%{_bindir}/unicode_start
gzip -c %SOURCE5 > %{buildroot}/%{_mandir}/man1/kbdinfo.1.gz gzip -c %SOURCE5 > $RPM_BUILD_ROOT/%{_mandir}/man1/kbdinfo.1.gz
cp -r %{buildroot}/lib/%{name}/locale/ %{buildroot}%{_datadir}/locale mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d
rm -rf %{buildroot}/lib/%{name}/locale install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/vlock
mkdir -p %{buildroot}%{_sysconfdir}/pam.d mkdir -p $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/legacy
install -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/pam.d/vlock mv $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/{amiga,atari,i386,include,mac,ppc,sun} $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/legacy
mkdir -p %{buildroot}/lib/%{name}/keymaps/legacy mkdir -p $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb
mv %{buildroot}/lib/%{name}/keymaps/{amiga,atari,i386,include,mac,ppc,sun} %{buildroot}/lib/%{name}/keymaps/legacy
mkdir -p %{buildroot}/lib/%{name}/keymaps/xkb
perl xml2lst.pl < /usr/share/X11/xkb/rules/base.xml > layouts-variants.lst perl xml2lst.pl < /usr/share/X11/xkb/rules/base.xml > layouts-variants.lst
while read line; do while read line; do
XKBLAYOUT=`echo "$line" | cut -d " " -f 1` XKBLAYOUT=`echo "$line" | cut -d " " -f 1`
echo "$XKBLAYOUT" >> layouts-list.lst echo "$XKBLAYOUT" >> layouts-list.lst
XKBVARIANT=`echo "$line" | cut -d " " -f 2` XKBVARIANT=`echo "$line" | cut -d " " -f 2`
ckbcomp "$XKBLAYOUT" "$XKBVARIANT" | gzip > %{buildroot}/lib/%{name}/keymaps/xkb/"$XKBLAYOUT"-"$XKBVARIANT".map.gz ckbcomp -rules base "$XKBLAYOUT" "$XKBVARIANT" | gzip > $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/"$XKBLAYOUT"-"$XKBVARIANT".map.gz
done < layouts-variants.lst done < layouts-variants.lst
cat layouts-list.lst | sort -u >> layouts-list-uniq.lst cat layouts-list.lst | sort -u >> layouts-list-uniq.lst
while read line; do while read line; do
ckbcomp "$line" | gzip > %{buildroot}/lib/%{name}/keymaps/xkb/"$line".map.gz ckbcomp -rules base "$line" | gzip > $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/"$line".map.gz
done < layouts-list-uniq.lst done < layouts-list-uniq.lst
gunzip %{buildroot}/lib/%{name}/keymaps/xkb/fi.map.gz zgrep -L "U+0041" $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/* | xargs rm -f
mv %{buildroot}/lib/%{name}/keymaps/xkb/fi.map %{buildroot}/lib/%{name}/keymaps/xkb/fi-kotoistus.map
gzip %{buildroot}/lib/%{name}/keymaps/xkb/fi-kotoistus.map
gunzip %{buildroot}/lib/%{name}/keymaps/xkb/cz.map.gz if [ -f "$RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/cz.map.gz" ]; then
patch %{buildroot}/lib/%{name}/keymaps/xkb/cz.map < %{SOURCE6} gunzip $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/cz.map.gz
gzip %{buildroot}/lib/%{name}/keymaps/xkb/cz.map patch $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/cz.map < %{SOURCE6}
gzip $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/cz.map
fi
%find_lang %{name}
%check
make check
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%license COPYING %license COPYING
%doc AUTHORS %doc AUTHORS
/bin/*
%{_datadir}/locale/* %{_datadir}/locale/*
%{_bindir}/* %{_bindir}/*
%config(noreplace) %{_sysconfdir}/pam.d/vlock %config(noreplace) %{_sysconfdir}/pam.d/vlock
# library for tests
%exclude %{_libdir}/libtswrap*
%exclude %{_prefix}/lib/debug/%{_libdir}/libtswrap*
%files misc %files misc
%defattr(-,root,root) %defattr(-,root,root)
/lib/%{name}/* %{kbd_datadir}
%exclude /lib/%{name}/keymaps/legacy %exclude %{kbd_datadir}/keymaps/legacy
%files legacy %files legacy
%defattr(-,root,root) %defattr(-,root,root)
/lib/%{name}/keymaps/legacy/* %{kbd_datadir}/keymaps/legacy
%files help %files help
%defattr(-,root,root) %defattr(-,root,root)
@ -172,6 +172,9 @@ gzip %{buildroot}/lib/%{name}/keymaps/xkb/cz.map
%{_mandir}/man8/*.8.gz %{_mandir}/man8/*.8.gz
%changelog %changelog
* Tue Dec 07 2021 wangkerong <wangkerong@huawei.com> - 2.4.0-1
- update to 2.4.0
* Tue Jul 12 2021 panchenbo <panchenbo@uniontech.com> - 2.2.0-2 * Tue Jul 12 2021 panchenbo <panchenbo@uniontech.com> - 2.2.0-2
- fix kbd contain man dir - fix kbd contain man dir