/[packages]/updates/5/thunderbird/current/SPECS/thunderbird.spec
ViewVC logotype

Contents of /updates/5/thunderbird/current/SPECS/thunderbird.spec

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30