Impress Remote 1.0.5, tag sdremote-1.0.5
[LibreOffice.git] / sysui / desktop / suse / suse-menus.spec
blobb00e966b290b9782df2a6e3b8f45a88fda2c674b
2 # This file is part of the LibreOffice project.
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # This file incorporates work covered by the following license notice:
10 # Licensed to the Apache Software Foundation (ASF) under one or more
11 # contributor license agreements. See the NOTICE file distributed
12 # with this work for additional information regarding copyright
13 # ownership. The ASF licenses this file to you under the Apache
14 # License, Version 2.0 (the "License"); you may not use this file
15 # except in compliance with the License. You may obtain a copy of
16 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 # version and release passed by command-line
19 Version: %version
20 Release: %release
21 Summary: %productname desktop integration
22 Name: %pkgprefix-suse-menus
23 Group: Office
24 License: LGPLv3 with MPLv2, ALv2 and others
25 Vendor: The Document Foundation
26 AutoReqProv: no
27 BuildArch: noarch
28 # /etc/SuSE-release for SuSE, SLES and Novell Linux Desktop ..
29 Requires: /etc/SuSE-release
30 # .. but not for Sun JDS
31 Conflicts: SunDesktopVersion
32 Provides: libreoffice-desktop-integration
33 %define _unpackaged_files_terminate_build 0
34 %define _binary_filedigest_algorithm 1
35 %define _binary_payload w9.gzdio
37 %define gnome_dir /opt/gnome
38 %define gnome_mime_theme hicolor
40 %description
41 %productname desktop integration
43 %install
44 rm -rf $RPM_BUILD_ROOT/*
46 # hack/workaround to make SuSE's brp-symlink-script happy. It wants the targets of all links
47 # to be present on the build-system/the buildroot. But the point is that we generate stale
48 # links intentionally (until we find a better solution) #46226
49 export NO_BRP_STALE_LINK_ERROR=yes
51 mkdir -p $RPM_BUILD_ROOT
53 # set parameters for the create_tree script
54 export DESTDIR=$RPM_BUILD_ROOT
55 export KDEMAINDIR=/opt/kde3
56 export GNOMEDIR=%{gnome_dir}
58 ./create_tree.sh
60 %clean
61 rm -rf $RPM_BUILD_ROOT
63 %triggerin -- %pkgprefix, %pkgprefix-writer, %pkgprefix-calc, %pkgprefix-draw, %pkgprefix-impress, %pkgprefix-base, %pkgprefix-math
64 if [ -x /opt/gnome/bin/update-desktop-database ]; then
65 echo Update Desktop Database
66 /opt/gnome/bin/update-desktop-database -q /usr/share/applications
67 /opt/gnome/bin/update-desktop-database
70 %triggerun -- %pkgprefix, %pkgprefix-writer, %pkgprefix-calc, %pkgprefix-draw, %pkgprefix-impress, %pkgprefix-base, %pkgprefix-math
71 if [ "$1" = "0" ] ; then
72 # the menu-package gets uninstalled/updated - postun will run the command
73 exit 0
75 if [ "$2" = "0" ] ; then
76 # the triggering package gets removed
77 if [ -x /opt/gnome/bin/update-desktop-database ]; then
78 echo Update Desktop Database
79 /opt/gnome/bin/update-desktop-database -q /usr/share/applications
80 /opt/gnome/bin/update-desktop-database
84 %post
85 # run always, since there are versions of this package that did not include
86 # a shared-mime-info xml file
87 if [ -x /usr/bin/update-mime-database ]; then
88 update-mime-database /usr/share/mime
91 if [ -x /opt/gnome/bin/update-desktop-database ]; then
92 echo Update Desktop Database
93 /opt/gnome/bin/update-desktop-database -q /usr/share/applications
94 /opt/gnome/bin/update-desktop-database
97 # add symlinks so that nautilus can identify the mime-icons
98 # not strictly freedesktop-stuff but there is no common naming scheme yet.
99 # One proposal is "mime-application:vnd.oasis.opendocument.spreadsheet.png"
100 # for e.g. application/vnd.oasis.opendocument.spreadsheet
101 link_target_root="%{gnome_dir}/share/icons/%{gnome_mime_theme}"
103 if [ ! -d "${link_target_root}" ]
104 then
105 link_target_root="%{gnome_dir}/share/icons/gnome"
108 for subdir in `cd ${link_target_root}; ls -d *`
110 link_dir="%{gnome_dir}/share/icons/%{gnome_mime_theme}/$subdir/mimetypes"
111 link_target_dir="../../../gnome/$subdir/mimetypes/"
113 test -d "${link_dir}" || mkdir -p "${link_dir}"
114 test -d ${link_dir}/${link_target_dir} || continue
116 icon=${link_target_dir}%iconprefix-drawing.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.png
117 icon=${link_target_dir}%iconprefix-drawing-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.template.png
118 icon=${link_target_dir}%iconprefix-formula.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.math.png
119 icon=${link_target_dir}%iconprefix-master-document.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.global.png
120 icon=${link_target_dir}%iconprefix-oasis-database.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.base.png
121 icon=${link_target_dir}%iconprefix-oasis-database.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.database.png
122 icon=${link_target_dir}%iconprefix-oasis-drawing.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics.png
123 icon=${link_target_dir}%iconprefix-oasis-drawing-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics-template.png
124 icon=${link_target_dir}%iconprefix-oasis-formula.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.formula.png
125 icon=${link_target_dir}%iconprefix-oasis-master-document.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-master.png
126 icon=${link_target_dir}%iconprefix-oasis-presentation.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation.png
127 icon=${link_target_dir}%iconprefix-oasis-presentation-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation-template.png
128 icon=${link_target_dir}%iconprefix-oasis-spreadsheet.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet.png
129 icon=${link_target_dir}%iconprefix-oasis-spreadsheet-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet-template.png
130 icon=${link_target_dir}%iconprefix-oasis-text.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text.png
131 icon=${link_target_dir}%iconprefix-oasis-text-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-template.png
132 icon=${link_target_dir}%iconprefix-oasis-web-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-web.png
133 icon=${link_target_dir}%iconprefix-presentation.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.png
134 icon=${link_target_dir}%iconprefix-presentation-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.template.png
135 icon=${link_target_dir}%iconprefix-spreadsheet.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.png
136 icon=${link_target_dir}%iconprefix-spreadsheet-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.template.png
137 icon=${link_target_dir}%iconprefix-text.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.png
138 icon=${link_target_dir}%iconprefix-text-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.template.png
139 icon=${link_target_dir}%iconprefix-extension.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.openofficeorg.extension.png
140 done
142 # run only on first install, since postun is run when updating
143 # post would be run before the old files are removed
144 if [ "$1" = "1" ] ; then # first install
145 for themedir in /opt/gnome/share/icons/gnome /opt/gnome/share/icons/hicolor /opt/kde3/share/icons/hicolor /opt/kde3/share/icons/locolor; do
146 if [ -e $themedir/icon-theme.cache ] ; then
147 # touch in, in case we cannot find gtk-update-icon-cache (just to make sure)
148 touch $themedir
149 # path to gtk-update-icon-cache is not in rpm's install_script_path by default.
150 if [ -x /opt/gnome/bin/gtk-update-icon-cache ]; then
151 /opt/gnome/bin/gtk-update-icon-cache $themedir
153 # ignore errors (e.g. when there is a cache, but no index.theme)
154 true
156 done
159 # update /etc/mime.types
160 # backing out existing entries to avoid duplicates
161 sed '
162 /application\/vnd\.oasis\.opendocument/d
163 /application\/vnd\.openofficeorg/d
164 /application\/vnd\.sun/d
165 /application\/vnd\.stardivision/d
166 ' /etc/mime.types 2>/dev/null >> /etc/mime.types.tmp$$
169 # now append our stuff to the temporary file
170 cat >> /etc/mime.types.tmp$$ << END
171 application/vnd.oasis.opendocument.text odt
172 application/vnd.oasis.opendocument.text-flat-xml fodt
173 application/vnd.oasis.opendocument.text-template ott
174 application/vnd.oasis.opendocument.text-web oth
175 application/vnd.oasis.opendocument.text-master odm
176 application/vnd.oasis.opendocument.graphics odg
177 application/vnd.oasis.opendocument.graphics-flat-xml fodg
178 application/vnd.oasis.opendocument.graphics-template otg
179 application/vnd.oasis.opendocument.presentation odp
180 application/vnd.oasis.opendocument.presentation-flat-xml fodp
181 application/vnd.oasis.opendocument.presentation-template otp
182 application/vnd.oasis.opendocument.spreadsheet ods
183 application/vnd.oasis.opendocument.spreadsheet-flat-xml fods
184 application/vnd.oasis.opendocument.spreadsheet-template ots
185 application/vnd.oasis.opendocument.chart odc
186 application/vnd.oasis.opendocument.formula odf
187 application/vnd.oasis.opendocument.image odi
188 application/vnd.sun.xml.writer sxw
189 application/vnd.sun.xml.writer.template stw
190 application/vnd.sun.xml.writer.global sxg
191 application/vnd.stardivision.writer sdw vor
192 application/vnd.stardivision.writer-global sgl
193 application/vnd.sun.xml.calc sxc
194 application/vnd.sun.xml.calc.template stc
195 application/vnd.stardivision.calc sdc
196 application/vnd.stardivision.chart sds
197 application/vnd.sun.xml.impress sxi
198 application/vnd.sun.xml.impress.template sti
199 application/vnd.stardivision.impress sdd sdp
200 application/vnd.sun.xml.draw sxd
201 application/vnd.sun.xml.draw.template std
202 application/vnd.stardivision.draw sda
203 application/vnd.sun.xml.math sxm
204 application/vnd.stardivision.math smf
205 application/vnd.sun.xml.base odb
206 application/vnd.openofficeorg.extension oxt
207 application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
208 application/vnd.ms-word.document.macroenabled.12 docm
209 application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
210 application/vnd.ms-word.template.macroenabled.12 dotm
211 application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
212 application/vnd.ms-excel.sheet.macroenabled.12 xlsm
213 application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx
214 application/vnd.ms-excel.template.macroenabled.12 xltm
215 application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
216 application/vnd.ms-powerpoint.presentation.macroenabled.12 pptm
217 application/vnd.openxmlformats-officedocument.presentationml.template potx
218 application/vnd.ms-powerpoint.template.macroenabled.12 potm
221 # and replace the original file
222 mv -f /etc/mime.types.tmp$$ /etc/mime.types 2>/dev/null
224 # update /etc/mailcap only at initial install
225 if [ "$1" = 1 ]
226 then
227 # backing out existing entries to avoid duplicates
228 sed '
229 /^# OpenOffice.org/d
230 /^application\/vnd\.oasis\.opendocument/d
231 /^application\/vnd\.openofficeorg/d
232 /^application\/vnd\.sun/d
233 /^application\/vnd\.stardivision/d
234 /^application\/vnd\.ms-word/d
235 /^application\/vnd\.ms-excel/d
236 /^application\/vnd\.ms-powerpoint/d
237 /^application\/x-star/d
238 /excel/d
239 /ms[-]*word/d
240 /powerpoint/d
241 ' /etc/mailcap 2>/dev/null >> /etc/mailcap.tmp$$
243 # now append our stuff to the temporary file
244 cat >> /etc/mailcap.tmp$$ << END
245 # LibreOffice
246 application/vnd.oasis.opendocument.text; %unixfilename -view %s
247 application/vnd.oasis.opendocument.text-flat-xml; %unixfilename -view %s
248 application/vnd.oasis.opendocument.text-template; %unixfilename -view %s
249 application/vnd.oasis.opendocument.text-web; %unixfilename -view %s
250 application/vnd.oasis.opendocument.text-master; %unixfilename -view %s
251 application/vnd.sun.xml.writer; %unixfilename -view %s
252 application/vnd.sun.xml.writer.template; %unixfilename -view %s
253 application/vnd.sun.xml.writer.global; %unixfilename -view %s
254 application/vnd.stardivision.writer; %unixfilename -view %s
255 application/vnd.stardivision.writer-global; %unixfilename -view %s
256 application/x-starwriter; %unixfilename -view %s
257 application/vnd.oasis.opendocument.formula; %unixfilename -view %s
258 application/vnd.sun.xml.math; %unixfilename -view %s
259 application/vnd.stardivision.math; %unixfilename -view %s
260 application/x-starmath; %unixfilename -view %s
261 application/msword; %unixfilename -view %s
262 application/vnd.oasis.opendocument.spreadsheet; %unixfilename -view %s
263 application/vnd.oasis.opendocument.spreadsheet-flat-xml; %unixfilename -view %s
264 application/vnd.oasis.opendocument.spreadsheet-template; %unixfilename -view %s
265 application/vnd.sun.xml.calc; %unixfilename -view %s
266 application/vnd.sun.xml.calc.template; %unixfilename -view %s
267 application/vnd.stardivision.calc; %unixfilename -view %s
268 application/x-starcalc; %unixfilename -view %s
269 application/vnd.stardivision.chart; %unixfilename -view %s
270 application/x-starchart; %unixfilename -view %s
271 application/excel; %unixfilename -view %s
272 application/msexcel; %unixfilename -view %s
273 application/vnd.ms-excel; %unixfilename -view %s
274 application/x-msexcel; %unixfilename -view %s
275 application/vnd.oasis.opendocument.presentation; %unixfilename -view %s
276 application/vnd.oasis.opendocument.presentation-flat-xml; %unixfilename -view %s
277 application/vnd.oasis.opendocument.presentation-template; %unixfilename -view %s
278 application/vnd.sun.xml.impress; %unixfilename -view %s
279 application/vnd.sun.xml.impress.template; %unixfilename -view %s
280 application/vnd.stardivision.impress; %unixfilename -view %s
281 application/x-starimpress; %unixfilename -view %s
282 application/powerpoint; %unixfilename -view %s
283 application/mspowerpoint; %unixfilename -view %s
284 application/vnd.ms-powerpoint; %unixfilename -view %s
285 application/x-mspowerpoint; %unixfilename -view %s
286 application/vnd.oasis.opendocument.graphics; %unixfilename -view %s
287 application/vnd.oasis.opendocument.graphics-flat-xml; %unixfilename -view %s
288 application/vnd.oasis.opendocument.graphics-template; %unixfilename -view %s
289 application/vnd.sun.xml.draw; %unixfilename -view %s
290 application/vnd.sun.xml.draw.template; %unixfilename -view %s
291 application/vnd.stardivision.draw; %unixfilename -view %s
292 application/x-stardraw; %unixfilename -view %s
293 application/vnd.oasis.opendocument.database; %unixfilename -view %s
294 application/vnd.sun.xml.base; %unixfilename -view %s
295 application/vnd.wordperfect; %unixfilename -view %s
296 application/wordperfect5.1; %unixfilename -view %s
297 application/x-wordperfect; %unixfilename -view %s
298 application/wordperfect; %unixfilename -view %s
299 application/vnd.lotus-wordpro; %unixfilename -view %s
300 application/wpwin; %unixfilename -view %s
301 application/vnd.openofficeorg.extension; %unixfilename %s
302 application/vnd.openxmlformats-officedocument.wordprocessingml.document; %unixfilename -view %s
303 application/vnd.ms-word.document.macroenabled.12;%unixfilename -view %s
304 application/vnd.openxmlformats-officedocument.wordprocessingml.template; %unixfilename -view %s
305 application/vnd.ms-word.template.macroenabled.12; %unixfilename -view %s
306 application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; %unixfilename -view %s
307 application/vnd.ms-excel.sheet.macroenabled.12; %unixfilename -view %s
308 application/vnd.openxmlformats-officedocument.spreadsheetml.template; %unixfilename -view %s
309 application/vnd.ms-excel.template.macroenabled.12; %unixfilename -view %s
310 application/vnd.openxmlformats-officedocument.presentationml.presentation; %unixfilename -view %s
311 application/vnd.ms-powerpoint.presentation.macroenabled.12; %unixfilename -view %s
312 application/vnd.openxmlformats-officedocument.presentationml.template; %unixfilename -view %s
313 application/vnd.ms-powerpoint.template.macroenabled.12; %unixfilename -view %s
314 application/x-hwp; %unixfilename -view %s
317 # and replace the original file
318 mv -f /etc/mailcap.tmp$$ /etc/mailcap
321 %preun
322 # remove from /etc/mailcap only on de-install
323 if [ "$1" = 0 ]
324 then
325 # backing all entries pointing to our binary
326 sed '/%unixfilename/d' /etc/mailcap 2>/dev/null >> /etc/mailcap.tmp$$
328 # and replace the original file
329 mv -f /etc/mailcap.tmp$$ /etc/mailcap
332 %postun
333 # run only when erasing this package, since %post of the new package ran
334 # previously or updates already handled by triggers.
335 if [ "$1" = 0 ] ; then
336 if [ -x /opt/gnome/bin/update-desktop-database ]; then
337 /opt/gnome/bin/update-desktop-database -q /usr/share/applications
339 if [ -x /usr/bin/update-mime-database ]; then
340 update-mime-database /usr/share/mime
343 #run always
344 for themedir in /opt/gnome/share/icons/gnome /opt/gnome/share/icons/hicolor /opt/kde3/share/icons/hicolor /opt/kde3/share/icons/locolor; do
345 if [ -e $themedir/icon-theme.cache ] ; then
346 # touch in, in case we cannot find gtk-update-icon-cache (just to make sure)
347 touch $themedir
348 # path to gtk-update-icon-cache is not in rpm's install_script_path by default.
349 if [ -x /opt/gnome/bin/gtk-update-icon-cache ]; then
350 /opt/gnome/bin/gtk-update-icon-cache $themedir
352 # ignore errors (e.g. when there is a cache, but no index.theme)
353 true
355 done
357 %files
358 %if "%unixfilename" != "libreoffice%productversion" && "%unixfilename" != "lodev%productversion"
359 # compat symlinks
360 %attr(0755,root,root) /opt/%unixfilename
361 %attr(0755,root,root) /usr/bin/libreoffice%productversion
362 %attr(0755,root,root) /usr/bin/libreoffice%productversion-printeradmin
363 %endif
364 %attr(0755,root,root) %verify(not size md5) /usr/bin/%unixfilename
365 %attr(0755,root,root) /usr/bin/%unixfilename-printeradmin
366 %defattr(0644, root, root)
367 /opt/gnome/share/application-registry/*.applications
368 /usr/share/applications/%unixfilename-writer.desktop
369 /usr/share/applications/%unixfilename-calc.desktop
370 /usr/share/applications/%unixfilename-draw.desktop
371 /usr/share/applications/%unixfilename-impress.desktop
372 /usr/share/applications/%unixfilename-math.desktop
373 /usr/share/applications/%unixfilename-base.desktop
374 /usr/share/applications/%unixfilename-printeradmin.desktop
375 /usr/share/applications/%unixfilename-startcenter.desktop
376 /usr/share/applications/%unixfilename-javafilter.desktop
377 /usr/share/applications/%unixfilename-xsltfilter.desktop
378 /opt/gnome/share/mime-info/*.keys
379 /opt/gnome/share/mime-info/*.mime
380 /opt/kde3/share/mimelnk/application/*.desktop
381 /opt/gnome/share/icons/gnome/*/apps/*png
382 /opt/gnome/share/icons/gnome/*/mimetypes/*png
383 /opt/gnome/share/icons/gnome/scalable/apps/*svg
384 /opt/gnome/share/icons/gnome/scalable/mimetypes/*svg
385 /opt/kde3/share/icons/hicolor/*/apps/*png
386 /opt/kde3/share/icons/hicolor/*/mimetypes/*png
387 /opt/kde3/share/icons/hicolor/scalable/apps/*svg
388 /opt/kde3/share/icons/hicolor/scalable/mimetypes/*svg
389 /opt/kde3/share/icons/locolor/*/apps/*png
390 /opt/kde3/share/icons/locolor/*/mimetypes/*png
391 /usr/share/mime/packages/*