Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > edf1ccfec929231c262f21f260341298 > files > 13

kbd-1.12-8.1mdv2008.0.src.rpm

%define kbddir /usr/lib/kbd
%define subrel 1

Name:   	kbd
Version:	1.12
Release:	%mkrel 8
Summary:	Keyboard and console utilities for Linux
License:	GPL
Group:  	Terminals
URL:    	ftp://ftp.win.tue.nl/pub/linux-local/utils/kbd/
Source0:	ftp://ftp.kernel.org/pub/linux/utils/kbd/kbd-%version.tar.bz2
Source1:	ftp://ftp.kernel.org/pub/linux/utils/kbd/kbd-%version.tar.bz2.sign
Source2:	ucwfonts.tar.bz2
Source3:	ftp://ftp.linux-france.org/pub/macintosh/kbd-mac-fr-4.1.tar.gz
Source4:	keytable.init
Source5:	kbd-mdv-keymaps-20070521.tar.bz2
Source6:	configure_keyboard.sh
Source7:	setsysfont
# mandriva keyboard updates
Patch0: 	kbd-1.12-mandriva.patch
# tilde with twosuperior in french keyboard
Patch1: 	kbd-1.12-tilde_twosuperior_french_kbd.patch
# some modifications to cover PPC using Linux keycodes
Patch2: 	kbd-1.12-ppc_using_linux_keycodes.patch
# thai support, I tried to convert it from console-tools package
# (support added by Pablo), using also updated thay_ksym patch from
# debian and the following patches from:
# http://linux.thai.net/~thep/th-console/console-tools/console-tools-thai_ksym.patch
# http://linux.thai.net/~thep/th-console/console-data/console-data-thai_orig-1999.08.29.patch
Patch3: 	kbd-1.12-thai_ksym_deb.patch
Patch4: 	kbd-1.12-data_thai.patch
# loadkeys only works as root, and we use unicode_start in configure_keyboard.sh
Patch5: 	kbd-1.12-unicode_start_no_loadkeys.patch
# on PPC we need to see whether mac or Linux keycodes are being used - stew
Patch6: 	keytable.init.ppc.patch
# Don't allow unicode_{start,stop} to run if we aren't in a linux vt, as
# it doesn't make sense and causes bugs if we run it under X
Patch7: 	kbd-1.12-unicode_only_in_linux_vt.patch
BuildRoot:	%_tmppath/%name-buildroot
BuildRequires:	bison flex
BuildRequires:	gcc
BuildRequires:	gettext-devel
BuildRequires:	glibc-devel
BuildRequires:	make
Conflicts:	initscripts <= 8.54-2mdv2008.0
Conflicts:	util-linux < 2.13
Obsoletes:	console-tools <= 0.2.3-62mdv2008.0

%description
This package contains utilities to load console fonts and keyboard maps.
It also includes a number of different fonts and keyboard maps.

%prep
%setup -q -a 2
%patch0 -p1
%patch1 -p1
%ifarch ppc ppc64
%patch2 -p1
%endif
%patch3 -p1
%patch4 -p1
%patch5 -p1
# TODO: Patch6 was already disabled in console-tools, still needed?
#patch6
%patch7 -p1

mkdir mac_frnew; cd mac_frnew
tar -zxf %_sourcedir/kbd-mac-fr-4.1.tar.gz
gunzip mac-fr-ext_new.kmap.gz
mv mac-fr-ext_new.kmap ../data/keymaps/mac/all/mac-fr-ext_new.map
cd ..; rm -rf mac_frnew

pushd data
tar -jxf %_sourcedir/kbd-mdv-keymaps-20070521.tar.bz2
cp keymaps/i386/include/delete.inc keymaps/i386/include/delete.map
popd

%build
./configure --datadir=%kbddir --mandir=%_mandir
%make

%install
rm -rf %buildroot
make DESTDIR=%buildroot install

# keep some keymap/consolefonts compatibility with console-tools
ln -s fr-latin9.map.gz \
	%buildroot%kbddir/keymaps/i386/azerty/fr-latin0.map.gz
ln -s us-acentos.map.gz \
	%buildroot%kbddir/keymaps/i386/qwerty/us-intl.map.gz
ln -s mac-us.map.gz \
	%buildroot%kbddir/keymaps/mac/all/mac-br-abnt2.map.gz
ln -s mac-us.map.gz \
	%buildroot%kbddir/keymaps/mac/all/mac-gr.map.gz
ln -s mac-us.map.gz \
	%buildroot%kbddir/keymaps/mac/all/mac-no-latin1.map.gz
ln -s mac-us.map.gz \
	%buildroot%kbddir/keymaps/mac/all/mac-cz-us-qwertz.map.gz
ln -s mac-us.map.gz \
	%buildroot%kbddir/keymaps/mac/all/mac-hu.map.gz
ln -s mac-us.map.gz \
	%buildroot%kbddir/keymaps/mac/all/mac-Pl02.map.gz
ln -s mac-us.map.gz \
	%buildroot%kbddir/keymaps/mac/all/mac-ru1.map.gz
ln -s mac-us.map.gz \
	%buildroot%kbddir/keymaps/mac/all/mac-jp106.map.gz
ln -s iso07u-16.psfu.gz \
	%buildroot%kbddir/consolefonts/iso07.f16.psfu.gz
ln -s lat2-16.psfu.gz \
	%buildroot%kbddir/consolefonts/lat2-sun16.psfu.gz
ln -s lat5-16.psfu.gz \
	%buildroot%kbddir/consolefonts/lat5u-16.psfu.gz

# Our initscripts/drakx-kbd-mouse-x11 may want to load these directly as
# they were like this when using console-tools (GRP_TOGGLE), so we do
# this to keep compatibility (#32284)
for toggle_file in alt_shift_toggle caps_toggle ctrl_alt_toggle \
                   ctrl_shift_toggle lwin_toggle menu_toggle \
                   rwin_toggle toggle
do
	cp %buildroot%kbddir/keymaps/i386/include/$toggle_file.inc \
	   %buildroot%kbddir/keymaps/i386/include/$toggle_file.map
	gzip %buildroot%kbddir/keymaps/i386/include/$toggle_file.map
done

mkdir -p %buildroot/%_sysconfdir/profile.d
install -m 0755 %_sourcedir/configure_keyboard.sh \
	%buildroot/%_sysconfdir/profile.d/configure_keyboard.sh

mkdir -p %buildroot/%_sysconfdir/rc.d/init.d
install -m 0755 %_sourcedir/keytable.init \
	%buildroot/%_sysconfdir/rc.d/init.d/keytable
%ifarch ppc ppc64
bzcat %_sourcedir/keytable.init.ppc.patch | \
	patch -d %buildroot/%_sysconfdir/rc.d/init.d -p0
%endif

# some scripts expects setfont and unicode_{start,stop} inside /bin
mkdir -p %buildroot/bin
mv %buildroot/%_bindir/unicode_{start,stop} %buildroot/bin
ln -s ../../bin/unicode_start %buildroot/%_bindir/unicode_start
ln -s ../../bin/unicode_stop %buildroot/%_bindir/unicode_stop
mv %buildroot/%_bindir/setfont %buildroot/bin
ln -s ../../bin/setfont %buildroot/%_bindir/setfont

mkdir %buildroot/sbin
install -m 0755 %_sourcedir/setsysfont %buildroot/sbin

%find_lang %name

%clean
rm -rf %buildroot

%post
%_post_service keytable

%preun
%_preun_service keytable

%files -f %name.lang
%defattr(0755,root,root,0755)
%_bindir/chvt
%_bindir/deallocvt
%_bindir/dumpkeys
%_bindir/fgconsole
%_bindir/getkeycodes
%_bindir/kbd_mode
%_bindir/kbdrate
%_bindir/loadunimap
%_bindir/mapscrn
%_bindir/openvt
%_bindir/psfaddtable
%_bindir/psfgettable
%_bindir/psfstriptable
%_bindir/psfxtable
%ifarch %{ix86}
%_bindir/resizecons
%endif
%_bindir/setfont
%_bindir/setkeycodes
%_bindir/setleds
%_bindir/setmetamode
%_bindir/showconsolefont
%_bindir/showkey
%_bindir/unicode_start
%_bindir/unicode_stop
%config(noreplace) %_sysconfdir/profile.d/configure_keyboard.sh
%config(noreplace) %_sysconfdir/rc.d/init.d/keytable
/bin/loadkeys
/bin/setfont
/bin/unicode_start
/bin/unicode_stop
/sbin/setsysfont
%defattr(0644,root,root,0755)
%_mandir/man1/chvt.1*
%_mandir/man1/deallocvt.1*
%_mandir/man1/dumpkeys.1*
%_mandir/man1/fgconsole.1*
%_mandir/man1/kbd_mode.1*
%_mandir/man1/loadkeys.1*
%_mandir/man1/openvt.1*
%_mandir/man1/psfaddtable.1*
%_mandir/man1/psfgettable.1*
%_mandir/man1/psfstriptable.1*
%_mandir/man1/psfxtable.1*
%_mandir/man1/setleds.1*
%_mandir/man1/setmetamode.1*
%_mandir/man1/showkey.1*
%_mandir/man1/unicode_start.1*
%_mandir/man1/unicode_stop.1*
%_mandir/man5/keymaps.5*
%_mandir/man8/getkeycodes.8*
%_mandir/man8/kbdrate.8*
%_mandir/man8/loadunimap.8*
%_mandir/man8/mapscrn.8*
%_mandir/man8/resizecons.8*
%_mandir/man8/setfont.8*
%_mandir/man8/setkeycodes.8*
%_mandir/man8/showconsolefont.8*
%kbddir


%changelog
* Wed Nov 14 2007 Herton Ronaldo Krzesinski <herton@mandriva.com.br> 1.12-8.1mdv2008.0
+ Revision: 108794
- Don't print an error if a .uni keymap is not found and avoid verbose
  loadkeys in keytable initscript.
- Readd back unicode keytable handling that was removed by mistake by me
  to keytable initscript (#35028). Also test if /bin/loadkeys is
  executable, not only if it exists.
- unicode_{start,stop}: don't allow them to run if we're not in a linux
  vt, otherwise bugs can happen, like when you try to run kbd_mode
  inside X.

* Thu Sep 27 2007 Herton Ronaldo Krzesinski <herton@mandriva.com.br> 1.12-8mdv2008.0
+ Revision: 93422
- setsysfont: send error output to stderr and trailing spaces cleanups,
  contributed by Jose Da Silva (#33845). Also while at it I discovered
  one small bug: to show the error message to tell the location of
  sysconfig.txt, setsysfont was looking for /usr/share/doc/initscripts-*
  as previously the directory had version in its name, it's no more this
  way since some changes happened in mandriva packaging stuff, so now
  hopefully use a more reliable check.

* Tue Sep 25 2007 Herton Ronaldo Krzesinski <herton@mandriva.com.br> 1.12-7mdv2008.0
+ Revision: 92713
- Consider all toggle definitions that could be loaded before with
  console-toools. There are additional toggle definitions that were not
  covered when keeping compatibility with previous console-tools package
  and current keytable initscript. Only shift_toggle.inc wasn't
  considered now because it doesn't have any definition. Reported in
  part by dok_cooker (in #mandriva-cooker irc channel on freenode).

* Tue Aug 14 2007 Herton Ronaldo Krzesinski <herton@mandriva.com.br> 1.12-6mdv2008.0
+ Revision: 63150
- Removed vt-is-UTF8, not needed anymore by our initscripts.

* Mon Aug 06 2007 Herton Ronaldo Krzesinski <herton@mandriva.com.br> 1.12-5mdv2008.0
+ Revision: 59383
- Copy some *.inc files to *.map to keep compatibility with
  initscripts/drakx-kbd-mouse-x11 (#32284).

* Fri Aug 03 2007 Herton Ronaldo Krzesinski <herton@mandriva.com.br> 1.12-4mdv2008.0
+ Revision: 58570
- Added compatibility symlinks for some console-tools fonts, to avoid
  problems on upgrades from console-tools:
  iso07.f16 -> iso07u-16
  lat2-sun16 -> lat2-16
  lat5u-16 -> lat5-16
  Reported by Rafal Prasal and Pascal Rigaux.

* Wed Aug 01 2007 Olivier Blin <oblin@mandriva.com> 1.12-3mdv2008.0
+ Revision: 57804
- package resizecons on ix86 only
- buildrequire flex
- update conflicting initscripts version
- remove console-tools provides
- buildrequire bison

  + Herton Ronaldo Krzesinski <herton@mandriva.com.br>
    - Added missing conflicts to util-linux < 2.13 as seem by blino, now
      that we provide kbdrate with kbd.
    - Provide again kbdrate, as this will be removed from util-linux
      package.
    - Install back at /usr/lib/kbd, we depend on /usr/bin/locale on
      initialization inside initscripts so it doesn't matter, as we
      depend anyway on /usr to be mounted.
    - Added transitional provides for console-tools.
    - Cleanups.
    - Install kbd data files in /lib/kbd and with this remove the need to do
      workarounds in post or initscripts to load files before /usr is
      mounted.
    - Obsolete console-tools.
    - Made the same fixes to vt-is-UTF8.c as on console-tools package
      (bug #27948):
      * applied patch vt-is-UTF8_only_linux_vt based on an almost equal
        debian patch: don't allow vt-is-UTF8 run in a terminal different
        from linux vt.
      * applied patch fscanf_nonblock: vt-is-UTF8 detection of console mode
        is unreliable because it uses terminal input/output + escape codes.
        Other processes can be writing/reading from the same vt and messing
        with results expected by fscanf function inside is_in_UTF8_mode,
        making it possibly block waiting for data. I implemented a
        workaround by using fcntl to make it nonblock, I tried a cleaner
        solution but didn't found another way. (and linux could offer an
        ioctl to check its vc->vc_utf variable, see linux/drivers/char/vt.c,
        to avoid to using the current vt-is-UTF8 messy detection).
    - Added appropriate setsysfont script.
    - Removed uneeded stty_iutf8 patch.
    - Fixed keytable initscript for kbd.
    - We don't always use unicode_start as root (like in
      configure_keyboard.sh), so we can't use loadkeys
      (unicode_start_no_loadkeys patch).
    - Enable proper conflicts for initscripts, console-tools packages. Added
      a new meta provides, vt-tools.
    - Don't ship kbdrate, already in util-linux.
    - Copy font files to /etc/sysconfig/console in post scriptlet as made on
      console-tools (related to initscripts).
    - Adapted vt-is-UTF8 from console-tools.
    - Move some binaries into /bin as initscripts requires them.
    - Fixed macintosh keymap symlinks.
    - Added initscript, configure_keyboard.sh script and init.ppc patch from
      console-tools package.
    - Migrated keymaps from kbd-mdk-keymaps-20050108.tar.bz2 and
      ctools-cyr.tar.bz2 to kbd-mdv-keymaps-20070521.tar.bz2 (tried to adapt
      to kbd).
    - Added more symlinks to keymaps to map them to the ones present in
      console-tools (us-intl -> us-acentos, some for mac).
    - Added updated mac-fr keymap definition, it's also in a previous
      version on console-tools package:
      * french mac keymap v3 - console-data-1999.08.29-mac.patch.
    - Converted tilde-with-twosuperior-in-french-keyboard patch from console
      tools into tilde_twosuperior_french_kbd patch.
    - ppc-using-linux-keycodes console-tools patch ->
      ppc_using_linux_keycodes patch.
    - Migrated mandrake patch from console-tools (kbd-1.12-mandriva.patch).
    - Migrated thai support from console-tools (I hope it's right).
    - Added ucwfonts as it's also on console-tools.
    - Added stty_iutf8 patch, set console input mode when in utf8 (needs
      testing).
    - Import kbd