/[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 166421 - (hide annotations) (download)
Thu Nov 10 23:54:00 2011 UTC (12 years, 5 months ago) by anssi
File size: 12855 byte(s)
- prevent installation of -kde in %pre if main package installation
  was prevented by its %pre

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

  ViewVC Help
Powered by ViewVC 1.1.30