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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 231210 - (show annotations) (download)
Tue Apr 17 15:49:11 2012 UTC (12 years ago) by anssi
File size: 12347 byte(s)
- new version 11.2.202.233
  o bugfixes related to stability and performance

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

  ViewVC Help
Powered by ViewVC 1.1.30