/[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 618809 - (show annotations) (download)
Tue Apr 29 03:52:52 2014 UTC (9 years, 11 months ago) by fwang
File size: 17388 byte(s)
fix make
1 %define upstream_version %{version}
2 %define release_dir comm-esr24
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: 24.5.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: pkgconfig(xft)
75 BuildRequires: libxt-devel
76 BuildRequires: hunspell-devel
77 BuildRequires: dbus-glib-devel
78 Requires(post): mktemp
79 Requires(post): rpm-helper
80 Requires(postun): rpm-helper
81 # Integrates thunderbird with xdg-utils.
82 Requires: xdg-utils
83 # Thunderbird 3 requires alsa
84 BuildRequires: libalsa-devel
85 BuildRequires: pkgconfig(gstreamer-0.10) >= 0.10.25
86 BuildRequires: pkgconfig(gstreamer-app-0.10)
87 BuildRequires: pkgconfig(gstreamer-plugins-base-0.10)
88 BuildRequires: python
89 BuildRequires: libnotify-devel
90 BuildRequires: startup-notification-devel
91 BuildRequires: libiw-devel
92 BuildRequires: libevent-devel >= 1.4.7
93 BuildRequires: libvpx-devel >= 0.9.7
94 Buildrequires: python-setuptools
95 %if %{mgaversion} >= 4
96 Requires: %{_lib}notify4
97 Requires: %{_lib}gstreamer0.10_0
98 Requires: %{_lib}gstreamer-plugins-base0.10_0
99 %endif
100 Suggests: %{_lib}canberra0
101 Suggests: %{_lib}cups2
102 Obsoletes: mozilla-thunderbird < %{epoch}:%{version}-%{release}
103 Provides: mozilla-thunderbird = %{epoch}:%{version}-%{release}
104
105 %description
106 %{title} is a full-featured email, RSS and newsgroup client that
107 makes emailing safer, faster and easier than ever before.
108
109 #===============================================================================
110 #enigmail
111
112 # Supported l10n language lists
113 %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
114
115 # Disabled l10n languages, for any reason
116 # nl sk es_AR do not support 0.95.0 yet
117 %define disabled_l10n_langlist hu
118 # global disabled_l10n_langlist %{nil}
119
120 # Language descriptions
121 %define language_ar ar
122 %define language_ca ca
123 %define language_cs cs-CZ
124 %define language_de de
125 %define language_el el
126 %define language_es_AR es-AR
127 %define language_es es-ES
128 %define language_fi fi-FI
129 %define language_fr fr
130 %define language_hu hu-HU
131 %define language_it it-IT
132 %define langname_it Italian
133 %define language_ja ja-JP
134 %define language_ko ko-KR
135 %define language_nb nb-NO
136 %define language_nl nl
137 %define language_pl pl
138 %define language_pt pt-PT
139 %define language_pt_BR pt-BR
140 %define language_ro ro-RO
141 %define language_ru ru-RU
142 %define language_sk sk
143 %define language_sl sl-SI
144 %define language_sv sv-SE
145 %define language_tr tr
146 %define language_vi vi
147 %define language_zh_CN zh-CN
148 %define language_zh_TW zh-TW
149
150 # --- Danger line ---
151
152 # All langs
153 %{expand:%%global langlist %(for lang in %l10n_langlist; do echo "$lang"; done | sort -u | sed ':a;$!N;s/\n/ /;ta')}
154
155 # Defaults (all languages enabled by default)
156 # l10n
157 %{expand:%(for lang in %l10n_langlist; do echo "%%define l10n_$lang 1"; done)}
158 %{expand:%(for lang in %disabled_l10n_langlist; do echo "%%define l10n_$lang 0"; done)}
159
160 # Params
161 %{expand:%(for lang in %langlist; do echo "%%bcond_without $lang"; done)}
162
163 %package enigmail
164 Summary: Access the authentication and encryption features provided by GnuPG
165 Group: Networking/Mail
166 Requires: %{name} = %{epoch}:%{version}
167 Obsoletes: %{name}-enigmime < %{epoch}:%{version}-%{release}
168 Provides: %{name}-enigmime = %{epoch}:%{version}-%{release}
169 Obsoletes: mozilla-thunderbird-enigmime < %{epoch}:%{version}-%{release}
170 Obsoletes: mozilla-thunderbird-enigmail < %{epoch}:%{version}-%{release}
171 Provides: mozilla-thunderbird-enigmime = %{epoch}:%{version}-%{release}
172 Provides: mozilla-thunderbird-enigmail = %{epoch}:%{version}-%{release}
173 Requires: gnupg
174 Requires(post): %{name} = %{epoch}:%{version}
175 Requires(preun): %{name} = %{epoch}:%{version}
176 Requires(post): mktemp
177 Requires(postun): mktemp
178 Suggests: pinentry-gtk
179 %(for lang in %l10n_langlist %disabled_l10n_langlist; do
180 echo "Obsoletes: thunderbird-enigmail-$lang < 0:10.0.2"
181 echo "Obsoletes: mozilla-thunderbird-enigmail-$lang < %{epoch}:%{version}-%{release}"
182 echo "Obsoletes: mozilla-thunderbird-enigmail-l10n-$lang < %{epoch}:%{version}-%{release}"
183 done)
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
211
212 %prep
213 %setup -q -c -n %{name}-%{version}
214
215 #===================
216 # Thunderbird itself
217 %setup -q -T -D -n %{name}-%{version}/%{release_dir}
218 %patch2 -p0
219 pushd mozilla
220 %patch7 -p1
221 %patch8 -p1
222 popd
223
224
225 %patch201 -p0 -b .default_mailer
226 %patch300 -p0 -b .progname
227 %patch301 -p1 -b .enigmailpackage
228 %patch304 -p0 -b .run-mozilla
229
230 %patch400 -p1 -b .appname
231
232 #===============================================================================
233 # Enigmail
234 %setup -q -T -D -n %{name}-%{version}/%{release_dir}/mozilla/extensions -a300
235
236 %setup -q -T -D -n %{name}-%{version}/%{release_dir}
237
238 #===============================================================================
239
240 # for virtualenv patch
241 cd mozilla
242 autoconf-2.13
243 cd ..
244
245 %build
246 export BUILD_OFFICIAL=1
247 export MOZILLA_OFFICIAL=1
248
249
250 CFLAGS=$(echo %optflags | %{__sed} -e 's/-fexceptions//')
251 CFLAGS="$CFLAGS -fno-strict-aliasing"
252 CXXFLAGS="$CFLAGS -fpermissive"
253 RPM_OPT_FLAGS="$CFLAGS"
254 LDFLAGS="%ldflags"
255 export CFLAGS
256 export CXXFLAGS
257 export RPM_OPT_FLAGS
258 export LDFLAGS
259
260 export MOZCONFIG=`pwd`/.mozconfig
261 cat > $MOZCONFIG << EOF
262 mk_add_options MOZILLA_OFFICIAL=1
263 mk_add_options BUILD_OFFICIAL=1
264 mk_add_options MOZ_MAKE_FLAGS="%{_smp_mflags}"
265 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir
266 ac_add_options --host=%{_host}
267 ac_add_options --target=%{_target_platform}
268 ac_add_options --prefix="%{_prefix}"
269 ac_add_options --libdir="%{_libdir}"
270 ac_add_options --sysconfdir="%{_sysconfdir}"
271 ac_add_options --mandir="%{_mandir}"
272 ac_add_options --includedir="%{_includedir}"
273 ac_add_options --datadir="%{_datadir}"
274 ac_add_options --enable-application=mail
275 ac_add_options --with-system-nspr
276 ac_add_options --with-system-nss
277 ac_add_options --with-system-jpeg
278 ac_add_options --with-system-zlib
279 %if %{mgaversion} >= 3
280 ac_add_options --with-system-png
281 %endif
282 ac_add_options --with-system-bz2
283 ac_add_options --enable-system-sqlite
284 ac_add_options --enable-system-hunspell
285 ac_add_options --enable-system-cairo
286 ac_add_options --with-pthreads
287 ac_add_options --disable-tests
288 ac_add_options --disable-debug
289 ac_add_options --disable-installer
290 ac_add_options --disable-updater
291 ac_add_options --enable-xinerama
292 ac_add_options --disable-crashreporter
293 ac_add_options --enable-default-toolkit=cairo-gtk2
294 ac_add_options --disable-xprint
295 ac_add_options --disable-strip
296 ac_add_options --enable-pango
297 ac_add_options --enable-startup-notification
298 ac_add_options --enable-svg
299 ac_add_options --enable-canvas
300 ac_add_options --enable-crypto
301 ac_add_options --enable-mathml
302 ac_add_options --disable-gnomevfs
303 ac_add_options --enable-gio
304 ac_add_options --enable-optimize
305 ac_add_options --with-system-libevent
306 ac_add_options --with-system-libvpx
307 ac_add_options --enable-official-branding
308 ac_add_options --with-distribution-id=org.mageia
309 EOF
310
311 make -f client.mk build
312
313 #===============================================================================
314
315 pushd mozilla/extensions/enigmail
316 ./makemake -r
317 popd
318
319 pushd objdir/mozilla/extensions/enigmail
320 make
321 %make xpi
322 popd
323
324 pushd mozilla/extensions/enigmail/lang
325 chmod 0755 ./make-lang.sh
326 for i in `cat current-languages.txt`; do
327 ./make-lang.sh $i %{enigmail_short_version}
328 done
329 popd
330
331 #===============================================================================
332
333 %install
334 %{__mkdir_p} %{buildroot}{%{_libdir},%{_bindir},%{_datadir}/applications}
335 %{__mkdir_p} %buildroot%tbdir
336
337 rm -f extensions/spellcheck/locales/en-US/hunspell/en-US.{dic,aff}
338
339 # workaround to use system nss shlibsign instead currently missing bundled one
340 # https://bugzilla.mozilla.org/show_bug.cgi?id=736327
341 ln -s %{_bindir}/shlibsign %{_builddir}/%{name}-%{version}/%{release_dir}/objdir/mozilla/dist/bin/shlibsign
342
343 %makeinstall_std -f client.mk
344
345 rm -rf %buildroot%tbdir/dictionaries
346 ln -s %{_datadir}/hunspell %buildroot%tbdir/dictionaries
347
348
349 %{__install} -p -D %{SOURCE303} %{buildroot}/%{_datadir}/applications/%{name}.desktop
350
351 %{__perl} -pi -e 's|^moz_libdir=.*|moz_libdir=%{tbdir}|' %{buildroot}%{_bindir}/thunderbird
352 %{__perl} -pi -e 's|^MRE_HOME=.*|MRE_HOME=%{tbdir}|' %{buildroot}%{_bindir}/thunderbird
353
354 #used for matching system locale on startup
355 %{__cat} %{SOURCE12} | %{__perl} -p -e 's,THUNDERBIRD_RPM_VR,%{version}-%{release},g;' \
356 -e 's,THUNDERBIRD_VENDOR_COMMENT,%{product_release},g;' \
357 > %{buildroot}%{tbdir}/defaults/pref/all-mageia.js
358
359 #===============================================================================
360
361 # icons
362 %{__mkdir_p} %{buildroot}{%{_liconsdir},%{_iconsdir},%{_miconsdir}}
363 %{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/{16x16,22x22,24x24,32x32,48x48,256x256}/apps
364 %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default48.png %{buildroot}%{_liconsdir}/%{name}.png
365 %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default32.png %{buildroot}%{_iconsdir}/%{name}.png
366 %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default16.png %{buildroot}%{_miconsdir}/%{name}.png
367 %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
368 %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default22.png %{buildroot}%{_datadir}/icons/hicolor/22x22/apps/%{name}.png
369 %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default24.png %{buildroot}%{_datadir}/icons/hicolor/24x24/apps/%{name}.png
370 %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
371 %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
372 %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default256.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/%{name}.png
373
374 #===============================================================================
375
376 %{__mkdir_p} %{buildroot}%{tbextdir}/%{enigmail_id}
377 %if !%{xpi}
378 %{_bindir}/unzip -q objdir/mozilla/dist/bin/enigmail-%{enigmail_short_version}*.xpi -d %{buildroot}%{tbextdir}/%{enigmail_id}
379 %{__chmod} 644 %{buildroot}%{tbextdir}/%{enigmail_id}/chrome.manifest
380 %else
381 %{__cp} -aL objdir/mozilla/dist/bin/enigmail-%{enigmail_short_version}*.xpi %{buildroot}%{tbextdir}/%{enigmail_id}/%{enigmail_id}.xpi
382 %endif
383
384 #==============================================================================
385 #enigmail lang package
386 # Convert rpm macros to bash variables
387 %{expand:%(for lang in %langlist; do echo "language_$lang=%%{language_$lang}"; done)}
388 %{expand:%(for lang in %langlist; do echo "with_$lang=%%{with $lang}"; done)}
389 %{expand:%(for lang in %l10n_langlist; do echo "l10n_$lang=%%{l10n_$lang}"; done)}
390 pushd mozilla/extensions/enigmail/lang
391 for lang in %langlist; do
392 %{__mkdir_p} %{buildroot}%{_datadir}/mozilla/extensions/%{tb_appid}/enigmail-$lang@enigmail.mozdev.org
393 language="language_$lang"
394 language=${!language}
395 %{_bindir}/unzip -q enigmail-${language}-%{enigmail_short_version}.xpi -d %{buildroot}%{_datadir}/mozilla/extensions/%{tb_appid}/enigmail-$lang@enigmail.mozdev.org/
396 done
397 popd
398
399 #===============================================================================
400
401 %{__cp} -aL objdir/mozilla/dist/bin/nsinstall %{buildroot}%{_bindir}
402
403 #===============================================================================
404
405 #exclude devel files
406 %{__rm} -rf %{buildroot}%{_datadir}/idl/%{oname}-%{version}
407 %{__rm} -rf %{buildroot}%{_includedir}/%{oname}-%{version}
408 %{__rm} -rf %{buildroot}%{_libdir}/%{oname}-devel-%{version}
409
410 #===============================================================================
411
412 %post
413
414 mktemp="/bin/mktemp -d -q -p /tmp -t %{name}.XXXXXXXXXX"
415
416 TMPDIR= TB_TMPDIR=`$mktemp` && {
417 HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -register
418 test -d "$TB_TMPDIR" && %{__rm} -rf -- "$TB_TMPDIR"
419 }
420
421
422 #===============================================================================
423
424 %post enigmail
425 if [ -f %{tbdir}/components/compreg.dat ]; then
426 %{__rm} -f %{tbdir}/components/compreg.dat
427 fi
428
429 if [ -f %{tbdir}/components/xpti.dat ]; then
430 %{__rm} -f %{tbdir}/components/xpti.dat
431 fi
432
433 mktemp="/bin/mktemp -d -q -p /tmp -t %{name}.XXXXXXXXXX"
434
435 TMPDIR= TB_TMPDIR=`$mktemp` && {
436 %if %{xpi}
437 HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -install-global-extension %{tbextdir}/enigmail-%{enigmail_version}-linux-*.xpi
438 %endif
439 HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -register
440 test -d "$TB_TMPDIR" && %{__rm} -rf -- "$TB_TMPDIR"
441 }
442
443 %preun enigmail
444 if [ -f %{tbdir}/components/compreg.dat ]; then
445 %{__rm} -f %{tbdir}/components/compreg.dat
446 fi
447
448 if [ -f %{tbdir}/components/xpti.dat ]; then
449 %{__rm} -f %{tbdir}/components/xpti.dat
450 fi
451
452 if [ -x %{tbdir}/thunderbird-bin ]; then
453 mktemp="/bin/mktemp -d -q -p /tmp -t %{name}.XXXXXXXXXX"
454
455 TMPDIR= TB_TMPDIR=`$mktemp` && {
456 %if %{xpi}
457 HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -install-global-extension %{tbextdir}/enigmail-%{enigmail_version}-linux-*.xpi
458 %endif
459 HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -register
460 test -d "$TB_TMPDIR" && %{__rm} -rf -- "$TB_TMPDIR"
461 }
462 fi
463
464 #===============================================================================
465
466 %files
467 %doc mozilla/LEGAL
468 %attr(755,root,root) %{_bindir}/thunderbird
469 %attr(644,root,root) %{_datadir}/applications/*.desktop
470 %{tbdir}
471 %if %{xpi}
472 %dir %{tbextdir}
473 %endif
474 # Mandriva menu
475 %{_miconsdir}/%{name}.png
476 %{_iconsdir}/%{name}.png
477 %{_liconsdir}/%{name}.png
478 # other icons
479 %{_iconsdir}/hicolor/*/apps/%{name}.png
480 %exclude %{tbextdir}/%{enigmail_id}
481
482 %files enigmail
483 %{tbextdir}/%{enigmail_id}
484 %(for lang in %langlist; do
485 echo "%%lang($lang) %{_datadir}/mozilla/extensions/%{tb_appid}/enigmail-$lang@enigmail.mozdev.org"
486 done)
487
488 %files -n nsinstall
489 %{_bindir}/nsinstall

  ViewVC Help
Powered by ViewVC 1.1.30