/[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 135882 - (show annotations) (download)
Sun Aug 28 12:21:21 2011 UTC (12 years, 7 months ago) by anssi
File size: 11336 byte(s)
clean up on download failure
1
2 %define name flash-player-plugin
3 %define version 10.3.183.5
4 %define rel 2
5
6 # backportability
7 %define _localstatedir /var
8
9 %ifarch x86_64
10 # fake 64-bit package that contains 32-bit flash
11 # (to avoid having to have 32-bit nonfree repo on 64-bit)
12 # - Anssi 08/2011
13 %define _lib lib
14 %define _libdir %{_prefix}/lib
15 %endif
16
17 %ifarch x86_64
18 # fake 64-bit package
19 Summary: Flash Player plugin for browsers - 32-bit version
20 %else
21 Summary: Flash Player plugin for browsers
22 %endif
23 Name: %name
24 Version: %version
25 Release: %mkrel %rel
26 License: Proprietary
27 URL: http://www.adobe.com/products/flashplayer/
28 Group: Networking/WWW
29 ExclusiveArch: %ix86
30 # fake 64-bit package:
31 ExclusiveArch: x86_64
32
33 Requires(pre): curl
34
35 # obtained by objdump -x /usr/lib/mozilla/plugins/libflashplayer.so | grep NEEDED
36 # helper: for i in $(objdump -p libflashplayer.so | grep NEEDED | awk '{ print $2 }'); do
37 # echo -n "$i: "; rpm -qf /usr/lib64/$i; done
38 # libX11.so.6 libXext.so.6 libXt.so.6 libfreetype.so.6
39 Requires: %{_lib}x11_6 %{_lib}xext6 %{_lib}xt6 %{_lib}freetype6
40 # libfontconfig.so.1 libgtk-x11-2.0.so.0, libgdk-x11-2.0.so.0
41 Requires: %{_lib}fontconfig1 %{_lib}gtk+-x11-2.0_0
42 # libatk-1.0.so.0 libgdk_pixbuf-2.0.so.0 libpangocairo-1.0.so.0, libpango-1.0.so.0
43 Requires: %{_lib}atk1.0_0 %{_lib}gdk_pixbuf2.0_0 %{_lib}pango1.0_0
44 # libcairo.so.2 libgobject-2.0.so.0, libgmodule-2.0.so.0, libglib-2.0.so.0
45 Requires: %{_lib}cairo2 %{_lib}glib2.0_0
46 # libnss3.so, libsmime3.so, libssl3.so libplds4.so, libplc4.so, libnspr4.so
47 Requires: %{_lib}nss3 %{_lib}nspr4
48 # required for audio, dlopened:
49 Requires: %{_lib}alsa2
50 # dlopened:
51 Requires: %{_lib}curl4
52 # dlopened, for video acceleration:
53 Suggests: %{_lib}vdpau1
54 #
55 Conflicts: FlashPlayer < 9.0.115.0-5
56 Conflicts: flash-plugin FlashPlayer-plugin flashplayer-plugin
57 # Conflict with free plugins to avoid user confusion as to which one is
58 # actually used:
59 Conflicts: gnash-firefox-plugin
60 Conflicts: swfdec-mozilla
61 Conflicts: lightspark-mozilla-plugin
62 Conflicts: libflashsupport < 0.20080000.1
63 Obsoletes: flash-player-plugin10.2 < 10.2.152
64 BuildRequires: kde4-macros
65 %ifarch x86_64
66 # fake 64-bit package
67 Suggests: nspluginwrapper
68 %endif
69 BuildRoot: %{_tmppath}/%{name}-root
70
71 %description
72 Adobe Flash Player plugin for browsers.
73
74 NOTE: This package does not contain the Flash Player itself. The
75 software will be automatically downloaded from Adobe during the
76 package installation.
77
78 Installing this package indicates acceptance of the EULA, available
79 from http://www.adobe.com/products/eulas/players/flash/.
80 %ifarch x86_64
81 NOTE: This package actually contains the 32-bit version of Flash
82 Player as 64-bit stable Flash Player is not yet available.
83
84 This package will be automatically upgraded to the 64-bit version
85 when it becomes available.
86 %endif
87 # It would be preferable to have the KCM module in the main package with
88 # simply not requiring any kde stuff. However, standard KDE installation
89 # doesn't necessary include libkutils4. - Anssi 08/2011
90
91 %ifnarch x86_64
92 # fake 64-bit package
93 %package kde
94 Summary: Flash Player KDE settings module
95 Group: Networking/WWW
96 Requires: %{name} = %{version}-%{release}
97 Requires(post): %{name} = %{version}-%{release}
98 # helper: for i in $(objdump -p usr/lib/kde4/kcm_adobe_flash_player.so | grep NEEDED | awk '{ print $2 }'); do
99 # echo -n "$i: "; rpm -qf /usr/lib64/$i; done
100 Requires: %{_lib}kdeui5
101 Requires: %{_lib}sm6
102 Requires: %{_lib}ice6
103 Requires: %{_lib}x11_6
104 Requires: %{_lib}xext6
105 Requires: %{_lib}xft2
106 Requires: %{_lib}xau6
107 Requires: %{_lib}xdmcp6
108 Requires: %{_lib}xpm4
109 Requires: %{_lib}kutils4
110 Requires: %{_lib}kdecore5
111 Requires: %{_lib}qtdbus4
112 Requires: %{_lib}qtcore4
113 Requires: %{_lib}qtsvg4
114 Requires: %{_lib}qtgui4
115 Conflicts: flash-player-plugin < 10.3.183.5
116 Conflicts: flash-player-plugin11 < 11.0.1.98-0.b2.080811.2
117
118 %description kde
119 KDE settings module for Adobe Flash Player.
120
121 NOTE: This package does not contain the software itself. The
122 software will be automatically downloaded from the Adobe server
123 during the package installation.
124
125 Installing this package indicates acceptance of the EULA, available
126 from http://www.adobe.com/products/eulas/players/flash/.
127
128 %endif
129
130 %prep
131 %setup -c -T
132
133 # The linuxdownload.adobe.com rpm usually stays up longer, but fpdownload.macromedia.com is faster.
134 # Their md5sums usually differ.
135 #ifarch %ix86
136 # fake 64-bit package
137 %define downurl1 http://fpdownload.macromedia.com/get/flashplayer/current/flash-plugin-%version-release.i386.rpm
138 %define tmd5sum1 05df93d6f61f555bec3267ea6eeb54f0
139 %define downurl2 http://linuxdownload.adobe.com/linux/i386/flash-plugin-%version-release.i386.rpm
140 %define tmd5sum2 c02f9b54d942c0b0d59edb1cbff2ae6b
141 %define tarname flash-plugin-%version-release.i386.rpm
142 %define tartype rpm
143 #endif
144
145 %if 0
146 # fake 64-bit package
147 #ifarch x86_64
148 %define downurl1 http://download.macromedia.com/pub/labs/flashplayer10/libflashplayer-%version.linux-x86_64.so.tar.gz
149 %define tmd5sum1 none, not available
150 %define downurl2 %nil
151 %define tmd5sum2 %nil
152 %define tarname libflashplayer-%version.linux-x86_64.so.tar.gz
153 %define tartype tar
154 %endif
155
156 %define file %{_localstatedir}/lib/%{name}/%{tarname}
157
158 %install
159 rm -rf %{buildroot}
160
161 install -d -m755 %{buildroot}%{_localstatedir}/lib/%{name}
162 install -d -m755 %{buildroot}%{_libdir}/mozilla/plugins
163 touch %{buildroot}%{_libdir}/mozilla/plugins/libflashplayer.so
164 touch %{buildroot}%{_libdir}/mozilla/plugins/LICENSE.flashplayer
165 touch %{buildroot}%{_libdir}/mozilla/plugins/README.flashplayer
166 touch %{buildroot}%{_localstatedir}/lib/%{name}/%{tarname}
167
168 install -d -m755 %{buildroot}%{_bindir}
169 touch %{buildroot}%{_bindir}/flash-player-properties
170
171 %ifnarch x86_64
172 # fake 64-bit package
173 install -d -m755 %{buildroot}%{_kde_services}
174 touch %{buildroot}%{_kde_services}/kcm_adobe_flash_player.desktop
175 install -d -m755 %{buildroot}%{_kde_libdir}/kde4
176 touch %{buildroot}%{_kde_libdir}/kde4/kcm_adobe_flash_player.so
177 %endif
178
179 install -d -m755 %{buildroot}%{_datadir}/applications
180 touch %{buildroot}%{_datadir}/applications/flash-player-properties.desktop
181
182 for i in 16 22 24 32 48; do
183 install -d -m755 %{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps
184 touch %{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps/flash-player-properties.png
185 done
186
187 install -d -m755 %{buildroot}%{_datadir}/%{name}
188 cat > %{buildroot}%{_datadir}/%{name}/functions << EOF
189 tar_extract() {
190 extractdir=\$(mktemp -d --tmpdir=/tmp)
191 if [ -z "\$extractdir" ]; then
192 echo "Error during extraction." >&2
193 exit 1
194 fi
195
196 cd "\$extractdir" || exit 1
197 %if "%tartype" == "rpm"
198 rpm2cpio "%file" | cpio -i --quiet -d
199 %else
200 tar -xzf "%file"
201 %endif
202
203 FILENUM=1
204 FILE_SRC="\$FILE1_SRC"
205 FILE_DST="\$FILE1_DST"
206 while [ -n "\$FILE_SRC" ]; do
207 mv -f "\$FILE_SRC" "\$FILE_DST"
208 FILENUM=\$((FILENUM+1))
209 eval FILE_SRC="\\\$FILE\${FILENUM}_SRC"
210 eval FILE_DST="\\\$FILE\${FILENUM}_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 MD5SUM1="%{tmd5sum1}"
234 MD5SUM2="%{tmd5sum2}"
235 MD5SUM3=
236 URL1="%{downurl1}"
237 URL2="%{downurl2}"
238 URL3=
239
240 URLNUM=1
241
242 install -d -m 0755 %{_localstatedir}/lib/%{name}
243
244 echo "Note that by downloading the Adobe Flash Player you indicate your acceptance of"
245 echo "the EULA, available from http://www.adobe.com/products/eulas/players/flash/"
246 while ! checkmd5sum "%file"; do
247 eval URL="\$URL$URLNUM"
248 if [ -z "$URL" ]; then
249 echo "Error: Unable to download Flash Player. This is likely due to this package" >&2
250 echo " being too old. Please file a bug report at https://bugs.mageia.org" >&2
251 echo " so that the package gets updated. Thank you." >&2
252 echo "" >&2
253 echo " In the meantime, you can download Flash Player manually from" >&2
254 echo " http://get.adobe.com/flashplayer/" >&2
255 rm -f "%file"
256 [ "$(ls -A "%{_localstatedir}/lib/%{name}")" ] && rm -rf "%{_localstatedir}/lib/%{name}"
257 exit 1
258 fi
259 URLNUM=$((URLNUM+1))
260 echo "Downloading from $URL:"
261 curl --connect-timeout 20 -m 10800 -L "$URL" > "%file"
262 done
263
264 %post
265 FILE1_SRC="usr/lib/flash-plugin/libflashplayer.so"
266 FILE1_DST="%{_libdir}/mozilla/plugins/libflashplayer.so"
267 FILE2_SRC="usr/lib/flash-plugin/LICENSE"
268 FILE2_DST="%{_libdir}/mozilla/plugins/LICENSE.flashplayer"
269 FILE3_SRC="usr/lib/flash-plugin/README"
270 FILE3_DST="%{_libdir}/mozilla/plugins/README.flashplayer"
271
272 FILE4_SRC="usr/bin/flash-player-properties"
273 FILE4_DST="%{_bindir}/flash-player-properties"
274 FILE5_SRC="usr/share/applications/flash-player-properties.desktop"
275 FILE5_DST="%{_datadir}/applications/flash-player-properties.desktop"
276
277 FILE6_SRC="usr/share/icons/hicolor/16x16/apps/flash-player-properties.png"
278 FILE6_DST="%{_iconsdir}/hicolor/16x16/apps/flash-player-properties.png"
279 FILE7_SRC="usr/share/icons/hicolor/22x22/apps/flash-player-properties.png"
280 FILE7_DST="%{_iconsdir}/hicolor/22x22/apps/flash-player-properties.png"
281 FILE8_SRC="usr/share/icons/hicolor/24x24/apps/flash-player-properties.png"
282 FILE8_DST="%{_iconsdir}/hicolor/24x24/apps/flash-player-properties.png"
283 FILE9_SRC="usr/share/icons/hicolor/32x32/apps/flash-player-properties.png"
284 FILE9_DST="%{_iconsdir}/hicolor/32x32/apps/flash-player-properties.png"
285 FILE10_SRC="usr/share/icons/hicolor/48x48/apps/flash-player-properties.png"
286 FILE10_DST="%{_iconsdir}/hicolor/48x48/apps/flash-player-properties.png"
287 FILE11_SRC=
288
289 . %{_datadir}/%{name}/functions
290 tar_extract
291
292 # show in KDE as well (in case user doesn't have -kde subpkg
293 sed -i 's,NotShowIn=KDE;,,' %{_datadir}/applications/flash-player-properties.desktop
294 # otherwise KDE hides it:
295 sed -i 's,GNOME;,,' %{_datadir}/applications/flash-player-properties.desktop
296
297 echo "Installation successful."
298
299 if [ "$(uname -m)" == x86_64 ]; then
300 if ! [ -x %{_bindir}/nspluginwrapper ]; then
301 echo "Install nspluginwrapper if you want to use the plugin with 64bit browsers too."
302 fi
303 fi
304
305 %ifnarch x86_64
306 # fake 64-bit package
307 %post kde
308 FILE1_SRC="usr/lib/kde4/kcm_adobe_flash_player.so"
309 FILE1_DST="%{_kde_libdir}/kde4/kcm_adobe_flash_player.so"
310 FILE2_SRC="usr/share/kde4/services/kcm_adobe_flash_player.desktop"
311 FILE2_DST="%{_kde_services}/kcm_adobe_flash_player.desktop"
312
313 . %{_datadir}/%{name}/functions
314 tar_extract
315
316 if [ "$(uname -m)" == x86_64 ]; then
317 echo "Note: Adobe Flash Player configurator can only be accessed from the normal Tools"
318 echo "menu instead of KDE System Settings (due to this being a 64bit system)."
319 rm -f %{_kde_services}/kcm_adobe_flash_player.desktop
320 fi
321 %endif
322
323 %files
324 %defattr(-,root,root)
325 %dir %{_localstatedir}/lib/%{name}
326 %ghost %{_localstatedir}/lib/%{name}/%{tarname}
327 %dir %{_datadir}/%{name}
328 %{_datadir}/%{name}/functions
329
330 %dir %{_libdir}/mozilla
331 %dir %{_libdir}/mozilla/plugins
332 %ghost %{_libdir}/mozilla/plugins/libflashplayer.so
333 %ghost %{_libdir}/mozilla/plugins/LICENSE.flashplayer
334 %ghost %{_libdir}/mozilla/plugins/README.flashplayer
335
336 %ghost %{_bindir}/flash-player-properties
337 %ghost %{_datadir}/applications/flash-player-properties.desktop
338 %ghost %{_iconsdir}/hicolor/*/apps/flash-player-properties.png
339
340 %ifnarch x86_64
341 # fake 64-bit package
342 %files kde
343 %defattr(-,root,root)
344 %ghost %{_kde_libdir}/kde4/kcm_adobe_flash_player.so
345 %ghost %{_kde_services}/kcm_adobe_flash_player.desktop
346 %endif

  ViewVC Help
Powered by ViewVC 1.1.30