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