]> git.pld-linux.org Git - packages/adobe-flash.git/blob - adobe-flash.spec
- single package with triggers on browser packages
[packages/adobe-flash.git] / adobe-flash.spec
1 #
2 # Conditional build:
3 %bcond_with     license_agreement       # generates package
4 #
5 Summary:        Flash plugin for Netscape-compatible WWW browsers
6 Summary(pl):    Wtyczka Flash dla przeglĀ±darek WWW zgodnych z Netscape
7 %define         base_name       macromedia-flash
8 %if %{with license_agreement}
9 Name:           %{base_name}
10 %else
11 Name:           %{base_name}-installer
12 %endif
13 Version:        7.0r25
14 Release:        2.13%{?with_license_agreement:wla}
15 License:        Free to use, non-distributable
16 Group:          X11/Applications/Multimedia
17 %if %{with license_agreement}
18 Source0:        http://fpdownload.macromedia.com/get/shockwave/flash/english/linux/%{version}/install_flash_player_7_linux.tar.gz
19 # NoSource0-md5:        79c59a5ea29347e01c8e6575dd054cd1
20 %endif
21 URL:            http://www.macromedia.com/software/flash/
22 BuildRequires:  rpmbuild(macros) >= 1.224
23 Requires:       browser-plugins
24 %if %{without license_agreement}
25 Requires:       /usr/bin/builder
26 %endif
27 Obsoletes:      flash-plugin
28 Obsoletes:      mozilla-plugin-macromedia-flash
29 Obsoletes:      mozilla-firefox-plugin-macromedia-flash
30 Obsoletes:      konqueror-plugin-macromedia-flash
31 ExclusiveArch:  %{ix86}
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %define         _plugindir      %{_libdir}/browser-plugins
35
36 # TODO: opera, galeon and skipstone.
37 # use macro, otherwise extra LF inserted along with the ifarch
38 %define browsers mozilla, mozilla-firefox, konqueror
39
40 %description
41 Flash plugin for Netscape-compatible WWW browsers.
42
43 Supported browsers: %{browsers}.
44
45 %description -l pl
46 Wtyczka Flash dla przeglĀ±darek WWW zgodnych z Netscape.
47
48 Supported browsers: %{browsers}.
49
50 %prep
51 %if %{with license_agreement}
52 %setup -q -n install_flash_player_7_linux
53 %endif
54
55 %install
56 rm -rf $RPM_BUILD_ROOT
57 %if %{without license_agreement}
58 install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/%{base_name}}
59
60 cat <<'EOF' >$RPM_BUILD_ROOT%{_bindir}/%{base_name}.install
61 #!/bin/sh
62 if [ "$1" = "--with" -a "$2" = "license_agreement" ]; then
63         TMPDIR=`rpm --eval "%%{tmpdir}"`; export TMPDIR
64         SPECDIR=`rpm --eval "%%{_specdir}"`; export SPECDIR
65         SRPMDIR=`rpm --eval "%%{_srcrpmdir}"`; export SRPMDIR
66         SOURCEDIR=`rpm --eval "%%{_sourcedir}"`; export SOURCEDIR
67         BUILDDIR=`rpm --eval "%%{_builddir}"`; export BUILDDIR
68         RPMDIR=`rpm --eval "%%{_rpmdir}"`; export RPMDIR
69         BACKUP=0
70         mkdir -p $TMPDIR $SPECDIR $SRPMDIR $RPMDIR $SRPMDIR $SOURCEDIR $BUILDDIR
71         if [ -f $SPECDIR/%{base_name}.spec ]; then
72                 BACKUP=1
73                 mv -f $SPECDIR/%{base_name}.spec $SPECDIR/%{base_name}.spec.prev
74         fi
75         if echo "$3" | grep '\.src\.rpm$' >/dev/null; then
76                 ( cd $SRPMDIR
77                 if echo "$3" | grep '://' >/dev/null; then
78                         wget --passive-ftp -t0 "$3"
79                 else
80                         cp -f "$3" .
81                 fi
82                 rpm2cpio `basename "$3"` | ( cd $TMPDIR; cpio -i %{base_name}.spec )
83                 )
84                 cp -i $TMPDIR/%{base_name}.spec $SPECDIR/%{base_name}.spec || exit 1
85         else
86                 cp -i "$3" $SPECDIR || exit 1
87         fi
88         ( cd $SPECDIR
89         %{_bindir}/builder -nc -ncs --with license_agreement --opts --target=%{_target_cpu} %{base_name}.spec
90         if [ "$?" -ne 0 ]; then
91                 exit 2
92         fi
93         RPMNAME=%{base_name}-%{version}-%{release}wla.%{_target_cpu}.rpm
94         RPMNAMES="$RPMNAMES $RPMDIR/$RPMNAME"
95         rpm -U $RPMNAMES || echo -e "Install manually the file(s):\n   $RPMNAMES" )
96         if [ "$BACKUP" -eq 1 ]; then
97                 if [ -f $SPECDIR/%{base_name}.spec.prev ]; then
98                         mv -f $SPECDIR/%{base_name}.spec.prev $SPECDIR/%{base_name}.spec
99                 fi
100         fi
101 else
102         echo "
103 License issues made us not to include inherent files into
104 this package by default. If you want to create full working
105 package please build it with the following command:
106
107 $0 --with license_agreement %{_datadir}/%{base_name}/%{base_name}.spec
108 "
109 fi
110 EOF
111
112 install %{_specdir}/%{base_name}.spec $RPM_BUILD_ROOT%{_datadir}/%{base_name}
113
114 %else
115
116 install -d $RPM_BUILD_ROOT%{_plugindir}
117 install *.{so,xpt} $RPM_BUILD_ROOT%{_plugindir}
118
119 %endif
120
121 %clean
122 rm -rf $RPM_BUILD_ROOT
123
124 %if %{without license_agreement}
125 %pre
126 echo "
127 License issues made us not to include inherent files into
128 this package by default. If you want to create full working
129 package please build it with the following command:
130
131 %{base_name}.install --with license_agreement %{_datadir}/%{base_name}/%{base_name}.spec
132 "
133 %else
134
135 %triggerin -- mozilla-firefox
136 %nsplugin_install -d %{_libdir}/mozilla-firefox/plugins libflashplayer.so flashplayer.xpt
137
138 %triggerun -- mozilla-firefox
139 %nsplugin_uninstall -d %{_libdir}/mozilla-firefox/plugins libflashplayer.so flashplayer.xpt
140
141 %triggerin -- mozilla
142 %nsplugin_install -d %{_libdir}/mozilla/plugins libflashplayer.so flashplayer.xpt
143 umask 022
144 rm -f /usr/%{_lib}/mozilla/components/{compreg,xpti}.dat
145 if [ -x /usr/bin/regxpcom ]; then
146         MOZILLA_FIVE_HOME=/usr/%{_lib}/mozilla /usr/bin/regxpcom
147 fi
148
149 %triggerun -- mozilla
150 %nsplugin_uninstall -d %{_libdir}/mozilla/plugins libflashplayer.so flashplayer.xpt
151 umask 022
152 rm -f /usr/%{_lib}/mozilla/components/{compreg,xpti}.dat
153 if [ -x /usr/bin/regxpcom ]; then
154         MOZILLA_FIVE_HOME=/usr/%{_lib}/mozilla /usr/bin/regxpcom
155 fi
156
157 %triggerin -- konqueror
158 %nsplugin_install -d %{_libdir}/kde3/plugins/konqueror libflashplayer.so
159
160 %triggerun -- konqueror
161 %nsplugin_uninstall -d %{_libdir}/kde3/plugins/konqueror libflashplayer.so
162
163 %endif
164
165 %files
166 %defattr(644,root,root,755)
167
168 %if %{without license_agreement}
169 %attr(755,root,root) %{_bindir}/%{base_name}.install
170 %{_datadir}/%{base_name}
171
172 %else
173 %attr(755,root,root) %{_plugindir}/*.so
174 %{_plugindir}/*.xpt
175 %endif
This page took 0.053865 seconds and 4 git commands to generate.