1*30cfceefSAndrew Rist# *************************************************************
2*30cfceefSAndrew Rist#
3*30cfceefSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
4*30cfceefSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
5*30cfceefSAndrew Rist#  distributed with this work for additional information
6*30cfceefSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
7*30cfceefSAndrew Rist#  to you under the Apache License, Version 2.0 (the
8*30cfceefSAndrew Rist#  "License"); you may not use this file except in compliance
9*30cfceefSAndrew Rist#  with the License.  You may obtain a copy of the License at
10*30cfceefSAndrew Rist#
11*30cfceefSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12*30cfceefSAndrew Rist#
13*30cfceefSAndrew Rist#  Unless required by applicable law or agreed to in writing,
14*30cfceefSAndrew Rist#  software distributed under the License is distributed on an
15*30cfceefSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*30cfceefSAndrew Rist#  KIND, either express or implied.  See the License for the
17*30cfceefSAndrew Rist#  specific language governing permissions and limitations
18*30cfceefSAndrew Rist#  under the License.
19*30cfceefSAndrew Rist#
20*30cfceefSAndrew Rist# *************************************************************
21cdf0e10cSrcweir# version and release passed by command-line
22cdf0e10cSrcweirVersion: %version
23cdf0e10cSrcweirRelease: %release
24cdf0e10cSrcweirSummary: %productname desktop integration
25cdf0e10cSrcweirName: %pkgprefix-freedesktop-menus
26cdf0e10cSrcweir#BuildRequires: sed
27cdf0e10cSrcweir#BuildRequires: perl
28cdf0e10cSrcweirGroup: Office
29bda541ebSArmin Le GrandLicense: ALv2
30cdf0e10cSrcweirProvides: openoffice.org3-desktop-integration
31cdf0e10cSrcweirConflicts: %pkgprefix-suse-menus
32cdf0e10cSrcweirConflicts: %pkgprefix-debian-menus
33cdf0e10cSrcweirConflicts: %pkgprefix-redhat-menus
34cdf0e10cSrcweirConflicts: %pkgprefix-mandriva-menus
35cdf0e10cSrcweirBuildArch: noarch
36cdf0e10cSrcweirAutoReqProv: no
37cdf0e10cSrcweir%define _binary_filedigest_algorithm 1
38cdf0e10cSrcweir%define _binary_payload w9.gzdio
39cdf0e10cSrcweir
40cdf0e10cSrcweir%description
41cdf0e10cSrcweir%productname desktop integration for desktop-environments that implement
42cdf0e10cSrcweirthe menu- and mime-related specifications from http://www.freedesktop.org
43cdf0e10cSrcweirInstall this package if you're using a distribution not covered by any of
44cdf0e10cSrcweirthe other %pkgprefix-<distribution>-menus packages.
45cdf0e10cSrcweir
46cdf0e10cSrcweir%install
47cdf0e10cSrcweirrm -rf $RPM_BUILD_ROOT
48cdf0e10cSrcweir
49cdf0e10cSrcweir# hack/workaround to make SuSE's brp-symlink-script happy. It wants the targets of all links
50cdf0e10cSrcweir# to be present on the build-system/the buildroot. But the point is that we generate stale
51cdf0e10cSrcweir# links intentionally (until we find a better solution) #46226
52cdf0e10cSrcweirexport NO_BRP_STALE_LINK_ERROR=yes
53cdf0e10cSrcweir
54cdf0e10cSrcweirmkdir -p $RPM_BUILD_ROOT
55cdf0e10cSrcweir
56cdf0e10cSrcweir# FIXME: remove - only purpose is to create packages identical to OOF680 m8
57cdf0e10cSrcweirumask 0000
58cdf0e10cSrcweir
59cdf0e10cSrcweir# set parameters for the create_tree script
60cdf0e10cSrcweirexport DESTDIR=$RPM_BUILD_ROOT
61cdf0e10cSrcweirexport KDEMAINDIR=/usr
62cdf0e10cSrcweirexport GNOMEDIR=/usr
63cdf0e10cSrcweirexport GNOME_MIME_THEME=hicolor
64cdf0e10cSrcweir
65cdf0e10cSrcweir./create_tree.sh
66cdf0e10cSrcweir
67cdf0e10cSrcweircd $RPM_BUILD_ROOT
68cdf0e10cSrcweir
69cdf0e10cSrcweir# freedesktop-based desktop-environments don't need/use this.
70cdf0e10cSrcweirrm -rf usr/share/application-registry
71cdf0e10cSrcweirrm -rf usr/share/applications.flag
72cdf0e10cSrcweirrm -rf usr/share/mime-info
73cdf0e10cSrcweirrm -rf usr/share/mimelnk
74cdf0e10cSrcweirrm -rf usr/share/applnk-redhat
75cdf0e10cSrcweir#find usr/share/icons -name '*.png' -exec chmod g+w {} \;
76cdf0e10cSrcweir
77cdf0e10cSrcweir%clean
78cdf0e10cSrcweirrm -rf $RPM_BUILD_ROOT
79cdf0e10cSrcweir
80cdf0e10cSrcweir%triggerin -- %pkgprefix, %pkgprefix-writer, %pkgprefix-calc, %pkgprefix-draw, %pkgprefix-impress, %pkgprefix-math
81cdf0e10cSrcweir# this is run when one of the above packages is already installed and the menu
82cdf0e10cSrcweir# package gets installed OR when the menu-package is already installed and one
83cdf0e10cSrcweir# of the above listed packages gets installed
84cdf0e10cSrcweir
85cdf0e10cSrcweir# Dut to a bug in rpm it is not possible to check why the script is triggered...
86cdf0e10cSrcweir# This is how it should be: 1st arg: number of this package, 2nd arg: number of
87cdf0e10cSrcweir# package that triggers - the bug is that rpm reports the same number for both
88cdf0e10cSrcweir# (the value of the 2nd one), so just run this always...
89cdf0e10cSrcweir# http://rhn.redhat.com/errata/RHBA-2004-098.html
90cdf0e10cSrcweir# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=100509
91cdf0e10cSrcweir
92cdf0e10cSrcweirif [ -x /opt/gnome/bin/update-desktop-database ]; then
93cdf0e10cSrcweir    /opt/gnome/bin/update-desktop-database -q
94cdf0e10cSrcweirelif (which update-desktop-database); then
95cdf0e10cSrcweir  update-desktop-database -q /usr/share/applications
96cdf0e10cSrcweirfi
97cdf0e10cSrcweir
98cdf0e10cSrcweir%triggerun -- %pkgprefix, %pkgprefix-writer, %pkgprefix-calc, %pkgprefix-draw, %pkgprefix-impress, %pkgprefix-math
99cdf0e10cSrcweirif [ "$1" = "0" ] ; then
100cdf0e10cSrcweir  # the menu-package gets uninstalled/updated - postun will run the command
101cdf0e10cSrcweir  exit 0
102cdf0e10cSrcweirfi
103cdf0e10cSrcweirif [ "$2" = "0" ] ; then
104cdf0e10cSrcweir  # the triggering package gets removed
105cdf0e10cSrcweir  if [ -x /opt/gnome/bin/update-desktop-database ]; then
106cdf0e10cSrcweir      /opt/gnome/bin/update-desktop-database -q
107cdf0e10cSrcweir  elif (which update-desktop-database); then
108cdf0e10cSrcweir    update-desktop-database -q /usr/share/applications
109cdf0e10cSrcweir  fi
110cdf0e10cSrcweirfi
111cdf0e10cSrcweir
112cdf0e10cSrcweir%post
113cdf0e10cSrcweir# no need to run it when updating, since %postun of the old package is run
114cdf0e10cSrcweir# afterwards
115cdf0e10cSrcweir
116cdf0e10cSrcweirif [ "$1" = "1" ] ; then  # first install
117cdf0e10cSrcweir  if [ -x /opt/gnome/bin/update-desktop-database ]; then
118cdf0e10cSrcweir    /opt/gnome/bin/update-desktop-database -q
119cdf0e10cSrcweir  elif (which update-desktop-database); then
120cdf0e10cSrcweir    update-desktop-database -q /usr/share/applications
121cdf0e10cSrcweir  fi
122cdf0e10cSrcweir
123cdf0e10cSrcweir  if (which update-mime-database); then
124cdf0e10cSrcweir    update-mime-database /usr/share/mime
125cdf0e10cSrcweir  fi
126cdf0e10cSrcweirfi
127cdf0e10cSrcweir
128cdf0e10cSrcweir
129cdf0e10cSrcweir#run always
130cdf0e10cSrcweirfor theme in gnome hicolor locolor; do
131cdf0e10cSrcweir    if [ -e /usr/share/icons/$theme/icon-theme.cache ] ; then
132cdf0e10cSrcweir        # touch it, just in case we cannot find the binary...
133cdf0e10cSrcweir        touch /usr/share/icons/$theme
134cdf0e10cSrcweir        if [ -x /opt/gnome/bin/gtk-update-icon-cache ]; then
135cdf0e10cSrcweir            /opt/gnome/bin/gtk-update-icon-cache -q /usr/share/icons/$theme
136cdf0e10cSrcweir        elif (which gtk-update-icon-cache); then
137cdf0e10cSrcweir            gtk-update-icon-cache -q /usr/share/icons/$theme
138cdf0e10cSrcweir        fi
139cdf0e10cSrcweir        # ignore errors (e.g. when there is a cache, but no index.theme)
140cdf0e10cSrcweir        true
141cdf0e10cSrcweir    fi
142cdf0e10cSrcweirdone
143cdf0e10cSrcweir
144cdf0e10cSrcweir
145cdf0e10cSrcweir# update /etc/mime.types
146cdf0e10cSrcweir# backing out existing entries to avoid duplicates
147cdf0e10cSrcweirsed '
148cdf0e10cSrcweir/application\/vnd\.oasis\.opendocument/d
149cdf0e10cSrcweir/application\/vnd\.sun/d
150cdf0e10cSrcweir/application\/vnd\.stardivision/d
151cdf0e10cSrcweir/application\/vnd\.openofficeorg/d
152cdf0e10cSrcweir' /etc/mime.types 2>/dev/null >> /etc/mime.types.tmp$$
153cdf0e10cSrcweir
154cdf0e10cSrcweir# now append our stuff to the temporary file
155cdf0e10cSrcweircat >> /etc/mime.types.tmp$$ << END
156cdf0e10cSrcweirapplication/vnd.oasis.opendocument.text	odt
157cdf0e10cSrcweirapplication/vnd.oasis.opendocument.text-template ott
158cdf0e10cSrcweirapplication/vnd.oasis.opendocument.text-web oth
159cdf0e10cSrcweirapplication/vnd.oasis.opendocument.text-master odm
160cdf0e10cSrcweirapplication/vnd.oasis.opendocument.graphics odg
161cdf0e10cSrcweirapplication/vnd.oasis.opendocument.graphics-template otg
162cdf0e10cSrcweirapplication/vnd.oasis.opendocument.presentation odp
163cdf0e10cSrcweirapplication/vnd.oasis.opendocument.presentation-template otp
164cdf0e10cSrcweirapplication/vnd.oasis.opendocument.spreadsheet ods
165cdf0e10cSrcweirapplication/vnd.oasis.opendocument.spreadsheet-template ots
166cdf0e10cSrcweirapplication/vnd.oasis.opendocument.chart odc
167cdf0e10cSrcweirapplication/vnd.oasis.opendocument.formula odf
168cdf0e10cSrcweirapplication/vnd.oasis.opendocument.image odi
169cdf0e10cSrcweirapplication/vnd.sun.xml.writer sxw
170cdf0e10cSrcweirapplication/vnd.sun.xml.writer.template stw
171cdf0e10cSrcweirapplication/vnd.sun.xml.writer.global sxg
172cdf0e10cSrcweirapplication/vnd.stardivision.writer sdw vor
173cdf0e10cSrcweirapplication/vnd.stardivision.writer-global sgl
174cdf0e10cSrcweirapplication/vnd.sun.xml.calc sxc
175cdf0e10cSrcweirapplication/vnd.sun.xml.calc.template stc
176cdf0e10cSrcweirapplication/vnd.stardivision.calc sdc
177cdf0e10cSrcweirapplication/vnd.stardivision.chart sds
178cdf0e10cSrcweirapplication/vnd.sun.xml.impress sxi
179cdf0e10cSrcweirapplication/vnd.sun.xml.impress.template sti
180cdf0e10cSrcweirapplication/vnd.stardivision.impress sdd sdp
181cdf0e10cSrcweirapplication/vnd.sun.xml.draw sxd
182cdf0e10cSrcweirapplication/vnd.sun.xml.draw.template std
183cdf0e10cSrcweirapplication/vnd.stardivision.draw sda
184cdf0e10cSrcweirapplication/vnd.sun.xml.math sxm
185cdf0e10cSrcweirapplication/vnd.sun.xml.base odb
186cdf0e10cSrcweirapplication/vnd.stardivision.math smf
187cdf0e10cSrcweirapplication/vnd.openofficeorg.extension oxt
188cdf0e10cSrcweirapplication/vnd.openxmlformats-officedocument.wordprocessingml.document docx
189cdf0e10cSrcweirapplication/vnd.ms-word.document.macroenabled.12 docm
190cdf0e10cSrcweirapplication/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
191cdf0e10cSrcweirapplication/vnd.ms-word.template.macroenabled.12 dotm
192cdf0e10cSrcweirapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
193cdf0e10cSrcweirapplication/vnd.ms-excel.sheet.macroenabled.12 xlsm
194cdf0e10cSrcweirapplication/vnd.openxmlformats-officedocument.spreadsheetml.template xltx
195cdf0e10cSrcweirapplication/vnd.ms-excel.template.macroenabled.12 xltm
196cdf0e10cSrcweirapplication/vnd.openxmlformats-officedocument.presentationml.presentation pptx
197cdf0e10cSrcweirapplication/vnd.ms-powerpoint.presentation.macroenabled.12 pptm
198cdf0e10cSrcweirapplication/vnd.openxmlformats-officedocument.presentationml.template potx
199cdf0e10cSrcweirapplication/vnd.ms-powerpoint.template.macroenabled.12 potm
200cdf0e10cSrcweirEND
201cdf0e10cSrcweir
202cdf0e10cSrcweir# and replace the original file
203cdf0e10cSrcweirmv -f /etc/mime.types.tmp$$ /etc/mime.types 2>/dev/null
204cdf0e10cSrcweir
205cdf0e10cSrcweir# update /etc/mailcap only at initial install
206cdf0e10cSrcweirif [ "$1" = 1 ]
207cdf0e10cSrcweirthen
208cdf0e10cSrcweir  # backing out existing entries to avoid duplicates
209cdf0e10cSrcweir  sed '
210cdf0e10cSrcweir/^# OpenOffice.org/d
211cdf0e10cSrcweir/^application\/vnd\.oasis\.opendocument/d
212cdf0e10cSrcweir/^application\/vnd\.openofficeorg/d
213cdf0e10cSrcweir/^application\/vnd\.sun/d
214cdf0e10cSrcweir/^application\/vnd\.stardivision/d
215cdf0e10cSrcweir/^application\/vnd\.ms-word/d
216cdf0e10cSrcweir/^application\/vnd\.ms-excel/d
217cdf0e10cSrcweir/^application\/vnd\.ms-powerpoint/d
218cdf0e10cSrcweir/^application\/x-star/d
219cdf0e10cSrcweir/excel/d
220cdf0e10cSrcweir/ms[-]*word/d
221cdf0e10cSrcweir/powerpoint/d
222cdf0e10cSrcweir' /etc/mailcap 2>/dev/null >> /etc/mailcap.tmp$$
223cdf0e10cSrcweir
224cdf0e10cSrcweir  # now append our stuff to the temporary file
225cdf0e10cSrcweir  cat >> /etc/mailcap.tmp$$ << END
226bda541ebSArmin Le Grand# Apache OpenOffice
227cdf0e10cSrcweirapplication/vnd.oasis.opendocument.text; %unixfilename -view %s
228cdf0e10cSrcweirapplication/vnd.oasis.opendocument.text-template; %unixfilename -view %s
229cdf0e10cSrcweirapplication/vnd.oasis.opendocument.text-web; %unixfilename -view %s
230cdf0e10cSrcweirapplication/vnd.oasis.opendocument.text-master; %unixfilename -view %s
231cdf0e10cSrcweirapplication/vnd.sun.xml.writer; %unixfilename -view %s
232cdf0e10cSrcweirapplication/vnd.sun.xml.writer.template; %unixfilename -view %s
233cdf0e10cSrcweirapplication/vnd.sun.xml.writer.global; %unixfilename -view %s
234cdf0e10cSrcweirapplication/vnd.stardivision.writer; %unixfilename -view %s
235cdf0e10cSrcweirapplication/vnd.stardivision.writer-global; %unixfilename -view %s
236cdf0e10cSrcweirapplication/x-starwriter; %unixfilename -view %s
237cdf0e10cSrcweirapplication/vnd.oasis.opendocument.formula; %unixfilename -view %s
238cdf0e10cSrcweirapplication/vnd.sun.xml.math; %unixfilename -view %s
239cdf0e10cSrcweirapplication/vnd.stardivision.math; %unixfilename -view %s
240cdf0e10cSrcweirapplication/x-starmath; %unixfilename -view %s
241cdf0e10cSrcweirapplication/msword; %unixfilename -view %s
242cdf0e10cSrcweirapplication/vnd.oasis.opendocument.spreadsheet; %unixfilename -view %s
243cdf0e10cSrcweirapplication/vnd.oasis.opendocument.spreadsheet-template; %unixfilename -view %s
244cdf0e10cSrcweirapplication/vnd.sun.xml.calc; %unixfilename -view %s
245cdf0e10cSrcweirapplication/vnd.sun.xml.calc.template; %unixfilename -view %s
246cdf0e10cSrcweirapplication/vnd.stardivision.calc; %unixfilename -view %s
247cdf0e10cSrcweirapplication/x-starcalc; %unixfilename -view %s
248cdf0e10cSrcweirapplication/vnd.stardivision.chart; %unixfilename -view %s
249cdf0e10cSrcweirapplication/x-starchart; %unixfilename -view %s
250cdf0e10cSrcweirapplication/excel; %unixfilename -view %s
251cdf0e10cSrcweirapplication/msexcel; %unixfilename -view %s
252cdf0e10cSrcweirapplication/vnd.ms-excel; %unixfilename -view %s
253cdf0e10cSrcweirapplication/x-msexcel; %unixfilename -view %s
254cdf0e10cSrcweirapplication/vnd.oasis.opendocument.presentation; %unixfilename -view %s
255cdf0e10cSrcweirapplication/vnd.oasis.opendocument.presentation-template; %unixfilename -view %s
256cdf0e10cSrcweirapplication/vnd.sun.xml.impress; %unixfilename -view %s
257cdf0e10cSrcweirapplication/vnd.sun.xml.impress.template; %unixfilename -view %s
258cdf0e10cSrcweirapplication/vnd.stardivision.impress; %unixfilename -view %s
259cdf0e10cSrcweirapplication/x-starimpress; %unixfilename -view %s
260cdf0e10cSrcweirapplication/powerpoint; %unixfilename -view %s
261cdf0e10cSrcweirapplication/mspowerpoint; %unixfilename -view %s
262cdf0e10cSrcweirapplication/vnd.ms-powerpoint; %unixfilename -view %s
263cdf0e10cSrcweirapplication/x-mspowerpoint; %unixfilename -view %s
264cdf0e10cSrcweirapplication/vnd.oasis.opendocument.graphics; %unixfilename -view %s
265cdf0e10cSrcweirapplication/vnd.oasis.opendocument.graphics-template; %unixfilename -view %s
266cdf0e10cSrcweirapplication/vnd.sun.xml.draw; %unixfilename -view %s
267cdf0e10cSrcweirapplication/vnd.sun.xml.draw.template; %unixfilename -view %s
268cdf0e10cSrcweirapplication/vnd.stardivision.draw; %unixfilename -view %s
269cdf0e10cSrcweirapplication/x-stardraw; %unixfilename -view %s
270cdf0e10cSrcweirapplication/vnd.oasis.opendocument.database; %unixfilename -view %s
271cdf0e10cSrcweirapplication/vnd.sun.xml.base; %unixfilename -view %s
272cdf0e10cSrcweirapplication/vnd.openofficeorg.extension; %unixfilename %s
273cdf0e10cSrcweirapplication/vnd.openxmlformats-officedocument.wordprocessingml.document; %unixfilename -view %s
274cdf0e10cSrcweirapplication/vnd.ms-word.document.macroenabled.12;%unixfilename -view %s
275cdf0e10cSrcweirapplication/vnd.openxmlformats-officedocument.wordprocessingml.template; %unixfilename -view %s
276cdf0e10cSrcweirapplication/vnd.ms-word.template.macroenabled.12; %unixfilename -view %s
277cdf0e10cSrcweirapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet; %unixfilename -view %s
278cdf0e10cSrcweirapplication/vnd.ms-excel.sheet.macroenabled.12; %unixfilename -view %s
279cdf0e10cSrcweirapplication/vnd.openxmlformats-officedocument.spreadsheetml.template; %unixfilename -view %s
280cdf0e10cSrcweirapplication/vnd.ms-excel.template.macroenabled.12; %unixfilename -view %s
281cdf0e10cSrcweirapplication/vnd.openxmlformats-officedocument.presentationml.presentation; %unixfilename -view %s
282cdf0e10cSrcweirapplication/vnd.ms-powerpoint.presentation.macroenabled.12; %unixfilename -view %s
283cdf0e10cSrcweirapplication/vnd.openxmlformats-officedocument.presentationml.template; %unixfilename -view %s
284cdf0e10cSrcweirapplication/vnd.ms-powerpoint.template.macroenabled.12; %unixfilename -view %s
285cdf0e10cSrcweirEND
286cdf0e10cSrcweir
287cdf0e10cSrcweir  # and replace the original file
288cdf0e10cSrcweir  mv -f /etc/mailcap.tmp$$ /etc/mailcap
289cdf0e10cSrcweirfi
290cdf0e10cSrcweir
291cdf0e10cSrcweirif [ -x /opt/gnome/bin/update-desktop-database ]; then
292cdf0e10cSrcweir    /opt/gnome/bin/update-desktop-database -q
293cdf0e10cSrcweirelif (which update-desktop-database); then
294cdf0e10cSrcweir  update-desktop-database -q /usr/share/applications
295cdf0e10cSrcweirfi
296cdf0e10cSrcweir
297cdf0e10cSrcweir%preun
298cdf0e10cSrcweir# remove from /etc/mailcap only on de-install
299cdf0e10cSrcweirif [ "$1" = 0 ]
300cdf0e10cSrcweirthen
301cdf0e10cSrcweir  # backing all entries pointing to our binary
302cdf0e10cSrcweir  sed '/%unixfilename/d' /etc/mailcap 2>/dev/null >> /etc/mailcap.tmp$$
303cdf0e10cSrcweir
304cdf0e10cSrcweir  # and replace the original file
305cdf0e10cSrcweir  mv -f /etc/mailcap.tmp$$ /etc/mailcap
306cdf0e10cSrcweirfi
307cdf0e10cSrcweir
308cdf0e10cSrcweir%postun
309cdf0e10cSrcweirif [ "$1" = 0 ] ; then # only run when erasing the package - other cases handled by the triggers
310cdf0e10cSrcweir  if [ -x /opt/gnome/bin/update-desktop-database ]; then
311cdf0e10cSrcweir    /opt/gnome/bin/update-desktop-database -q
312cdf0e10cSrcweir  elif (which update-desktop-database); then
313cdf0e10cSrcweir    update-desktop-database -q
314cdf0e10cSrcweir  fi
315cdf0e10cSrcweir# run always - both when upgrading as well as when erasing the package
316cdf0e10cSrcweir  if (which update-mime-database); then
317cdf0e10cSrcweir    update-mime-database /usr/share/mime
318cdf0e10cSrcweir  fi
319cdf0e10cSrcweirfi
320cdf0e10cSrcweir
321cdf0e10cSrcweir#run always
322cdf0e10cSrcweirfor theme in gnome hicolor locolor; do
323cdf0e10cSrcweir  if [ -e /usr/share/icons/$theme/icon-theme.cache ] ; then
324cdf0e10cSrcweir   # touch it, just in case we cannot find the binary...
325cdf0e10cSrcweir    touch /usr/share/icons/$theme
326cdf0e10cSrcweir    if [ -x /opt/gnome/bin/gtk-update-icon-cache ]; then
327cdf0e10cSrcweir      /opt/gnome/bin/gtk-update-icon-cache -q /usr/share/icons/$theme
328cdf0e10cSrcweir    elif (which gtk-update-icon-cache); then
329cdf0e10cSrcweir      gtk-update-icon-cache -q /usr/share/icons/$theme
330cdf0e10cSrcweir    fi
331cdf0e10cSrcweir    # ignore errors (e.g. when there is a cache, but no index.theme)
332cdf0e10cSrcweir    true
333cdf0e10cSrcweir  fi
334cdf0e10cSrcweirdone
335cdf0e10cSrcweir
336cdf0e10cSrcweir%files
337cdf0e10cSrcweir# specify stale symlinks verbatim, not as glob - a change in recent versions of
338cdf0e10cSrcweir# glibc breaks rpm unless rpm is build with internal glob-matching (issue 49374)
339cdf0e10cSrcweir# https://bugzilla.redhat.com/beta/show_bug.cgi?id=134362
340cdf0e10cSrcweir%defattr(-, root, root)
341cdf0e10cSrcweir%attr(0755, root, root) /usr/bin/*
342cdf0e10cSrcweir/usr/share/applications/%unixfilename-base.desktop
343cdf0e10cSrcweir/usr/share/applications/%unixfilename-calc.desktop
344cdf0e10cSrcweir/usr/share/applications/%unixfilename-draw.desktop
345cdf0e10cSrcweir/usr/share/applications/%unixfilename-impress.desktop
346cdf0e10cSrcweir/usr/share/applications/%unixfilename-math.desktop
347cdf0e10cSrcweir/usr/share/applications/%unixfilename-printeradmin.desktop
348cdf0e10cSrcweir/usr/share/applications/%unixfilename-writer.desktop
349cdf0e10cSrcweir/usr/share/applications/%unixfilename-startcenter.desktop
350cdf0e10cSrcweir/usr/share/applications/%unixfilename-javafilter.desktop
351cdf0e10cSrcweir/usr/share/icons/gnome/*/apps/*png
352cdf0e10cSrcweir/usr/share/icons/gnome/*/mimetypes/*png
353cdf0e10cSrcweir/usr/share/icons/hicolor/*/apps/*png
354cdf0e10cSrcweir/usr/share/icons/hicolor/*/mimetypes/*png
355cdf0e10cSrcweir/usr/share/icons/locolor/*/apps/*png
356cdf0e10cSrcweir/usr/share/icons/locolor/*/mimetypes/*png
357cdf0e10cSrcweir/usr/share/mime/packages/*
358