updated on Wed Jan 25 00:20:47 UTC 2012
[aur-mirror.git] / vok_sk / vok_sk.install
blob550ee3eeb25cdcb3396e42a4985c3b6becaea82d
1 post_install() {
2   perl -ne '/^[[:blank:]]*vok_sk[[:blank:]]{1,}/ && exit 1' /usr/share/X11/xkb/rules/xorg.lst && (
3   sed -i "s/^! layout$/! layout\n  vok_sk          vogo's keyboard (slovak)/" /usr/share/X11/xkb/rules/xorg.lst
4   sed -i "s/^! variant$/! variant\n  basic           vok_sk: Qwerty (national chars with AltGr)\n  slovak          vok_sk: Qwerty (digits with AltGr)\n  qwertz          vok_sk: Qwertz (national chars with AltGr)\n  slovak_qwertz   vok_sk: 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_sk</name>
13         <shortDescription>Vogo'\''s kbd</shortDescription>
14         <description>Slovak keyboard by Vogo</description>
15         <languageList><iso639Id>slo</iso639Id></languageList>
16         <countryList><iso3166Id>SK</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>slovak</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>slovak_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_sk[[:blank:]]{1,}/ && exit 1' /usr/share/X11/xkb/rules/xorg.lst && (
59   sed -i "s/^! layout$/! layout\n  vok_sk          vogo's keyboard (slovak)/" /usr/share/X11/xkb/rules/xorg.lst
60   sed -i "s/^! variant$/! variant\n  basic           vok_sk: Qwerty (national chars with AltGr)\n  slovak          vok_sk: Qwerty (digits with AltGr)\n  qwertz          vok_sk: Qwertz (national chars with AltGr)\n  slovak_qwertz   vok_sk: 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_sk          vogo'\''s keyboard (slovak)$/!p' /usr/share/X11/xkb/rules/xorg.lst
68 sed -ni '/  basic           vok_sk: Qwerty (national chars with AltGr)$/!p' /usr/share/X11/xkb/rules/xorg.lst
69 sed -ni '/  slovak          vok_sk: Qwerty (digits with AltGr)/!p' /usr/share/X11/xkb/rules/xorg.lst
70 sed -ni '/  qwertz          vok_sk: Qwertz (national chars with AltGr)/!p' /usr/share/X11/xkb/rules/xorg.lst
71 sed -ni '/  slovak_qwertz   vok_sk: 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_sk'\'']
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 "$@"