/[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 141931 - (show annotations) (download)
Fri Sep 9 17:51:43 2011 UTC (12 years, 7 months ago) by anssi
File size: 11703 byte(s)
- enforce permissions for extracted files (no effect with current
  Flash Player version)

1
2 %define name flash-player-plugin
3 %define version 10.3.183.7
4 %define rel 1
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 951d2b9703e903b3c0ed700e2bbc5857
139 %define downurl2 http://linuxdownload.adobe.com/linux/i386/flash-plugin-%version-release.i386.rpm
140 %define tmd5sum2 7c9fe718e8c7fb0a6b54560be74384e8
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 -R root:root
199 %else
200 tar -xzf "%file" --no-same-owner --no-same-permissions
201 %endif
202
203 FILENUM=1
204 FILE_SRC="\$FILE1_SRC"
205 FILE_DST="\$FILE1_DST"
206 FILE_PRM="\$FILE1_PRM"
207 while [ -n "\$FILE_SRC" ]; do
208 chmod "\$FILE_PRM" "\$FILE_SRC"
209 mv -f "\$FILE_SRC" "\$FILE_DST"
210 FILENUM=\$((FILENUM+1))
211 eval FILE_SRC="\\\$FILE\${FILENUM}_SRC"
212 eval FILE_DST="\\\$FILE\${FILENUM}_DST"
213 eval FILE_PRM="\\\$FILE\${FILENUM}_PRM"
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 MD5SUM1="%{tmd5sum1}"
237 MD5SUM2="%{tmd5sum2}"
238 MD5SUM3=
239 URL1="%{downurl1}"
240 URL2="%{downurl2}"
241 URL3=
242
243 URLNUM=1
244
245 install -d -m 0755 %{_localstatedir}/lib/%{name}
246
247 echo "Note that by downloading the Adobe Flash Player you indicate your acceptance of"
248 echo "the EULA, available from http://www.adobe.com/products/eulas/players/flash/"
249 while ! checkmd5sum "%file"; do
250 eval URL="\$URL$URLNUM"
251 if [ -z "$URL" ]; then
252 echo "Error: Unable to download Flash Player. This is likely due to this package" >&2
253 echo " being too old. Please file a bug report at https://bugs.mageia.org" >&2
254 echo " so that the package gets updated. Thank you." >&2
255 echo "" >&2
256 echo " In the meantime, you can download Flash Player manually from" >&2
257 echo " http://get.adobe.com/flashplayer/" >&2
258 rm -f "%file"
259 [ "$(ls -A "%{_localstatedir}/lib/%{name}")" ] && rm -rf "%{_localstatedir}/lib/%{name}"
260 exit 1
261 fi
262 URLNUM=$((URLNUM+1))
263 echo "Downloading from $URL:"
264 curl --connect-timeout 20 -m 10800 -L "$URL" > "%file"
265 done
266
267 %post
268 FILE1_SRC="usr/lib/flash-plugin/libflashplayer.so"
269 FILE1_DST="%{_libdir}/mozilla/plugins/libflashplayer.so"
270 FILE1_PRM="0755"
271 FILE2_SRC="usr/lib/flash-plugin/LICENSE"
272 FILE2_DST="%{_libdir}/mozilla/plugins/LICENSE.flashplayer"
273 FILE2_PRM="0644"
274 FILE3_SRC="usr/lib/flash-plugin/README"
275 FILE3_DST="%{_libdir}/mozilla/plugins/README.flashplayer"
276 FILE3_PRM="0644"
277
278 FILE4_SRC="usr/bin/flash-player-properties"
279 FILE4_DST="%{_bindir}/flash-player-properties"
280 FILE4_PRM="0755"
281 FILE5_SRC="usr/share/applications/flash-player-properties.desktop"
282 FILE5_DST="%{_datadir}/applications/flash-player-properties.desktop"
283 FILE5_PRM="0644"
284
285 FILE6_SRC="usr/share/icons/hicolor/16x16/apps/flash-player-properties.png"
286 FILE6_DST="%{_iconsdir}/hicolor/16x16/apps/flash-player-properties.png"
287 FILE6_PRM="0644"
288 FILE7_SRC="usr/share/icons/hicolor/22x22/apps/flash-player-properties.png"
289 FILE7_DST="%{_iconsdir}/hicolor/22x22/apps/flash-player-properties.png"
290 FILE7_PRM="0644"
291 FILE8_SRC="usr/share/icons/hicolor/24x24/apps/flash-player-properties.png"
292 FILE8_DST="%{_iconsdir}/hicolor/24x24/apps/flash-player-properties.png"
293 FILE8_PRM="0644"
294 FILE9_SRC="usr/share/icons/hicolor/32x32/apps/flash-player-properties.png"
295 FILE9_DST="%{_iconsdir}/hicolor/32x32/apps/flash-player-properties.png"
296 FILE9_PRM="0644"
297 FILE10_SRC="usr/share/icons/hicolor/48x48/apps/flash-player-properties.png"
298 FILE10_DST="%{_iconsdir}/hicolor/48x48/apps/flash-player-properties.png"
299 FILE10_PRM="0644"
300 FILE11_SRC=
301
302 . %{_datadir}/%{name}/functions
303 tar_extract
304
305 # show in KDE as well (in case user doesn't have -kde subpkg
306 sed -i 's,NotShowIn=KDE;,,' %{_datadir}/applications/flash-player-properties.desktop
307 # otherwise KDE hides it:
308 sed -i 's,GNOME;,,' %{_datadir}/applications/flash-player-properties.desktop
309
310 echo "Installation successful."
311
312 if [ "$(uname -m)" == x86_64 ]; then
313 if ! [ -x %{_bindir}/nspluginwrapper ]; then
314 echo "Install nspluginwrapper if you want to use the plugin with 64bit browsers too."
315 fi
316 fi
317
318 %ifnarch x86_64
319 # fake 64-bit package
320 %post kde
321 FILE1_SRC="usr/lib/kde4/kcm_adobe_flash_player.so"
322 FILE1_DST="%{_kde_libdir}/kde4/kcm_adobe_flash_player.so"
323 FILE1_PRM="0755"
324 FILE2_SRC="usr/share/kde4/services/kcm_adobe_flash_player.desktop"
325 FILE2_DST="%{_kde_services}/kcm_adobe_flash_player.desktop"
326 FILE2_PRM="0644"
327 FILE3_SRC=
328
329 . %{_datadir}/%{name}/functions
330 tar_extract
331
332 if [ "$(uname -m)" == x86_64 ]; then
333 echo "Note: Adobe Flash Player configurator can only be accessed from the normal Tools"
334 echo "menu instead of KDE System Settings (due to this being a 64bit system)."
335 rm -f %{_kde_services}/kcm_adobe_flash_player.desktop
336 fi
337 %endif
338
339 %files
340 %defattr(-,root,root)
341 %dir %{_localstatedir}/lib/%{name}
342 %ghost %{_localstatedir}/lib/%{name}/%{tarname}
343 %dir %{_datadir}/%{name}
344 %{_datadir}/%{name}/functions
345
346 %dir %{_libdir}/mozilla
347 %dir %{_libdir}/mozilla/plugins
348 %ghost %{_libdir}/mozilla/plugins/libflashplayer.so
349 %ghost %{_libdir}/mozilla/plugins/LICENSE.flashplayer
350 %ghost %{_libdir}/mozilla/plugins/README.flashplayer
351
352 %ghost %{_bindir}/flash-player-properties
353 %ghost %{_datadir}/applications/flash-player-properties.desktop
354 %ghost %{_iconsdir}/hicolor/*/apps/flash-player-properties.png
355
356 %ifnarch x86_64
357 # fake 64-bit package
358 %files kde
359 %defattr(-,root,root)
360 %ghost %{_kde_libdir}/kde4/kcm_adobe_flash_player.so
361 %ghost %{_kde_services}/kcm_adobe_flash_player.desktop
362 %endif

  ViewVC Help
Powered by ViewVC 1.1.30