]> git.pld-linux.org Git - packages/adobe-flash.git/blob - adobe-flash.spec
- won't work as pre, post-install call installer
[packages/adobe-flash.git] / adobe-flash.spec
1 # Conditional build:
2 %bcond_with     license_agreement       # generates package
3
4 %define         _ver_major      7
5 %define         _ver_minor      0
6 %define         _ver_patch      25
7 Summary:        Flash plugin for Netscape-compatible WWW browsers
8 Summary(pl):    Wtyczka Flash dla przegl±darek WWW zgodnych z Netscape
9 %define         base_name       macromedia-flash
10 %if %{with license_agreement}
11 Name:           %{base_name}
12 %else
13 Name:           %{base_name}-installer
14 %endif
15 Version:        %{_ver_major}.%{_ver_minor}.%{_ver_patch}
16 Release:        3%{?with_license_agreement:wla}
17 License:        Free to use, non-distributable
18 Group:          X11/Applications/Multimedia
19 %if %{with license_agreement}
20 Source0:        http://fpdownload.macromedia.com/get/shockwave/flash/english/linux/%{_ver_major}.%{_ver_minor}r%{_ver_patch}/install_flash_player_%{_ver_major}_linux.tar.gz
21 # NoSource0-md5:        79c59a5ea29347e01c8e6575dd054cd1
22 %else
23 Source0:        license-installer.sh
24 %endif
25 URL:            http://www.macromedia.com/software/flashplayer/
26 %if %{with license_agreement}
27 BuildRequires:  rpmbuild(macros) >= 1.236
28 %endif
29 Requires:       browser-plugins(%{_target_cpu})
30 %if %{without license_agreement}
31 Requires:       cpio
32 Requires:       rpm-build-tools
33 Requires:       wget
34 %endif
35 Obsoletes:      flash-plugin
36 Obsoletes:      mozilla-plugin-macromedia-flash
37 Obsoletes:      mozilla-firefox-plugin-macromedia-flash
38 Obsoletes:      konqueror-plugin-macromedia-flash
39 ExclusiveArch:  %{ix86}
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %define         _plugindir      %{_libdir}/browser-plugins
43
44 # TODO: galeon and skipstone.
45 # use macro, otherwise extra LF inserted along with the ifarch
46 %define browsers mozilla, mozilla-firefox, konqueror, opera
47
48 %description
49 Flash plugin for Netscape-compatible WWW browsers.
50
51 Supported browsers: %{browsers}.
52
53 %description -l pl
54 Wtyczka Flash dla przegl±darek WWW zgodnych z Netscape.
55
56 Obs³ugiwane przegl±darki: %{browsers}.
57
58 %prep
59 %if %{with license_agreement}
60 %setup -q -n install_flash_player_7_linux
61 %endif
62
63 %install
64 rm -rf $RPM_BUILD_ROOT
65 %if %{without license_agreement}
66 install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/%{base_name}}
67
68 sed -e '
69         s/@BASE_NAME@/%{base_name}/g
70         s/@TARGET_CPU@/%{_target_cpu}/g
71         s-@VERSION@-%{version}-g
72         s-@RELEASE@-%{release}-g
73         s,@SPECFILE@,%{_datadir}/%{base_name}/%{base_name}.spec,g
74 ' %{SOURCE0} > $RPM_BUILD_ROOT%{_bindir}/%{base_name}.install
75
76 install %{_specdir}/%{base_name}.spec $RPM_BUILD_ROOT%{_datadir}/%{base_name}
77
78 %else
79
80 install -d $RPM_BUILD_ROOT%{_plugindir}
81 install *.{so,xpt} $RPM_BUILD_ROOT%{_plugindir}
82
83 %endif
84
85 %clean
86 rm -rf $RPM_BUILD_ROOT
87
88 %if %{without license_agreement}
89 %post
90 %{_bindir}/%{base_name}.install
91
92 %else
93
94 %triggerin -- mozilla-firefox
95 %nsplugin_install -d %{_libdir}/mozilla-firefox/plugins libflashplayer.so flashplayer.xpt
96
97 %triggerun -- mozilla-firefox
98 %nsplugin_uninstall -d %{_libdir}/mozilla-firefox/plugins libflashplayer.so flashplayer.xpt
99
100 %triggerin -- mozilla
101 %nsplugin_install -d %{_libdir}/mozilla/plugins libflashplayer.so flashplayer.xpt
102 if [ -d /usr/%{_lib}/mozilla ]; then
103         umask 022
104         rm -f /usr/%{_lib}/mozilla/components/{compreg,xpti}.dat
105         if [ -x /usr/bin/regxpcom ]; then
106                 MOZILLA_FIVE_HOME=/usr/%{_lib}/mozilla /usr/bin/regxpcom
107         fi
108 fi
109
110 %triggerun -- mozilla
111 %nsplugin_uninstall -d %{_libdir}/mozilla/plugins libflashplayer.so flashplayer.xpt
112 if [ -d /usr/%{_lib}/mozilla ]; then
113         umask 022
114         rm -f /usr/%{_lib}/mozilla/components/{compreg,xpti}.dat
115         if [ -x /usr/bin/regxpcom ]; then
116                 MOZILLA_FIVE_HOME=/usr/%{_lib}/mozilla /usr/bin/regxpcom
117         fi
118 fi
119
120 %triggerin -- konqueror
121 %nsplugin_install -d %{_libdir}/kde3/plugins/konqueror libflashplayer.so
122
123 %triggerun -- konqueror
124 %nsplugin_uninstall -d %{_libdir}/kde3/plugins/konqueror libflashplayer.so
125
126 %triggerin -- opera
127 %nsplugin_install -d %{_libdir}/opera/plugins libflashplayer.so
128
129 %triggerun -- opera
130 %nsplugin_uninstall -d %{_libdir}/opera/plugins libflashplayer.so
131
132 # as rpm removes the old obsoleted package files after the triggers
133 # above are ran, add another trigger to make the links there.
134 %triggerpostun -- mozilla-firefox-plugin-macromedia-flash
135 %nsplugin_install -f -d %{_libdir}/mozilla-firefox/plugins libflashplayer.so flashplayer.xpt
136
137 %triggerpostun -- mozilla-plugin-macromedia-flash
138 %nsplugin_install -f -d %{_libdir}/mozilla/plugins libflashplayer.so flashplayer.xpt
139
140 %triggerpostun -- konqueror-plugin-macromedia-flash
141 %nsplugin_install -f -d %{_libdir}/kde3/plugins/konqueror libflashplayer.so
142 %endif
143
144 %files
145 %defattr(644,root,root,755)
146
147 %if %{without license_agreement}
148 %attr(755,root,root) %{_bindir}/%{base_name}.install
149 %{_datadir}/%{base_name}
150
151 %else
152 %attr(755,root,root) %{_plugindir}/*.so
153 %{_plugindir}/*.xpt
154 %endif
This page took 0.083704 seconds and 4 git commands to generate.