3 if [ "$1" = "configure" ] ; then # first install
4 # update shared mime-info database
5 if [ -x /usr
/bin
/update-mime-database
]; then
6 update-mime-database
/usr
/share
/mime
8 # update desktop database
9 if [ -x /usr
/bin
/update-desktop-database
]; then
10 update-desktop-database
-q /usr
/share
/applications
12 # update debian style menus
13 if [ -x /usr
/bin
/update-menus
]; then
16 # update icon-cache if already present
17 for theme
in gnome hicolor locolor
; do
18 if [ -e /usr
/share
/icons
/$theme/icon-theme.cache
] ; then
19 # touch it, just in case we cannot find the binary...
20 touch /usr
/share
/icons
/$theme
21 if (which gtk-update-icon-cache
); then
22 gtk-update-icon-cache
/usr
/share
/icons
/$theme
24 # ignore errors (e.g. when there is a cache, but no index.theme)
30 # update /etc/mime.types
31 # backing out existing entries to avoid duplicates
33 /application\/vnd\.oasis\.opendocument/d
34 /application\/vnd\.sun/d
35 /application\/vnd\.stardivision/d
36 /application\/vnd\.openofficeorg/d
37 ' /etc
/mime.types
2>/dev
/null
>> /etc
/mime.types.tmp$$
39 # now append our stuff to the temporary file
40 cat >> /etc
/mime.types.tmp$$
<< END
41 application/vnd.oasis.opendocument.text odt
42 application/vnd.oasis.opendocument.text-template ott
43 application/vnd.oasis.opendocument.text-web oth
44 application/vnd.oasis.opendocument.text-master odm
45 application/vnd.oasis.opendocument.graphics odg
46 application/vnd.oasis.opendocument.graphics-template otg
47 application/vnd.oasis.opendocument.presentation odp
48 application/vnd.oasis.opendocument.presentation-template otp
49 application/vnd.oasis.opendocument.spreadsheet ods
50 application/vnd.oasis.opendocument.spreadsheet-template ots
51 application/vnd.oasis.opendocument.chart odc
52 application/vnd.oasis.opendocument.formula odf
53 application/vnd.oasis.opendocument.image odi
54 application/vnd.sun.xml.writer sxw
55 application/vnd.sun.xml.writer.template stw
56 application/vnd.sun.xml.writer.global sxg
57 application/vnd.stardivision.writer sdw vor
58 application/vnd.stardivision.writer-global sgl
59 application/vnd.sun.xml.calc sxc
60 application/vnd.sun.xml.calc.template stc
61 application/vnd.stardivision.calc sdc
62 application/vnd.stardivision.chart sds
63 application/vnd.sun.xml.impress sxi
64 application/vnd.sun.xml.impress.template sti
65 application/vnd.stardivision.impress sdd sdp
66 application/vnd.sun.xml.draw sxd
67 application/vnd.sun.xml.draw.template std
68 application/vnd.stardivision.draw sda
69 application/vnd.sun.xml.math sxm
70 application/vnd.stardivision.math smf
71 application/vnd.sun.xml.base odb
72 application/vnd.openofficeorg.extension oxt
75 # and replace the original file
76 mv -f /etc
/mime.types.tmp$$
/etc
/mime.types
2>/dev
/null
78 # update /etc/mailcap only at initial install
79 if [ "$1" = "configure" ]
81 # backing out existing entries to avoid duplicates
84 /^application\/vnd\.oasis\.opendocument/d
85 /^application\/vnd\.openofficeorg/d
86 /^application\/vnd\.sun/d
87 /^application\/vnd\.stardivision/d
88 /^application\/vnd\.ms-word/d
89 /^application\/vnd\.ms-excel/d
90 /^application\/vnd\.ms-powerpoint/d
91 /^application\/x-star/d
95 ' /etc
/mailcap
2>/dev
/null
>> /etc
/mailcap.tmp$$
97 # now append our stuff to the temporary file
98 cat >> /etc
/mailcap.tmp$$
<< END
100 application/vnd.oasis.opendocument.text; %PREFIX -view %s
101 application/vnd.oasis.opendocument.text-template; %PREFIX -view %s
102 application/vnd.oasis.opendocument.text-web; %PREFIX -view %s
103 application/vnd.oasis.opendocument.text-master; %PREFIX -view %s
104 application/vnd.sun.xml.writer; %PREFIX -view %s
105 application/vnd.sun.xml.writer.template; %PREFIX -view %s
106 application/vnd.sun.xml.writer.global; %PREFIX -view %s
107 application/vnd.stardivision.writer; %PREFIX -view %s
108 application/vnd.stardivision.writer-global; %PREFIX -view %s
109 application/x-starwriter; %PREFIX -view %s
110 application/vnd.oasis.opendocument.formula; %PREFIX -view %s
111 application/vnd.sun.xml.math; %PREFIX -view %s
112 application/vnd.stardivision.math; %PREFIX -view %s
113 application/x-starmath; %PREFIX -view %s
114 application/msword; %PREFIX -view %s
115 application/vnd.oasis.opendocument.spreadsheet; %PREFIX -view %s
116 application/vnd.oasis.opendocument.spreadsheet-template; %PREFIX -view %s
117 application/vnd.sun.xml.calc; %PREFIX -view %s
118 application/vnd.sun.xml.calc.template; %PREFIX -view %s
119 application/vnd.stardivision.calc; %PREFIX -view %s
120 application/x-starcalc; %PREFIX -view %s
121 application/vnd.stardivision.chart; %PREFIX -view %s
122 application/x-starchart; %PREFIX -view %s
123 application/excel; %PREFIX -view %s
124 application/msexcel; %PREFIX -view %s
125 application/vnd.ms-excel; %PREFIX -view %s
126 application/x-msexcel; %PREFIX -view %s
127 application/vnd.oasis.opendocument.presentation; %PREFIX -view %s
128 application/vnd.oasis.opendocument.presentation-template; %PREFIX -view %s
129 application/vnd.sun.xml.impress; %PREFIX -view %s
130 application/vnd.sun.xml.impress.template; %PREFIX -view %s
131 application/vnd.stardivision.impress; %PREFIX -view %s
132 application/x-starimpress; %PREFIX -view %s
133 application/powerpoint; %PREFIX -view %s
134 application/mspowerpoint; %PREFIX -view %s
135 application/vnd.ms-powerpoint; %PREFIX -view %s
136 application/x-mspowerpoint; %PREFIX -view %s
137 application/vnd.oasis.opendocument.graphics; %PREFIX -view %s
138 application/vnd.oasis.opendocument.graphics-template; %PREFIX -view %s
139 application/vnd.sun.xml.draw; %PREFIX -view %s
140 application/vnd.sun.xml.draw.template; %PREFIX -view %s
141 application/vnd.stardivision.draw; %PREFIX -view %s
142 application/x-stardraw; %PREFIX -view %s
143 application/vnd.oasis.opendocument.database; %PREFIX -view %s
144 application/vnd.sun.xml.base; %PREFIX -view %s
145 application/vnd.writerperfect; %PREFIX -view %s
146 application/wordperfect5.1; %PREFIX -view %s
147 application/x-wordperfect; %PREFIX -view %s
148 application/wordperfect; %PREFIX -view %s
149 application/wpwin; %PREFIX -view %s
150 application/vnd.openofficeorg.extension; %PREFIX %s
153 # and replace the original file
154 mv -f /etc
/mailcap.tmp$$
/etc
/mailcap