/[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 1085939 - (show annotations) (download)
Mon Feb 13 08:42:19 2017 UTC (7 years, 2 months ago) by ns80
File size: 25014 byte(s)
- update thunderbird to 45.7.1 (mga#20267)

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

  ViewVC Help
Powered by ViewVC 1.1.30