3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 # This file incorporates work covered by the following license notice:
11 # Licensed to the Apache Software Foundation (ASF) under one or more
12 # contributor license agreements. See the NOTICE file distributed
13 # with this work for additional information regarding copyright
14 # ownership. The ASF licenses this file to you under the Apache
15 # License, Version 2.0 (the "License"); you may not use this file
16 # except in compliance with the License. You may obtain a copy of
17 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 if [ "$1" = "configure" ] ; then # first install
21 # update shared mime-info database
22 if [ -x /usr
/bin
/update-mime-database
]; then
23 update-mime-database
/usr
/share
/mime
25 # update desktop database
26 if [ -x /usr
/bin
/update-desktop-database
]; then
27 update-desktop-database
-q /usr
/share
/applications
29 # update debian style menus
30 if [ -x /usr
/bin
/update-menus
]; then
33 # update icon-cache if already present
34 if [ -e /usr
/share
/icons
/hicolor
/icon-theme.cache
] ; then
35 # touch it, just in case we cannot find the binary...
36 touch /usr
/share
/icons
/hicolor
37 if (which gtk-update-icon-cache
); then
38 gtk-update-icon-cache
/usr
/share
/icons
/hicolor
40 # ignore errors (e.g. when there is a cache, but no index.theme)
45 # update /etc/mime.types
46 # backing out existing entries to avoid duplicates
48 /application\/vnd\.oasis\.opendocument/d
49 /application\/vnd\.sun/d
50 /application\/vnd\.stardivision/d
51 /application\/vnd\.openofficeorg/d
52 ' /etc
/mime.types
2>/dev
/null
>> /etc
/mime.types.tmp$$
54 # now append our stuff to the temporary file
55 cat >> /etc
/mime.types.tmp$$
<< END
56 application/vnd.oasis.opendocument.text odt
57 application/vnd.oasis.opendocument.text-flat-xml fodt
58 application/vnd.oasis.opendocument.text-template ott
59 application/vnd.oasis.opendocument.text-web oth
60 application/vnd.oasis.opendocument.text-master odm
61 application/vnd.oasis.opendocument.text-master-template otm
62 application/vnd.oasis.opendocument.graphics odg
63 application/vnd.oasis.opendocument.graphics-flat-xml fodg
64 application/vnd.oasis.opendocument.graphics-template otg
65 application/vnd.oasis.opendocument.presentation odp
66 application/vnd.oasis.opendocument.presentation-flat-xml fodp
67 application/vnd.oasis.opendocument.presentation-template otp
68 application/vnd.oasis.opendocument.spreadsheet ods
69 application/vnd.oasis.opendocument.spreadsheet-flat-xml fods
70 application/vnd.oasis.opendocument.spreadsheet-template ots
71 application/vnd.oasis.opendocument.chart odc
72 application/vnd.oasis.opendocument.formula odf
73 application/vnd.oasis.opendocument.image odi
74 application/vnd.sun.xml.writer sxw
75 application/vnd.sun.xml.writer.template stw
76 application/vnd.sun.xml.writer.global sxg
77 application/vnd.stardivision.writer sdw vor
78 application/vnd.stardivision.writer-global sgl
79 application/vnd.sun.xml.calc sxc
80 application/vnd.sun.xml.calc.template stc
81 application/vnd.stardivision.calc sdc
82 application/vnd.stardivision.chart sds
83 application/vnd.sun.xml.impress sxi
84 application/vnd.sun.xml.impress.template sti
85 application/vnd.stardivision.impress sdd sdp
86 application/vnd.sun.xml.draw sxd
87 application/vnd.sun.xml.draw.template std
88 application/vnd.stardivision.draw sda
89 application/vnd.sun.xml.math sxm
90 application/vnd.stardivision.math smf
91 application/vnd.sun.xml.base odb
92 application/vnd.openofficeorg.extension oxt
95 # and replace the original file
96 mv -f /etc
/mime.types.tmp$$
/etc
/mime.types
2>/dev
/null
98 # update /etc/mailcap only at initial install
99 if [ "$1" = "configure" ]
101 # backing out existing entries to avoid duplicates
104 /^application\/vnd\.oasis\.opendocument/d
105 /^application\/vnd\.openofficeorg/d
106 /^application\/vnd\.sun/d
107 /^application\/vnd\.stardivision/d
108 /^application\/vnd\.ms-word/d
109 /^application\/vnd\.ms-excel/d
110 /^application\/vnd\.ms-powerpoint/d
111 /^application\/x-star/d
115 ' /etc
/mailcap
2>/dev
/null
>> /etc
/mailcap.tmp$$
117 # now append our stuff to the temporary file
118 cat >> /etc
/mailcap.tmp$$
<< END
120 application/vnd.oasis.opendocument.text; %PREFIX -view %s
121 application/vnd.oasis.opendocument.text-flat-xml; %PREFIX -view %s
122 application/vnd.oasis.opendocument.text-template; %PREFIX -view %s
123 application/vnd.oasis.opendocument.text-web; %PREFIX -view %s
124 application/vnd.oasis.opendocument.text-master; %PREFIX -view %s
125 application/vnd.oasis.opendocument.text-master-template; %PREFIX -view %s
126 application/vnd.sun.xml.writer; %PREFIX -view %s
127 application/vnd.sun.xml.writer.template; %PREFIX -view %s
128 application/vnd.sun.xml.writer.global; %PREFIX -view %s
129 application/vnd.stardivision.writer; %PREFIX -view %s
130 application/vnd.stardivision.writer-global; %PREFIX -view %s
131 application/x-hwp; %PREFIX -view %s
132 application/x-starwriter; %PREFIX -view %s
133 application/vnd.oasis.opendocument.formula; %PREFIX -view %s
134 application/vnd.sun.xml.math; %PREFIX -view %s
135 application/vnd.stardivision.math; %PREFIX -view %s
136 application/x-starmath; %PREFIX -view %s
137 application/msword; %PREFIX -view %s
138 application/vnd.oasis.opendocument.spreadsheet; %PREFIX -view %s
139 application/vnd.oasis.opendocument.spreadsheet-flat-xml; %PREFIX -view %s
140 application/vnd.oasis.opendocument.spreadsheet-template; %PREFIX -view %s
141 application/vnd.sun.xml.calc; %PREFIX -view %s
142 application/vnd.sun.xml.calc.template; %PREFIX -view %s
143 application/vnd.stardivision.calc; %PREFIX -view %s
144 application/x-starcalc; %PREFIX -view %s
145 application/vnd.stardivision.chart; %PREFIX -view %s
146 application/x-starchart; %PREFIX -view %s
147 application/excel; %PREFIX -view %s
148 application/msexcel; %PREFIX -view %s
149 application/vnd.ms-excel; %PREFIX -view %s
150 application/x-msexcel; %PREFIX -view %s
151 application/vnd.oasis.opendocument.presentation; %PREFIX -view %s
152 application/vnd.oasis.opendocument.presentation-flat-xml; %PREFIX -view %s
153 application/vnd.oasis.opendocument.presentation-template; %PREFIX -view %s
154 application/vnd.sun.xml.impress; %PREFIX -view %s
155 application/vnd.sun.xml.impress.template; %PREFIX -view %s
156 application/vnd.stardivision.impress; %PREFIX -view %s
157 application/x-starimpress; %PREFIX -view %s
158 application/powerpoint; %PREFIX -view %s
159 application/mspowerpoint; %PREFIX -view %s
160 application/vnd.ms-powerpoint; %PREFIX -view %s
161 application/x-mspowerpoint; %PREFIX -view %s
162 application/vnd.oasis.opendocument.graphics; %PREFIX -view %s
163 application/vnd.oasis.opendocument.graphics-flat-xml; %PREFIX -view %s
164 application/vnd.oasis.opendocument.graphics-template; %PREFIX -view %s
165 application/vnd.sun.xml.draw; %PREFIX -view %s
166 application/vnd.sun.xml.draw.template; %PREFIX -view %s
167 application/vnd.stardivision.draw; %PREFIX -view %s
168 application/x-stardraw; %PREFIX -view %s
169 application/vnd.oasis.opendocument.base; %PREFIX -view %s
170 application/vnd.sun.xml.base; %PREFIX -view %s
171 application/vnd.writerperfect; %PREFIX -view %s
172 application/wordperfect5.1; %PREFIX -view %s
173 application/x-wordperfect; %PREFIX -view %s
174 application/wordperfect; %PREFIX -view %s
175 application/vnd.lotus-wordpro; %PREFIX -view %s
176 application/wpwin; %PREFIX -view %s
177 application/x-mswrite; %PREFIX -view %s
178 application/vnd.openofficeorg.extension; %PREFIX %s
181 # and replace the original file
182 mv -f /etc
/mailcap.tmp$$
/etc
/mailcap