/[packages]/cauldron/flash-player-plugin/current/SPECS/flash-player-plugin.spec
ViewVC logotype

Annotation of /cauldron/flash-player-plugin/current/SPECS/flash-player-plugin.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 258412 - (hide annotations) (download)
Sat Jun 9 11:11:11 2012 UTC (11 years, 10 months ago) by anssi
File size: 13339 byte(s)
- require libraries by file names instead of package names (suggested
  by simplew, fixes #5824 (unable to use libcairo-xcb2))

1 anssi 258412 %ifarch x86_64
2     %define bitmark ()(64bit)
3     %else
4     %define bitmark %nil
5     %endif
6    
7 ennael 89107 Summary: Flash Player plugin for browsers
8 doktor5000 151537 Name: flash-player-plugin
9 anssi 234712 Version: 11.2.202.235
10 anssi 210094 Release: %mkrel 1
11 ennael 89107 License: Proprietary
12     URL: http://www.adobe.com/products/flashplayer/
13     Group: Networking/WWW
14 doktor5000 151631 ExclusiveArch: %ix86 x86_64
15 anssi 134274 Requires(pre): curl
16 ennael 89107
17 anssi 258412 # helper for getting requires:
18     # for i in $(objdump -p libflashplayer.so | grep NEEDED | awk '{ print $2 }' | grep -v ld-linux); do echo "Requires: $i%{bitmark}"; done
19     Requires: libatk-1.0.so.0%{bitmark}
20     Requires: libcairo.so.2%{bitmark}
21     Requires: libc.so.6%{bitmark}
22     Requires: libdl.so.2%{bitmark}
23     Requires: libfontconfig.so.1%{bitmark}
24     Requires: libfreetype.so.6%{bitmark}
25     Requires: libgdk_pixbuf-2.0.so.0%{bitmark}
26     Requires: libgdk-x11-2.0.so.0%{bitmark}
27     Requires: libglib-2.0.so.0%{bitmark}
28     Requires: libgmodule-2.0.so.0%{bitmark}
29     Requires: libgobject-2.0.so.0%{bitmark}
30     Requires: libgthread-2.0.so.0%{bitmark}
31     Requires: libgtk-x11-2.0.so.0%{bitmark}
32     Requires: libm.so.6%{bitmark}
33     Requires: libnspr4.so%{bitmark}
34     Requires: libnss3.so%{bitmark}
35     Requires: libnssutil3.so%{bitmark}
36     Requires: libpango-1.0.so.0%{bitmark}
37     Requires: libpangocairo-1.0.so.0%{bitmark}
38     Requires: libpangoft2-1.0.so.0%{bitmark}
39     Requires: libplc4.so%{bitmark}
40     Requires: libplds4.so%{bitmark}
41     Requires: libpthread.so.0%{bitmark}
42     Requires: librt.so.1%{bitmark}
43     Requires: libsmime3.so%{bitmark}
44     Requires: libssl3.so%{bitmark}
45     Requires: libX11.so.6%{bitmark}
46     Requires: libXcursor.so.1%{bitmark}
47     Requires: libXext.so.6%{bitmark}
48     Requires: libXrender.so.1%{bitmark}
49     Requires: libXt.so.6%{bitmark}
50     # end of helper produced requires
51    
52 ennael 89107 # required for audio, dlopened:
53 anssi 258412 Requires: libasound.so.2%{bitmark}
54 ennael 89107 # dlopened:
55 anssi 258412 Requires: libcurl.so.4%{bitmark}
56 ennael 89107 # dlopened, for video acceleration:
57 anssi 258412 Suggests: libvdpau.so.1%{bitmark}
58 ennael 89107 #
59     Conflicts: FlashPlayer < 9.0.115.0-5
60     Conflicts: flash-plugin FlashPlayer-plugin flashplayer-plugin
61     # Conflict with free plugins to avoid user confusion as to which one is
62     # actually used:
63     Conflicts: gnash-firefox-plugin
64     Conflicts: swfdec-mozilla
65     Conflicts: lightspark-mozilla-plugin
66     Conflicts: libflashsupport < 0.20080000.1
67     Obsoletes: flash-player-plugin10.2 < 10.2.152
68 doktor5000 151537 Provides: flash-player-plugin11
69     Obsoletes: flash-player-plugin11
70 anssi 98265 BuildRequires: kde4-macros
71 ennael 89107 BuildRoot: %{_tmppath}/%{name}-root
72    
73     %description
74     Adobe Flash Player plugin for browsers.
75    
76     NOTE: This package does not contain the Flash Player itself. The
77 doktor5000 151537 software will be automatically downloaded from Adobe during package
78     installation.
79 ennael 89107
80 anssi 152188 Installing this package indicates acceptance of the Flash Player EULA,
81 anssi 152244 available at http://www.adobe.com/products/eulas/players/flash/
82     %ifnarch x86_64
83     and as %{_libdir}/mozilla/plugins/LICENSE.flashplayer.
84     %endif
85 ennael 89107
86 anssi 134274 # It would be preferable to have the KCM module in the main package with
87     # simply not requiring any kde stuff. However, standard KDE installation
88     # doesn't necessary include libkutils4. - Anssi 08/2011
89     %package kde
90     Summary: Flash Player KDE settings module
91     Group: Networking/WWW
92     Requires: %{name} = %{version}-%{release}
93     Requires(post): %{name} = %{version}-%{release}
94 anssi 258412 # helper for getting requires:
95     # for i in $(objdump -p kcm_adobe_flash_player.so | grep NEEDED | awk '{ print $2 }' | grep -v ld-linux); do echo "Requires: $i%{bitmark}"; done
96     Requires: libc.so.6%{bitmark}
97     Requires: libICE.so.6%{bitmark}
98     Requires: libkdecore.so.5%{bitmark}
99     Requires: libkdeui.so.5%{bitmark}
100     Requires: libkutils.so.4%{bitmark}
101     Requires: libm.so.6%{bitmark}
102     Requires: libpthread.so.0%{bitmark}
103     Requires: libQtCore.so.4%{bitmark}
104     Requires: libQtDBus.so.4%{bitmark}
105     Requires: libQtGui.so.4%{bitmark}
106     Requires: libQtSvg.so.4%{bitmark}
107     Requires: libSM.so.6%{bitmark}
108     Requires: libX11.so.6%{bitmark}
109     Requires: libXau.so.6%{bitmark}
110     Requires: libXdmcp.so.6%{bitmark}
111     Requires: libXext.so.6%{bitmark}
112     Requires: libXft.so.2%{bitmark}
113     Requires: libXpm.so.4%{bitmark}
114     # end of helper produced requires
115 anssi 134274 Conflicts: flash-player-plugin < 10.3.183.5
116 doktor5000 151537 Provides: flash-player-plugin11-kde
117     Obsoletes: flash-player-plugin11-kde
118 anssi 134274
119     %description kde
120     KDE settings module for Adobe Flash Player.
121    
122     NOTE: This package does not contain the software itself. The
123     software will be automatically downloaded from the Adobe server
124 doktor5000 151537 during package installation.
125 anssi 134274
126 anssi 152188 Installing this package indicates acceptance of the Flash Player EULA,
127 anssi 152244 available at http://www.adobe.com/products/eulas/players/flash/
128     %ifnarch x86_64
129     and as %{_libdir}/mozilla/plugins/LICENSE.flashplayer.
130     %endif
131 anssi 134274
132 ennael 89107 %prep
133     %setup -c -T
134    
135 anssi 152244 # Always prefer versioned archives instead of unversioned ones, so that when
136     # Adobe updates the Flash Player, the old md5sum continues to work until
137     # this package is updated for the new version.
138    
139 doktor5000 151631 # The linuxdownload.adobe.com rpm usually stays up longer, but fpdownload.macromedia.com is faster.
140     # Their md5sums usually differ.
141    
142 doktor5000 151537 %ifarch %ix86
143 anssi 166427 %define downurl1 http://fpdownload.macromedia.com/get/flashplayer/pdc/%{version}/flash-plugin-%{version}-release.i386.rpm
144 anssi 234712 %define tmd5sum1 6f6155e9265667e9a2aea094e62dc71b
145     %define downurl2 %nil
146     %define tmd5sum2 %nil
147     # 404 as of 2012-05-04, repo up-to-date with latest version
148     #define downurl2 http://linuxdownload.adobe.com/linux/i386/flash-plugin-%{version}-release.i386.rpm
149     #define tmd5sum2 4b6accab17a6bdf923f5f6044ad596a5
150 anssi 152244 %define downurl3 %nil
151     %define tmd5sum3 %nil
152     %define tarname flash-plugin-%{version}-release.i386.rpm
153    
154     %define warn_on_missing_files 1
155 doktor5000 151537 %endif
156 anssi 134330
157 doktor5000 151537 %ifarch x86_64
158 anssi 166427 %define downurl1 http://fpdownload.macromedia.com/get/flashplayer/pdc/%{version}/flash-plugin-%{version}-release.x86_64.rpm
159 anssi 234712 %define tmd5sum1 7de9b66be1e4c1078f9e048e3f6982a8
160     %define downurl2 %nil
161     %define tmd5sum2 %nil
162     # 404 as of 2012-05-04, repo up-to-date with latest version
163     #define downurl2 http://linuxdownload.adobe.com/linux/x86_64/flash-plugin-%{version}-release.x86_64.rpm
164     #define tmd5sum2 bd6b80a34e870093fb78bae99ff97ca5
165 anssi 166427 %define downurl3 %nil
166     %define downurl3 %nil
167 anssi 152244 %define tarname flash-plugin-%{version}-release.x86_64.rpm
168    
169 anssi 166427 %define warn_on_missing_files 1
170 ennael 89107 %endif
171    
172 anssi 134274 %define file %{_localstatedir}/lib/%{name}/%{tarname}
173    
174     %install
175     rm -rf %{buildroot}
176    
177     install -d -m755 %{buildroot}%{_localstatedir}/lib/%{name}
178     install -d -m755 %{buildroot}%{_libdir}/mozilla/plugins
179     touch %{buildroot}%{_libdir}/mozilla/plugins/libflashplayer.so
180 doktor5000 151631 touch %{buildroot}%{_libdir}/mozilla/plugins/LICENSE.flashplayer
181     touch %{buildroot}%{_libdir}/mozilla/plugins/README.flashplayer
182 anssi 134274 touch %{buildroot}%{_localstatedir}/lib/%{name}/%{tarname}
183    
184     install -d -m755 %{buildroot}%{_bindir}
185     touch %{buildroot}%{_bindir}/flash-player-properties
186    
187     install -d -m755 %{buildroot}%{_kde_services}
188     touch %{buildroot}%{_kde_services}/kcm_adobe_flash_player.desktop
189     install -d -m755 %{buildroot}%{_kde_libdir}/kde4
190     touch %{buildroot}%{_kde_libdir}/kde4/kcm_adobe_flash_player.so
191    
192     install -d -m755 %{buildroot}%{_datadir}/applications
193     touch %{buildroot}%{_datadir}/applications/flash-player-properties.desktop
194    
195     for i in 16 22 24 32 48; do
196     install -d -m755 %{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps
197     touch %{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps/flash-player-properties.png
198     done
199    
200     install -d -m755 %{buildroot}%{_datadir}/%{name}
201     cat > %{buildroot}%{_datadir}/%{name}/functions << EOF
202 anssi 152244 next_file() {
203     FILENUM=\$((FILENUM+1))
204     eval FILE_SRC="\\\$FILE\${FILENUM}_SRC"
205     eval FILE_DST="\\\$FILE\${FILENUM}_DST"
206     eval FILE_PRM="\\\$FILE\${FILENUM}_PRM"
207     [ -n "\$FILE_SRC" ]
208     }
209    
210 anssi 134274 tar_extract() {
211 doktor5000 151631 extractdir=\$(mktemp -d --tmpdir=/tmp)
212 anssi 134274 if [ -z "\$extractdir" ]; then
213     echo "Error during extraction." >&2
214     exit 1
215     fi
216    
217     cd "\$extractdir" || exit 1
218 anssi 152244
219     if [ "\$(head -c4 "%file")" = \$'\\xED\\xAB\\xEE\\xDB' ]; then
220     rpm2cpio "%file" | cpio -i --quiet -d -R root:root
221     else
222     tar -xzf "%file" --no-same-owner --no-same-permissions
223     fi
224    
225     # Avoid leaving old files in case of failure below
226     FILENUM=0
227     while next_file; do
228     rm -f "\$FILE_DST"
229     done
230    
231     FILENUM=0
232     while next_file; do
233     if [ ! -f "\$FILE_SRC" ]; then
234     %if %warn_on_missing_files
235     echo "Warning: \$FILE_SRC not found in the Flash Player archive," >&2
236     echo " skipping installation of \$FILE_DST." >&2
237     echo " Please file a bug report at https://bugs.mageia.org/ ." >&2
238 anssi 134274 %endif
239 anssi 152244 continue
240     fi
241    
242 anssi 141931 chmod "\$FILE_PRM" "\$FILE_SRC"
243 anssi 134274 mv -f "\$FILE_SRC" "\$FILE_DST"
244     done
245     rm -rf "\$extractdir"
246     }
247     EOF
248    
249     %clean
250     rm -rf %{buildroot}
251    
252     %pre
253     checkmd5sum() {
254     [ -e "$1" ] || return 1
255     FILEMD5="$(md5sum $1 | cut -d" " -f1)"
256     [ -n "$FILEMD5" ] || return 1
257     MD5NUM=1
258     eval MD5SUM="\$MD5SUM$MD5NUM"
259     while [ "$MD5SUM" ]; do
260     [ "$MD5SUM" = "$FILEMD5" ] && return 0
261     MD5NUM=$((MD5NUM+1))
262     eval MD5SUM="\$MD5SUM$MD5NUM"
263     done
264     return 1
265     }
266 anssi 182382
267     get_proxy_from_urpmi() {
268     if [ -e /etc/urpmi/proxy.cfg ]; then
269     proxy="$(grep ^http_proxy= /etc/urpmi/proxy.cfg 2>/dev/null)"
270     proxy_user="$(grep ^proxy_user= /etc/urpmi/proxy.cfg 2>/dev/null)"
271    
272     proxy="${proxy#http_proxy=}"
273     proxy_user="${proxy_user#proxy_user=}"
274    
275     [ -n "$proxy" ] && echo "--proxy $proxy"
276     [ -n "$proxy_user" ] && echo "--proxy-user $proxy_user"
277     fi
278     }
279    
280 ennael 89107 MD5SUM1="%{tmd5sum1}"
281     MD5SUM2="%{tmd5sum2}"
282 anssi 152244 MD5SUM3="%{tmd5sum3}"
283     MD5SUM4=
284 ennael 89107 URL1="%{downurl1}"
285     URL2="%{downurl2}"
286 anssi 152244 URL3="%{downurl3}"
287     URL4=
288 anssi 134274
289     URLNUM=1
290    
291     install -d -m 0755 %{_localstatedir}/lib/%{name}
292    
293     echo "Note that by downloading the Adobe Flash Player you indicate your acceptance of"
294 anssi 152188 echo "the EULA, available at http://www.adobe.com/products/eulas/players/flash/"
295 anssi 134274 while ! checkmd5sum "%file"; do
296     eval URL="\$URL$URLNUM"
297     if [ -z "$URL" ]; then
298     echo "Error: Unable to download Flash Player. This is likely due to this package" >&2
299     echo " being too old. Please file a bug report at https://bugs.mageia.org" >&2
300     echo " so that the package gets updated. Thank you." >&2
301     echo "" >&2
302     echo " In the meantime, you can download Flash Player manually from" >&2
303     echo " http://get.adobe.com/flashplayer/" >&2
304 doktor5000 151631 rm -f "%file"
305     [ "$(ls -A "%{_localstatedir}/lib/%{name}")" ] && rm -rf "%{_localstatedir}/lib/%{name}"
306 anssi 134274 exit 1
307     fi
308     URLNUM=$((URLNUM+1))
309     echo "Downloading from $URL:"
310 anssi 182382 curl --connect-timeout 20 -m 10800 -L $(get_proxy_from_urpmi) "$URL" > "%file"
311 anssi 134274 done
312    
313     %post
314 doktor5000 151631 FILE1_SRC="usr/%{_lib}/flash-plugin/libflashplayer.so"
315 ennael 89107 FILE1_DST="%{_libdir}/mozilla/plugins/libflashplayer.so"
316 anssi 141931 FILE1_PRM="0755"
317 anssi 152188 FILE2_SRC="usr/%{_lib}/flash-plugin/LICENSE"
318 doktor5000 151631 FILE2_DST="%{_libdir}/mozilla/plugins/LICENSE.flashplayer"
319     FILE2_PRM="0644"
320     FILE3_SRC="usr/%{_lib}/flash-plugin/README"
321     FILE3_DST="%{_libdir}/mozilla/plugins/README.flashplayer"
322 anssi 141931 FILE3_PRM="0644"
323 anssi 98265
324 anssi 152188 FILE4_SRC="usr/bin/flash-player-properties"
325     FILE4_DST="%{_bindir}/flash-player-properties"
326     FILE4_PRM="0755"
327     FILE5_SRC="usr/share/applications/flash-player-properties.desktop"
328     FILE5_DST="%{_datadir}/applications/flash-player-properties.desktop"
329     FILE5_PRM="0644"
330 anssi 98265
331 anssi 152188 FILE6_SRC="usr/share/icons/hicolor/16x16/apps/flash-player-properties.png"
332     FILE6_DST="%{_iconsdir}/hicolor/16x16/apps/flash-player-properties.png"
333     FILE6_PRM="0644"
334     FILE7_SRC="usr/share/icons/hicolor/22x22/apps/flash-player-properties.png"
335     FILE7_DST="%{_iconsdir}/hicolor/22x22/apps/flash-player-properties.png"
336     FILE7_PRM="0644"
337     FILE8_SRC="usr/share/icons/hicolor/24x24/apps/flash-player-properties.png"
338     FILE8_DST="%{_iconsdir}/hicolor/24x24/apps/flash-player-properties.png"
339     FILE8_PRM="0644"
340     FILE9_SRC="usr/share/icons/hicolor/32x32/apps/flash-player-properties.png"
341     FILE9_DST="%{_iconsdir}/hicolor/32x32/apps/flash-player-properties.png"
342     FILE9_PRM="0644"
343     FILE10_SRC="usr/share/icons/hicolor/48x48/apps/flash-player-properties.png"
344     FILE10_DST="%{_iconsdir}/hicolor/48x48/apps/flash-player-properties.png"
345     FILE10_PRM="0644"
346     FILE11_SRC=
347    
348 anssi 134274 . %{_datadir}/%{name}/functions
349     tar_extract
350 anssi 98265
351 anssi 134274 # show in KDE as well (in case user doesn't have -kde subpkg
352 anssi 152244 sed -i 's,NotShowIn=KDE;,,' %{_datadir}/applications/flash-player-properties.desktop 2>/dev/null || :
353 anssi 134274 # otherwise KDE hides it:
354 anssi 152244 sed -i 's,GNOME;,,' %{_datadir}/applications/flash-player-properties.desktop 2>/dev/null || :
355 anssi 98265
356 anssi 152188 echo "Adobe Flash Player installation successful."
357 ennael 89107
358 anssi 166421 %pre kde
359     # When installing both main package and -kde, failure of %pre of main package
360     # can prevent installation of it, but urpmi/rpm will try to install -kde
361     # regardless. FIXME.
362     # For now, workaround it by preventing -kde installation as well:
363     [ -e %{_datadir}/%{name}/functions ]
364 ennael 89107
365 anssi 134274 %post kde
366 doktor5000 151631 FILE1_SRC="usr/%{_lib}/kde4/kcm_adobe_flash_player.so"
367 anssi 134274 FILE1_DST="%{_kde_libdir}/kde4/kcm_adobe_flash_player.so"
368 anssi 141931 FILE1_PRM="0755"
369 anssi 134274 FILE2_SRC="usr/share/kde4/services/kcm_adobe_flash_player.desktop"
370     FILE2_DST="%{_kde_services}/kcm_adobe_flash_player.desktop"
371 anssi 141931 FILE2_PRM="0644"
372     FILE3_SRC=
373 ennael 89107
374 anssi 134274 . %{_datadir}/%{name}/functions
375     tar_extract
376 ennael 89107
377 anssi 152244 sed -i 's,=personal,=network-and-connectivity,' %{_kde_services}/kcm_adobe_flash_player.desktop 2>/dev/null || :
378 ennael 89107
379     %files
380 doktor5000 151537
381 ennael 89107 %dir %{_localstatedir}/lib/%{name}
382     %ghost %{_localstatedir}/lib/%{name}/%{tarname}
383 anssi 134274 %dir %{_datadir}/%{name}
384     %{_datadir}/%{name}/functions
385    
386 ennael 89107 %dir %{_libdir}/mozilla
387     %dir %{_libdir}/mozilla/plugins
388     %ghost %{_libdir}/mozilla/plugins/libflashplayer.so
389 doktor5000 151631 %ghost %{_libdir}/mozilla/plugins/LICENSE.flashplayer
390     %ghost %{_libdir}/mozilla/plugins/README.flashplayer
391 ennael 89107
392 anssi 98265 %ghost %{_bindir}/flash-player-properties
393     %ghost %{_datadir}/applications/flash-player-properties.desktop
394     %ghost %{_iconsdir}/hicolor/*/apps/flash-player-properties.png
395 ennael 89107
396 anssi 134274 %files kde
397     %defattr(-,root,root)
398 anssi 98265 %ghost %{_kde_libdir}/kde4/kcm_adobe_flash_player.so
399     %ghost %{_kde_services}/kcm_adobe_flash_player.desktop

  ViewVC Help
Powered by ViewVC 1.1.30