/[packages]/updates/5/flash-player-plugin/pristine/SPECS/flash-player-plugin.spec
ViewVC logotype

Contents of /updates/5/flash-player-plugin/pristine/SPECS/flash-player-plugin.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1052939 - (show annotations) (download)
Wed Sep 14 18:04:57 2016 UTC (7 years, 6 months ago) by anssi
File size: 15906 byte(s)
Copying release 11.2.202.635-1.mga5.nonfree to pristine/ directory.
1 %ifarch x86_64
2 %define bitmark ()(64bit)
3 %else
4 %define bitmark %nil
5 %endif
6
7 %define hal_flash_snap 20130530
8 %define flash_libdir %{_libdir}/%{name}
9
10 # Internal dependencies (Anssi 04/2014)
11 %global common_exceptions ^libflashplayer\\.so.*$|^libhal\\.so.*$|^lib_plugin.so
12 %global __requires_exclude %common_exceptions
13 %global __provides_exclude %common_exceptions
14
15 Summary: Flash Player plugin for browsers
16 Name: flash-player-plugin
17 Version: 11.2.202.635
18 Release: %mkrel 1
19 License: Proprietary
20 URL: http://www.adobe.com/products/flashplayer/
21 Group: Networking/WWW
22 ExclusiveArch: %ix86 x86_64
23 BuildRequires: dbus-devel
24 Requires(pre): curl
25
26 # http://github.com/cshorler/hal-flash
27 Source1: hal-flash-%hal_flash_snap.tar.xz
28
29 # helper for getting requires:
30 # for i in $(objdump -p libflashplayer.so | grep NEEDED | awk '{ print $2 }' | grep -v ld-linux); do echo "Requires: $i%{bitmark}"; done
31 Requires: libatk-1.0.so.0%{bitmark}
32 Requires: libcairo.so.2%{bitmark}
33 Requires: libc.so.6%{bitmark}
34 Requires: libdl.so.2%{bitmark}
35 Requires: libfontconfig.so.1%{bitmark}
36 Requires: libfreetype.so.6%{bitmark}
37 Requires: libgdk_pixbuf-2.0.so.0%{bitmark}
38 Requires: libgdk-x11-2.0.so.0%{bitmark}
39 Requires: libglib-2.0.so.0%{bitmark}
40 Requires: libgmodule-2.0.so.0%{bitmark}
41 Requires: libgobject-2.0.so.0%{bitmark}
42 Requires: libgthread-2.0.so.0%{bitmark}
43 Requires: libgtk-x11-2.0.so.0%{bitmark}
44 Requires: libm.so.6%{bitmark}
45 Requires: libnspr4.so%{bitmark}
46 Requires: libnss3.so%{bitmark}
47 Requires: libnssutil3.so%{bitmark}
48 Requires: libpango-1.0.so.0%{bitmark}
49 Requires: libpangocairo-1.0.so.0%{bitmark}
50 Requires: libpangoft2-1.0.so.0%{bitmark}
51 Requires: libplc4.so%{bitmark}
52 Requires: libplds4.so%{bitmark}
53 Requires: libpthread.so.0%{bitmark}
54 Requires: librt.so.1%{bitmark}
55 Requires: libsmime3.so%{bitmark}
56 Requires: libssl3.so%{bitmark}
57 Requires: libX11.so.6%{bitmark}
58 Requires: libXcursor.so.1%{bitmark}
59 Requires: libXext.so.6%{bitmark}
60 Requires: libXrender.so.1%{bitmark}
61 Requires: libXt.so.6%{bitmark}
62 # end of helper produced requires
63
64 # required for audio, dlopened:
65 Requires: libasound.so.2%{bitmark}
66 # dlopened:
67 Requires: libcurl.so.4%{bitmark}
68 # required for content protection by libadobecp.so
69 Requires: libdbus-1.so.3%{bitmark}
70 # dlopened, for video acceleration:
71 Recommends: libvdpau.so.1%{bitmark}
72 #
73 Conflicts: FlashPlayer < 9.0.115.0-5
74 Conflicts: flash-plugin FlashPlayer-plugin flashplayer-plugin
75 # Conflict with free plugins to avoid user confusion as to which one is
76 # actually used:
77 Conflicts: gnash-firefox-plugin
78 Conflicts: swfdec-mozilla
79 Conflicts: lightspark-mozilla-plugin
80 Conflicts: libflashsupport < 0.20080000.1
81 Obsoletes: flash-player-plugin10.2 < 10.2.152
82 Provides: flash-player-plugin11
83 Obsoletes: flash-player-plugin11
84 BuildRequires: kde4-macros
85 BuildRoot: %{_tmppath}/%{name}-root
86
87 %description
88 Adobe Flash Player plugin for browsers.
89
90 NOTE: This package does not contain the Flash Player itself. The
91 software will be automatically downloaded from Adobe during package
92 installation.
93
94 Installing this package indicates acceptance of the Flash Player EULA,
95 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
100 # It would be preferable to have the KCM module in the main package with
101 # simply not requiring any kde stuff. However, standard KDE installation
102 # doesn't necessary include libkutils4. - Anssi 08/2011
103 %package kde
104 Summary: Flash Player KDE settings module
105 Group: Networking/WWW
106 Requires: %{name} = %{version}-%{release}
107 Requires(post): %{name} = %{version}-%{release}
108 # helper for getting requires:
109 # 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
110 Requires: libc.so.6%{bitmark}
111 Requires: libICE.so.6%{bitmark}
112 Requires: libkdecore.so.5%{bitmark}
113 Requires: libkdeui.so.5%{bitmark}
114 Requires: libkutils.so.4%{bitmark}
115 Requires: libm.so.6%{bitmark}
116 Requires: libpthread.so.0%{bitmark}
117 Requires: libQtCore.so.4%{bitmark}
118 Requires: libQtDBus.so.4%{bitmark}
119 Requires: libQtGui.so.4%{bitmark}
120 Requires: libQtSvg.so.4%{bitmark}
121 Requires: libSM.so.6%{bitmark}
122 Requires: libX11.so.6%{bitmark}
123 Requires: libXau.so.6%{bitmark}
124 Requires: libXdmcp.so.6%{bitmark}
125 Requires: libXext.so.6%{bitmark}
126 Requires: libXft.so.2%{bitmark}
127 Requires: libXpm.so.4%{bitmark}
128 # end of helper produced requires
129 Conflicts: flash-player-plugin < 10.3.183.5
130 Provides: flash-player-plugin11-kde
131 Obsoletes: flash-player-plugin11-kde
132
133 %description kde
134 KDE settings module for Adobe Flash Player.
135
136 NOTE: This package does not contain the software itself. The
137 software will be automatically downloaded from the Adobe server
138 during package installation.
139
140 Installing this package indicates acceptance of the Flash Player EULA,
141 available at http://www.adobe.com/products/eulas/players/flash/
142 %ifnarch x86_64
143 and in %{flash_libdir}/LICENSE.flashplayer.
144 %endif
145
146 %prep
147 %setup -q -c -T -a1
148
149 # Always prefer versioned archives instead of unversioned ones, so that when
150 # Adobe updates the Flash Player, the old sha256sum continues to work until
151 # this package is updated for the new version.
152
153 # The linuxdownload.adobe.com rpm usually stays up longer, but fpdownload.macromedia.com is faster.
154 # Their sha256sums usually differ.
155
156 %ifarch %ix86
157 %define downurl1 http://fpdownload.macromedia.com/get/flashplayer/pdc/%{version}/flash-plugin-%{version}-release.i386.rpm
158 # (Anssi) this was up faster (i.e. at the time of writing it was up but downurl1 was not), but does not stay up very long, same sha256 as url1:
159 %define downurl2 http://fpdownload.macromedia.com/get/flashplayer/current/licensing/linux/flash-plugin-%{version}-release.i386.rpm
160 # can be temporarily disabled by %nilling if not yet available at the time of updating:
161 #define downurl3 http://linuxdownload.adobe.com/linux/i386/flash-plugin-%{version}-release.i386.rpm
162 %define downurl3 %nil
163 %define downurl4 %nil
164
165 # sha256sum:filesize
166 %define tsha256sum1 74a1a8ef2e40b64988d1fcb99c6bd65e565966668e721a6035b18c260d1e719a:6971129
167 %define tsha256sum2 %nil
168 %define tsha256sum3 %nil
169
170 %define tarname flash-plugin-%{version}-release.i386.rpm
171
172 %define warn_on_missing_files 1
173 %endif
174
175 %ifarch x86_64
176 %define downurl1 http://fpdownload.macromedia.com/get/flashplayer/pdc/%{version}/flash-plugin-%{version}-release.x86_64.rpm
177 %define downurl2 http://fpdownload.macromedia.com/get/flashplayer/current/licensing/linux/flash-plugin-%{version}-release.x86_64.rpm
178 #define downurl3 http://linuxdownload.adobe.com/linux/x86_64/flash-plugin-%{version}-release.x86_64.rpm
179 %define downurl3 %nil
180 %define downurl4 %nil
181
182 %define tsha256sum1 880880775bbf318e65ec2e5c34b93b27387672e2ec7917fda33e7cd6613116c0:7279829
183 %define tsha256sum2 %nil
184 %define tsha256sum3 %nil
185
186 %define tarname flash-plugin-%{version}-release.x86_64.rpm
187
188 %define warn_on_missing_files 1
189 %endif
190
191 %define file %{_localstatedir}/lib/%{name}/%{tarname}
192
193 cat > README.%_real_vendor <<EOF
194 This package does not contain the Flash Player itself. The software is
195 automatically downloaded from Adobe during package installation.
196
197 This package uses a wrapper in %{_libdir}/mozilla/plugins/libflashplayer.so
198 which loads the real Flash Player from %{flash_libdir}/libflashplayer.so,
199 while also loading the HAL-UDisks wrapper "hal-flash" by Chris Horler
200 (https://github.com/cshorler/hal-flash) which is required to satisfy the
201 HAL dependency of Flash Player for protected content playback.
202 EOF
203 cp -a hal-flash-%hal_flash_snap/COPYING COPYING.hal-flash
204
205 %build
206
207 cd hal-flash-%hal_flash_snap
208 autoreconf -fi
209 %configure2_5x
210 %make
211 cd -
212
213 # we want the dummy dependencies (Anssi 03/2014)
214 %define _disable_ld_as_needed 1
215
216 # Create a wrapper plugin that loads both the real Flash Player and the wrapper libhal.so.1
217 # (Anssi 03/2014)
218 echo | gcc %{optflags} %{ldflags} -Wall -fPIC -shared -o libflashsoname.so -x c - -Wl,-soname,libflashplayer.so
219 echo | gcc %{optflags} %{ldflags} -Wall -fPIC -shared -o libflashwrap.so -x c - -Wl,-soname,lib_plugin.so \
220 -Wl,-rpath,%{flash_libdir} -x none \
221 libflashsoname.so hal-flash-%hal_flash_snap/src/.libs/libhal.so
222
223 %install
224 rm -rf %{buildroot}
225
226 install -d -m755 %{buildroot}%{_localstatedir}/lib/%{name}
227 install -d -m755 %{buildroot}%{flash_libdir}
228 install -d -m755 %{buildroot}%{_libdir}/mozilla/plugins
229
230 install -m755 libflashwrap.so %{buildroot}%{_libdir}/mozilla/plugins/libflashplayer.so
231 install -m755 hal-flash-%hal_flash_snap/src/.libs/libhal.so.1 %{buildroot}%{flash_libdir}/
232
233 touch %{buildroot}%{flash_libdir}/libflashplayer.so
234 touch %{buildroot}%{flash_libdir}/LICENSE.flashplayer
235 touch %{buildroot}%{flash_libdir}/README.flashplayer
236 touch %{buildroot}%{_localstatedir}/lib/%{name}/%{tarname}
237
238 install -d -m755 %{buildroot}%{_bindir}
239 touch %{buildroot}%{_bindir}/flash-player-properties
240
241 install -d -m755 %{buildroot}%{_kde_services}
242 touch %{buildroot}%{_kde_services}/kcm_adobe_flash_player.desktop
243 install -d -m755 %{buildroot}%{_kde_libdir}/kde4
244 touch %{buildroot}%{_kde_libdir}/kde4/kcm_adobe_flash_player.so
245
246 install -d -m755 %{buildroot}%{_datadir}/applications
247 touch %{buildroot}%{_datadir}/applications/flash-player-properties.desktop
248
249 for i in 16 22 24 32 48; do
250 install -d -m755 %{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps
251 touch %{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps/flash-player-properties.png
252 done
253
254 install -d -m755 %{buildroot}%{_datadir}/%{name}
255 cat > %{buildroot}%{_datadir}/%{name}/functions << EOF
256 next_file() {
257 FILENUM=\$((FILENUM+1))
258 eval FILE_SRC="\\\$FILE\${FILENUM}_SRC"
259 eval FILE_DST="\\\$FILE\${FILENUM}_DST"
260 eval FILE_PRM="\\\$FILE\${FILENUM}_PRM"
261 [ -n "\$FILE_SRC" ]
262 }
263
264 tar_extract() {
265 extractdir=\$(mktemp -d --tmpdir=/tmp)
266 if [ -z "\$extractdir" ]; then
267 echo "Error during extraction." >&2
268 exit 1
269 fi
270
271 cd "\$extractdir" || exit 1
272
273 if [ "\$(head -c4 "%file")" = \$'\\xED\\xAB\\xEE\\xDB' ]; then
274 rpm2cpio "%file" | cpio -i --quiet -d -R root:root
275 else
276 tar -xzf "%file" --no-same-owner --no-same-permissions
277 fi
278
279 # Avoid leaving old files in case of failure below
280 FILENUM=0
281 while next_file; do
282 rm -f "\$FILE_DST"
283 done
284
285 FILENUM=0
286 while next_file; do
287 if [ ! -f "\$FILE_SRC" ]; then
288 %if %warn_on_missing_files
289 echo "Warning: \$FILE_SRC not found in the Flash Player archive," >&2
290 echo " skipping installation of \$FILE_DST." >&2
291 echo " Please file a bug report at https://bugs.mageia.org/ ." >&2
292 %endif
293 continue
294 fi
295
296 chmod "\$FILE_PRM" "\$FILE_SRC"
297 mv -f "\$FILE_SRC" "\$FILE_DST"
298 done
299 rm -rf "\$extractdir"
300 }
301 EOF
302
303 %clean
304 rm -rf %{buildroot}
305
306 %pre
307 checksha256sum() {
308 [ -e "$1" ] || return 1
309 FILESHA256="$(sha256sum $1 | cut -d" " -f1)"
310 FILESIZE="$(stat -c%%s "$1")"
311 [ -n "$FILESHA256" ] || return 1
312 [ -n "$FILESIZE" ] || return 1
313 SHA256NUM=1
314 eval SHA256SUM="\$SHA256SUM$SHA256NUM"
315 while [ "$SHA256SUM" ]; do
316 [ "${SHA256SUM%:*}" = "$FILESHA256" ] && [ "${SHA256SUM#*:}" = "$FILESIZE" ] && return 0
317 SHA256NUM=$((SHA256NUM+1))
318 eval SHA256SUM="\$SHA256SUM$SHA256NUM"
319 done
320 return 1
321 }
322
323 get_proxy_from_urpmi() {
324 if [ -e /etc/urpmi/proxy.cfg ]; then
325 proxy="$(grep ^http_proxy= /etc/urpmi/proxy.cfg 2>/dev/null)"
326 proxy_user="$(grep ^proxy_user= /etc/urpmi/proxy.cfg 2>/dev/null)"
327
328 proxy="${proxy#http_proxy=}"
329 proxy_user="${proxy_user#proxy_user=}"
330
331 [ -n "$proxy" ] && echo "--proxy $proxy"
332 [ -n "$proxy_user" ] && echo "--proxy-user $proxy_user"
333 fi
334 }
335
336 SHA256SUM1="%{tsha256sum1}"
337 SHA256SUM2="%{tsha256sum2}"
338 SHA256SUM3="%{tsha256sum3}"
339 SHA256SUM4=
340 URL1="%{downurl1}"
341 URL2="%{downurl2}"
342 URL3="%{downurl3}"
343 URL4=
344
345 URLNUM=1
346
347 install -d -m 0755 %{_localstatedir}/lib/%{name}
348
349 echo "Note that by downloading the Adobe Flash Player you indicate your acceptance of"
350 echo "the EULA, available at http://www.adobe.com/products/eulas/players/flash/"
351 while ! checksha256sum "%file"; do
352 eval URL="\$URL$URLNUM"
353 if [ -z "$URL" ]; then
354 echo "Error: Unable to download Flash Player. This is likely due to this package" >&2
355 echo " being too old. Please file a bug report at https://bugs.mageia.org" >&2
356 echo " so that the package gets updated. Thank you." >&2
357 echo "" >&2
358 echo " In the meantime, you can download Flash Player manually from" >&2
359 echo " http://get.adobe.com/flashplayer/" >&2
360 rm -f "%file"
361 [ "$(ls -A "%{_localstatedir}/lib/%{name}")" ] && rm -rf "%{_localstatedir}/lib/%{name}"
362 exit 1
363 fi
364 URLNUM=$((URLNUM+1))
365 echo "Downloading from $URL:"
366 curl --connect-timeout 20 -m 10800 -L $(get_proxy_from_urpmi) "$URL" > "%file"
367 done
368
369 %post
370 FILE1_SRC="usr/%{_lib}/flash-plugin/libflashplayer.so"
371 FILE1_DST="%{flash_libdir}/libflashplayer.so"
372 FILE1_PRM="0755"
373 FILE2_SRC="usr/%{_lib}/flash-plugin/LICENSE"
374 FILE2_DST="%{flash_libdir}/LICENSE.flashplayer"
375 FILE2_PRM="0644"
376 FILE3_SRC="usr/%{_lib}/flash-plugin/README"
377 FILE3_DST="%{flash_libdir}/README.flashplayer"
378 FILE3_PRM="0644"
379
380 FILE4_SRC="usr/bin/flash-player-properties"
381 FILE4_DST="%{_bindir}/flash-player-properties"
382 FILE4_PRM="0755"
383 FILE5_SRC="usr/share/applications/flash-player-properties.desktop"
384 FILE5_DST="%{_datadir}/applications/flash-player-properties.desktop"
385 FILE5_PRM="0644"
386
387 FILE6_SRC="usr/share/icons/hicolor/16x16/apps/flash-player-properties.png"
388 FILE6_DST="%{_iconsdir}/hicolor/16x16/apps/flash-player-properties.png"
389 FILE6_PRM="0644"
390 FILE7_SRC="usr/share/icons/hicolor/22x22/apps/flash-player-properties.png"
391 FILE7_DST="%{_iconsdir}/hicolor/22x22/apps/flash-player-properties.png"
392 FILE7_PRM="0644"
393 FILE8_SRC="usr/share/icons/hicolor/24x24/apps/flash-player-properties.png"
394 FILE8_DST="%{_iconsdir}/hicolor/24x24/apps/flash-player-properties.png"
395 FILE8_PRM="0644"
396 FILE9_SRC="usr/share/icons/hicolor/32x32/apps/flash-player-properties.png"
397 FILE9_DST="%{_iconsdir}/hicolor/32x32/apps/flash-player-properties.png"
398 FILE9_PRM="0644"
399 FILE10_SRC="usr/share/icons/hicolor/48x48/apps/flash-player-properties.png"
400 FILE10_DST="%{_iconsdir}/hicolor/48x48/apps/flash-player-properties.png"
401 FILE10_PRM="0644"
402 FILE11_SRC=
403
404 . %{_datadir}/%{name}/functions
405 tar_extract
406
407 # show in KDE as well (in case user doesn't have -kde subpkg
408 sed -i 's,NotShowIn=KDE;,,' %{_datadir}/applications/flash-player-properties.desktop 2>/dev/null || :
409 # otherwise KDE hides it:
410 sed -i 's,GNOME;,,' %{_datadir}/applications/flash-player-properties.desktop 2>/dev/null || :
411
412 echo "Adobe Flash Player installation successful."
413
414 %pre kde
415 # When installing both main package and -kde, failure of %pre of main package
416 # can prevent installation of it, but urpmi/rpm will try to install -kde
417 # regardless. FIXME.
418 # For now, workaround it by preventing -kde installation as well:
419 [ -e %{_datadir}/%{name}/functions ] && [ -e %{_localstatedir}/lib/%{name}/%{tarname} ]
420
421 %post kde
422 FILE1_SRC="usr/%{_lib}/kde4/kcm_adobe_flash_player.so"
423 FILE1_DST="%{_kde_libdir}/kde4/kcm_adobe_flash_player.so"
424 FILE1_PRM="0755"
425 FILE2_SRC="usr/share/kde4/services/kcm_adobe_flash_player.desktop"
426 FILE2_DST="%{_kde_services}/kcm_adobe_flash_player.desktop"
427 FILE2_PRM="0644"
428 FILE3_SRC=
429
430 . %{_datadir}/%{name}/functions
431 tar_extract
432
433 sed -i 's,=personal,=network-and-connectivity,' %{_kde_services}/kcm_adobe_flash_player.desktop 2>/dev/null || :
434
435 %files
436 %doc README.%_real_vendor
437 %doc COPYING.hal-flash
438
439 %dir %{_localstatedir}/lib/%{name}
440 %ghost %{_localstatedir}/lib/%{name}/%{tarname}
441 %dir %{_datadir}/%{name}
442 %{_datadir}/%{name}/functions
443
444 %dir %{_libdir}/mozilla
445 %dir %{_libdir}/mozilla/plugins
446 %{_libdir}/mozilla/plugins/libflashplayer.so
447 %dir %{flash_libdir}
448 %{flash_libdir}/libhal.so.1
449 %ghost %{flash_libdir}/libflashplayer.so
450 %ghost %{flash_libdir}/LICENSE.flashplayer
451 %ghost %{flash_libdir}/README.flashplayer
452
453 %ghost %{_bindir}/flash-player-properties
454 %ghost %{_datadir}/applications/flash-player-properties.desktop
455 %ghost %{_iconsdir}/hicolor/*/apps/flash-player-properties.png
456
457 %files kde
458 %defattr(-,root,root)
459 %ghost %{_kde_libdir}/kde4/kcm_adobe_flash_player.so
460 %ghost %{_kde_services}/kcm_adobe_flash_player.desktop

  ViewVC Help
Powered by ViewVC 1.1.30