1 |
Summary: Flash Player plugin for browsers |
2 |
Name: flash-player-plugin |
3 |
Version: 11.2.202.235 |
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 6f6155e9265667e9a2aea094e62dc71b |
115 |
%define downurl2 %nil |
116 |
%define tmd5sum2 %nil |
117 |
# 404 as of 2012-05-04, repo up-to-date with latest version |
118 |
#define downurl2 http://linuxdownload.adobe.com/linux/i386/flash-plugin-%{version}-release.i386.rpm |
119 |
#define tmd5sum2 4b6accab17a6bdf923f5f6044ad596a5 |
120 |
%define downurl3 %nil |
121 |
%define tmd5sum3 %nil |
122 |
%define tarname flash-plugin-%{version}-release.i386.rpm |
123 |
|
124 |
%define warn_on_missing_files 1 |
125 |
%endif |
126 |
|
127 |
%ifarch x86_64 |
128 |
%define downurl1 http://fpdownload.macromedia.com/get/flashplayer/pdc/%{version}/flash-plugin-%{version}-release.x86_64.rpm |
129 |
%define tmd5sum1 7de9b66be1e4c1078f9e048e3f6982a8 |
130 |
%define downurl2 %nil |
131 |
%define tmd5sum2 %nil |
132 |
# 404 as of 2012-05-04, repo up-to-date with latest version |
133 |
#define downurl2 http://linuxdownload.adobe.com/linux/x86_64/flash-plugin-%{version}-release.x86_64.rpm |
134 |
#define tmd5sum2 bd6b80a34e870093fb78bae99ff97ca5 |
135 |
%define downurl3 %nil |
136 |
%define downurl3 %nil |
137 |
%define tarname flash-plugin-%{version}-release.x86_64.rpm |
138 |
|
139 |
%define warn_on_missing_files 1 |
140 |
%endif |
141 |
|
142 |
%define file %{_localstatedir}/lib/%{name}/%{tarname} |
143 |
|
144 |
%install |
145 |
rm -rf %{buildroot} |
146 |
|
147 |
install -d -m755 %{buildroot}%{_localstatedir}/lib/%{name} |
148 |
install -d -m755 %{buildroot}%{_libdir}/mozilla/plugins |
149 |
touch %{buildroot}%{_libdir}/mozilla/plugins/libflashplayer.so |
150 |
touch %{buildroot}%{_libdir}/mozilla/plugins/LICENSE.flashplayer |
151 |
touch %{buildroot}%{_libdir}/mozilla/plugins/README.flashplayer |
152 |
touch %{buildroot}%{_localstatedir}/lib/%{name}/%{tarname} |
153 |
|
154 |
install -d -m755 %{buildroot}%{_bindir} |
155 |
touch %{buildroot}%{_bindir}/flash-player-properties |
156 |
|
157 |
install -d -m755 %{buildroot}%{_kde_services} |
158 |
touch %{buildroot}%{_kde_services}/kcm_adobe_flash_player.desktop |
159 |
install -d -m755 %{buildroot}%{_kde_libdir}/kde4 |
160 |
touch %{buildroot}%{_kde_libdir}/kde4/kcm_adobe_flash_player.so |
161 |
|
162 |
install -d -m755 %{buildroot}%{_datadir}/applications |
163 |
touch %{buildroot}%{_datadir}/applications/flash-player-properties.desktop |
164 |
|
165 |
for i in 16 22 24 32 48; do |
166 |
install -d -m755 %{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps |
167 |
touch %{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps/flash-player-properties.png |
168 |
done |
169 |
|
170 |
install -d -m755 %{buildroot}%{_datadir}/%{name} |
171 |
cat > %{buildroot}%{_datadir}/%{name}/functions << EOF |
172 |
next_file() { |
173 |
FILENUM=\$((FILENUM+1)) |
174 |
eval FILE_SRC="\\\$FILE\${FILENUM}_SRC" |
175 |
eval FILE_DST="\\\$FILE\${FILENUM}_DST" |
176 |
eval FILE_PRM="\\\$FILE\${FILENUM}_PRM" |
177 |
[ -n "\$FILE_SRC" ] |
178 |
} |
179 |
|
180 |
tar_extract() { |
181 |
extractdir=\$(mktemp -d --tmpdir=/tmp) |
182 |
if [ -z "\$extractdir" ]; then |
183 |
echo "Error during extraction." >&2 |
184 |
exit 1 |
185 |
fi |
186 |
|
187 |
cd "\$extractdir" || exit 1 |
188 |
|
189 |
if [ "\$(head -c4 "%file")" = \$'\\xED\\xAB\\xEE\\xDB' ]; then |
190 |
rpm2cpio "%file" | cpio -i --quiet -d -R root:root |
191 |
else |
192 |
tar -xzf "%file" --no-same-owner --no-same-permissions |
193 |
fi |
194 |
|
195 |
# Avoid leaving old files in case of failure below |
196 |
FILENUM=0 |
197 |
while next_file; do |
198 |
rm -f "\$FILE_DST" |
199 |
done |
200 |
|
201 |
FILENUM=0 |
202 |
while next_file; do |
203 |
if [ ! -f "\$FILE_SRC" ]; then |
204 |
%if %warn_on_missing_files |
205 |
echo "Warning: \$FILE_SRC not found in the Flash Player archive," >&2 |
206 |
echo " skipping installation of \$FILE_DST." >&2 |
207 |
echo " Please file a bug report at https://bugs.mageia.org/ ." >&2 |
208 |
%endif |
209 |
continue |
210 |
fi |
211 |
|
212 |
chmod "\$FILE_PRM" "\$FILE_SRC" |
213 |
mv -f "\$FILE_SRC" "\$FILE_DST" |
214 |
done |
215 |
rm -rf "\$extractdir" |
216 |
} |
217 |
EOF |
218 |
|
219 |
%clean |
220 |
rm -rf %{buildroot} |
221 |
|
222 |
%pre |
223 |
checkmd5sum() { |
224 |
[ -e "$1" ] || return 1 |
225 |
FILEMD5="$(md5sum $1 | cut -d" " -f1)" |
226 |
[ -n "$FILEMD5" ] || return 1 |
227 |
MD5NUM=1 |
228 |
eval MD5SUM="\$MD5SUM$MD5NUM" |
229 |
while [ "$MD5SUM" ]; do |
230 |
[ "$MD5SUM" = "$FILEMD5" ] && return 0 |
231 |
MD5NUM=$((MD5NUM+1)) |
232 |
eval MD5SUM="\$MD5SUM$MD5NUM" |
233 |
done |
234 |
return 1 |
235 |
} |
236 |
|
237 |
get_proxy_from_urpmi() { |
238 |
if [ -e /etc/urpmi/proxy.cfg ]; then |
239 |
proxy="$(grep ^http_proxy= /etc/urpmi/proxy.cfg 2>/dev/null)" |
240 |
proxy_user="$(grep ^proxy_user= /etc/urpmi/proxy.cfg 2>/dev/null)" |
241 |
|
242 |
proxy="${proxy#http_proxy=}" |
243 |
proxy_user="${proxy_user#proxy_user=}" |
244 |
|
245 |
[ -n "$proxy" ] && echo "--proxy $proxy" |
246 |
[ -n "$proxy_user" ] && echo "--proxy-user $proxy_user" |
247 |
fi |
248 |
} |
249 |
|
250 |
MD5SUM1="%{tmd5sum1}" |
251 |
MD5SUM2="%{tmd5sum2}" |
252 |
MD5SUM3="%{tmd5sum3}" |
253 |
MD5SUM4= |
254 |
URL1="%{downurl1}" |
255 |
URL2="%{downurl2}" |
256 |
URL3="%{downurl3}" |
257 |
URL4= |
258 |
|
259 |
URLNUM=1 |
260 |
|
261 |
install -d -m 0755 %{_localstatedir}/lib/%{name} |
262 |
|
263 |
echo "Note that by downloading the Adobe Flash Player you indicate your acceptance of" |
264 |
echo "the EULA, available at http://www.adobe.com/products/eulas/players/flash/" |
265 |
while ! checkmd5sum "%file"; do |
266 |
eval URL="\$URL$URLNUM" |
267 |
if [ -z "$URL" ]; then |
268 |
echo "Error: Unable to download Flash Player. This is likely due to this package" >&2 |
269 |
echo " being too old. Please file a bug report at https://bugs.mageia.org" >&2 |
270 |
echo " so that the package gets updated. Thank you." >&2 |
271 |
echo "" >&2 |
272 |
echo " In the meantime, you can download Flash Player manually from" >&2 |
273 |
echo " http://get.adobe.com/flashplayer/" >&2 |
274 |
rm -f "%file" |
275 |
[ "$(ls -A "%{_localstatedir}/lib/%{name}")" ] && rm -rf "%{_localstatedir}/lib/%{name}" |
276 |
exit 1 |
277 |
fi |
278 |
URLNUM=$((URLNUM+1)) |
279 |
echo "Downloading from $URL:" |
280 |
curl --connect-timeout 20 -m 10800 -L $(get_proxy_from_urpmi) "$URL" > "%file" |
281 |
done |
282 |
|
283 |
%post |
284 |
FILE1_SRC="usr/%{_lib}/flash-plugin/libflashplayer.so" |
285 |
FILE1_DST="%{_libdir}/mozilla/plugins/libflashplayer.so" |
286 |
FILE1_PRM="0755" |
287 |
FILE2_SRC="usr/%{_lib}/flash-plugin/LICENSE" |
288 |
FILE2_DST="%{_libdir}/mozilla/plugins/LICENSE.flashplayer" |
289 |
FILE2_PRM="0644" |
290 |
FILE3_SRC="usr/%{_lib}/flash-plugin/README" |
291 |
FILE3_DST="%{_libdir}/mozilla/plugins/README.flashplayer" |
292 |
FILE3_PRM="0644" |
293 |
|
294 |
FILE4_SRC="usr/bin/flash-player-properties" |
295 |
FILE4_DST="%{_bindir}/flash-player-properties" |
296 |
FILE4_PRM="0755" |
297 |
FILE5_SRC="usr/share/applications/flash-player-properties.desktop" |
298 |
FILE5_DST="%{_datadir}/applications/flash-player-properties.desktop" |
299 |
FILE5_PRM="0644" |
300 |
|
301 |
FILE6_SRC="usr/share/icons/hicolor/16x16/apps/flash-player-properties.png" |
302 |
FILE6_DST="%{_iconsdir}/hicolor/16x16/apps/flash-player-properties.png" |
303 |
FILE6_PRM="0644" |
304 |
FILE7_SRC="usr/share/icons/hicolor/22x22/apps/flash-player-properties.png" |
305 |
FILE7_DST="%{_iconsdir}/hicolor/22x22/apps/flash-player-properties.png" |
306 |
FILE7_PRM="0644" |
307 |
FILE8_SRC="usr/share/icons/hicolor/24x24/apps/flash-player-properties.png" |
308 |
FILE8_DST="%{_iconsdir}/hicolor/24x24/apps/flash-player-properties.png" |
309 |
FILE8_PRM="0644" |
310 |
FILE9_SRC="usr/share/icons/hicolor/32x32/apps/flash-player-properties.png" |
311 |
FILE9_DST="%{_iconsdir}/hicolor/32x32/apps/flash-player-properties.png" |
312 |
FILE9_PRM="0644" |
313 |
FILE10_SRC="usr/share/icons/hicolor/48x48/apps/flash-player-properties.png" |
314 |
FILE10_DST="%{_iconsdir}/hicolor/48x48/apps/flash-player-properties.png" |
315 |
FILE10_PRM="0644" |
316 |
FILE11_SRC= |
317 |
|
318 |
. %{_datadir}/%{name}/functions |
319 |
tar_extract |
320 |
|
321 |
# show in KDE as well (in case user doesn't have -kde subpkg |
322 |
sed -i 's,NotShowIn=KDE;,,' %{_datadir}/applications/flash-player-properties.desktop 2>/dev/null || : |
323 |
# otherwise KDE hides it: |
324 |
sed -i 's,GNOME;,,' %{_datadir}/applications/flash-player-properties.desktop 2>/dev/null || : |
325 |
|
326 |
echo "Adobe Flash Player installation successful." |
327 |
|
328 |
%pre kde |
329 |
# When installing both main package and -kde, failure of %pre of main package |
330 |
# can prevent installation of it, but urpmi/rpm will try to install -kde |
331 |
# regardless. FIXME. |
332 |
# For now, workaround it by preventing -kde installation as well: |
333 |
[ -e %{_datadir}/%{name}/functions ] |
334 |
|
335 |
%post kde |
336 |
FILE1_SRC="usr/%{_lib}/kde4/kcm_adobe_flash_player.so" |
337 |
FILE1_DST="%{_kde_libdir}/kde4/kcm_adobe_flash_player.so" |
338 |
FILE1_PRM="0755" |
339 |
FILE2_SRC="usr/share/kde4/services/kcm_adobe_flash_player.desktop" |
340 |
FILE2_DST="%{_kde_services}/kcm_adobe_flash_player.desktop" |
341 |
FILE2_PRM="0644" |
342 |
FILE3_SRC= |
343 |
|
344 |
. %{_datadir}/%{name}/functions |
345 |
tar_extract |
346 |
|
347 |
sed -i 's,=personal,=network-and-connectivity,' %{_kde_services}/kcm_adobe_flash_player.desktop 2>/dev/null || : |
348 |
|
349 |
%files |
350 |
|
351 |
%dir %{_localstatedir}/lib/%{name} |
352 |
%ghost %{_localstatedir}/lib/%{name}/%{tarname} |
353 |
%dir %{_datadir}/%{name} |
354 |
%{_datadir}/%{name}/functions |
355 |
|
356 |
%dir %{_libdir}/mozilla |
357 |
%dir %{_libdir}/mozilla/plugins |
358 |
%ghost %{_libdir}/mozilla/plugins/libflashplayer.so |
359 |
%ghost %{_libdir}/mozilla/plugins/LICENSE.flashplayer |
360 |
%ghost %{_libdir}/mozilla/plugins/README.flashplayer |
361 |
|
362 |
%ghost %{_bindir}/flash-player-properties |
363 |
%ghost %{_datadir}/applications/flash-player-properties.desktop |
364 |
%ghost %{_iconsdir}/hicolor/*/apps/flash-player-properties.png |
365 |
|
366 |
%files kde |
367 |
%defattr(-,root,root) |
368 |
%ghost %{_kde_libdir}/kde4/kcm_adobe_flash_player.so |
369 |
%ghost %{_kde_services}/kcm_adobe_flash_player.desktop |