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