/[packages]/cauldron/thunderbird/current/SPECS/thunderbird.spec
ViewVC logotype

Contents of /cauldron/thunderbird/current/SPECS/thunderbird.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 655458 - (show annotations) (download)
Tue Jul 22 07:43:12 2014 UTC (6 years, 3 months ago) by fwang
File size: 17504 byte(s)
build with system icu
1 %define upstream_version %{version}
2 %define release_dir comm-esr31
3 %define title Mozilla Thunderbird
4
5 %define oname thunderbird
6 %define tb_appid \{3550f703-e582-4d05-9a08-453d09bdfdc6\}
7 %define tbdir %{_libdir}/%{oname}-%{version}
8 %define tbextdir %{_libdir}/mozilla/extensions/%{tb_appid}
9
10 %define xpi 0
11 %define enigmail_version 1.6
12 %define enigmail_short_version 1.6
13 %define enigmail_id \{847b3a00-7ab1-11d4-8f02-006008948af5\}
14
15 %define _provides_exceptions libgtkembedmoz.so\\|libxpcom.so
16 %define _requires_exceptions libgtkembedmoz.so\\|libxpcom.so\\|libxul.so
17
18 # this seems fragile, so require the exact version or later (#58754)
19 %define sqlite3_version %(pkg-config --modversion sqlite3 &>/dev/null && pkg-config --modversion sqlite3 2>/dev/null || echo 0)
20 # this one as well (#59759)
21 %define nss_libname %mklibname nss 3
22 %define nss_version %(pkg-config --modversion nss &>/dev/null && pkg-config --modversion nss 2>/dev/null || echo 0)
23
24 Name: thunderbird
25 Epoch: 0
26 Version: 31.0
27 Release: %mkrel 1
28 Summary: Full-featured email, RSS, and newsgroup client
29 License: MPL
30 Group: Networking/Mail
31 URL: http://www.mozilla.org/thunderbird/organizations/
32 Source0: ftp://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/%{upstream_version}/source/thunderbird-%{upstream_version}.source.tar.bz2
33 Source12: mozilla-thunderbird-mageia-default-prefs.js
34 # Mandriva sources (Source300+)
35 Source300: http://www.mozilla-enigmail.org/download/source/enigmail-%{enigmail_version}.tar.gz
36 Source301: http://www.mozilla-enigmail.org/download/source/enigmail-%{enigmail_version}.tar.gz.asc
37 Source303: thunderbird.desktop
38 # Build patches
39 Patch2: mozilla-firefox-1.0-prdtoa.patch
40 Patch7: firefox-10.0-nspr-version.patch
41 Patch8: firefox-10.0-nss-version.patch
42 # Mageia patches (patch100+)
43 # Debian patches (Patch200+)
44 Patch201: thunderbird-24.0-mga-default-mailer.patch
45 # Mandriva patches (Patch300+)
46 Patch300: mozilla-thunderbird-0.8-progname.patch
47 Patch301: mozilla-thunderbird-enigmail-package.patch
48 Patch304: mozilla-thunderbird-run-mozilla.patch
49 # OpenSuse patches (Patch400+)
50 Patch400: thunderbird-appname.patch
51 BuildRequires: autoconf2.1
52 BuildRequires: cairo-devel >= 1.8.8
53 Requires: %{mklibname sqlite3_ 0} >= %{sqlite3_version}
54 BuildRequires: sqlite3-devel >= 3.7.17
55 Requires: %{nss_libname} >= 2:%{nss_version}
56 BuildRequires: yasm
57 BuildRequires: mesagl-devel
58 BuildRequires: gtk2-devel
59 BuildRequires: gzip
60 BuildRequires: python-devel
61 BuildRequires: python-virtualenv
62 BuildRequires: libjpeg-devel
63 #(tpg) older versions doesn't support apng extension
64 %if %{mgaversion} >= 3
65 BuildRequires: libpng-devel >= 2:1.5.11
66 %endif
67 BuildRequires: nspr-devel >= 2:4.10.1
68 BuildRequires: nss-static-devel >= 2:3.15.2
69 BuildRequires: unzip
70 BuildRequires: zip
71 BuildRequires: zlib-devel
72 BuildRequires: libIDL-devel
73 BuildRequires: freetype2-devel
74 BuildRequires: icu-devel
75 BuildRequires: pkgconfig(xft)
76 BuildRequires: pkgconfig(libpulse)
77 BuildRequires: libxt-devel
78 BuildRequires: hunspell-devel
79 BuildRequires: dbus-glib-devel
80 Requires(post): mktemp
81 Requires(post): rpm-helper
82 Requires(postun): rpm-helper
83 # Integrates thunderbird with xdg-utils.
84 Requires: xdg-utils
85 # Thunderbird 3 requires alsa
86 BuildRequires: libalsa-devel
87 BuildRequires: pkgconfig(gstreamer-0.10) >= 0.10.25
88 BuildRequires: pkgconfig(gstreamer-app-0.10)
89 BuildRequires: pkgconfig(gstreamer-plugins-base-0.10)
90 BuildRequires: python
91 BuildRequires: libnotify-devel
92 BuildRequires: startup-notification-devel
93 BuildRequires: libiw-devel
94 BuildRequires: libevent-devel >= 1.4.7
95 BuildRequires: libvpx-devel >= 0.9.7
96 Buildrequires: python-setuptools
97 %if %{mgaversion} >= 4
98 Requires: %{_lib}notify4
99 Requires: %{_lib}gstreamer0.10_0
100 Requires: %{_lib}gstreamer-plugins-base0.10_0
101 %endif
102 Suggests: %{_lib}canberra0
103 Suggests: %{_lib}cups2
104 Obsoletes: mozilla-thunderbird < %{epoch}:%{version}-%{release}
105 Provides: mozilla-thunderbird = %{epoch}:%{version}-%{release}
106
107 %description
108 %{title} is a full-featured email, RSS and newsgroup client that
109 makes emailing safer, faster and easier than ever before.
110
111 #===============================================================================
112 #enigmail
113
114 # Supported l10n language lists
115 %define l10n_langlist ar ca cs de el es fi fr it ja ko nb nl pl pt pt_BR ru sl sv tr vi zh_CN zh_TW
116
117 # Disabled l10n languages, for any reason
118 # nl sk es_AR do not support 0.95.0 yet
119 %define disabled_l10n_langlist hu
120 # global disabled_l10n_langlist %{nil}
121
122 # Language descriptions
123 %define language_ar ar
124 %define language_ca ca
125 %define language_cs cs-CZ
126 %define language_de de
127 %define language_el el
128 %define language_es_AR es-AR
129 %define language_es es-ES
130 %define language_fi fi-FI
131 %define language_fr fr
132 %define language_hu hu-HU
133 %define language_it it-IT
134 %define langname_it Italian
135 %define language_ja ja-JP
136 %define language_ko ko-KR
137 %define language_nb nb-NO
138 %define language_nl nl
139 %define language_pl pl
140 %define language_pt pt-PT
141 %define language_pt_BR pt-BR
142 %define language_ro ro-RO
143 %define language_ru ru-RU
144 %define language_sk sk
145 %define language_sl sl-SI
146 %define language_sv sv-SE
147 %define language_tr tr
148 %define language_vi vi
149 %define language_zh_CN zh-CN
150 %define language_zh_TW zh-TW
151
152 # --- Danger line ---
153
154 # All langs
155 %{expand:%%global langlist %(for lang in %l10n_langlist; do echo "$lang"; done | sort -u | sed ':a;$!N;s/\n/ /;ta')}
156
157 # Defaults (all languages enabled by default)
158 # l10n
159 %{expand:%(for lang in %l10n_langlist; do echo "%%define l10n_$lang 1"; done)}
160 %{expand:%(for lang in %disabled_l10n_langlist; do echo "%%define l10n_$lang 0"; done)}
161
162 # Params
163 %{expand:%(for lang in %langlist; do echo "%%bcond_without $lang"; done)}
164
165 %package enigmail
166 Summary: Access the authentication and encryption features provided by GnuPG
167 Group: Networking/Mail
168 Requires: %{name} = %{epoch}:%{version}
169 Obsoletes: %{name}-enigmime < %{epoch}:%{version}-%{release}
170 Provides: %{name}-enigmime = %{epoch}:%{version}-%{release}
171 Obsoletes: mozilla-thunderbird-enigmime < %{epoch}:%{version}-%{release}
172 Obsoletes: mozilla-thunderbird-enigmail < %{epoch}:%{version}-%{release}
173 Provides: mozilla-thunderbird-enigmime = %{epoch}:%{version}-%{release}
174 Provides: mozilla-thunderbird-enigmail = %{epoch}:%{version}-%{release}
175 Requires: gnupg
176 Requires(post): %{name} = %{epoch}:%{version}
177 Requires(preun): %{name} = %{epoch}:%{version}
178 Requires(post): mktemp
179 Requires(postun): mktemp
180 Suggests: pinentry-gtk
181 %(for lang in %l10n_langlist %disabled_l10n_langlist; do
182 echo "Obsoletes: thunderbird-enigmail-$lang < 0:10.0.2"
183 echo "Obsoletes: mozilla-thunderbird-enigmail-$lang < %{epoch}:%{version}-%{release}"
184 echo "Obsoletes: mozilla-thunderbird-enigmail-l10n-$lang < %{epoch}:%{version}-%{release}"
185 done)
186
187 %description enigmail
188 Enigmail is an extension to the mail client of %{title}
189 which allows users to access the authentication and encryption
190 features provided by GnuPG.
191
192 Main Features
193
194 * Encrypt/sign mail when sending, decrypt/authenticate received
195 mail
196 * Support for inline-PGP (RFC 2440) and PGP/MIME (RFC 3156)
197 * Per-Account based encryption and signing defaults
198 * Per-Recipient rules for automated key selection, and
199 enabling/disabling encryption and signing
200 * OpenPGP key management interface
201
202 #===============================================================================
203
204 %package -n nsinstall
205 Summary: Netscape portable install command
206 Group: Development/Other
207
208 %description -n nsinstall
209 Netscape portable install command.
210
211 #===============================================================================
212
213
214 %prep
215 %setup -q -c -n %{name}-%{version}
216
217 #===================
218 # Thunderbird itself
219 %setup -q -T -D -n %{name}-%{version}/%{release_dir}
220 %patch2 -p0
221 pushd mozilla
222 #patch7 -p1
223 %patch8 -p1
224 popd
225
226
227 %patch201 -p0 -b .default_mailer
228 %patch300 -p0 -b .progname
229 %patch301 -p1 -b .enigmailpackage
230 %patch304 -p0 -b .run-mozilla
231
232 %patch400 -p1 -b .appname
233
234 #===============================================================================
235 # Enigmail
236 %setup -q -T -D -n %{name}-%{version}/%{release_dir}/mozilla/extensions -a300
237
238 %setup -q -T -D -n %{name}-%{version}/%{release_dir}
239
240 #===============================================================================
241
242 # for virtualenv patch
243 cd mozilla
244 autoconf-2.13
245 cd ..
246
247 %build
248 export BUILD_OFFICIAL=1
249 export MOZILLA_OFFICIAL=1
250
251
252 CFLAGS=$(echo %optflags | %{__sed} -e 's/-fexceptions//')
253 CFLAGS="$CFLAGS -fno-strict-aliasing"
254 CXXFLAGS="$CFLAGS -fpermissive"
255 RPM_OPT_FLAGS="$CFLAGS"
256 LDFLAGS="%ldflags"
257 export CFLAGS
258 export CXXFLAGS
259 export RPM_OPT_FLAGS
260 export LDFLAGS
261
262 export MOZCONFIG=`pwd`/.mozconfig
263 cat > $MOZCONFIG << EOF
264 mk_add_options MOZILLA_OFFICIAL=1
265 mk_add_options BUILD_OFFICIAL=1
266 mk_add_options MOZ_MAKE_FLAGS="%{_smp_mflags}"
267 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir
268 ac_add_options --host=%{_host}
269 ac_add_options --target=%{_target_platform}
270 ac_add_options --prefix="%{_prefix}"
271 ac_add_options --libdir="%{_libdir}"
272 ac_add_options --sysconfdir="%{_sysconfdir}"
273 ac_add_options --mandir="%{_mandir}"
274 ac_add_options --includedir="%{_includedir}"
275 ac_add_options --datadir="%{_datadir}"
276 ac_add_options --enable-application=mail
277 ac_add_options --with-system-nspr
278 ac_add_options --with-system-nss
279 ac_add_options --with-system-jpeg
280 ac_add_options --with-system-zlib
281 ac_add_options --with-system-icu
282 %if %{mgaversion} >= 3
283 ac_add_options --with-system-png
284 %endif
285 ac_add_options --with-system-bz2
286 ac_add_options --enable-system-sqlite
287 ac_add_options --enable-system-hunspell
288 ac_add_options --enable-system-cairo
289 ac_add_options --with-pthreads
290 ac_add_options --disable-tests
291 ac_add_options --disable-debug
292 ac_add_options --disable-installer
293 ac_add_options --disable-updater
294 ac_add_options --enable-xinerama
295 ac_add_options --disable-crashreporter
296 ac_add_options --enable-default-toolkit=cairo-gtk2
297 ac_add_options --disable-xprint
298 ac_add_options --disable-strip
299 ac_add_options --enable-pango
300 ac_add_options --enable-startup-notification
301 ac_add_options --enable-svg
302 ac_add_options --enable-canvas
303 ac_add_options --enable-crypto
304 ac_add_options --enable-mathml
305 ac_add_options --disable-gnomevfs
306 ac_add_options --enable-gio
307 ac_add_options --enable-optimize
308 ac_add_options --with-system-libevent
309 ac_add_options --with-system-libvpx
310 ac_add_options --enable-official-branding
311 ac_add_options --with-distribution-id=org.mageia
312 EOF
313
314 mkdir -p mozilla/objdir
315
316 make -f client.mk build
317
318 #===============================================================================
319
320 pushd mozilla/extensions/enigmail
321 ./makemake -r
322 popd
323
324 pushd objdir/mozilla/extensions/enigmail
325 make
326 %make xpi
327 popd
328
329 pushd mozilla/extensions/enigmail/lang
330 chmod 0755 ./make-lang.sh
331 for i in `cat current-languages.txt`; do
332 ./make-lang.sh $i %{enigmail_short_version}
333 done
334 popd
335
336 #===============================================================================
337
338 %install
339 %{__mkdir_p} %{buildroot}{%{_libdir},%{_bindir},%{_datadir}/applications}
340 %{__mkdir_p} %buildroot%tbdir
341
342 rm -f extensions/spellcheck/locales/en-US/hunspell/en-US.{dic,aff}
343
344 # workaround to use system nss shlibsign instead currently missing bundled one
345 # https://bugzilla.mozilla.org/show_bug.cgi?id=736327
346 ln -s %{_bindir}/shlibsign %{_builddir}/%{name}-%{version}/%{release_dir}/objdir/mozilla/dist/bin/shlibsign
347
348 %makeinstall_std -f client.mk
349
350 rm -rf %buildroot%tbdir/dictionaries
351 ln -s %{_datadir}/hunspell %buildroot%tbdir/dictionaries
352
353
354 %{__install} -p -D %{SOURCE303} %{buildroot}/%{_datadir}/applications/%{name}.desktop
355
356 %{__perl} -pi -e 's|^moz_libdir=.*|moz_libdir=%{tbdir}|' %{buildroot}%{_bindir}/thunderbird
357 %{__perl} -pi -e 's|^MRE_HOME=.*|MRE_HOME=%{tbdir}|' %{buildroot}%{_bindir}/thunderbird
358
359 #used for matching system locale on startup
360 %{__cat} %{SOURCE12} | %{__perl} -p -e 's,THUNDERBIRD_RPM_VR,%{version}-%{release},g;' \
361 -e 's,THUNDERBIRD_VENDOR_COMMENT,%{product_release},g;' \
362 > %{buildroot}%{tbdir}/defaults/pref/all-mageia.js
363
364 #===============================================================================
365
366 # icons
367 %{__mkdir_p} %{buildroot}{%{_liconsdir},%{_iconsdir},%{_miconsdir}}
368 %{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/{16x16,22x22,24x24,32x32,48x48,256x256}/apps
369 %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default48.png %{buildroot}%{_liconsdir}/%{name}.png
370 %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default32.png %{buildroot}%{_iconsdir}/%{name}.png
371 %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default16.png %{buildroot}%{_miconsdir}/%{name}.png
372 %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
373 %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default22.png %{buildroot}%{_datadir}/icons/hicolor/22x22/apps/%{name}.png
374 %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default24.png %{buildroot}%{_datadir}/icons/hicolor/24x24/apps/%{name}.png
375 %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
376 %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
377 %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default256.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/%{name}.png
378
379 #===============================================================================
380
381 %{__mkdir_p} %{buildroot}%{tbextdir}/%{enigmail_id}
382 %if !%{xpi}
383 %{_bindir}/unzip -q objdir/mozilla/dist/bin/enigmail-%{enigmail_short_version}*.xpi -d %{buildroot}%{tbextdir}/%{enigmail_id}
384 %{__chmod} 644 %{buildroot}%{tbextdir}/%{enigmail_id}/chrome.manifest
385 %else
386 %{__cp} -aL objdir/mozilla/dist/bin/enigmail-%{enigmail_short_version}*.xpi %{buildroot}%{tbextdir}/%{enigmail_id}/%{enigmail_id}.xpi
387 %endif
388
389 #==============================================================================
390 #enigmail lang package
391 # Convert rpm macros to bash variables
392 %{expand:%(for lang in %langlist; do echo "language_$lang=%%{language_$lang}"; done)}
393 %{expand:%(for lang in %langlist; do echo "with_$lang=%%{with $lang}"; done)}
394 %{expand:%(for lang in %l10n_langlist; do echo "l10n_$lang=%%{l10n_$lang}"; done)}
395 pushd mozilla/extensions/enigmail/lang
396 for lang in %langlist; do
397 %{__mkdir_p} %{buildroot}%{_datadir}/mozilla/extensions/%{tb_appid}/enigmail-$lang@enigmail.mozdev.org
398 language="language_$lang"
399 language=${!language}
400 %{_bindir}/unzip -q enigmail-${language}-%{enigmail_short_version}.xpi -d %{buildroot}%{_datadir}/mozilla/extensions/%{tb_appid}/enigmail-$lang@enigmail.mozdev.org/
401 done
402 popd
403
404 #===============================================================================
405
406 %{__cp} -aL objdir/mozilla/dist/bin/nsinstall %{buildroot}%{_bindir}
407
408 #===============================================================================
409
410 #exclude devel files
411 %{__rm} -rf %{buildroot}%{_datadir}/idl/%{oname}-%{version}
412 %{__rm} -rf %{buildroot}%{_includedir}/%{oname}-%{version}
413 %{__rm} -rf %{buildroot}%{_libdir}/%{oname}-devel-%{version}
414
415 #===============================================================================
416
417 %post
418
419 mktemp="/bin/mktemp -d -q -p /tmp -t %{name}.XXXXXXXXXX"
420
421 TMPDIR= TB_TMPDIR=`$mktemp` && {
422 HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -register
423 test -d "$TB_TMPDIR" && %{__rm} -rf -- "$TB_TMPDIR"
424 }
425
426
427 #===============================================================================
428
429 %post enigmail
430 if [ -f %{tbdir}/components/compreg.dat ]; then
431 %{__rm} -f %{tbdir}/components/compreg.dat
432 fi
433
434 if [ -f %{tbdir}/components/xpti.dat ]; then
435 %{__rm} -f %{tbdir}/components/xpti.dat
436 fi
437
438 mktemp="/bin/mktemp -d -q -p /tmp -t %{name}.XXXXXXXXXX"
439
440 TMPDIR= TB_TMPDIR=`$mktemp` && {
441 %if %{xpi}
442 HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -install-global-extension %{tbextdir}/enigmail-%{enigmail_version}-linux-*.xpi
443 %endif
444 HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -register
445 test -d "$TB_TMPDIR" && %{__rm} -rf -- "$TB_TMPDIR"
446 }
447
448 %preun enigmail
449 if [ -f %{tbdir}/components/compreg.dat ]; then
450 %{__rm} -f %{tbdir}/components/compreg.dat
451 fi
452
453 if [ -f %{tbdir}/components/xpti.dat ]; then
454 %{__rm} -f %{tbdir}/components/xpti.dat
455 fi
456
457 if [ -x %{tbdir}/thunderbird-bin ]; then
458 mktemp="/bin/mktemp -d -q -p /tmp -t %{name}.XXXXXXXXXX"
459
460 TMPDIR= TB_TMPDIR=`$mktemp` && {
461 %if %{xpi}
462 HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -install-global-extension %{tbextdir}/enigmail-%{enigmail_version}-linux-*.xpi
463 %endif
464 HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -register
465 test -d "$TB_TMPDIR" && %{__rm} -rf -- "$TB_TMPDIR"
466 }
467 fi
468
469 #===============================================================================
470
471 %files
472 %doc mozilla/LEGAL
473 %attr(755,root,root) %{_bindir}/thunderbird
474 %attr(644,root,root) %{_datadir}/applications/*.desktop
475 %{tbdir}
476 %if %{xpi}
477 %dir %{tbextdir}
478 %endif
479 # Mandriva menu
480 %{_miconsdir}/%{name}.png
481 %{_iconsdir}/%{name}.png
482 %{_liconsdir}/%{name}.png
483 # other icons
484 %{_iconsdir}/hicolor/*/apps/%{name}.png
485 %exclude %{tbextdir}/%{enigmail_id}
486
487 %files enigmail
488 %{tbextdir}/%{enigmail_id}
489 %(for lang in %langlist; do
490 echo "%%lang($lang) %{_datadir}/mozilla/extensions/%{tb_appid}/enigmail-$lang@enigmail.mozdev.org"
491 done)
492
493 %files -n nsinstall
494 %{_bindir}/nsinstall

  ViewVC Help
Powered by ViewVC 1.1.28