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

  ViewVC Help
Powered by ViewVC 1.1.30