/[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 134274 - (show annotations) (download)
Wed Aug 17 23:58:10 2011 UTC (12 years, 8 months ago) by anssi
File size: 10336 byte(s)
- split out KDE KCM module into -kde subpackage (bug #1275)
- download in %pre instead of %posttrans
- unpack in %post instead of %posttrans
- always re-enable GTK flash-player-properties in KDE as well
- drop now unneeded calls to nspluginwrapper and gtk-icon-cache,
  they are now handled by filetriggers

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

  ViewVC Help
Powered by ViewVC 1.1.30