1 |
%define upstream_version %{version} |
2 |
# The tarball is pretty inconsistent with directory structure. |
3 |
# Sometimes there is a top level directory. That goes here. |
4 |
# |
5 |
# IMPORTANT: If there is no top level directory, this should be |
6 |
# set to the cwd, ie: '.' |
7 |
%define release_dir %{name}-%{version} |
8 |
|
9 |
%define title Mozilla Thunderbird |
10 |
|
11 |
# |
12 |
# Compiler Choices |
13 |
# |
14 |
|
15 |
# limit max cpus to allow build on i586 : 8 cpus fail with 52.8.0 version |
16 |
%ifnarch x86_64 |
17 |
%define _smp_ncpus_max 4 |
18 |
%else |
19 |
%define _smp_ncpus_max 8 |
20 |
%endif |
21 |
|
22 |
# Use CCache for speedup compiling (only for developing) |
23 |
%define use_ccache 0 |
24 |
%{?_with_ccache: %global use_ccache 1} |
25 |
%{?_without_ccache: %global use_ccache 0} |
26 |
|
27 |
# Enable O3 Optimization |
28 |
%define use_opt_o3 0 |
29 |
%{?_with_opt_o3: %global use_opt_o3 1} |
30 |
%{?_without_opt_o3: %global use_opt_o3 0} |
31 |
|
32 |
# Use GTK3 toolkit |
33 |
%define use_toolkit_gtk3 1 |
34 |
%{?_with_gtk3: %global use_toolkit_gtk3 1} |
35 |
%{?_without_gtk3: %global use_toolkit_gtk3 0} |
36 |
|
37 |
%define oname thunderbird |
38 |
%define tb_appid \{3550f703-e582-4d05-9a08-453d09bdfdc6\} |
39 |
%define tbdir %{_libdir}/%{name} |
40 |
%define tbextdir %{_libdir}/mozilla/extensions/%{tb_appid} |
41 |
%global langpackdir %{tbdir}/distribution/extensions |
42 |
|
43 |
#(doktor5000) lightning definitions |
44 |
%define lightning_id \{e2fda1a4-762b-4020-b5ad-a41df1933103\} |
45 |
%define lightning_version 5.4 |
46 |
|
47 |
#(doktor5000) this is where the actual build happens to keep compiled objects out-of-tree |
48 |
# see https://bugzilla.mozilla.org/show_bug.cgi?id=1106883#c4 for context information |
49 |
%define objdir objdir |
50 |
|
51 |
# fallback using absolute path - should be used with .mozconfig |
52 |
# see https://bugzilla.mozilla.org/show_bug.cgi?id=1106883#c4 for context information |
53 |
#define objdir objdir-tb %%{_builddir}/%%{name}-%%{version}/%%{release_dir}/%%{objdir} |
54 |
|
55 |
%define xpi 0 |
56 |
%define enigmail_version 2.0.8 |
57 |
%define enigmail_short_version 2.0 |
58 |
%define enigmail_id \{847b3a00-7ab1-11d4-8f02-006008948af5\} |
59 |
|
60 |
%global __provides_exclude libgtkembedmoz.so|libxpcom.so |
61 |
%global __requires_exclude libgtkembedmoz.so|libxpcom.so|libxul.so |
62 |
|
63 |
# Conditional Building Options |
64 |
# |
65 |
# #{with system_cairo}: use system cairo graphics library optionally |
66 |
# (default for now is to use the in-tree cairo library, which for thunderbird |
67 |
# 45.4.0 is stuck at 1.9.5. Compiling with system cairo instead of the |
68 |
# in-tree one seems to produce an executable which is subject to sporadic |
69 |
# crashes. Note that this affects also the PDF engine used by Thunderbird |
70 |
# to print documents, which in the case of the system-cairo will be newer. |
71 |
# |
72 |
%bcond_with system_cairo |
73 |
|
74 |
#define debug_package #{nil} |
75 |
|
76 |
# this seems fragile, so require the exact version or later (#58754) |
77 |
%define sqlite3_version %(pkg-config --modversion sqlite3 &>/dev/null && pkg-config --modversion sqlite3 2>/dev/null || echo 0) |
78 |
# this one as well (#59759) |
79 |
%define nss_libname %mklibname nss 3 |
80 |
%define nss_version %(pkg-config --modversion nss &>/dev/null && pkg-config --modversion nss 2>/dev/null || echo 0) |
81 |
|
82 |
Name: thunderbird |
83 |
Epoch: 0 |
84 |
Version: 60.3.3 |
85 |
Release: %mkrel 6 |
86 |
Summary: Full-featured email, RSS, and newsgroup client |
87 |
License: MPL |
88 |
Group: Networking/Mail |
89 |
URL: http://www.mozilla.org/thunderbird/organizations/ |
90 |
Source0: http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/%{upstream_version}/source/thunderbird-%{upstream_version}.source.tar.xz |
91 |
# script to create tarball for the lightning l10n sources |
92 |
# first run bm -lp thunderbird.spec to ensure calendar/locales/shipped-locales definitions of current %%version are present and then |
93 |
# run the script in SOURCES/ folder as ./get-calendar-langpacks.sh to generate the tarball for the current %%version |
94 |
Source2: https://src.fedoraproject.org/rpms/thunderbird/raw/master/f/get-calendar-langpacks.sh |
95 |
# tarball for the lightning language sources, see above |
96 |
Source3: lightning-langpacks-%{version}.tar.xz |
97 |
|
98 |
# (doktor5000) needs to be manually updated/synced with calendar/locales/shipped-locales |
99 |
%global lightning_langs ca cs cy da de en-GB es-AR es-ES et eu fi fr fy-NL ga-IE gd hu is it ja lt nb-NO nl nn-NO pl pt-PT ru sk sq sv-SE tr uk zh-CN zh-TW |
100 |
|
101 |
Source12: mozilla-thunderbird-mageia-default-prefs.js |
102 |
Source300: https://enigmail.net/download/source/enigmail-%{enigmail_version}.tar.gz |
103 |
Source303: thunderbird.desktop |
104 |
|
105 |
# All patches P0 please |
106 |
# Mageia patches (patch100+) |
107 |
Patch1: thunderbird-60.0-progname.patch |
108 |
Patch3: thunderbird-60.0-run-mozilla.patch |
109 |
Patch4: thunderbird-60.0-optimize-noOs_everywhere.patch |
110 |
Patch5: thunderbird-60.0-appname.patch |
111 |
|
112 |
# Fedora patches |
113 |
Patch9: mozilla-build-arm.patch |
114 |
Patch415: Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch |
115 |
|
116 |
BuildRequires: autoconf2.1 |
117 |
%if %{with system_cairo} |
118 |
BuildRequires: pkgconfig(cairo) >= 1.10 |
119 |
%endif |
120 |
Requires: %{mklibname sqlite3_ 0} >= %{sqlite3_version} |
121 |
BuildRequires: pkgconfig(sqlite3) >= 3.22.0 |
122 |
Requires: %{nss_libname} >= 2:%{nss_version} |
123 |
BuildRequires: yasm |
124 |
BuildRequires: pkgconfig(gl) |
125 |
%if %{use_toolkit_gtk3} |
126 |
BuildRequires: pkgconfig(gtk+-3.0) >= 3.4.0 |
127 |
%endif |
128 |
BuildRequires: pkgconfig(gtk+-2.0) >= 2.18.0 |
129 |
BuildRequires: gzip |
130 |
BuildRequires: pkgconfig(python2) |
131 |
BuildRequires: pythonegg(2)(virtualenv) |
132 |
BuildRequires: pkgconfig(libjpeg) |
133 |
BuildRequires: pkgconfig(libpng) >= 1.6.34 |
134 |
BuildRequires: pkgconfig(nspr) >= 4.19 |
135 |
BuildRequires: nss-static-devel >= 2:3.36.5 |
136 |
BuildRequires: unzip |
137 |
BuildRequires: zip |
138 |
BuildRequires: pkgconfig(zlib) |
139 |
BuildRequires: pkgconfig(libIDL-2.0) |
140 |
BuildRequires: pkgconfig(freetype2) |
141 |
BuildRequires: icu-devel |
142 |
BuildRequires: pkgconfig(xft) |
143 |
BuildRequires: pkgconfig(libpulse) |
144 |
BuildRequires: pkgconfig(xt) |
145 |
BuildRequires: pkgconfig(hunspell) >= 1.6.2 |
146 |
BuildRequires: pkgconfig(dbus-glib-1) >= 0.60 |
147 |
Requires(post): mktemp |
148 |
Requires(post): rpm-helper |
149 |
Requires(postun): rpm-helper |
150 |
# Integrates thunderbird with xdg-utils. |
151 |
Requires: xdg-utils |
152 |
# Thunderbird 3 requires alsa |
153 |
BuildRequires: pkgconfig(alsa) |
154 |
BuildRequires: pkgconfig(gstreamer-1.0) |
155 |
BuildRequires: pkgconfig(gstreamer-allocators-1.0) |
156 |
# pango-devel is bring in also by gtk+2-devel but not with minimal requirement |
157 |
BuildRequires: pkgconfig(pango) >= 1.22.0 |
158 |
BuildRequires: python2 |
159 |
BuildRequires: pkgconfig(libnotify) |
160 |
BuildRequires: pkgconfig(libstartup-notification-1.0) >= 0.8 |
161 |
BuildRequires: libiw-devel |
162 |
BuildRequires: pkgconfig(libevent) >= 1.4.7 |
163 |
BuildRequires: pkgconfig(vpx) >= 1.5.0 |
164 |
BuildRequires: pythonegg(2)(setuptools) |
165 |
# (doktor5000) only required for checkout of lightning l10 sources, see mklangsource.sh |
166 |
BuildRequires: mercurial |
167 |
BuildRequires: pkgconfig(gconf-2.0) |
168 |
BuildRequires: java-headless |
169 |
BuildRequires: rootcerts |
170 |
BuildRequires: doxygen |
171 |
BuildRequires: glibc-static-devel |
172 |
BuildRequires: wget |
173 |
BuildRequires: cdrkit-genisoimage |
174 |
BuildRequires: ffmpeg-devel |
175 |
BuildRequires: pkgconfig(theora) |
176 |
BuildRequires: pkgconfig(xscrnsaver) |
177 |
BuildRequires: pythonegg(2)(pysqlite) |
178 |
BuildRequires: cargo |
179 |
BuildRequires: rust |
180 |
BuildRequires: clang |
181 |
BuildRequires: clang-devel |
182 |
BuildRequires: llvm-devel |
183 |
Requires: %{_lib}notify4 |
184 |
Requires: gstreamer1.0-libav |
185 |
# try to fix mga#1344 (automatic installation of proper -l10n package) |
186 |
# packages requiring locales-XX will be automatically preferred when locales-XX |
187 |
# is already installed |
188 |
Recommends: thunderbird-l10n |
189 |
Recommends: %{_lib}canberra0 |
190 |
Recommends: %{_lib}cups2 |
191 |
Obsoletes: mozilla-thunderbird < %{epoch}:%{version}-%{release} |
192 |
Conflicts: mozilla-thunderbird < %{epoch}:%{version}-%{release} |
193 |
Provides: mozilla-thunderbird = %{epoch}:%{version}-%{release} |
194 |
Obsoletes: thunderbird-lightning < 1:3.3-7 |
195 |
Provides: thunderbird-lightning |
196 |
|
197 |
%description |
198 |
%{title} is a full-featured email, RSS and newsgroup client that |
199 |
makes emailing safer, faster and easier than ever before. |
200 |
|
201 |
#=============================================================================== |
202 |
#enigmail |
203 |
|
204 |
# Supported l10n language lists |
205 |
%define l10n_langlist ar bg 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 |
206 |
|
207 |
# Disabled l10n languages, for any reason |
208 |
# nl sk es_AR do not support 0.95.0 yet |
209 |
## %define disabled_l10n_langlist hu |
210 |
# global disabled_l10n_langlist %{nil} |
211 |
|
212 |
# Language descriptions |
213 |
%define language_ar ar |
214 |
%define language_bg bg |
215 |
%define language_ca ca |
216 |
%define language_cs cs |
217 |
%define language_de de |
218 |
%define language_el el |
219 |
%define language_es_AR es-AR |
220 |
%define language_es es-ES |
221 |
%define language_fi fi |
222 |
%define language_fr fr |
223 |
%define language_hu hu |
224 |
%define language_it it |
225 |
%define langname_it Italian |
226 |
%define language_ja ja |
227 |
%define language_ko ko |
228 |
%define language_nb nb-NO |
229 |
%define language_nl nl |
230 |
%define language_pl pl |
231 |
%define language_pt pt-PT |
232 |
%define language_pt_BR pt-BR |
233 |
%define language_ro ro |
234 |
%define language_ru ru |
235 |
%define language_sk sk |
236 |
%define language_sl sl |
237 |
%define language_sv sv-SE |
238 |
%define language_tr tr |
239 |
%define language_vi vi |
240 |
%define language_zh_CN zh-CN |
241 |
%define language_zh_TW zh-TW |
242 |
|
243 |
# --- Danger line --- |
244 |
|
245 |
# All langs |
246 |
%{expand:%%global langlist %(for lang in %l10n_langlist; do echo "$lang"; done | sort -u | sed ':a;$!N;s/\n/ /;ta')} |
247 |
|
248 |
# Defaults (all languages enabled by default) |
249 |
# l10n |
250 |
%{expand:%(for lang in %l10n_langlist; do echo "%%define l10n_$lang 1"; done)} |
251 |
%{expand:%(for lang in %disabled_l10n_langlist; do echo "%%define l10n_$lang 0"; done)} |
252 |
|
253 |
# Params |
254 |
%{expand:%(for lang in %langlist; do echo "%%bcond_without $lang"; done)} |
255 |
|
256 |
%package enigmail |
257 |
Summary: Access the authentication and encryption features provided by GnuPG |
258 |
Group: Networking/Mail |
259 |
Requires: %{name} = %{epoch}:%{version} |
260 |
Obsoletes: %{name}-enigmime < %{epoch}:%{version}-%{release} |
261 |
Provides: %{name}-enigmime = %{epoch}:%{version}-%{release} |
262 |
Obsoletes: mozilla-thunderbird-enigmime < %{epoch}:%{version}-%{release} |
263 |
Obsoletes: mozilla-thunderbird-enigmail < %{epoch}:%{version}-%{release} |
264 |
Provides: mozilla-thunderbird-enigmime = %{epoch}:%{version}-%{release} |
265 |
Provides: mozilla-thunderbird-enigmail = %{epoch}:%{version}-%{release} |
266 |
Requires: gnupg2 |
267 |
Requires(post): %{name} = %{epoch}:%{version} |
268 |
Requires(preun): %{name} = %{epoch}:%{version} |
269 |
Requires(post): mktemp |
270 |
Requires(postun): mktemp |
271 |
Recommends: pinentry-gtk |
272 |
%(for lang in %l10n_langlist %disabled_l10n_langlist; do |
273 |
echo "Obsoletes: thunderbird-enigmail-$lang < 0:10.0.2" |
274 |
echo "Obsoletes: mozilla-thunderbird-enigmail-$lang < %{epoch}:%{version}-%{release}" |
275 |
echo "Obsoletes: mozilla-thunderbird-enigmail-l10n-$lang < %{epoch}:%{version}-%{release}" |
276 |
done) |
277 |
|
278 |
%description enigmail |
279 |
Enigmail is an extension to the mail client of %{title} |
280 |
which allows users to access the authentication and encryption |
281 |
features provided by GnuPG. |
282 |
|
283 |
Main Features |
284 |
|
285 |
* Encrypt/sign mail when sending, decrypt/authenticate received |
286 |
mail |
287 |
* Support for inline-PGP (RFC 2440) and PGP/MIME (RFC 3156) |
288 |
* Per-Account based encryption and signing defaults |
289 |
* Per-Recipient rules for automated key selection, and |
290 |
enabling/disabling encryption and signing |
291 |
* OpenPGP key management interface |
292 |
|
293 |
#=============================================================================== |
294 |
|
295 |
|
296 |
%prep |
297 |
%setup -q -c -n %{name}-%{version} |
298 |
|
299 |
#=================== |
300 |
# Thunderbird itself |
301 |
%setup -q -T -D -n %{name}-%{version}/%{release_dir} |
302 |
|
303 |
%patch1 -p0 |
304 |
%patch3 -p0 |
305 |
%patch4 -p0 |
306 |
%patch5 -p0 |
307 |
%patch9 -p0 |
308 |
%ifarch %{arm} |
309 |
%patch415 -p0 |
310 |
%endif |
311 |
|
312 |
#=============================================================================== |
313 |
# Enigmail |
314 |
%setup -q -T -D -n %{name}-%{version}/%{release_dir}/extensions -a300 |
315 |
|
316 |
%setup -q -T -D -n %{name}-%{version}/%{release_dir} |
317 |
|
318 |
#=============================================================================== |
319 |
|
320 |
|
321 |
%build |
322 |
export BUILD_OFFICIAL=1 |
323 |
export MOZILLA_OFFICIAL=1 |
324 |
|
325 |
%ifarch %{ix86} && %{mgaversion} == 5 |
326 |
# (doktor5000) --disable-new-dtags in addition to -fnostack-protector to get rid of "undefined reference to '__stack_chk_fail'" against libc on i5 |
327 |
CFLAGS=$(echo %optflags | %{__sed} -e 's/-fexceptions//;s/--enable-new-dtags/--disable-new-dtags/') |
328 |
CFLAGS="$CFLAGS -fno-strict-aliasing -fno-stack-protector" |
329 |
%else |
330 |
CFLAGS=$(echo %optflags | %{__sed} -e 's/-fexceptions//') |
331 |
CFLAGS="$CFLAGS -fno-strict-aliasing" |
332 |
%endif |
333 |
CXXFLAGS="$CFLAGS -fpermissive" |
334 |
RPM_OPT_FLAGS="$CFLAGS" |
335 |
LDFLAGS="%ldflags" |
336 |
|
337 |
%ifnarch x86_64 |
338 |
CFLAGS=$(echo "$CFLAGS" | %{__sed} -e 's/-g/-g1/') |
339 |
CXXFLAGS=$(echo "$CXXFLAGS" | %{__sed} -e 's/-g/-g1/') |
340 |
# If MOZ_DEBUG_FLAGS is empty, firefox's build will default it to "-g" which |
341 |
# overrides the -g1 from line above and breaks building on s390 |
342 |
# (OOM when linking, rhbz#1238225) |
343 |
export MOZ_DEBUG_FLAGS=" " |
344 |
%endif |
345 |
|
346 |
export CFLAGS |
347 |
export CXXFLAGS |
348 |
export RPM_OPT_FLAGS |
349 |
export LDFLAGS |
350 |
|
351 |
%if %{use_opt_o3} |
352 |
export CFLAGS="$CFLAGS -O3" |
353 |
export CXXFLAGS="$CXXFLAGS -O3" |
354 |
%endif |
355 |
|
356 |
export MOZCONFIG=`pwd`/.mozconfig |
357 |
cat > $MOZCONFIG << EOF |
358 |
mk_add_options AUTOCONF=autoconf-2.13 |
359 |
mk_add_options MOZILLA_OFFICIAL=1 |
360 |
mk_add_options BUILD_OFFICIAL=1 |
361 |
mk_add_options MOZ_MAKE_FLAGS="-j%{_smp_ncpus_max}" |
362 |
# fallback using absolute path - should be used with define for absolute path for objdir |
363 |
# see https://bugzilla.mozilla.org/show_bug.cgi?id=1106883#c4 for context information |
364 |
#mk_add_options MOZ_OBJDIR=%%{_builddir}/%%{name}-%%{version}/%%{release_dir}/%%{objdir} |
365 |
# -Werror=format-security causes build failures when -Wno-format is explicitly given |
366 |
# for some sources |
367 |
ac_add_options --host=%{_host} |
368 |
ac_add_options --target=%{_target_platform} |
369 |
ac_add_options --prefix="%{_prefix}" |
370 |
ac_add_options --libdir="%{_libdir}" |
371 |
ac_add_options --includedir="%{_includedir}" |
372 |
ac_add_options --datadir="%{_datadir}" |
373 |
ac_add_options --enable-application=comm/mail |
374 |
ac_add_options --enable-calendar |
375 |
ac_add_options --with-system-nspr |
376 |
ac_add_options --with-system-nss |
377 |
ac_add_options --with-system-jpeg |
378 |
ac_add_options --with-system-zlib |
379 |
ac_add_options --with-system-icu |
380 |
ac_add_options --with-system-png |
381 |
ac_add_options --with-system-bz2 |
382 |
#ac_add_options --with-system-sqlite |
383 |
ac_add_options --enable-system-hunspell |
384 |
%if %{with system_cairo} |
385 |
ac_add_options --enable-system-cairo |
386 |
%endif |
387 |
ac_add_options --with-pthreads |
388 |
ac_add_options --disable-tests |
389 |
ac_add_options --disable-debug |
390 |
ac_add_options --disable-updater |
391 |
ac_add_options --disable-crashreporter |
392 |
%if %{use_toolkit_gtk3} |
393 |
ac_add_options --enable-default-toolkit=cairo-gtk3 |
394 |
%else |
395 |
ac_add_options --enable-default-toolkit=cairo-gtk2 |
396 |
%endif |
397 |
ac_add_options --disable-strip |
398 |
ac_add_options --disable-install-strip |
399 |
ac_add_options --enable-startup-notification |
400 |
%ifarch armv7hl |
401 |
# ARMv7 need that (rhbz#1426850) |
402 |
ac_add_options --enable-optimize="-g -O2 -fno-schedule-insns" |
403 |
%else |
404 |
ac_add_options --enable-optimize |
405 |
%endif |
406 |
ac_add_options --with-system-libevent |
407 |
ac_add_options --with-system-libvpx |
408 |
|
409 |
ac_add_options --enable-official-branding |
410 |
ac_add_options --with-distribution-id=org.mageia |
411 |
# |
412 |
%if %{use_ccache} |
413 |
ac_add_options --with-cache=%{_bindir}/ccache |
414 |
%endif |
415 |
%ifarch x86_64 |
416 |
ac_add_options --disable-elf-hack |
417 |
%endif |
418 |
%ifarch armv7hl |
419 |
ac_add_options --with-arch=armv7-a |
420 |
ac_add_options --with-float-abi=hard |
421 |
ac_add_options --with-fpu=vfpv3-d16 |
422 |
%endif |
423 |
%ifarch armv7hnl |
424 |
ac_add_options --with-arch=armv7-a |
425 |
ac_add_options --with-float-abi=hard |
426 |
ac_add_options --with-fpu=neon |
427 |
ac_add_options --disable-yarr-jit |
428 |
%endif |
429 |
%ifarch armv5tel |
430 |
ac_add_options --with-arch=armv5te |
431 |
ac_add_options --with-float-abi=soft |
432 |
ac_add_options --disable-yarr-jit |
433 |
%endif |
434 |
EOF |
435 |
|
436 |
# recommended way to build - also used by upstream buildsystem |
437 |
# see https://bugzilla.mozilla.org/show_bug.cgi?id=1106883#c4 for context information |
438 |
MOZ_OBJDIR=%{objdir} ./mach build |
439 |
|
440 |
#=============================================================================== |
441 |
|
442 |
pushd extensions/enigmail |
443 |
%configure2_5x |
444 |
make |
445 |
|
446 |
popd |
447 |
|
448 |
pushd extensions/enigmail/lang |
449 |
chmod 0755 ./make-lang.sh |
450 |
for i in `cat current-languages.txt`; do |
451 |
./make-lang.sh $i %{enigmail_short_version} |
452 |
done |
453 |
popd |
454 |
|
455 |
#=============================================================================== |
456 |
|
457 |
%install |
458 |
cd %{objdir} |
459 |
%make_install |
460 |
cd .. |
461 |
|
462 |
rm -rf %buildroot%tbdir/dictionaries |
463 |
ln -s %{_datadir}/hunspell %buildroot%tbdir/dictionaries |
464 |
|
465 |
# install icons |
466 |
for s in 16 22 24 32 48 64 128 256; do |
467 |
%{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps |
468 |
%{__cp} -p comm/mail/branding/%{name}/default${s}.png \ |
469 |
%{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/thunderbird.png |
470 |
done |
471 |
|
472 |
# desktop file |
473 |
%{__install} -p -D %{SOURCE303} %{buildroot}/%{_datadir}/applications/%{name}.desktop |
474 |
|
475 |
#used for matching system locale on startup |
476 |
%{__cat} %{SOURCE12} | %{__perl} -p -e 's,THUNDERBIRD_RPM_VR,%{version}-%{release},g;' \ |
477 |
-e 's,THUNDERBIRD_VENDOR_COMMENT,%{product_release},g;' \ |
478 |
> %{buildroot}%{tbdir}/defaults/pref/all-mageia.js |
479 |
|
480 |
# lightning langpacks install |
481 |
mkdir -p %{buildroot}%{langpackdir} |
482 |
cd %{buildroot}%{langpackdir} |
483 |
%{__tar} xf %{SOURCE3} |
484 |
chmod a+r *.xpi |
485 |
cd - |
486 |
|
487 |
#=============================================================================== |
488 |
|
489 |
%{__mkdir_p} %{buildroot}%{tbextdir}/%{enigmail_id} |
490 |
%if !%{xpi} |
491 |
%{_bindir}/unzip -q extensions/enigmail/build/enigmail-%{enigmail_short_version}*.xpi -d %{buildroot}%{tbextdir}/%{enigmail_id} |
492 |
%{__chmod} 644 %{buildroot}%{tbextdir}/%{enigmail_id}/chrome.manifest |
493 |
%else |
494 |
%{__cp} -aL extensions/enigmail/build/enigmail-%{enigmail_short_version}*.xpi %{buildroot}%{tbextdir}/%{enigmail_id}/%{enigmail_id}.xpi |
495 |
%endif |
496 |
|
497 |
#============================================================================== |
498 |
#enigmail lang package |
499 |
# Convert rpm macros to bash variables |
500 |
%{expand:%(for lang in %langlist; do echo "language_$lang=%%{language_$lang}"; done)} |
501 |
%{expand:%(for lang in %langlist; do echo "with_$lang=%%{with $lang}"; done)} |
502 |
%{expand:%(for lang in %l10n_langlist; do echo "l10n_$lang=%%{l10n_$lang}"; done)} |
503 |
pushd extensions/enigmail/lang |
504 |
for lang in %langlist; do |
505 |
%{__mkdir_p} %{buildroot}%{_datadir}/mozilla/extensions/%{tb_appid}/enigmail-$lang@enigmail.mozdev.org |
506 |
language="language_$lang" |
507 |
language=${!language} |
508 |
%{_bindir}/unzip -q enigmail-${language}-%{enigmail_short_version}.xpi -d %{buildroot}%{_datadir}/mozilla/extensions/%{tb_appid}/enigmail-$lang@enigmail.mozdev.org/ |
509 |
done |
510 |
popd |
511 |
|
512 |
#=============================================================================== |
513 |
|
514 |
#exclude devel files |
515 |
%{__rm} -rf %{buildroot}%{_libdir}/%{oname}-devel-%{version} |
516 |
|
517 |
#=============================================================================== |
518 |
|
519 |
%post enigmail |
520 |
if [ -f %{tbdir}/components/compreg.dat ]; then |
521 |
%{__rm} -f %{tbdir}/components/compreg.dat |
522 |
fi |
523 |
|
524 |
if [ -f %{tbdir}/components/xpti.dat ]; then |
525 |
%{__rm} -f %{tbdir}/components/xpti.dat |
526 |
fi |
527 |
|
528 |
mktemp="/bin/mktemp -d -q -p ${TMPDIR:-/tmp} -t %{name}.XXXXXXXXXX" |
529 |
|
530 |
TMPDIR= TB_TMPDIR=`$mktemp` && { |
531 |
%if %{xpi} |
532 |
HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -install-global-extension %{tbextdir}/enigmail-%{enigmail_version}-linux-*.xpi |
533 |
%endif |
534 |
HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -register |
535 |
test -d "$TB_TMPDIR" && %{__rm} -rf -- "$TB_TMPDIR" |
536 |
} |
537 |
|
538 |
%preun enigmail |
539 |
if [ -f %{tbdir}/components/compreg.dat ]; then |
540 |
%{__rm} -f %{tbdir}/components/compreg.dat |
541 |
fi |
542 |
|
543 |
if [ -f %{tbdir}/components/xpti.dat ]; then |
544 |
%{__rm} -f %{tbdir}/components/xpti.dat |
545 |
fi |
546 |
|
547 |
if [ -x %{tbdir}/thunderbird-bin ]; then |
548 |
mktemp="/bin/mktemp -d -q -p ${TMPDIR:-/tmp} -t %{name}.XXXXXXXXXX" |
549 |
|
550 |
TMPDIR= TB_TMPDIR=`$mktemp` && { |
551 |
%if %{xpi} |
552 |
HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -install-global-extension %{tbextdir}/enigmail-%{enigmail_version}-linux-*.xpi |
553 |
%endif |
554 |
HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -register |
555 |
test -d "$TB_TMPDIR" && %{__rm} -rf -- "$TB_TMPDIR" |
556 |
} |
557 |
fi |
558 |
|
559 |
#=============================================================================== |
560 |
|
561 |
%files |
562 |
%doc LEGAL |
563 |
# (doktor5000) explicit %%attrs are not applicable to symlinks, remove them |
564 |
%{_bindir}/thunderbird |
565 |
%attr(644,root,root) %{_datadir}/applications/*.desktop |
566 |
%{tbdir} |
567 |
%if %{xpi} |
568 |
%dir %{tbextdir} |
569 |
%endif |
570 |
# other icons |
571 |
%{_iconsdir}/hicolor/*/apps/%{name}.png |
572 |
%exclude %{tbextdir}/%{enigmail_id} |
573 |
|
574 |
%files enigmail |
575 |
%{tbextdir}/%{enigmail_id} |
576 |
# tag l10n files with %%lang(language) to only install those l10n files for which locales packages are installed |
577 |
%(for lang in %langlist; do |
578 |
echo "%%lang($lang) %{_datadir}/mozilla/extensions/%{tb_appid}/enigmail-$lang@enigmail.mozdev.org" |
579 |
done) |
580 |
|