]> git.pld-linux.org Git - packages/acroread.git/blob - acroread.spec
- we don't want to copy patches that don't exit
[packages/acroread.git] / acroread.spec
1 #
2 # Conditional build:
3 %bcond_with     license_agreement       # generates package
4 #
5 Summary:        Acrobat Reader
6 Summary(pl):    Acrobat Reader - czytnik plików PDF
7 Summary(ru):    ðÒÏÇÒÁÍÍÁ ÄÌÑ ÞÔÅÎÉÑ ÄÏËÕÍÅÎÔÏ× × ÆÏÒÍÁÔÅ PDF ÏÔ Adobe
8 Summary(uk):    ðÒÏÇÒÁÍÁ ÄÌÑ ÞÉÔÁÎÎÑ ÄÏËÕÍÅÎԦנՠÆÏÒÍÁÔ¦ PDF ×¦Ä Adobe
9 %define         base_name       acroread
10 %if %{with license_agreement}
11 Name:           %{base_name}
12 %else
13 Name:           %{base_name}-installer
14 %endif
15 Version:        5010
16 Release:        1%{?with_license_agreement:wla}
17 License:        distribution restricted (http://www.adobe.com/products/acrobat/distribute.html)
18 # in short:
19 # - not distributable on public sites (only linking to adobe.com permitted)
20 # - distribution on CD requires signing Distribution Agreement (see URL above)
21 Group:          X11/Applications/Graphics
22 %if %{with license_agreement}
23 Source0:        ftp://ftp.adobe.com/pub/adobe/acrobatreader/unix/5.x/linux-%{version}.tar.gz
24 %endif
25 Source1:        %{base_name}.desktop
26 Source2:        %{base_name}.png
27 URL:            http://www.adobe.com/products/acrobat/
28 ExclusiveArch:  %{ix86}
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %define         mozdir          %{_libdir}/mozilla/plugins
32
33 %define         platform        intellinux
34 %define         tar0            LINUXRDR.TAR
35 %define         tar1            COMMON.TAR
36
37 %define         _noautostrip    .*w.*\\.api
38
39 %description
40 Adobe(R) Reader(R) is free software that lets you view and print
41 PDF files (Portable Document Format) on a variety of hardware and
42 operating system platforms.
43
44 %description -l pl
45 Adobe(R) Reader(R) jest darmowym oprogramowaniem umo¿liwiaj±cym ogl±danie
46 oraz drukowanie plików PDF (Portable Document Format) na ró¿nych platformach
47 sprzêtowych oraz ró¿nych systemach operacyjnych.
48
49 %description -l ru
50 ðÒÏÇÒÁÍÍÁ ÄÌÑ ÞÔÅÎÉÑ ÄÏËÕÍÅÎÔÏ× × ÆÏÒÍÁÔÅ Portable Document Format
51 (PDF), ÓÇÅÎÅÒÉÒÏ×ÁÎÎÙÈ Adobe Acrobat'ÏÍ.
52
53 %description -l uk
54 ðÒÏÇÒÁÍÁ ÄÌÑ ÞÉÔÁÎÎÑ ÄÏËÕÍÅÎԦנՠÆÏÒÍÁÔ¦ Portable Document Format
55 (PDF), ÚÇÅÎÅÒÏ×ÁÎÉÈ Adobe Acrobat'ÏÍ.
56
57 %package -n mozilla-plugin-%{base_name}
58 Summary:        Mozilla PDF plugin
59 Summary(pl):    Wtyczka PDF do Mozilli
60 Group:          X11/Applications
61 Prereq:         mozilla-embedded
62 Requires:       %{base_name} = %{version}
63
64 %description -n mozilla-plugin-%{base_name}
65 A Mozilla plugin for displaying PDF (Portable Document Format) files.
66
67 %description -n mozilla-plugin-%{base_name} -l pl
68 Wtyczka Mozilli do wy¶wietlania plików PDF (Portable Document Format).
69
70 %prep
71 %if %{with license_agreement}
72 %setup -q -c
73 cd installers
74 tar xf %{tar0}
75 tar xf %{tar1}
76 %endif
77
78 %install
79 rm -rf $RPM_BUILD_ROOT
80 %if ! %{with license_agreement}
81 install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/%{base_name}}
82
83 cat <<EOF >$RPM_BUILD_ROOT%{_bindir}/%{base_name}.install
84 #!/bin/sh
85 if [ "\$1" = "--with" -a "\$2" = "license_agreement" ]; then
86         TMPDIR=\`rpm --eval "%%{tmpdir}"\`; export TMPDIR
87         SPECDIR=\`rpm --eval "%%{_specdir}"\`; export SPECDIR
88         SRPMDIR=\`rpm --eval "%%{_srcrpmdir}"\`; export SRPMDIR
89         SOURCEDIR=\`rpm --eval "%%{_sourcedir}"\`; export SOURCEDIR
90         BUILDDIR=\`rpm --eval "%%{_builddir}"\`; export BUILDDIR
91         RPMDIR=\`rpm --eval "%%{_rpmdir}"\`; export RPMDIR
92         BACKUP=0
93         mkdir -p \$TMPDIR \$SPECDIR \$SRPMDIR \$RPMDIR \$SRPMDIR \$SOURCEDIR \$BUILDDIR
94         if [ -f \$SPECDIR/%{base_name}.spec ]; then
95                 BACKUP=1
96                 mv -f \$SPECDIR/%{base_name}.spec \$SPECDIR/%{base_name}.spec.prev
97         fi
98         for i in %{base_name}.desktop %{base_name}.png %{base_name}-locale.patch; do
99                 if [ -f \$SOURCEDIR/\$i ]; then
100                         mv -f \$SOURCEDIR/\$i \$SOURCEDIR/\$i.prev
101                         BACKUP=1
102                 fi
103         done
104         if echo "\$3" | grep '\.src\.rpm$' >/dev/null; then
105                 ( cd \$SRPMDIR
106                 if echo "\$3" | grep '://' >/dev/null; then
107                         wget --passive-ftp -t0 "\$3"
108                 else
109                         cp -f "\$3" .
110                 fi
111                 rpm2cpio \`basename "\$3"\` | ( cd \$TMPDIR; cpio -i %{base_name}.spec )
112                 for i in %{base_name}.desktop %{base_name}.png %{base_name}-locale.patch; do
113                         rpm2cpio \$i | ( cd \$TMPDIR; cpio -i \$i )
114                 done )
115                 cp -i \$TMPDIR/%{base_name}.spec \$SPECDIR/%{base_name}.spec \
116                         || exit 1
117                 for i in %{base_name}.desktop %{base_name}.png %{base_name}-locale.patch; do
118                         cp -i \$TMPDIR/\$i \$SOURCEDIR/\$i || exit 1
119                 done
120         else
121                 cp -i "\$3" \$SPECDIR || exit 1
122                 for i in %{base_name}.desktop %{base_name}.png %{base_name}-locale.patch; do
123                         cp -i %{_datadir}/%{base_name}/\$i \$SOURCEDIR/\$i || exit 1
124                 done
125         fi
126         ( cd \$SPECDIR
127         %{_bindir}/builder -nc -ncs --with license_agreement --opts --target=%{_target_cpu} %{base_name}.spec
128         if [ "\$?" -ne 0 ]; then
129                 exit 2
130         fi
131         RPMNAME1=%{base_name}-%{version}-%{release}wla.%{_target_cpu}.rpm
132         RPMNAME2=mozilla-plugin-%{base_name}-%{version}-%{release}wla.%{_target_cpu}.rpm
133         echo "Installing \$RPMNAME1"
134         RPMNAMES=\$RPMDIR/\$RPMNAME1
135         if rpm -q --whatprovides mozilla-embedded >/dev/null 2>&1; then
136                 RPMNAMES="\$RPMNAMES \$RPMDIR/\$RPMNAME2"
137                 echo "Installing \$RPMNAME2"
138         else
139                 echo "Not installing \$RPMNAME2"
140         fi
141         rpm -U \$RPMNAMES || \
142                 echo -e "Install manually the file(s):\n   \$RPMNAMES" )
143         if [ "\$BACKUP" -eq 1 ]; then
144                 if [ -f \$SPECDIR/%{base_name}.spec.prev ]; then
145                         mv -f \$SPECDIR/%{base_name}.spec.prev \$SPECDIR/%{base_name}.spec
146                 fi
147                 for i in %{base_name}.desktop %{base_name}.png %{base_name}-locale.patch; do
148                         if [ -f \$SOURCEDIR/\$i.prev ]; then
149                                 mv -f \$SOURCEDIR/\$i.prev \$SOURCEDIR/\$i
150                         fi
151                 done
152         fi
153 else
154         echo "
155 License issues made us not to include inherent files into
156 this package by default. If you want to create full working
157 package please build it with the following command:
158
159 \$0 --with license_agreement %{_datadir}/%{base_name}/%{base_name}.spec
160 "
161 fi
162 EOF
163
164 install %{_specdir}/%{base_name}.spec $RPM_BUILD_ROOT%{_datadir}/%{base_name}
165 install %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/%{base_name}
166 install %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/%{base_name}
167
168 %else
169 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{base_name},%{mozdir}} \
170         $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
171
172 cd installers
173 cp -a Reader Resource $RPM_BUILD_ROOT%{_libdir}/%{base_name}
174 awk -v INSTDIR=%{_libdir}/%{base_name}/Reader \
175         '/^install_dir=/ {print "install_dir="INSTDIR; next} \
176         {print}' \
177         bin/%{base_name}.sh > $RPM_BUILD_ROOT%{_bindir}/%{base_name}
178 install Browsers/intellinux/* $RPM_BUILD_ROOT%{mozdir}
179 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
180 install %{SOURCE2} $RPM_BUILD_ROOT%{_pixmapsdir}
181 %endif
182
183 %clean
184 rm -rf $RPM_BUILD_ROOT
185
186 %if ! %{with license_agreement}
187 %pre
188 echo "
189 License issues made us not to include inherent files into
190 this package by default. If you want to create full working
191 package please build it with the following command:
192
193 %{base_name}.install --with license_agreement %{_datadir}/%{base_name}/%{base_name}.spec
194 "
195 %endif
196
197 %files
198 %defattr(644,root,root,755)
199 %if ! %{with license_agreement}
200 %attr(755,root,root) %{_bindir}/%{base_name}.install
201 %{_datadir}/%{base_name}
202 %else
203 %doc installers/{LICREAD.TXT,README}
204 %attr(755,root,root) %{_bindir}/*
205 %dir %{_libdir}/%{base_name}
206 %{_libdir}/%{base_name}/Resource
207
208 %dir %{_libdir}/%{base_name}/Reader
209 %{_libdir}/%{base_name}/Reader/help
210 %{_libdir}/%{base_name}/Reader/res
211 %{_libdir}/%{base_name}/Reader/AcroVersion
212 %{_libdir}/%{base_name}/Reader/*.pdf
213 %dir %{_libdir}/%{base_name}/Reader/%{platform}
214 %{_libdir}/%{base_name}/Reader/%{platform}/app-defaults
215 %{_libdir}/%{base_name}/Reader/%{platform}/fonts
216 %{_libdir}/%{base_name}/Reader/%{platform}/res
217 %attr(755,root,root) %{_libdir}/%{base_name}/Reader/%{platform}/plug_ins
218 %attr(755,root,root) %{_libdir}/%{base_name}/Reader/%{platform}/bin
219 %attr(755,root,root) %{_libdir}/%{base_name}/Reader/%{platform}/lib
220 %{_desktopdir}/acroread.desktop
221 %{_pixmapsdir}/*
222
223 %files -n mozilla-plugin-%{base_name}
224 %defattr(644,root,root,755)
225 %attr(755,root,root) %{mozdir}/*
226 %endif
This page took 0.045712 seconds and 4 git commands to generate.