updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / vok / vok.install
blob7a17cd7eac58834521ccba2dd64ed22de833a4fb
1 post_install() {
2   perl -ne '/^[[:blank:]]*vok[[:blank:]]{1,}/ && exit 1' /usr/share/X11/xkb/rules/xorg.lst && (
3   sed -i "s/^! layout$/! layout\n  vok             vogo's keyboard (czech)/" /usr/share/X11/xkb/rules/xorg.lst
4   sed -i "s/^! variant$/! variant\n  basic           vok: Qwerty (national chars with AltGr)\n  czech           vok: Qwerty (digits with AltGr)\n  qwertz          vok: Qwertz (national chars with AltGr)\n  czech_qwertz    vok: Qwertz (digits with AltGr)/" /usr/share/X11/xkb/rules/xorg.lst;)
5 tmpfile=$(mktemp)
6 echo 'copy $d := doc("/usr/share/X11/xkb/rules/evdev.xml")
7 modify (
8 insert node
10 <layout>
11       <configItem>
12         <name>vok</name>
13         <shortDescription>Vogo'\''s kbd</shortDescription>
14         <description>Czech keyboard by Vogo</description>
15         <languageList><iso639Id>cze</iso639Id></languageList>
16         <countryList><iso3166Id>CZ</iso3166Id></countryList>
17       </configItem>
18       <variantList>
19         <variant>
20           <configItem>
21             <name>basic</name>
22             <description>Qwerty (national chars with AltGr)</description>
23           </configItem>
24         </variant>
25         <variant>
26           <configItem>
27             <name>czech</name>
28             <description>Qwerty (digits with AltGr)</description>
29           </configItem>
30         </variant>
31         <variant>
32           <configItem>
33             <name>qwertz</name>
34             <description>Qwertz (national chars with AltGr)</description>
35           </configItem>
36         </variant>
37         <variant>
38           <configItem>
39             <name>czech_qwertz</name>
40             <description>Qwertz (digits with AltGr)</description>
41           </configItem>
42         </variant>
43       </variantList>
44 </layout>
46 as first into $d/xkbConfigRegistry/layoutList
48 return $d' | qizx - | /bin/sed '/^ *$/d' > $tmpfile
49 if [ "${PIPESTATUS[1]}" -eq 0 ]; then
50         mv $tmpfile /usr/share/X11/xkb/rules/evdev.xml
52 chmod a+r /usr/share/X11/xkb/rules/evdev.xml
53   echo "-- Please read http://www.abclinuxu.cz/blog/origami/2006/12/21/162644"
54   /bin/true
57 post_upgrade() {
58   perl -ne '/^[[:blank:]]*vok[[:blank:]]{1,}/ && exit 1' /usr/share/X11/xkb/rules/xorg.lst && (
59   sed -i "s/^! layout$/! layout\n  vok             vogo's keyboard (czech)/" /usr/share/X11/xkb/rules/xorg.lst
60   sed -i "s/^! variant$/! variant\n  basic           vok: Qwerty (national chars with AltGr)\n  czech           vok: Qwerty (digits with AltGr)\n  qwertz          vok: Qwertz (national chars with AltGr)\n  czech_qwertz    vok: Qwertz (digits with AltGr)/" /usr/share/X11/xkb/rules/xorg.lst;)
61   echo "-- Please read http://www.abclinuxu.cz/blog/origami/2006/12/21/162644"
62   /bin/true
63 /bin/true
66 pre_remove() {
67 sed -ni '/vok             vogo'\''s keyboard (czech)$/!p' /usr/share/X11/xkb/rules/xorg.lst
68 sed -ni '/  basic           vok: Qwerty (national chars with AltGr)$/!p' /usr/share/X11/xkb/rules/xorg.lst
69 sed -ni '/  czech           vok: Qwerty (digits with AltGr)/!p' /usr/share/X11/xkb/rules/xorg.lst
70 sed -ni '/  qwertz          vok: Qwertz (national chars with AltGr)/!p' /usr/share/X11/xkb/rules/xorg.lst
71 sed -ni '/  czech_qwertz    vok: Qwertz (digits with AltGr)/!p' /usr/share/X11/xkb/rules/xorg.lst
72 tmpfile=$(mktemp)
73 echo 'copy $d := doc("/usr/share/X11/xkb/rules/evdev.xml")
74 modify (
75 delete node $d/xkbConfigRegistry/layoutList/layout[configItem/name='\''vok'\'']
77 return $d' | qizx - | /bin/sed '/^ *$/d' >$tmpfile
78 if [ "${PIPESTATUS[1]}" -eq 0 ]; then
79         mv $tmpfile /usr/share/X11/xkb/rules/evdev.xml
81 chmod a+r /usr/share/X11/xkb/rules/evdev.xml
82 /bin/true
85 op=$1
86 shift
88 $op "$@"