bump product version to 5.0.4.1
[LibreOffice.git] / sysui / desktop / debian / postinst
blobb9b6f24426f1468bfc9e98303ee26d4bf4eafd2e
1 #!/bin/sh
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
31 update-menus
33 # update icon-cache if already present
34 for theme in gnome hicolor locolor; do
35 if [ -e /usr/share/icons/$theme/icon-theme.cache ] ; then
36 # touch it, just in case we cannot find the binary...
37 touch /usr/share/icons/$theme
38 if (which gtk-update-icon-cache); then
39 gtk-update-icon-cache /usr/share/icons/$theme
41 # ignore errors (e.g. when there is a cache, but no index.theme)
42 true
44 done
47 # update /etc/mime.types
48 # backing out existing entries to avoid duplicates
49 sed '
50 /application\/vnd\.oasis\.opendocument/d
51 /application\/vnd\.sun/d
52 /application\/vnd\.stardivision/d
53 /application\/vnd\.openofficeorg/d
54 ' /etc/mime.types 2>/dev/null >> /etc/mime.types.tmp$$
56 # now append our stuff to the temporary file
57 cat >> /etc/mime.types.tmp$$ << END
58 application/vnd.oasis.opendocument.text odt
59 application/vnd.oasis.opendocument.text-flat-xml fodt
60 application/vnd.oasis.opendocument.text-template ott
61 application/vnd.oasis.opendocument.text-web oth
62 application/vnd.oasis.opendocument.text-master odm
63 application/vnd.oasis.opendocument.text-master-template otm
64 application/vnd.oasis.opendocument.graphics odg
65 application/vnd.oasis.opendocument.graphics-flat-xml fodg
66 application/vnd.oasis.opendocument.graphics-template otg
67 application/vnd.oasis.opendocument.presentation odp
68 application/vnd.oasis.opendocument.presentation-flat-xml fodp
69 application/vnd.oasis.opendocument.presentation-template otp
70 application/vnd.oasis.opendocument.spreadsheet ods
71 application/vnd.oasis.opendocument.spreadsheet-flat-xml fods
72 application/vnd.oasis.opendocument.spreadsheet-template ots
73 application/vnd.oasis.opendocument.chart odc
74 application/vnd.oasis.opendocument.formula odf
75 application/vnd.oasis.opendocument.image odi
76 application/vnd.sun.xml.writer sxw
77 application/vnd.sun.xml.writer.template stw
78 application/vnd.sun.xml.writer.global sxg
79 application/vnd.stardivision.writer sdw vor
80 application/vnd.stardivision.writer-global sgl
81 application/vnd.sun.xml.calc sxc
82 application/vnd.sun.xml.calc.template stc
83 application/vnd.stardivision.calc sdc
84 application/vnd.stardivision.chart sds
85 application/vnd.sun.xml.impress sxi
86 application/vnd.sun.xml.impress.template sti
87 application/vnd.stardivision.impress sdd sdp
88 application/vnd.sun.xml.draw sxd
89 application/vnd.sun.xml.draw.template std
90 application/vnd.stardivision.draw sda
91 application/vnd.sun.xml.math sxm
92 application/vnd.stardivision.math smf
93 application/vnd.sun.xml.base odb
94 application/vnd.openofficeorg.extension oxt
95 END
97 # and replace the original file
98 mv -f /etc/mime.types.tmp$$ /etc/mime.types 2>/dev/null
100 # update /etc/mailcap only at initial install
101 if [ "$1" = "configure" ]
102 then
103 # backing out existing entries to avoid duplicates
104 sed '
105 /^# LibreOffice/d
106 /^application\/vnd\.oasis\.opendocument/d
107 /^application\/vnd\.openofficeorg/d
108 /^application\/vnd\.sun/d
109 /^application\/vnd\.stardivision/d
110 /^application\/vnd\.ms-word/d
111 /^application\/vnd\.ms-excel/d
112 /^application\/vnd\.ms-powerpoint/d
113 /^application\/x-star/d
114 /excel/d
115 /ms[-]*word/d
116 /powerpoint/d
117 ' /etc/mailcap 2>/dev/null >> /etc/mailcap.tmp$$
119 # now append our stuff to the temporary file
120 cat >> /etc/mailcap.tmp$$ << END
121 # LibreOffice
122 application/vnd.oasis.opendocument.text; %PREFIX -view %s
123 application/vnd.oasis.opendocument.text-flat-xml; %PREFIX -view %s
124 application/vnd.oasis.opendocument.text-template; %PREFIX -view %s
125 application/vnd.oasis.opendocument.text-web; %PREFIX -view %s
126 application/vnd.oasis.opendocument.text-master; %PREFIX -view %s
127 application/vnd.oasis.opendocument.text-master-template; %PREFIX -view %s
128 application/vnd.sun.xml.writer; %PREFIX -view %s
129 application/vnd.sun.xml.writer.template; %PREFIX -view %s
130 application/vnd.sun.xml.writer.global; %PREFIX -view %s
131 application/vnd.stardivision.writer; %PREFIX -view %s
132 application/vnd.stardivision.writer-global; %PREFIX -view %s
133 application/x-hwp; %PREFIX -view %s
134 application/x-starwriter; %PREFIX -view %s
135 application/vnd.oasis.opendocument.formula; %PREFIX -view %s
136 application/vnd.sun.xml.math; %PREFIX -view %s
137 application/vnd.stardivision.math; %PREFIX -view %s
138 application/x-starmath; %PREFIX -view %s
139 application/msword; %PREFIX -view %s
140 application/vnd.oasis.opendocument.spreadsheet; %PREFIX -view %s
141 application/vnd.oasis.opendocument.spreadsheet-flat-xml; %PREFIX -view %s
142 application/vnd.oasis.opendocument.spreadsheet-template; %PREFIX -view %s
143 application/vnd.sun.xml.calc; %PREFIX -view %s
144 application/vnd.sun.xml.calc.template; %PREFIX -view %s
145 application/vnd.stardivision.calc; %PREFIX -view %s
146 application/x-starcalc; %PREFIX -view %s
147 application/vnd.stardivision.chart; %PREFIX -view %s
148 application/x-starchart; %PREFIX -view %s
149 application/excel; %PREFIX -view %s
150 application/msexcel; %PREFIX -view %s
151 application/vnd.ms-excel; %PREFIX -view %s
152 application/x-msexcel; %PREFIX -view %s
153 application/vnd.oasis.opendocument.presentation; %PREFIX -view %s
154 application/vnd.oasis.opendocument.presentation-flat-xml; %PREFIX -view %s
155 application/vnd.oasis.opendocument.presentation-template; %PREFIX -view %s
156 application/vnd.sun.xml.impress; %PREFIX -view %s
157 application/vnd.sun.xml.impress.template; %PREFIX -view %s
158 application/vnd.stardivision.impress; %PREFIX -view %s
159 application/x-starimpress; %PREFIX -view %s
160 application/powerpoint; %PREFIX -view %s
161 application/mspowerpoint; %PREFIX -view %s
162 application/vnd.ms-powerpoint; %PREFIX -view %s
163 application/x-mspowerpoint; %PREFIX -view %s
164 application/vnd.oasis.opendocument.graphics; %PREFIX -view %s
165 application/vnd.oasis.opendocument.graphics-flat-xml; %PREFIX -view %s
166 application/vnd.oasis.opendocument.graphics-template; %PREFIX -view %s
167 application/vnd.sun.xml.draw; %PREFIX -view %s
168 application/vnd.sun.xml.draw.template; %PREFIX -view %s
169 application/vnd.stardivision.draw; %PREFIX -view %s
170 application/x-stardraw; %PREFIX -view %s
171 application/vnd.oasis.opendocument.database; %PREFIX -view %s
172 application/vnd.sun.xml.base; %PREFIX -view %s
173 application/vnd.writerperfect; %PREFIX -view %s
174 application/wordperfect5.1; %PREFIX -view %s
175 application/x-wordperfect; %PREFIX -view %s
176 application/wordperfect; %PREFIX -view %s
177 application/vnd.lotus-wordpro; %PREFIX -view %s
178 application/wpwin; %PREFIX -view %s
179 application/vnd.openofficeorg.extension; %PREFIX %s
182 # and replace the original file
183 mv -f /etc/mailcap.tmp$$ /etc/mailcap
186 exit 0