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

  ViewVC Help
Powered by ViewVC 1.1.30