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

  ViewVC Help
Powered by ViewVC 1.1.30