merged tag ooo/OOO330_m14
[LibreOffice.git] / sysui / desktop / suse / suse-menus.spec
blob14dbcde0f5e2884df29ea90ca0a4d95f4fecf533
1 # version and release passed by command-line
2 Version: %version
3 Release: %release
4 Summary: %productname desktop integration
5 Name: %pkgprefix-suse-menus
6 Group: Office
7 License: LGPL
8 Vendor: OpenOffice.org
9 AutoReqProv: no
10 BuildArch: noarch
11 # /etc/SuSE-release for SuSE, SLES and Novell Linux Desktop ..
12 Requires: /etc/SuSE-release
13 # .. but not for Sun JDS
14 Conflicts: SunDesktopVersion
15 Provides: openoffice.org3-desktop-integration
16 %define _unpackaged_files_terminate_build 0
17 %define _binary_filedigest_algorithm 1
18 %define _binary_payload w9.gzdio
19 %description
20 %productname desktop integration
22 %install
23 rm -rf $RPM_BUILD_ROOT/*
25 # hack/workaround to make SuSE's brp-symlink-script happy. It wants the targets of all links
26 # to be present on the build-system/the buildroot. But the point is that we generate stale
27 # links intentionally (until we find a better solution) #46226
28 export NO_BRP_STALE_LINK_ERROR=yes
30 mkdir -p $RPM_BUILD_ROOT
32 # set parameters for the create_tree script
33 export DESTDIR=$RPM_BUILD_ROOT
34 export KDEMAINDIR=/opt/kde3
35 export GNOMEDIR=/opt/gnome
36 export GNOME_MIME_THEME=hicolor
38 ./create_tree.sh
40 %clean
41 rm -rf $RPM_BUILD_ROOT
43 %triggerin -- %pkgprefix, %pkgprefix-writer, %pkgprefix-calc, %pkgprefix-draw, %pkgprefix-impress, %pkgprefix-base, %pkgprefix-math
44 if [ -x /opt/gnome/bin/update-desktop-database ]; then
45 echo Update Desktop Database
46 /opt/gnome/bin/update-desktop-database -q /usr/share/applications
47 /opt/gnome/bin/update-desktop-database
48 fi
50 %triggerun -- %pkgprefix, %pkgprefix-writer, %pkgprefix-calc, %pkgprefix-draw, %pkgprefix-impress, %pkgprefix-base, %pkgprefix-math
51 if [ "$1" = "0" ] ; then
52 # the menu-package gets uninstalled/updated - postun will run the command
53 exit 0
55 if [ "$2" = "0" ] ; then
56 # the triggering package gets removed
57 if [ -x /opt/gnome/bin/update-desktop-database ]; then
58 echo Update Desktop Database
59 /opt/gnome/bin/update-desktop-database -q /usr/share/applications
60 /opt/gnome/bin/update-desktop-database
61 fi
64 %post
65 # run always, since there are versions of this package that did not include
66 # a shared-mime-info xml file
67 if [ -x /usr/bin/update-mime-database ]; then
68 update-mime-database /usr/share/mime
71 if [ -x /opt/gnome/bin/update-desktop-database ]; then
72 echo Update Desktop Database
73 /opt/gnome/bin/update-desktop-database -q /usr/share/applications
74 /opt/gnome/bin/update-desktop-database
75 fi
77 # run only on first install, since postun is run when updating
78 # post would be run before the old files are removed
79 if [ "$1" = "1" ] ; then # first install
80 for themedir in /opt/gnome/share/icons/gnome /opt/gnome/share/icons/hicolor /opt/kde3/share/icons/hicolor /opt/kde3/share/icons/locolor; do
81 if [ -e $themedir/icon-theme.cache ] ; then
82 # touch in, in case we cannot find gtk-update-icon-cache (just to make sure)
83 touch $themedir
84 # path to gtk-update-icon-cache is not in rpm's install_script_path by default.
85 if [ -x /opt/gnome/bin/gtk-update-icon-cache ]; then
86 /opt/gnome/bin/gtk-update-icon-cache $themedir
88 # ignore errors (e.g. when there is a cache, but no index.theme)
89 true
91 done
94 # update /etc/mime.types
95 # backing out existing entries to avoid duplicates
96 sed '
97 /application\/vnd\.oasis\.opendocument/d
98 /application\/vnd\.openofficeorg/d
99 /application\/vnd\.sun/d
100 /application\/vnd\.stardivision/d
101 ' /etc/mime.types 2>/dev/null >> /etc/mime.types.tmp$$
104 # now append our stuff to the temporary file
105 cat >> /etc/mime.types.tmp$$ << END
106 application/vnd.oasis.opendocument.text odt
107 application/vnd.oasis.opendocument.text-template ott
108 application/vnd.oasis.opendocument.text-web oth
109 application/vnd.oasis.opendocument.text-master odm
110 application/vnd.oasis.opendocument.graphics odg
111 application/vnd.oasis.opendocument.graphics-template otg
112 application/vnd.oasis.opendocument.presentation odp
113 application/vnd.oasis.opendocument.presentation-template otp
114 application/vnd.oasis.opendocument.spreadsheet ods
115 application/vnd.oasis.opendocument.spreadsheet-template ots
116 application/vnd.oasis.opendocument.chart odc
117 application/vnd.oasis.opendocument.formula odf
118 application/vnd.oasis.opendocument.image odi
119 application/vnd.sun.xml.writer sxw
120 application/vnd.sun.xml.writer.template stw
121 application/vnd.sun.xml.writer.global sxg
122 application/vnd.stardivision.writer sdw vor
123 application/vnd.stardivision.writer-global sgl
124 application/vnd.sun.xml.calc sxc
125 application/vnd.sun.xml.calc.template stc
126 application/vnd.stardivision.calc sdc
127 application/vnd.stardivision.chart sds
128 application/vnd.sun.xml.impress sxi
129 application/vnd.sun.xml.impress.template sti
130 application/vnd.stardivision.impress sdd sdp
131 application/vnd.sun.xml.draw sxd
132 application/vnd.sun.xml.draw.template std
133 application/vnd.stardivision.draw sda
134 application/vnd.sun.xml.math sxm
135 application/vnd.stardivision.math smf
136 application/vnd.sun.xml.base odb
137 application/vnd.openofficeorg.extension oxt
138 application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
139 application/vnd.ms-word.document.macroenabled.12 docm
140 application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
141 application/vnd.ms-word.template.macroenabled.12 dotm
142 application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
143 application/vnd.ms-excel.sheet.macroenabled.12 xlsm
144 application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx
145 application/vnd.ms-excel.template.macroenabled.12 xltm
146 application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
147 application/vnd.ms-powerpoint.presentation.macroenabled.12 pptm
148 application/vnd.openxmlformats-officedocument.presentationml.template potx
149 application/vnd.ms-powerpoint.template.macroenabled.12 potm
152 # and replace the original file
153 mv -f /etc/mime.types.tmp$$ /etc/mime.types 2>/dev/null
155 # update /etc/mailcap only at initial install
156 if [ "$1" = 1 ]
157 then
158 # backing out existing entries to avoid duplicates
159 sed '
160 /^# OpenOffice.org/d
161 /^application\/vnd\.oasis\.opendocument/d
162 /^application\/vnd\.openofficeorg/d
163 /^application\/vnd\.sun/d
164 /^application\/vnd\.stardivision/d
165 /^application\/vnd\.ms-word/d
166 /^application\/vnd\.ms-excel/d
167 /^application\/vnd\.ms-powerpoint/d
168 /^application\/x-star/d
169 /excel/d
170 /ms[-]*word/d
171 /powerpoint/d
172 ' /etc/mailcap 2>/dev/null >> /etc/mailcap.tmp$$
174 # now append our stuff to the temporary file
175 cat >> /etc/mailcap.tmp$$ << END
176 # OpenOffice.org
177 application/vnd.oasis.opendocument.text; %unixfilename -view %s
178 application/vnd.oasis.opendocument.text-template; %unixfilename -view %s
179 application/vnd.oasis.opendocument.text-web; %unixfilename -view %s
180 application/vnd.oasis.opendocument.text-master; %unixfilename -view %s
181 application/vnd.sun.xml.writer; %unixfilename -view %s
182 application/vnd.sun.xml.writer.template; %unixfilename -view %s
183 application/vnd.sun.xml.writer.global; %unixfilename -view %s
184 application/vnd.stardivision.writer; %unixfilename -view %s
185 application/vnd.stardivision.writer-global; %unixfilename -view %s
186 application/x-starwriter; %unixfilename -view %s
187 application/vnd.oasis.opendocument.formula; %unixfilename -view %s
188 application/vnd.sun.xml.math; %unixfilename -view %s
189 application/vnd.stardivision.math; %unixfilename -view %s
190 application/x-starmath; %unixfilename -view %s
191 application/msword; %unixfilename -view %s
192 application/vnd.oasis.opendocument.spreadsheet; %unixfilename -view %s
193 application/vnd.oasis.opendocument.spreadsheet-template; %unixfilename -view %s
194 application/vnd.sun.xml.calc; %unixfilename -view %s
195 application/vnd.sun.xml.calc.template; %unixfilename -view %s
196 application/vnd.stardivision.calc; %unixfilename -view %s
197 application/x-starcalc; %unixfilename -view %s
198 application/vnd.stardivision.chart; %unixfilename -view %s
199 application/x-starchart; %unixfilename -view %s
200 application/excel; %unixfilename -view %s
201 application/msexcel; %unixfilename -view %s
202 application/vnd.ms-excel; %unixfilename -view %s
203 application/x-msexcel; %unixfilename -view %s
204 application/vnd.oasis.opendocument.presentation; %unixfilename -view %s
205 application/vnd.oasis.opendocument.presentation-template; %unixfilename -view %s
206 application/vnd.sun.xml.impress; %unixfilename -view %s
207 application/vnd.sun.xml.impress.template; %unixfilename -view %s
208 application/vnd.stardivision.impress; %unixfilename -view %s
209 application/x-starimpress; %unixfilename -view %s
210 application/powerpoint; %unixfilename -view %s
211 application/mspowerpoint; %unixfilename -view %s
212 application/vnd.ms-powerpoint; %unixfilename -view %s
213 application/x-mspowerpoint; %unixfilename -view %s
214 application/vnd.oasis.opendocument.graphics; %unixfilename -view %s
215 application/vnd.oasis.opendocument.graphics-template; %unixfilename -view %s
216 application/vnd.sun.xml.draw; %unixfilename -view %s
217 application/vnd.sun.xml.draw.template; %unixfilename -view %s
218 application/vnd.stardivision.draw; %unixfilename -view %s
219 application/x-stardraw; %unixfilename -view %s
220 application/vnd.oasis.opendocument.database; %unixfilename -view %s
221 application/vnd.sun.xml.base; %unixfilename -view %s
222 application/vnd.wordperfect; %unixfilename -view %s
223 application/wordperfect5.1; %unixfilename -view %s
224 application/x-wordperfect; %unixfilename -view %s
225 application/wordperfect; %unixfilename -view %s
226 application/wpwin; %unixfilename -view %s
227 application/vnd.openofficeorg.extension; %unixfilename %s
228 application/vnd.openxmlformats-officedocument.wordprocessingml.document; %unixfilename -view %s
229 application/vnd.ms-word.document.macroenabled.12;%unixfilename -view %s
230 application/vnd.openxmlformats-officedocument.wordprocessingml.template; %unixfilename -view %s
231 application/vnd.ms-word.template.macroenabled.12; %unixfilename -view %s
232 application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; %unixfilename -view %s
233 application/vnd.ms-excel.sheet.macroenabled.12; %unixfilename -view %s
234 application/vnd.openxmlformats-officedocument.spreadsheetml.template; %unixfilename -view %s
235 application/vnd.ms-excel.template.macroenabled.12; %unixfilename -view %s
236 application/vnd.openxmlformats-officedocument.presentationml.presentation; %unixfilename -view %s
237 application/vnd.ms-powerpoint.presentation.macroenabled.12; %unixfilename -view %s
238 application/vnd.openxmlformats-officedocument.presentationml.template; %unixfilename -view %s
239 application/vnd.ms-powerpoint.template.macroenabled.12; %unixfilename -view %s
242 # and replace the original file
243 mv -f /etc/mailcap.tmp$$ /etc/mailcap
246 %preun
247 # remove from /etc/mailcap only on de-install
248 if [ "$1" = 0 ]
249 then
250 # backing all entries pointing to our binary
251 sed '/%unixfilename/d' /etc/mailcap 2>/dev/null >> /etc/mailcap.tmp$$
253 # and replace the original file
254 mv -f /etc/mailcap.tmp$$ /etc/mailcap
257 %postun
258 # run only when erasing this package, since %post of the new package ran
259 # previously or updates already handled by triggers.
260 if [ "$1" = 0 ] ; then
261 if [ -x /opt/gnome/bin/update-desktop-database ]; then
262 /opt/gnome/bin/update-desktop-database -q /usr/share/applications
264 if [ -x /usr/bin/update-mime-database ]; then
265 update-mime-database /usr/share/mime
268 #run always
269 for themedir in /opt/gnome/share/icons/gnome /opt/gnome/share/icons/hicolor /opt/kde3/share/icons/hicolor /opt/kde3/share/icons/locolor; do
270 if [ -e $themedir/icon-theme.cache ] ; then
271 # touch in, in case we cannot find gtk-update-icon-cache (just to make sure)
272 touch $themedir
273 # path to gtk-update-icon-cache is not in rpm's install_script_path by default.
274 if [ -x /opt/gnome/bin/gtk-update-icon-cache ]; then
275 /opt/gnome/bin/gtk-update-icon-cache $themedir
277 # ignore errors (e.g. when there is a cache, but no index.theme)
278 true
280 done
282 %files
283 %attr(0755,root,root) /usr/bin/soffice
284 %attr(0755,root,root) %verify(not size md5) /usr/bin/%unixfilename
285 %attr(0755,root,root) /usr/bin/%unixfilename-printeradmin
286 %defattr(0644, root, root)
287 /opt/gnome/share/application-registry/*.applications
288 /usr/share/applications/%unixfilename-writer.desktop
289 /usr/share/applications/%unixfilename-calc.desktop
290 /usr/share/applications/%unixfilename-draw.desktop
291 /usr/share/applications/%unixfilename-impress.desktop
292 /usr/share/applications/%unixfilename-math.desktop
293 /usr/share/applications/%unixfilename-base.desktop
294 /usr/share/applications/%unixfilename-printeradmin.desktop
295 /usr/share/applications/%unixfilename-startcenter.desktop
296 /usr/share/applications/%unixfilename-javafilter.desktop
297 /opt/gnome/share/mime-info/*.keys
298 /opt/gnome/share/mime-info/*.mime
299 /opt/kde3/share/mimelnk/application/*.desktop
300 /opt/gnome/share/icons/gnome/*/apps/*png
301 /opt/gnome/share/icons/gnome/*/mimetypes/*png
302 /opt/gnome/share/icons/hicolor/*/mimetypes/*png
303 /opt/kde3/share/icons/hicolor/*/apps/*png
304 /opt/kde3/share/icons/hicolor/*/mimetypes/*png
305 /opt/kde3/share/icons/locolor/*/apps/*png
306 /opt/kde3/share/icons/locolor/*/mimetypes/*png
307 /usr/share/mime/packages/*