1 |
%if %{mdkversion} > 1000 |
2 |
%define __libtoolize /bin/true |
3 |
%endif |
4 |
%define __cputoolize /bin/true |
5 |
|
6 |
%define official_branding 1 |
7 |
|
8 |
%if %mandriva_branch == Cooker |
9 |
# Cooker |
10 |
%define release %mkrel 3 |
11 |
%else |
12 |
# Old distros |
13 |
%define subrel 1 |
14 |
%define release %mkrel 0 |
15 |
%endif |
16 |
|
17 |
%if %{official_branding} |
18 |
%define title Mozilla Thunderbird |
19 |
%else |
20 |
%define title Mail/News |
21 |
%endif |
22 |
|
23 |
%define oname thunderbird |
24 |
%define tb_appid \{3550f703-e582-4d05-9a08-453d09bdfdc6\} |
25 |
%define tbdir %{_libdir}/%{oname}-%{version} |
26 |
%define tbextdir %{_libdir}/mozilla/extensions/%{tb_appid} |
27 |
|
28 |
%define xpi 0 |
29 |
%define enigmail_version 1.1.2 |
30 |
%define enigmail_short_version 1.1.2 |
31 |
%define enigmail_id \{847b3a00-7ab1-11d4-8f02-006008948af5\} |
32 |
|
33 |
%define _provides_exceptions libgtkembedmoz.so\\|libxpcom.so |
34 |
%define _requires_exceptions libgtkembedmoz.so\\|libxpcom.so |
35 |
|
36 |
# FIXME: Bug in nsExtensionManager.js prevents using x86_64 as arch |
37 |
# FIXME: I tried to modify nsExtensionManager.js.in, but it |
38 |
# FIXME: complained that I had modified it |
39 |
%ifarch %{ix86} |
40 |
%define tbarch x86 |
41 |
%else # ix86 |
42 |
%ifarch x86_64 |
43 |
%if %mdkversion < 200810 |
44 |
%define tbarch amd64 |
45 |
%else # mdkversion |
46 |
%define tbarch %{_arch} |
47 |
%endif # mdkversion |
48 |
%else # x86_64 |
49 |
%define tbarch %{_arch} |
50 |
%endif # x86_64 |
51 |
%endif # ix86 |
52 |
|
53 |
# this seems fragile, so require the exact version or later (#58754) |
54 |
%define sqlite3_version %(pkg-config --modversion sqlite3 &>/dev/null && pkg-config --modversion sqlite3 2>/dev/null || echo 0) |
55 |
# this one as well (#59759) |
56 |
%define nss_libname %mklibname nss 3 |
57 |
%define nss_version %(pkg-config --modversion nss &>/dev/null && pkg-config --modversion nss 2>/dev/null || echo 0) |
58 |
|
59 |
Name: mozilla-thunderbird |
60 |
Version: 3.1.7 |
61 |
Release: %{release} |
62 |
Epoch: 0 |
63 |
Summary: Full-featured email, RSS, and newsgroup client |
64 |
License: MPL |
65 |
Group: Networking/Mail |
66 |
URL: http://www.mozillamessaging.com/ |
67 |
Source0: http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/%{version}/source/thunderbird-%{version}.source.tar.bz2 |
68 |
Source1: http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/%{version}/source/thunderbird-%{version}.source.tar.bz2.asc |
69 |
Source12: mozilla-thunderbird-mandriva-default-prefs.js |
70 |
Source30: mozilla-thunderbird-open-browser.sh |
71 |
Source31: mozilla-thunderbird-open-browser-xdg.sh |
72 |
# Mandriva sources (Source300+) |
73 |
Source300: http://www.mozilla-enigmail.org/download/source/enigmail-%{enigmail_version}.tar.gz |
74 |
Source301: http://www.mozilla-enigmail.org/download/source/enigmail-%{enigmail_version}.tar.gz.asc |
75 |
Source302: %{name}-icons.tar.bz2 |
76 |
Source303: mozilla-thunderbird-unofficial.png |
77 |
# Language package template |
78 |
Source400: mozilla-thunderbird-enigmail-l10n-template.in |
79 |
# Build patches |
80 |
Patch2: mozilla-firefox-1.0-prdtoa.patch |
81 |
Patch3: mozilla-thunderbird-2.0.0.19-fix-str-fmt.patch |
82 |
Patch4: mozilla-thunderbird-3.1.7-enable-lightning.patch |
83 |
# Debian patches (Patch200+) |
84 |
Patch200: mozilla-thunderbird-gtk-settings.patch |
85 |
Patch212: mozilla-thunderbird-enigmail-ui-content-contents-rdf.patch |
86 |
Patch213: mozilla-thunderbird-enigmail-build-package-contents-rdf.patch |
87 |
Patch215: mozilla-thunderbird-enigmail-visibility.patch |
88 |
# Mandriva patches (Patch300+) |
89 |
Patch300: mozilla-thunderbird-0.8-progname.patch |
90 |
Patch301: mozilla-thunderbird-enigmail-package.patch |
91 |
Patch302: mozilla-thunderbird-check-default-mailer.patch |
92 |
Patch304: mozilla-thunderbird-run-mozilla.patch |
93 |
Patch305: mozilla-thunderbird-2.0b1-x11libs.patch |
94 |
Patch306: mozilla-thunderbird-run-mozilla-soundwrapper.patch |
95 |
Patch307: mozilla-thunderbird-system-hunspell.patch |
96 |
# Adds support for config file thunderbird.cfg |
97 |
Patch310: thunderbird-2.0b2-configfile.patch |
98 |
Patch334: mozilla-thunderbird-2.0.0.22-CVE-2009-XXXX.diff |
99 |
Patch335: thunderbird-3.0rc1-format-not-a-string-literal.patch |
100 |
Patch336: mozilla-thunderbird-CVE-2009-3560.diff |
101 |
# OpenSuse patches (Patch400+) |
102 |
Patch400: thunderbird-appname.patch |
103 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root |
104 |
BuildRequires: autoconf2.1 |
105 |
%if %mdkversion >= 201000 |
106 |
BuildRequires: cairo-devel >= 1.8.8 |
107 |
%endif |
108 |
%if %mdkversion >= 200800 |
109 |
Requires: %{mklibname sqlite3_ 0} >= %{sqlite3_version} |
110 |
BuildRequires: libsqlite3-devel >= 3.6.22 |
111 |
%endif |
112 |
Requires: %{nss_libname} >= 2:%{nss_version} |
113 |
BuildRequires: gtk2-devel |
114 |
BuildRequires: gzip |
115 |
BuildRequires: python-devel |
116 |
BuildRequires: libgnome2-devel |
117 |
BuildRequires: libgnomeui2-devel |
118 |
BuildRequires: libjpeg-devel |
119 |
#(tpg) older versions doesn't support apng extension |
120 |
%if %mdkversion >= 200900 |
121 |
BuildRequires: libpng-devel >= 1.2.25-2 |
122 |
%endif |
123 |
BuildRequires: nspr-devel >= 2:4.8.4 |
124 |
BuildRequires: nss-devel >= 2:3.12.6 |
125 |
%if %{mdkversion} >= 200700 |
126 |
BuildRequires: nss-static-devel |
127 |
%endif |
128 |
BuildRequires: unzip |
129 |
BuildRequires: zip |
130 |
BuildRequires: zlib-devel |
131 |
BuildRequires: libIDL-devel |
132 |
# Needed by xmlterm (not built) and unused enigmail scripts |
133 |
#BuildRequires: tcsh |
134 |
BuildRequires: freetype2-devel |
135 |
%if %{mdkversion} >= 200610 |
136 |
BuildRequires: xft2-devel |
137 |
BuildRequires: libxt-devel |
138 |
%else |
139 |
BuildRequires: libXft2-devel |
140 |
%endif |
141 |
%if %mdkversion >= 200900 |
142 |
BuildRequires: hunspell-devel |
143 |
# fixes bug 46107 |
144 |
%endif |
145 |
Requires(post): desktop-file-utils |
146 |
Requires(postun): desktop-file-utils |
147 |
Requires(post): mktemp |
148 |
Requires(post): rpm-helper |
149 |
Requires(postun): rpm-helper |
150 |
# Integrates thunderbird with xdg-utils. |
151 |
%if %mdkversion >= 200800 |
152 |
Requires: xdg-utils |
153 |
%endif |
154 |
%if %{official_branding} |
155 |
BuildRequires: imagemagick |
156 |
%endif |
157 |
# Thunderbird 3 requires alsa |
158 |
BuildRequires: libalsa-devel |
159 |
BuildRequires: python |
160 |
BuildRequires: libnotify-devel |
161 |
BuildRequires: libiw-devel |
162 |
|
163 |
%description |
164 |
%{title} is a full-featured email, RSS and newsgroup client that |
165 |
makes emailing safer, faster and easier than ever before. |
166 |
|
167 |
#=============================================================================== |
168 |
|
169 |
%package enigmail |
170 |
Summary: Access the authentication and encryption features provided by GnuPG |
171 |
Group: Networking/Mail |
172 |
Requires: %{name} = %{epoch}:%{version} |
173 |
Obsoletes: %{name}-enigmime |
174 |
Provides: %{name}-enigmime = %{epoch}:%{version} |
175 |
Requires: gnupg |
176 |
Requires(post): %{name} = %{epoch}:%{version} |
177 |
Requires(preun): %{name} = %{epoch}:%{version} |
178 |
Requires(post): mktemp |
179 |
Requires(postun): mktemp |
180 |
# Bug #35180 |
181 |
%if %{mdkversion} >= 200810 |
182 |
Suggests: pinentry-gtk |
183 |
%endif |
184 |
|
185 |
%description enigmail |
186 |
Enigmail is an extension to the mail client of %{title} |
187 |
which allows users to access the authentication and encryption |
188 |
features provided by GnuPG. |
189 |
|
190 |
Main Features |
191 |
|
192 |
* Encrypt/sign mail when sending, decrypt/authenticate received |
193 |
mail |
194 |
* Support for inline-PGP (RFC 2440) and PGP/MIME (RFC 3156) |
195 |
* Per-Account based encryption and signing defaults |
196 |
* Per-Recipient rules for automated key selection, and |
197 |
enabling/disabling encryption and signing |
198 |
* OpenPGP key management interface |
199 |
|
200 |
#=============================================================================== |
201 |
|
202 |
%package -n nsinstall |
203 |
Summary: Netscape portable install command |
204 |
Group: Development/Other |
205 |
|
206 |
%description -n nsinstall |
207 |
Netscape portable install command. |
208 |
|
209 |
#=============================================================================== |
210 |
%package lightning |
211 |
Summary: Calendar extension for Thunderbird |
212 |
URL: http://www.mozilla.org/projects/calendar/lightning/ |
213 |
Requires: %{name} >= %{epoch}:%{version} |
214 |
|
215 |
%description lightning |
216 |
Calendar extension for Thunderbird. |
217 |
|
218 |
#=============================================================================== |
219 |
# enigmail-l10n |
220 |
# Supported l10n language lists |
221 |
%define l10n_langlist ar ca cs de el es fi fr hu it ja ko nb nl pl pt pt_BR ru sl sv tr vi zh_CN zh_TW |
222 |
|
223 |
# Disabled l10n languages, for any reason |
224 |
# nl sk es_AR do not support 0.95.0 yet |
225 |
#define disabled_l10n_langlist nl sk es_AR ro |
226 |
%define disabled_l10n_langlist %{nil} |
227 |
|
228 |
# Language descriptions |
229 |
%define language_ar ar |
230 |
%define langname_ar Arabic |
231 |
%define language_ca ca |
232 |
%define langname_ca Catalan |
233 |
%define language_cs cs-CZ |
234 |
%define langname_cs Czech |
235 |
%define language_de de-DE |
236 |
%define langname_de German |
237 |
%define language_el el |
238 |
%define langname_el Greek |
239 |
%define language_es_AR es-AR |
240 |
%define langname_es_AR Spanish (Argentina) |
241 |
%define language_es es-ES |
242 |
%define langname_es Spanish |
243 |
%define language_fi fi-FI |
244 |
%define langname_fi Finnish |
245 |
%define language_fr fr-FR |
246 |
%define langname_fr French |
247 |
%define language_hu hu-HU |
248 |
%define langname_hu Hungarian |
249 |
%define language_it it-IT |
250 |
%define langname_it Italian |
251 |
%define language_ja ja-JP |
252 |
%define langname_ja Japanese |
253 |
%define language_ko ko-KR |
254 |
%define langname_ko Korean |
255 |
%define language_nb nb-NO |
256 |
%define langname_nb Norwegian Bokmaal |
257 |
%define langname_nl Dutch |
258 |
%define language_nl nl-NL |
259 |
%define language_pl pl-PL |
260 |
%define langname_pl Polish |
261 |
%define langname_pt Portuguese |
262 |
%define language_pt pt-PT |
263 |
%define language_pt_BR pt-BR |
264 |
%define langname_pt_BR Brazilian portuguese |
265 |
%define language_ro ro-RO |
266 |
%define langname_ro Romanian |
267 |
%define language_ru ru-RU |
268 |
%define langname_ru Russian |
269 |
%define language_sk sk-SK |
270 |
%define langname_sk Slovak |
271 |
%define language_sl sl-SI |
272 |
%define langname_sl Slovenian |
273 |
%define language_sv sv-SE |
274 |
%define langname_sv Swedish |
275 |
%define language_tr tr-TR |
276 |
%define langname_tr Turkish |
277 |
%define language_vi vi-VN |
278 |
%define langname_vi Vietnamese |
279 |
%define language_zh_CN zh-CN |
280 |
%define langname_zh_CN Simplified Chinese |
281 |
%define language_zh_TW zh-TW |
282 |
%define langname_zh_TW Traditional Chinese |
283 |
|
284 |
# --- Danger line --- |
285 |
|
286 |
# All langs |
287 |
%{expand:%%define langlist %(for lang in %l10n_langlist; do echo "$lang"; done | sort -u | sed ':a;$!N;s/\n/ /;ta')} |
288 |
|
289 |
# Defaults (all languages enabled by default) |
290 |
# l10n |
291 |
%{expand:%(for lang in %l10n_langlist; do echo "%%define l10n_$lang 1"; done)} |
292 |
%{expand:%(for lang in %disabled_l10n_langlist; do echo "%%define l10n_$lang 0"; done)} |
293 |
|
294 |
# Params |
295 |
%{expand:%(for lang in %langlist; do echo "%%bcond_without $lang"; done)} |
296 |
|
297 |
# Locales |
298 |
%{expand:%(for lang in %l10n_langlist; do echo "%%define locale_$lang `echo $lang | cut -d _ -f 1` "; done)} |
299 |
|
300 |
# Expand all languages packages. |
301 |
%{expand:%(\ |
302 |
for lang in %langlist; do\ |
303 |
echo "%%{expand:%%(sed "s!__LANG__!$lang!g" %{_sourcedir}/mozilla-thunderbird-enigmail-l10n-template.in 2> /dev/null)}";\ |
304 |
done\ |
305 |
) |
306 |
} |
307 |
#=============================================================================== |
308 |
|
309 |
%prep |
310 |
%setup -q -c -n %{name}-%{version} |
311 |
|
312 |
#=================== |
313 |
# Thunderbird itself |
314 |
%setup -q -T -D -n %{name}-%{version}/comm-1.9.2 |
315 |
|
316 |
%patch2 -p0 |
317 |
%patch3 -p0 |
318 |
%patch4 -p0 |
319 |
|
320 |
%patch200 -p1 |
321 |
|
322 |
%patch300 -p0 -b .progname |
323 |
%patch301 -p1 -b .enigmailpackage |
324 |
%patch302 -p1 -b .check |
325 |
%patch304 -p0 -b .run-mozilla |
326 |
%patch305 -p1 -b .x11libs |
327 |
%patch307 -p1 -b .system-hunspell |
328 |
|
329 |
#%%if %{mdkversion} < 201000 |
330 |
#%%patch306 -p0 -b .run-mozilla-soundwrapper |
331 |
#%%endif |
332 |
|
333 |
%patch310 -p1 |
334 |
|
335 |
%patch334 -p0 -b .CVE-2009-XXXX |
336 |
%patch335 -p1 -b .literal |
337 |
%patch336 -p0 -b .CVE-2009-3560 |
338 |
|
339 |
%patch400 -p1 -b .appname |
340 |
|
341 |
#=============================================================================== |
342 |
# Enigmail |
343 |
%setup -q -T -D -n %{name}-%{version}/comm-1.9.2/mozilla/extensions -a300 |
344 |
%if 0 |
345 |
%patch212 -p2 -b .enigmail-ui-content-contents-rdf |
346 |
%patch213 -p2 -b .enigmail-build-package-contents-rdf |
347 |
%endif |
348 |
%if %{mdkversion} > 200810 |
349 |
%patch215 -p2 -b .enigmail-visibility |
350 |
%endif |
351 |
|
352 |
%if !%{official_branding} |
353 |
%setup -q -T -D -n %{name}-%{version}/comm-1.9.2 -a302 |
354 |
%endif |
355 |
|
356 |
%setup -q -T -D -n %{name}-%{version}/comm-1.9.2 |
357 |
|
358 |
#=============================================================================== |
359 |
|
360 |
%build |
361 |
export BUILD_OFFICIAL=1 |
362 |
export MOZILLA_OFFICIAL=1 |
363 |
|
364 |
#(tpg) please see bug #32024 |
365 |
# from fedora: Pragma visibility is broken on most platforms for some reason. |
366 |
# See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20297 |
367 |
export ac_cv_visibility_pragma=no |
368 |
|
369 |
CFLAGS=$(echo %optflags | %{__sed} -e 's/-fexceptions//') |
370 |
CFLAGS="$CFLAGS -fno-strict-aliasing" |
371 |
CXXFLAGS="$CFLAGS" |
372 |
RPM_OPT_FLAGS="$CFLAGS" |
373 |
export CFLAGS |
374 |
export CXXFLAGS |
375 |
export RPM_OPT_FLAGS |
376 |
|
377 |
autoconf-2.13 |
378 |
%configure2_5x \ |
379 |
--enable-application=mail \ |
380 |
--with-system-nspr \ |
381 |
--with-system-nss \ |
382 |
--with-system-jpeg \ |
383 |
--with-system-zlib \ |
384 |
%if %mdkversion >= 200900 |
385 |
--enable-system-png \ |
386 |
%else |
387 |
--disable-system-png \ |
388 |
%endif |
389 |
--with-pthreads \ |
390 |
--disable-tests \ |
391 |
--disable-debug \ |
392 |
--disable-installer \ |
393 |
--enable-xinerama \ |
394 |
--enable-default-toolkit=cairo-gtk2 \ |
395 |
--disable-xprint \ |
396 |
--disable-strip \ |
397 |
--enable-pango \ |
398 |
%if %mdkversion >= 201000 |
399 |
--enable-system-cairo \ |
400 |
%else |
401 |
--disable-system-cairo \ |
402 |
%endif |
403 |
--enable-svg \ |
404 |
--enable-canvas \ |
405 |
--enable-crypto \ |
406 |
--enable-extensions=default,inspector \ |
407 |
--enable-mathml \ |
408 |
--enable-system-hunspell \ |
409 |
--enable-calendar \ |
410 |
--disable-crashreporter \ |
411 |
--enable-static \ |
412 |
--disable-libxul \ |
413 |
--disable-dbus \ |
414 |
%if %mdkversion >= 200800 |
415 |
--enable-system-sqlite \ |
416 |
%else |
417 |
--disable-system-sqlite \ |
418 |
%endif |
419 |
%if %mdkversion >= 200900 |
420 |
--enable-system-hunspell \ |
421 |
%else |
422 |
--disable-system-myspell \ |
423 |
%endif |
424 |
--enable-official-branding \ |
425 |
--with-distribution-id=com.mandriva |
426 |
|
427 |
# Fix ABI for thunderbird and enigmail |
428 |
%{__perl} -pi -e 's|^TARGET_XPCOM_ABI =.*|TARGET_XPCOM_ABI = %{tbarch}-gcc3|' config/autoconf.mk |
429 |
%{__perl} -pi -e 's|^ENIG_XPCOM_ABI =.*|ENIG_XPCOM_ABI = Linux_%{tbarch}-gcc3|' extensions/enigmail/Makefile |
430 |
|
431 |
# Compress jars |
432 |
%{__perl} -pi -e 's|\-0|\-9|g' config/make-jars.pl |
433 |
|
434 |
%make |
435 |
|
436 |
#=============================================================================== |
437 |
|
438 |
pushd mozilla/extensions/enigmail |
439 |
|
440 |
for i in `find . -type f -name Makefile.in`; do |
441 |
if [ -f $i.bak ]; then |
442 |
cp $i.bak $i |
443 |
else |
444 |
%{__cp} $i $i.bak |
445 |
fi |
446 |
# %{__perl} -pi -e 's|^(DEPTH.*= )../|\1|;' $i |
447 |
done |
448 |
|
449 |
./makemake -r |
450 |
%{make} LOCAL_INCLUDES+="-I\$(DEPTH)/mailnews/mime/src -I../build -I../src -I../ipc/src" |
451 |
|
452 |
(cd lang |
453 |
%{__perl} -pi -e 's|es-AR/enigmail.properties|es-ES/enigmail.properties|' jar.mn |
454 |
echo 'zh-TW' >> current-languages.txt |
455 |
%{make} LOCAL_INCLUDES+="-I\$(DEPTH)/mailnews/mime/src -I../build -I../src -I../ipc/src" |
456 |
for i in `cat current-languages.txt`; do |
457 |
./make-lang.sh $i %{enigmail_short_version} |
458 |
done |
459 |
) |
460 |
|
461 |
%{make} xpi |
462 |
|
463 |
popd |
464 |
|
465 |
#=============================================================================== |
466 |
|
467 |
%install |
468 |
%{__rm} -rf %{buildroot} |
469 |
%{__mkdir_p} %{buildroot}{%{_libdir},%{_bindir},%{_datadir}/applications} |
470 |
%{__mkdir_p} %buildroot%tbdir |
471 |
|
472 |
%if %mdkversion >= 200810 |
473 |
rm -f extensions/spellcheck/locales/en-US/hunspell/en-US.{dic,aff} |
474 |
%endif |
475 |
|
476 |
make install DESTDIR=%{buildroot} -j ${NRPROC:-1} |
477 |
|
478 |
%if %mdkversion >= 200810 |
479 |
rm -rf %buildroot%tbdir/dictionaries |
480 |
ln -s /usr/share/dict/mozilla %buildroot%tbdir/dictionaries |
481 |
%endif |
482 |
|
483 |
## Compatibility links for now. #29128 |
484 |
#ln -s %{_libdir}/%{oname}-%{version} \ |
485 |
# %{buildroot}%{_libdir}/mozilla-thunderbird-%{version} |
486 |
#ln -s %{_bindir}/%{oname}-config \ |
487 |
# %{buildroot}%{_bindir}/mozilla-thunderbird-config |
488 |
|
489 |
%if %{official_branding} |
490 |
%{__install} -p -D %{buildroot}/%{tbdir}/chrome/icons/default/default256.png %{buildroot}%{_datadir}/pixmaps/%{name}.png |
491 |
%else |
492 |
%{__install} -p -D %{SOURCE302} %{buildroot}%{_datadir}/pixmaps/%{name}.png |
493 |
%endif |
494 |
|
495 |
cat << EOF > %{buildroot}/%{_datadir}/applications/mandriva-%{name}.desktop |
496 |
[Desktop Entry] |
497 |
Version=1.0 |
498 |
Name=%{title} |
499 |
GenericName=Mail/News |
500 |
Comment=Mail and News Client |
501 |
Exec=%{name} |
502 |
Icon=mozilla-thunderbird |
503 |
Terminal=false |
504 |
Type=Application |
505 |
StartupWMClass=Thunderbird-bin |
506 |
%if %mdkversion >= 200800 |
507 |
Categories=GTK;Network;News;Email;X-MandrivaLinux-CrossDesktop; |
508 |
%else |
509 |
Categories=GTK;Network;News;Email;Office;X-MandrivaLinux-CrossDesktop; |
510 |
%endif |
511 |
EOF |
512 |
|
513 |
# set up the thunderbird start script |
514 |
(cd %{buildroot}%{_bindir} && %{__ln_s} thunderbird %{name}) |
515 |
|
516 |
%{__perl} -pi -e 's|^moz_libdir=.*|moz_libdir=%{tbdir}|' %{buildroot}/%{_bindir}/thunderbird |
517 |
%{__perl} -pi -e 's|^MRE_HOME=.*|MRE_HOME=%{tbdir}|' %{buildroot}/%{_bindir}/thunderbird |
518 |
|
519 |
# <mrl> 200800 is safe here. |
520 |
%if %mdkversion >= 200800 |
521 |
# For backwards compatibility with old profiles. Bug #37528 |
522 |
%{__install} -m 755 %{SOURCE31} %{buildroot}/%{tbdir}/open-browser.sh |
523 |
# For new profiles |
524 |
%define COMMAND /usr/bin/xdg-open |
525 |
%else |
526 |
%{__install} -m 755 %{SOURCE30} %{buildroot}/%{tbdir}/open-browser.sh |
527 |
%define COMMAND %{tbdir}/open-browser.sh |
528 |
%endif |
529 |
|
530 |
%{__cat} %{SOURCE12} | %{__perl} -p -e 's,THUNDERBIRD_RPM_VR,%{version}-%{release},g;' \ |
531 |
-e 's,THUNDERBIRD_VENDOR_COMMENT,%{mandriva_release},g;' \ |
532 |
-e 's,COMMAND,%{COMMAND},g' \ |
533 |
> %{buildroot}/mdv-default-prefs |
534 |
%{__cp} -a %{buildroot}/mdv-default-prefs %{buildroot}/%{tbdir}/greprefs/all-mandriva.js |
535 |
%{__cp} -a %{buildroot}/mdv-default-prefs %{buildroot}/%{tbdir}/defaults/pref/all-mandriva.js |
536 |
%{__rm} -f %{buildroot}/mdv-default-prefs |
537 |
|
538 |
#=============================================================================== |
539 |
|
540 |
# icons |
541 |
%{__mkdir_p} %{buildroot}{%{_liconsdir},%{_iconsdir},%{_miconsdir}} |
542 |
%if %{official_branding} |
543 |
%{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/{16x16,22x22,24x24,32x32,48x48,256x256}/apps |
544 |
%{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default48.png %{buildroot}%{_liconsdir}/%{name}.png |
545 |
%{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default32.png %{buildroot}%{_iconsdir}/%{name}.png |
546 |
%{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default16.png %{buildroot}%{_miconsdir}/%{name}.png |
547 |
%{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/%{name}.png |
548 |
%{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default22.png %{buildroot}%{_datadir}/icons/hicolor/22x22/apps/%{name}.png |
549 |
%{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default24.png %{buildroot}%{_datadir}/icons/hicolor/24x24/apps/%{name}.png |
550 |
%{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png |
551 |
%{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png |
552 |
%{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default256.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/%{name}.png |
553 |
%else |
554 |
%{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/{64x64,128x128}/apps |
555 |
%{__install} -m 644 %{name}-48.png %{buildroot}%{_liconsdir}/%{name}.png |
556 |
%{__install} -m 644 %{name}-32.png %{buildroot}%{_iconsdir}/%{name}.png |
557 |
%{__install} -m 644 %{name}-16.png %{buildroot}%{_miconsdir}/%{name}.png |
558 |
# Converting up, but not a big issue now that we have official branding |
559 |
%{_bindir}/convert %{name}-48.png -resize 128x128 %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/%{name}.png |
560 |
%{_bindir}/convert %{name}-48.png -resize 64x64 %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/%{name}.png |
561 |
%endif |
562 |
|
563 |
#=============================================================================== |
564 |
|
565 |
#pushd dist |
566 |
#%{__mkdir_p} %{buildroot}%{_includedir}/%{oname}-%{version} |
567 |
#%{__cp} -aL include/* %{buildroot}%{_includedir}/%{oname}-%{version} |
568 |
#%{__mkdir_p} %{buildroot}%{_datadir}/idl/%{oname}-%{version} |
569 |
#%{__cp} -aL idl/* %{buildroot}%{_datadir}/idl/%{oname}-%{version} |
570 |
#popd |
571 |
|
572 |
#pushd dist/sdk |
573 |
#%{__mkdir_p} %{buildroot}%{_libdir}/%{oname}-%{version} |
574 |
#%{__cp} -aL bin/* %{buildroot}%{_libdir}/%{oname}-%{version} |
575 |
#%{__mkdir_p} %{buildroot}%{_includedir}/%{oname}-%{version} |
576 |
#%{__cp} -aL include/* %{buildroot}%{_includedir}/%{oname}-%{version} |
577 |
#%{__mkdir_p} %{buildroot}%{_datadir}/idl/%{oname}-%{version} |
578 |
#%{__cp} -aL idl/* %{buildroot}%{_datadir}/idl/%{oname}-%{version} |
579 |
#popd |
580 |
|
581 |
#=============================================================================== |
582 |
|
583 |
%{__mkdir_p} %{buildroot}%{tbextdir}/%{enigmail_id} |
584 |
%if !%{xpi} |
585 |
%{_bindir}/unzip -q mozilla/dist/bin/enigmail-%{enigmail_short_version}-linux-*.xpi -d %{buildroot}%{tbextdir}/%{enigmail_id} |
586 |
%{__chmod} 644 %{buildroot}%{tbextdir}/%{enigmail_id}/chrome.manifest |
587 |
%else |
588 |
%{__cp} -aL mozilla/dist/bin/enigmail-%{enigmail_short_version}-linux-*.xpi %{buildroot}%{tbextdir}/%{enigmail_id}/%{enigmail_id}.xpi |
589 |
%endif |
590 |
|
591 |
#============================================================================== |
592 |
#enigmail lang package |
593 |
# Convert rpm macros to bash variables |
594 |
%{expand:%(for lang in %langlist; do echo "language_$lang=%%{language_$lang}"; done)} |
595 |
%{expand:%(for lang in %langlist; do echo "with_$lang=%%{with $lang}"; done)} |
596 |
%{expand:%(for lang in %l10n_langlist; do echo "l10n_$lang=%%{l10n_$lang}"; done)} |
597 |
pushd mozilla/extensions/enigmail/lang |
598 |
for lang in %langlist; do |
599 |
%{__mkdir_p} %{buildroot}%{_datadir}/mozilla/extensions/%{tb_appid}/enigmail-$lang@enigmail.mozdev.org |
600 |
language="language_$lang" |
601 |
language=${!language} |
602 |
%{_bindir}/unzip -q enigmail-${language}-%{enigmail_short_version}.xpi -d %{buildroot}%{_datadir}/mozilla/extensions/%{tb_appid}/enigmail-$lang@enigmail.mozdev.org/ |
603 |
done |
604 |
popd |
605 |
|
606 |
#=============================================================================== |
607 |
# lightning ext here |
608 |
pushd mozilla/dist/xpi-stage/ |
609 |
for ext in {calendar-timezones,gdata-provider,lightning}; do |
610 |
hash="$(sed -n '/.*em:id>\(.*\)<\/em:id>.*/{s//\1/p;q}' $ext/install.rdf)" |
611 |
mkdir -p %buildroot%{tbextdir}/$hash |
612 |
%{_bindir}/unzip -q $ext.xpi -d %buildroot%{tbextdir}/$hash/ |
613 |
done |
614 |
popd |
615 |
|
616 |
#=============================================================================== |
617 |
|
618 |
touch %{buildroot}%{tbdir}/chrome/app-chrome.manifest |
619 |
%{__chmod} 644 %{buildroot}%{tbdir}/chrome/app-chrome.manifest |
620 |
touch %{buildroot}%{tbdir}/components/compreg.dat |
621 |
%{__chmod} 644 %{buildroot}%{tbdir}/components/compreg.dat |
622 |
touch %{buildroot}%{tbdir}/components/xpti.dat |
623 |
%{__chmod} 644 %{buildroot}%{tbdir}/components/xpti.dat |
624 |
|
625 |
#=============================================================================== |
626 |
|
627 |
# remove files already packaged as system libs |
628 |
#%{__chmod} 644 %{buildroot}%{tbdir}/defaults/pref/enigmail.js |
629 |
#%{__chmod} 644 %{buildroot}%{tbdir}/extensions/*/defaults/pref*/enigmail.js |
630 |
#%{__perl} -pi -e 's|agentPath",""|agentPath","%{_bindir}/gpg"|' %{buildroot}%{tbdir}/extensions/*/defaults/pref*/enigmail.js |
631 |
|
632 |
%{__cp} -aL mozilla/dist/bin/nsinstall %{buildroot}%{_bindir} |
633 |
|
634 |
#=============================================================================== |
635 |
|
636 |
mkdir -p %{buildroot}%{_sysconfdir} |
637 |
cat << EOF > %{buildroot}/%{_sysconfdir}/thunderbird.cfg |
638 |
pref("network.protocol-handler.app.http", "/usr/bin/xdg-open"); |
639 |
pref("network.protocol-handler.app.https", "/usr/bin/xdg-open"); |
640 |
pref("network.protocol-handler.app.ftp", "/usr/bin/xdg-open"); |
641 |
EOF |
642 |
ln -s %{_sysconfdir}/thunderbird.cfg \ |
643 |
%{buildroot}%{tbdir}/thunderbird.cfg |
644 |
|
645 |
#============================================================================== |
646 |
|
647 |
%clean |
648 |
%{__rm} -rf %{buildroot} |
649 |
|
650 |
#=============================================================================== |
651 |
|
652 |
%pre |
653 |
%if %mdkversion >= 200810 |
654 |
if [ $1 == 2 ]; then |
655 |
if [ -d %{tbdir}/dictionaries ]; then |
656 |
# Otherelse rpm can't switch this into a symlink :( |
657 |
rm -rf %{tbdir}/dictionaries |
658 |
fi |
659 |
fi |
660 |
%endif # 200810 |
661 |
|
662 |
%post |
663 |
%if %mdkversion > 200600 |
664 |
%{_bindir}/update-desktop-database %{_datadir}/applications |
665 |
%endif |
666 |
|
667 |
%create_ghostfile %{tbdir}/chrome/app-chrome.manifest root root 644 |
668 |
%create_ghostfile %{tbdir}/components/compreg.dat root root 644 |
669 |
%create_ghostfile %{tbdir}/components/xpti.dat root root 644 |
670 |
|
671 |
if [ -f %{tbdir}/components/compreg.dat ]; then |
672 |
%{__rm} -f %{tbdir}/components/compreg.dat |
673 |
fi |
674 |
|
675 |
if [ -f %{tbdir}/components/xpti.dat ]; then |
676 |
%{__rm} -f %{tbdir}/components/xpti.dat |
677 |
fi |
678 |
|
679 |
mktemp="/bin/mktemp -d -q -p /tmp -t %{name}.XXXXXXXXXX" |
680 |
|
681 |
TMPDIR= TB_TMPDIR=`$mktemp` && { |
682 |
HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -register |
683 |
test -d "$TB_TMPDIR" && %{__rm} -rf -- "$TB_TMPDIR" |
684 |
} |
685 |
|
686 |
if [ -x %{_bindir}/gtk-update-icon-cache ]; then |
687 |
%{_bindir}/gtk-update-icon-cache --force --quiet %{_datadir}/icons/hicolor |
688 |
fi |
689 |
|
690 |
|
691 |
%postun |
692 |
%if %mdkversion > 200600 |
693 |
%{_bindir}/update-desktop-database %{_datadir}/applications |
694 |
%endif |
695 |
if [ "$1" = "0" -a -x %{_bindir}/gtk-update-icon-cache ]; then |
696 |
%{_bindir}/gtk-update-icon-cache --force --quiet %{_datadir}/icons/hicolor |
697 |
fi |
698 |
|
699 |
|
700 |
#=============================================================================== |
701 |
|
702 |
%post enigmail |
703 |
if [ -f %{tbdir}/components/compreg.dat ]; then |
704 |
%{__rm} -f %{tbdir}/components/compreg.dat |
705 |
fi |
706 |
|
707 |
if [ -f %{tbdir}/components/xpti.dat ]; then |
708 |
%{__rm} -f %{tbdir}/components/xpti.dat |
709 |
fi |
710 |
|
711 |
mktemp="/bin/mktemp -d -q -p /tmp -t %{name}.XXXXXXXXXX" |
712 |
|
713 |
TMPDIR= TB_TMPDIR=`$mktemp` && { |
714 |
%if %{xpi} |
715 |
HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -install-global-extension %{tbextdir}/enigmail-%{enigmail_version}-linux-*.xpi |
716 |
%endif |
717 |
HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -register |
718 |
test -d "$TB_TMPDIR" && %{__rm} -rf -- "$TB_TMPDIR" |
719 |
} |
720 |
|
721 |
%preun enigmail |
722 |
if [ -f %{tbdir}/components/compreg.dat ]; then |
723 |
%{__rm} -f %{tbdir}/components/compreg.dat |
724 |
fi |
725 |
|
726 |
if [ -f %{tbdir}/components/xpti.dat ]; then |
727 |
%{__rm} -f %{tbdir}/components/xpti.dat |
728 |
fi |
729 |
|
730 |
if [ -x %{tbdir}/thunderbird-bin ]; then |
731 |
mktemp="/bin/mktemp -d -q -p /tmp -t %{name}.XXXXXXXXXX" |
732 |
|
733 |
TMPDIR= TB_TMPDIR=`$mktemp` && { |
734 |
%if %{xpi} |
735 |
HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -install-global-extension %{tbextdir}/enigmail-%{enigmail_version}-linux-*.xpi |
736 |
%endif |
737 |
HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -register |
738 |
test -d "$TB_TMPDIR" && %{__rm} -rf -- "$TB_TMPDIR" |
739 |
} |
740 |
fi |
741 |
|
742 |
#=============================================================================== |
743 |
|
744 |
%files |
745 |
%defattr(-,root,root,-) |
746 |
%doc mozilla/LEGAL |
747 |
%attr(755,root,root) %{_bindir}/mozilla-thunderbird |
748 |
%attr(755,root,root) %{_bindir}/thunderbird |
749 |
%attr(644,root,root) %{_datadir}/applications/*.desktop |
750 |
%attr(644,root,root) %{_datadir}/pixmaps/%{name}.png |
751 |
%ghost %{tbdir}/chrome/app-chrome.manifest |
752 |
%ghost %{tbdir}/components/compreg.dat |
753 |
%ghost %{tbdir}/components/xpti.dat |
754 |
%{tbdir} |
755 |
%if %{xpi} |
756 |
%dir %{tbextdir} |
757 |
%endif |
758 |
%config(noreplace) %{_sysconfdir}/thunderbird.cfg |
759 |
# Mandriva menu |
760 |
%{_miconsdir}/%{name}.png |
761 |
%{_iconsdir}/%{name}.png |
762 |
%{_liconsdir}/%{name}.png |
763 |
# other icons |
764 |
%if %{official_branding} |
765 |
%{_datadir}/icons/hicolor/16x16/apps/%{name}.png |
766 |
%{_datadir}/icons/hicolor/22x22/apps/%{name}.png |
767 |
%{_datadir}/icons/hicolor/24x24/apps/%{name}.png |
768 |
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png |
769 |
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png |
770 |
%{_datadir}/icons/hicolor/256x256/apps/%{name}.png |
771 |
%else |
772 |
%{_datadir}/icons/hicolor/64x64/apps/%{name}.png |
773 |
%{_datadir}/icons/hicolor/128x128/apps/%{name}.png |
774 |
%endif |
775 |
# enigmail |
776 |
%exclude %{tbextdir}/%{enigmail_id} |
777 |
# exclude enigmail stuff |
778 |
#%exclude %{tbdir}/components/enigmail* |
779 |
#%exclude %{tbdir}/components/enigMsgCompFields.js |
780 |
#%exclude %{tbdir}/components/enigprefs-service.js |
781 |
#%exclude %{tbdir}/chrome/enigmail*.jar |
782 |
#%exclude %{tbdir}/defaults/pref/enigmail.js |
783 |
#%exclude %{tbdir}/defaults/preferences/enigmail.js |
784 |
#%exclude %{tbdir}/enigmail*xpi |
785 |
# enigmime |
786 |
#%exclude %{tbdir}/components/enigmime.xpt |
787 |
#%exclude %{tbdir}/components/ipc.xpt |
788 |
#%exclude %{tbdir}/components/libenigmime.so |
789 |
#%exclude %{tbdir}/chrome/enigmime.jar |
790 |
#%exclude %{tbdir}/platform/*/components/*enigmime* |
791 |
|
792 |
%files enigmail |
793 |
%defattr(-,root,root) |
794 |
%{tbextdir}/%{enigmail_id} |
795 |
|
796 |
%files -n nsinstall |
797 |
%defattr(-,root,root) |
798 |
%{_bindir}/nsinstall |
799 |
|
800 |
%files lightning |
801 |
%defattr(-,root,root) |
802 |
%{tbextdir}/calendar-timezones@mozilla.org |
803 |
%{tbextdir}/{a62ef8ec-5fdc-40c2-873c-223b8a6925cc} |
804 |
%{tbextdir}/{3550f703-e582-4d05-9a08-453d09bdfdc6} |
805 |
|
806 |
|