-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththunderbird.spec
2371 lines (1759 loc) · 75.5 KB
/
thunderbird.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%if 0%{?fedora} > 35 || 0%{?rhel} > 9
%global dictionarydir hunspell
%else
%global dictionarydir myspell
%endif
# Disabled arm due to rhbz#1658940
ExcludeArch: armv7hl
# Use system nspr/nss?
%define system_nss 1
# Build as a debug package?
%define debug_build 0
# Hardened build?
%define hardened_build 1
%define system_ffi 1
%define build_langpacks 1
%bcond_with toolchain_clang
%global use_bundled_cbindgen 1
%global disable_elfhack 1
%if %{?system_nss}
%global nspr_version 4.26.0
%global nspr_build_version %(pkg-config --silence-errors --modversion nspr 2>/dev/null || echo 65536)
%global nss_version 3.55.0
%global nss_build_version %(pkg-config --silence-errors --modversion nss 2>/dev/null || echo 65536)
%endif
%define freetype_version 2.1.9
%define libnotify_version 0.4
%define _default_patch_fuzz 2
# There are still build problems on s390x, see
# https://koji.fedoraproject.org/koji/taskinfo?taskID=55048351
# https://bugzilla.redhat.com/show_bug.cgi?id=1897522
ExcludeArch: s390x
# libvpx is too new for Firefox 65
%if 0%{?fedora} < 30
%global system_libvpx 1
%else
%global system_libvpx 0
%endif
%define system_jpeg 1
# Use system libicu? - libicu even on rawhide too old
%if 0%{?fedora} >= 27
%define system_libicu 0
%else
%define system_libicu 0
%endif
# Big endian platforms
%ifarch ppc64 s390x
# Javascript Intl API is not supported on big endian platforms right now:
# https://bugzilla.mozilla.org/show_bug.cgi?id=1322212
%define big_endian 1
%endif
%if %{?system_libvpx}
%global libvpx_version 1.4.0
%endif
%define thunderbird_app_id \{3550f703-e582-4d05-9a08-453d09bdfdc6\}
%global langpackdir %{mozappdir}/extensions
# The tarball is pretty inconsistent with directory structure.
# Sometimes there is a top level directory. That goes here.
#
# IMPORTANT: If there is no top level directory, this should be
# set to the cwd, ie: '.'
%define objdir objdir
%define mozappdir %{_libdir}/thunderbird
%define official_branding 1
%define enable_mozilla_crashreporter 0
# enable crash reporter only for iX86
%ifarch %{ix86} x86_64
%if 0%{?fedora} < 27 && 0%{?rhel} <= 7
%define enable_mozilla_crashreporter 1
%endif
%endif
%if %{with toolchain_clang}
%global toolchain clang
%endif
# Exclude private libraries from autogenerated provides and requires
%global __provides_exclude_from ^%{mozappdir}
%global __requires_exclude ^(%%(find %{buildroot}%{mozappdir} -name '*.so' | xargs -n1 basename | sort -u | paste -s -d '|' -))
Summary: Mozilla Thunderbird mail/newsgroup client
Name: thunderbird
Version: 102.10.0
Release: 1%{?dist}
URL: http://www.mozilla.org/projects/thunderbird/
License: MPL-2.0 OR GPL-2.0-or-later OR LGPL-2.0-or-later
Source0: https://archive.mozilla.org/pub/thunderbird/releases/%{version}%{?pre_version}/source/thunderbird-%{version}%{?pre_version}.source.tar.xz
%if %{build_langpacks}
Source1: thunderbird-langpacks-%{version}-20230411.tar.xz
%endif
Source3: get-calendar-langpacks.sh
Source4: cbindgen-vendor.tar.xz
Source10: thunderbird-mozconfig
Source11: thunderbird-mozconfig-branded
Source12: thunderbird-redhat-default-prefs.js
Source20: thunderbird.desktop
Source21: thunderbird.sh.in
Source25: thunderbird-symbolic.svg
Source28: thunderbird-wayland.sh.in
Source29: thunderbird-wayland.desktop
Source32: node-stdout-nonblocking-wrapper
# Build patches
Patch9: mozilla-build-arm.patch
#Patch226: rhbz-1354671.patch
Patch415: Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch
#Patch416: firefox-SIOCGSTAMP.patch
Patch418: mozilla-1512162.patch
#Patch419: bindgen-d0dfc52706f23db9dc9d74642eeebd89d73cb8d0.patch
Patch103: rhbz-1219542-s390-build.patch
# gcc 12 build fix patches
Patch422: 0001-GLIBCXX-fix-for-GCC-12.patch
# Python 3.11 "ValueError: invalid mode: 'rU'"; 'U' is deprecated since Python 3 and default, error with Python 3.11
# Python 3.11 "Invalid regular expression for rule '...'. global flags not at the start of the expression at position ...
Patch425: build-disable-elfhack.patch
Patch426: gcc13-header-dependencies.patch
# PPC fix
Patch304: mozilla-1245783.patch
# Fedora specific patches
# Upstream patches
Patch402: mozilla-526293.patch
Patch406: mozilla-1170092.patch
Patch408: D165150.diff
Patch409: D165152.diff
# Bundled expat backported patches
Patch501: expat-CVE-2022-25235.patch
Patch502: expat-CVE-2022-25236.patch
Patch503: expat-CVE-2022-25315.patch
# Tentative patch for RUSTFLAGS parsing issue,
# borrowed from firefox commit 24c9accce19c5cae9394430b24eaf938a9c17882:
# https://bugzilla.redhat.com/show_bug.cgi?id=2184743
# https://bugzilla.mozilla.org/show_bug.cgi?id=1474486
Patch1200: rustflags-commasplit.patch
%if %{official_branding}
# Required by Mozilla Corporation
%else
# Not yet approved by Mozillla Corporation
%endif
BuildRequires: make
BuildRequires: gcc-c++
%if %{?system_nss}
BuildRequires: nss-static >= %{nss_version}
BuildRequires: nspr-devel >= %{nspr_version}
BuildRequires: nss-devel >= %{nss_version}
Requires: nspr >= %{nspr_build_version}
Requires: nss >= %{nss_build_version}
%endif
BuildRequires: libnotify-devel >= %{libnotify_version}
BuildRequires: libpng-devel
BuildRequires: libjpeg-devel
BuildRequires: zip
BuildRequires: bzip2-devel
BuildRequires: zlib-devel
#BuildRequires: libIDL-devel
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: krb5-devel
BuildRequires: pango-devel
BuildRequires: freetype-devel >= %{freetype_version}
BuildRequires: libXt-devel
BuildRequires: libXrender-devel
BuildRequires: hunspell-devel
BuildRequires: llvm
BuildRequires: llvm-devel
BuildRequires: clang
BuildRequires: clang-libs
%if "%toolchain" == "clang"
BuildRequires: lld
%endif
%if %{?system_ffi}
BuildRequires: libffi-devel
%endif
BuildRequires: startup-notification-devel
BuildRequires: alsa-lib-devel
BuildRequires: m4
BuildRequires: desktop-file-utils
BuildRequires: libcurl-devel
BuildRequires: mesa-libGL-devel
%if %{?system_libvpx}
BuildRequires: libvpx-devel >= %{libvpx_version}
%endif
BuildRequires: pulseaudio-libs-devel
BuildRequires: libicu-devel
BuildRequires: perl-interpreter
Requires: mozilla-filesystem
BuildRequires: yasm
BuildRequires: dbus-glib-devel
Obsoletes: thunderbird-lightning
Provides: thunderbird-lightning
Obsoletes: thunderbird-lightning-gdata <= 1:3.3.0.14
BuildRequires: rust
BuildRequires: cargo
BuildRequires: clang-devel
BuildRequires: python3-devel
%if !0%{?use_bundled_cbindgen}
BuildRequires: cbindgen
%endif
BuildRequires: nodejs
BuildRequires: nasm >= 1.13
%if 0%{?big_endian}
BuildRequires: icu
%endif
# require any OpenPGP backend with the librnp interface
# see comm/mail/extensions/openpgp/content/modules/RNPLib.jsm
# %%{mozappdir}/librnp.so or %%{_libdir}/librnp.so.0
Requires: (thunderbird-librnp%{?_isa} or librnp%{?_isa})
# prefer the librnp implementation bundled with thunderbird
Suggests: thunderbird-librnp-rnp%{?_isa}
Suggests: u2f-hidraw-policy
%description
Mozilla Thunderbird is a standalone mail and newsgroup client.
%package librnp-rnp
Summary: OpenPGP implementation for Thunderbird based on RNP
Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: thunderbird-librnp
Provides: thunderbird-librnp%{?_isa}
Conflicts: thunderbird-librnp%{?_isa}
%description librnp-rnp
The thunderbird-librnp-rnp package contains an OpenPGP implementation
based on RNP.
%files librnp-rnp
%{mozappdir}/librnp.so
%{mozappdir}/rnp-cli
%{mozappdir}/rnpkeys
%package wayland
Summary: Thunderbird Wayland launcher.
Requires: %{name}
%description wayland
The thunderbird-wayland package contains launcher and desktop file
to run Thunderbird natively on Wayland.
%files wayland
%{_bindir}/thunderbird-wayland
%attr(644,root,root) %{_datadir}/applications/mozilla-thunderbird-wayland.desktop
%if %{enable_mozilla_crashreporter}
%global moz_debug_prefix %{_prefix}/lib/debug
%global moz_debug_dir %{moz_debug_prefix}%{mozappdir}
%global uname_m %(uname -m)
%global symbols_file_name %{name}-%{version}.en-US.%{_os}-%{uname_m}.crashreporter-symbols.zip
%global symbols_file_path %{moz_debug_dir}/%{symbols_file_name}
%global _find_debuginfo_opts -p %{symbols_file_path} -o debugcrashreporter.list
%global crashreporter_pkg_name mozilla-crashreporter-%{name}-debuginfo
%package -n %{crashreporter_pkg_name}
Summary: Debugging symbols used by Mozilla's crash reporter servers
%description -n %{crashreporter_pkg_name}
This package provides debug information for XULRunner, for use by
Mozilla's crash reporter servers. If you are trying to locally
debug %{name}, you want to install %{name}-debuginfo instead.
%files -n %{crashreporter_pkg_name} -f debugcrashreporter.list
%defattr(-,root,root)
%endif
%prep
%setup -q
# Build patches
%patch9 -p2 -b .arm
%ifarch s390
%patch103 -p1 -b .rhbz-1219542-s390-build
%endif
%if 0%{?fedora} >= 35
# since python3.10 we need to use `from collections.abc` instead of `from collections`.
%endif
%patch304 -p1 -b .1245783
# Patch for big endian platforms only
#%if 0%{?big_endian}
#%endif
#ARM run-time patch
%ifarch aarch64
#%patch226 -p1 -b .1354671
%endif
%ifarch %{arm}
%patch415 -p1 -b .mozilla-1238661
%endif
#FIXME %patch416 -p1 -b .SIOCGSTAMP
%patch418 -p1 -b .mozbz-1512162
%if 0%{?disable_elfhack}
%patch425 -p1 -b .build-disable-elfhack
%endif
# most likely fixed
#%patch419 -p1 -b .bindgen
#cd ..
%patch402 -p1 -b .526293
%patch406 -p1 -b .1170092-etc-conf
%patch408 -p1 -b .D165150
%patch409 -p1 -b .D165152
pushd comm
popd
%patch422 -p1 -b .0001-GLIBCXX-fix-for-GCC-12
%patch426 -p1 -b .gcc13-header-dependencies
%patch501 -p1 -b .expat-CVE-2022-25235
%patch502 -p1 -b .expat-CVE-2022-25236
%patch503 -p1 -b .expat-CVE-2022-25315
%patch1200 -p1 -b .rustflags-commasplit
%if %{official_branding}
# Required by Mozilla Corporation
%else
# Not yet approved by Mozilla Corporation
%endif
%{__rm} -f .mozconfig
%{__cp} %{SOURCE10} .mozconfig
%if %{official_branding}
%{__cat} %{SOURCE11} >> .mozconfig
%endif
echo "ac_add_options --prefix=\"%{_prefix}\"" >> .mozconfig
echo "ac_add_options --libdir=\"%{_libdir}\"" >> .mozconfig
%if %{?system_nss}
echo "ac_add_options --with-system-nspr" >> .mozconfig
echo "ac_add_options --with-system-nss" >> .mozconfig
%else
echo "ac_add_options --without-system-nspr" >> .mozconfig
echo "ac_add_options --without-system-nss" >> .mozconfig
%endif
# Second arches fail to start with jemalloc enabled
%ifnarch %{ix86} x86_64
echo "ac_add_options --disable-jemalloc" >> .mozconfig
%endif
%if %{?system_ffi}
echo "ac_add_options --enable-system-ffi" >> .mozconfig
%endif
%if %{?debug_build}
echo "ac_add_options --enable-debug" >> .mozconfig
echo "ac_add_options --disable-optimize" >> .mozconfig
%else
%global optimize_flags "none"
%ifarch ppc64le aarch64
%global optimize_flags "-g -O2"
%endif
%if %{?optimize_flags} != "none"
echo 'ac_add_options --enable-optimize=%{?optimize_flags}' >> .mozconfig
%else
echo 'ac_add_options --enable-optimize' >> .mozconfig
%endif
echo "ac_add_options --disable-debug" >> .mozconfig
%endif
%ifarch aarch64
echo "ac_add_options --disable-jit" >> .mozconfig
%endif
%ifnarch %{ix86} x86_64
echo "ac_add_options --disable-webrtc" >> .mozconfig
%endif
%ifarch armv7hl
echo "ac_add_options --with-arch=armv7-a" >> .mozconfig
echo "ac_add_options --with-float-abi=hard" >> .mozconfig
echo "ac_add_options --with-fpu=vfpv3-d16" >> .mozconfig
%endif
%ifarch armv7hnl
echo "ac_add_options --with-arch=armv7-a" >> .mozconfig
echo "ac_add_options --with-float-abi=hard" >> .mozconfig
echo "ac_add_options --with-fpu=neon" >> .mozconfig
echo "ac_add_options --disable-yarr-jit" >> .mozconfig
%endif
%ifarch armv5tel
echo "ac_add_options --with-arch=armv5te" >> .mozconfig
echo "ac_add_options --with-float-abi=soft" >> .mozconfig
echo "ac_add_options --disable-yarr-jit" >> .mozconfig
%endif
%if %{?system_libicu}
echo "ac_add_options --with-system-icu" >> .mozconfig
%else
echo "ac_add_options --without-system-icu" >> .mozconfig
%endif
%if !%{?system_jpeg}
echo "ac_add_options --without-system-jpeg" >> .mozconfig
%else
echo "ac_add_options --with-system-jpeg" >> .mozconfig
%endif
%if %{?system_libvpx}
echo "ac_add_options --with-system-libvpx" >> .mozconfig
%else
echo "ac_add_options --without-system-libvpx" >> .mozconfig
%endif
%if %{enable_mozilla_crashreporter}
echo "ac_add_options --enable-crashreporter" >> .mozconfig
%else
echo "ac_add_options --disable-crashreporter" >> .mozconfig
%endif
echo 'export NODEJS="%{_buildrootdir}/bin/node-stdout-nonblocking-wrapper"' >> .mozconfig
# Remove executable bit to make brp-mangle-shebangs happy.
find third_party -type f -iname "*.rs"|xargs chmod a-x
#===============================================================================
%build
# Disable LTO to work around rhbz#1883904
%define _lto_cflags %{nil}
%if 0%{?use_bundled_cbindgen}
mkdir -p my_rust_vendor
cd my_rust_vendor
%{__tar} xf %{SOURCE4}
cd -
mkdir -p .cargo
cat > .cargo/config <<EOL
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "`pwd`/my_rust_vendor"
EOL
env CARGO_HOME=.cargo cargo install cbindgen
export PATH=`pwd`/.cargo/bin:$PATH
%endif
%if 0%{?big_endian}
echo "Generate big endian version of config/external/icu/data/icud58l.dat"
icupkg -tb config/external/icu/data/icudt67l.dat config/external/icu/data/icudt67b.dat
ls -l config/external/icu/data
rm -f config/external/icu/data/icudt*l.dat
# ./mach python intl/icu_sources_data.py .
# ls -l config/external/icu/data
# rm -f config/external/icu/data/icudt*l.dat
# cat /tmp/icu*
%endif
mkdir %{_buildrootdir}/bin || :
cp %{SOURCE32} %{_buildrootdir}/bin || :
# Update the various config.guess to upstream release for aarch64 support
find ./ -name config.guess -exec cp /usr/lib/rpm/config.guess {} ';'
# -fpermissive is needed to build with gcc 4.6+ which has become stricter
#
# Mozilla builds with -Wall with exception of a few warnings which show up
# everywhere in the code; so, don't override that.
#
# Disable C++ exceptions since Mozilla code is not exception-safe
#
MOZ_OPT_FLAGS=$(echo "$RPM_OPT_FLAGS -fpermissive" | \
%{__sed} -e 's/-Wall//')
%if 0%{?fedora} < 30
MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -Wformat-security -Wformat -Werror=format-security"
%else
# Workaround for mozbz#1531309
MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-Werror=format-security//')
%endif
# Use hardened build?
%if %{?hardened_build}
MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fPIC -Wl,-z,relro -Wl,-z,now"
%endif
%if %{?debug_build}
MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-O2//')
%endif
%ifarch s390
MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g1/')
# If MOZ_DEBUG_FLAGS is empty, firefox's build will default it to "-g" which
# overrides the -g1 from line above and breaks building on s390
# (OOM when linking, rhbz#1238225)
export MOZ_DEBUG_FLAGS=" "
%endif
%ifarch %{arm} %{ix86}
MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g0/')
export MOZ_DEBUG_FLAGS=" "
%endif
%if "%toolchain" != "clang"
%ifarch s390 ppc aarch64 %{ix86}
MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
%endif
%ifarch %{arm}
MOZ_LINK_FLAGS="-Wl,--no-keep-memory"
echo "ac_add_options --enable-linker=gold" >> .mozconfig
%endif
%endif
%if 0%{?flatpak}
# Make sure the linker can find libraries in /app/lib64 as we don't use
# __global_ldflags that normally sets this.
MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -L%{_libdir}"
%endif
%ifarch %{arm} %{ix86} %{s390x}
export RUSTFLAGS="-Cdebuginfo=0"
%endif
# We don't want thunderbird to use CK_GCM_PARAMS_V3 in nss
MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -DNSS_PKCS11_3_0_STRICT"
echo "export CFLAGS=\"$MOZ_OPT_FLAGS\"" >> .mozconfig
echo "export CXXFLAGS=\"$MOZ_OPT_FLAGS\"" >> .mozconfig
echo "export LDFLAGS=\"$MOZ_LINK_FLAGS\"" >> .mozconfig
%if "%toolchain" == "clang"
echo "export LLVM_PROFDATA=\"llvm-profdata\"" >> .mozconfig
echo "export AR=\"llvm-ar\"" >> .mozconfig
echo "export NM=\"llvm-nm\"" >> .mozconfig
echo "export RANLIB=\"llvm-ranlib\"" >> .mozconfig
echo "ac_add_options --enable-linker=lld" >> .mozconfig
%else
echo "export CC=gcc" >> .mozconfig
echo "export CXX=g++" >> .mozconfig
echo "export AR=\"gcc-ar\"" >> .mozconfig
echo "export NM=\"gcc-nm\"" >> .mozconfig
echo "export RANLIB=\"gcc-ranlib\"" >> .mozconfig
%endif
%if 0%{?build_with_pgo}
echo "ac_add_options MOZ_PGO=1" >> .mozconfig
# PGO build doesn't work with ccache
export CCACHE_DISABLE=1
%endif
MOZ_SMP_FLAGS=-j1
# On x86 architectures, Mozilla can build up to 4 jobs at once in parallel,
# however builds tend to fail on other arches when building in parallel.
%ifarch %{ix86} x86_64 ppc %{power64} aarch64
[ -z "$RPM_BUILD_NCPUS" ] && \
RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"
[ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2
[ "$RPM_BUILD_NCPUS" -ge 4 ] && MOZ_SMP_FLAGS=-j4
[ "$RPM_BUILD_NCPUS" -ge 8 ] && MOZ_SMP_FLAGS=-j8
%endif
export MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS"
export STRIP=/bin/true
export MACH_USE_SYSTEM_PYTHON=1
./mach build -v
# create debuginfo for crash-stats.mozilla.com
%if %{enable_mozilla_crashreporter}
make -C %{objdir} buildsymbols
%endif
#===============================================================================
%install
cd %{objdir}
DESTDIR=$RPM_BUILD_ROOT make install
cd ..
# install icons
for s in 16 22 24 32 48 64 128 256; do
%{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps
%{__cp} -p comm/mail/branding/%{name}/default${s}.png \
$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps/thunderbird.png
done
# Install hight contrast icon
%{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps
%{__cp} -p %{SOURCE25} \
%{buildroot}%{_datadir}/icons/hicolor/symbolic/apps
desktop-file-install --vendor mozilla \
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{SOURCE20}
desktop-file-install --vendor mozilla \
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{SOURCE29}
# set up the thunderbird start script
rm -f $RPM_BUILD_ROOT/%{_bindir}/thunderbird
%{__cat} %{SOURCE21} | %{__sed} -e 's,__PREFIX__,%{_prefix},g' > \
$RPM_BUILD_ROOT/%{_bindir}/thunderbird
%{__chmod} 755 $RPM_BUILD_ROOT/%{_bindir}/thunderbird
%{__cat} %{SOURCE28} | %{__sed} -e 's,__PREFIX__,%{_prefix},g' > \
%{buildroot}%{_bindir}/thunderbird-wayland
%{__chmod} 755 %{buildroot}%{_bindir}/thunderbird-wayland
# set up our default preferences
%{__cat} %{SOURCE12} | %{__sed} -e 's,THUNDERBIRD_RPM_VR,%{version}-%{release},g' \
-e 's,myspell,%{dictionarydir},g' \
> $RPM_BUILD_ROOT/rh-default-prefs
%{__install} -D $RPM_BUILD_ROOT/rh-default-prefs $RPM_BUILD_ROOT/%{mozappdir}/greprefs/all-redhat.js
%{__install} -D $RPM_BUILD_ROOT/rh-default-prefs $RPM_BUILD_ROOT/%{mozappdir}/defaults/pref/all-redhat.js
%{__rm} $RPM_BUILD_ROOT/rh-default-prefs
%{__rm} -f $RPM_BUILD_ROOT%{_bindir}/thunderbird-config
# own mozilla plugin dir (#135050)
%{__mkdir_p} $RPM_BUILD_ROOT%{_libdir}/mozilla/plugins
# own extension directories
%{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/mozilla/extensions/%{thunderbird_app_id}
%{__mkdir_p} $RPM_BUILD_ROOT%{_libdir}/mozilla/extensions/%{thunderbird_app_id}
# System config dir (#1525709)
%{__mkdir_p} %{buildroot}%{_sysconfdir}/%{name}/pref
# Install langpacks
%{__rm} -f %{name}.lang # Delete for --short-circuit option
touch %{name}.lang
%if %{build_langpacks}
%{__mkdir_p} %{buildroot}%{langpackdir}
%{__tar} xf %{SOURCE1}
for langpack in `ls thunderbird-langpacks/*.xpi`; do
language=`basename $langpack .xpi`
%{__mkdir_p} $extensionID
unzip -qq $langpack -d $extensionID
find $extensionID -type f | xargs chmod 644
cd $extensionID
zip -qq -r9mX ../${extensionID}.xpi *
cd -
%{__install} -m 644 ${extensionID}.xpi %{buildroot}%{langpackdir}
language=`echo $language | sed -e 's/-/_/g'`
echo "%%lang($language) %{langpackdir}/${extensionID}.xpi" >> %{name}.lang
done
%{__rm} -rf thunderbird-langpacks
%endif
# Get rid of devel package and its debugsymbols
%{__rm} -rf $RPM_BUILD_ROOT%{_libdir}/%{name}-devel-%{version}
# Copy over the LICENSE
install -c -m 644 LICENSE $RPM_BUILD_ROOT%{mozappdir}
# Use the system hunspell dictionaries
%{__rm} -rf $RPM_BUILD_ROOT/%{mozappdir}/dictionaries
ln -s $(pkg-config --variable prefix hunspell)/share/%{dictionarydir} $RPM_BUILD_ROOT%{mozappdir}/dictionaries
# ghost files
%{__mkdir_p} $RPM_BUILD_ROOT%{mozappdir}/components
touch $RPM_BUILD_ROOT%{mozappdir}/components/compreg.dat
touch $RPM_BUILD_ROOT%{mozappdir}/components/xpti.dat
# Add debuginfo for crash-stats.mozilla.com
%if %{enable_mozilla_crashreporter}
%{__mkdir_p} $RPM_BUILD_ROOT/%{moz_debug_dir}
%{__cp} %{objdir}/dist/%{symbols_file_name} $RPM_BUILD_ROOT/%{moz_debug_dir}
%endif
# Register as an application to be visible in the software center
mkdir -p $RPM_BUILD_ROOT%{_datadir}/metainfo
%{__cp} -p comm/mail/branding/%{name}/net.thunderbird.Thunderbird.appdata.xml $RPM_BUILD_ROOT%{_datadir}/metainfo/thunderbird.appdata.xml
sed -i -e 's|<icon .*|<icon type="stock">thunderbird</icon>|' "$RPM_BUILD_ROOT%{_datadir}/metainfo/thunderbird.appdata.xml"
#===============================================================================
%post
update-desktop-database &> /dev/null || :
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%postun
update-desktop-database &> /dev/null || :
if [ $1 -eq 0 ] ; then
touch --no-create %{_datadir}/icons/hicolor &>/dev/null
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#===============================================================================
%files -f %{name}.lang
%defattr(-,root,root,-)
%attr(755,root,root) %{_bindir}/thunderbird
%{_datadir}/metainfo/*.appdata.xml
%attr(644,root,root) %{_datadir}/applications/mozilla-thunderbird.desktop
%dir %{_sysconfdir}/%{name}
%dir %{_sysconfdir}/%{name}/*
%dir %{_datadir}/mozilla/extensions/%{thunderbird_app_id}
%dir %{_libdir}/mozilla/extensions/%{thunderbird_app_id}
%dir %{mozappdir}
%doc %{mozappdir}/LICENSE
%{mozappdir}/chrome
%dir %{mozappdir}/components
%ghost %{mozappdir}/components/compreg.dat
%ghost %{mozappdir}/components/xpti.dat
%{mozappdir}/omni.ja
%{mozappdir}/plugin-container
%{mozappdir}/defaults
%{mozappdir}/dictionaries
%if %{build_langpacks}
%dir %{langpackdir}
%endif
%{mozappdir}/greprefs
%{mozappdir}/isp
%{mozappdir}/thunderbird-bin
%{mozappdir}/thunderbird
%{mozappdir}/*.so
%exclude %{mozappdir}/librnp.so
%{mozappdir}/platform.ini
%{mozappdir}/application.ini
%exclude %{mozappdir}/removed-files
%{_datadir}/icons/hicolor/16x16/apps/thunderbird.png
%{_datadir}/icons/hicolor/22x22/apps/thunderbird.png
%{_datadir}/icons/hicolor/24x24/apps/thunderbird.png
%{_datadir}/icons/hicolor/256x256/apps/thunderbird.png
%{_datadir}/icons/hicolor/32x32/apps/thunderbird.png
%{_datadir}/icons/hicolor/48x48/apps/thunderbird.png
%{_datadir}/icons/hicolor/64x64/apps/thunderbird.png
%{_datadir}/icons/hicolor/128x128/apps/thunderbird.png
%{_datadir}/icons/hicolor/symbolic/apps/thunderbird-symbolic.svg
%if %{enable_mozilla_crashreporter}
%{mozappdir}/crashreporter
%{mozappdir}/crashreporter.ini
%{mozappdir}/Throbber-small.gif
%endif
%if !%{?system_nss}
%{mozappdir}/*.chk
%endif
%{mozappdir}/dependentlibs.list
%{mozappdir}/fonts
%{mozappdir}/pingsender
#===============================================================================
%changelog
* Tue Apr 11 2023 Eike Rathke <[email protected]> - 102.10.0-1
- Update to 102.10.0
* Wed Mar 29 2023 Eike Rathke <[email protected]> - 102.9.1-1
- Update to 102.9.1
* Wed Mar 15 2023 Eike Rathke <[email protected]> - 102.9.0-1
- Update to 102.9.0
* Fri Feb 17 2023 Eike Rathke <[email protected]> - 102.8.0-1
- Update to 102.8.0
* Wed Feb 08 2023 Eike Rathke <[email protected]> - 102.7.2-1
- Update to 102.7.2
* Tue Jan 31 2023 Eike Rathke <[email protected]> - 102.7.1-2
- Update to 102.7.1 build2
* Tue Jan 24 2023 Eike Rathke <[email protected]> - 102.7.1-1
- Update to 102.7.1
- Fix FTBFS gcc13 header dependencies
* Sat Jan 21 2023 Fedora Release Engineering <[email protected]> - 102.6.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Wed Dec 21 2022 Martin Stransky <[email protected]> - 102.6.0-2
- Backported mozbz#1804877 - set XDG_ACTIVATION_TOKEN when launch
external application.
* Tue Dec 13 2022 Eike Rathke <[email protected]> - 102.6.0-1
- Update to 102.6.0
* Thu Dec 01 2022 Eike Rathke <[email protected]> - 102.5.1-1
- Update to 102.5.1
* Tue Nov 15 2022 Eike Rathke <[email protected]> - 102.5.0-1
- Update to 102.5.0
- Use SPDX license IDs in spec
* Wed Nov 02 2022 Eike Rathke <[email protected]> - 102.4.1-1
- Update to 102.4.1
* Wed Oct 19 2022 Eike Rathke <[email protected]> - 102.4.0-1
- Update to 102.4.0
* Thu Sep 29 2022 Eike Rathke <[email protected]> - 102.3.1-1
- Update to 102.3.1
* Wed Sep 21 2022 Eike Rathke <[email protected]> - 102.3.0-1
- Update to 102.3.0
* Thu Sep 01 2022 Eike Rathke <[email protected]> - 102.2.1-1
- Update to 102.2.1
* Tue Aug 23 2022 Eike Rathke <[email protected]> - 102.2.0-1
- Update to 102.2.0
* Wed Aug 3 2022 Jan Horak <[email protected]> - 102.1.0-1
- Update to 102.1.0
* Thu Jul 28 2022 Eike Rathke <[email protected]> - 91.12.0-1
- Update to 91.12.0
* Sat Jul 23 2022 Fedora Release Engineering <[email protected]> - 91.11.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jul 11 2022 Eike Rathke <[email protected]> - 91.11.0-3
- Fix f37 FTBFS Python 3.11 API incompatibilities
* Tue Jul 05 2022 Tom Stellard <[email protected]> - 91.11.0-2
- Clean up macros that allow building with clang
* Wed Jun 29 2022 Eike Rathke <[email protected]> - 91.11.0-1
- Update to 91.11.0
* Tue May 31 2022 Eike Rathke <[email protected]> - 91.10.0-1
- Update to 91.10.0
* Tue May 24 2022 Eike Rathke <[email protected]> - 91.9.1-1
- Update to 91.9.1
* Wed May 04 2022 Eike Rathke <[email protected]> - 91.9.0-1
- Update to 91.9.0
* Wed Apr 20 2022 Parag Nemade <pnemade AT redhat DOT com> - 91.8.0-2
- Update hunspell dictionary path
F36 Change https://fedoraproject.org/wiki/Changes/Hunspell_dictionary_dir_change
* Mon Apr 11 2022 Eike Rathke <[email protected]> - 91.8.0-1
- Update to 91.8.0
* Tue Mar 15 2022 Eike Rathke <[email protected]> - 91.7.0-1
- Update to 91.7.0
- plus patches to bundled expat against CVE-2022-25235 CVE-2022-25236 CVE-2022-25315
* Mon Mar 7 2022 Jan Horak <[email protected]> - 91.6.2-1
- Update to 91.6.2
* Mon Feb 28 2022 Jan Horak <[email protected]> - 91.6.1-1
- Update to 91.6.1 build1
* Fri Feb 11 2022 Jan Horak <[email protected]> - 91.6.0-2
- Supply stock icon to the appdata file
* Wed Feb 09 2022 Jan Horak <[email protected]> - 91.6.0-1
- Update to 91.6.0 build1
* Wed Feb 09 2022 Jan Horak <[email protected]> - 91.5.0-3
- Put appdata.xml to medainfo location
* Sat Jan 22 2022 Fedora Release Engineering <[email protected]> - 91.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Tue Jan 18 2022 Jan Horak <[email protected]> - 91.5.0-1
- Update to 91.5.0 build1
* Wed Dec 15 2021 Jan Horak <[email protected]> - 91.4.0-1
- Update to 91.4.0 build2
- Enabled wayland backend for all DE (thanks to Timothée Ravier <[email protected]>)
* Tue Nov 09 2021 Jan Horak <[email protected]> - 91.3.0-1
- Update to 91.3.0 build2
* Fri Oct 15 2021 Jan Horak <[email protected]> - 91.2.0-1
- Update to 91.2.0 build1
* Tue Sep 07 2021 Jan Horak <[email protected]> - 91.1.0-1
- Update to 91.1.0 build2
* Thu Aug 26 2021 Jan Horak <[email protected]> - 91.0.3-2
- Update to 91.0.3 build1
* Mon Aug 23 2021 Jan Horak <[email protected]> - 91.0.2-1
- Update to 91.0.2 build1
* Mon Aug 16 2021 Jan Horak <[email protected]> - 91.0-1
- Update to 91.0 build1
* Fri Jul 23 2021 Fedora Release Engineering <[email protected]> - 78.12.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Wed Jul 21 2021 Jan Horak <[email protected]> - 78.12.0-1
- Update to 78.12.0 build2
* Wed Jun 02 2021 Jan Horak <[email protected]> - 78.11.0-1
- Update to 78.11.0 build1
* Sat May 15 2021 Fabio Valentini <[email protected]> - 78.10.1-3
- Split off librnp and make it possible to use a different OpenPGP backend.
* Wed May 05 2021 Jan Horak <[email protected]> - 78.10.1-2
- Fixed source0
* Tue May 04 2021 Jan Horak <[email protected]> - 78.10.1-1
- Update to 78.10.1 build1
* Tue Mar 30 2021 Jonathan Wakely <[email protected]> - 78.8.1-2
- Rebuilt for removed libstdc++ symbol (#1937698)
* Mon Mar 15 2021 Jan Horak <[email protected]> - 78.8.1-1
- Update to 78.8.1 build1
* Thu Feb 18 2021 Jan Horak <[email protected]> - 78.8.0-1
- Update to 78.8.0 build1
* Thu Jan 28 2021 Jan Horak <[email protected]> - 78.7.0-2
- Fixing package requires/provides the same way as provided by kalev for Firefox
* Wed Jan 27 2021 Jan Horak <[email protected]> - 78.7.0-1
- Update to 78.7.0 build2
* Wed Jan 20 2021 Orion Poplawski <[email protected]> - 78.6.1-2
- Own /usr/lib*/thunderbird/gtk2 directory
- Provide /etc/thunderbird/pref (bug #1525709)
- Filter package provides and requires
* Thu Jan 14 2021 Jan Horak <[email protected]> - 78.6.1-1
- Update to 78.6.1 build1
* Tue Dec 15 2020 Jan Horak <[email protected]> - 78.6.0-1
- Update to 78.6.0 build1
* Mon Dec 14 2020 Martin Stransky <[email protected]> - 78.5.0-2
- Added fix for rhbz#1907267 (Thunderbird on Wayland launcher
does not show up as 'running' in the dash)
* Wed Nov 25 2020 Jan Horak <[email protected]> - 78.5.0-1
- Update to 78.5.0 build3
* Thu Nov 12 2020 Jan Horak <[email protected]> - 78.4.3-1
- Update to 78.4.3 build1
* Mon Nov 09 2020 Kalev Lember <[email protected]> - 78.4.0-3
- Add release tag to appdata
* Thu Oct 22 2020 Jan Horak <[email protected]> - 78.4.0-2
- Update to 78.4.0 build1
* Wed Oct 07 2020 Jan Horak <[email protected]> - 78.3.1-2
- Reenable s390x
* Wed Sep 30 2020 Jan Horak <[email protected]> - 78.3.1-1
- Update to 78.3.1 build1
* Tue Sep 08 2020 Jan Horak <[email protected]> - 68.12.0-1
- Update to 68.12.0 build1
* Thu Aug 06 2020 Jan Horak <[email protected]> - 68.11.0-1
- Update to 68.11.0 build1
* Sat Aug 01 2020 Fedora Release Engineering <[email protected]> - 68.10.0-3
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jul 29 2020 Fedora Release Engineering <[email protected]> - 68.10.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jul 09 2020 Jan Horak <[email protected]> - 68.10.0-1
- Update to 68.10.0 build1
* Mon Jun 08 2020 Jan Horak <[email protected]> - 68.9.0-1
- Update to 68.9.0 build1
* Fri May 15 2020 Martin Stransky <[email protected]> - 68.8.0-2
- Use D-Bus remote on Wayland (rhbz#1817330).
* Thu May 14 2020 Jan Horak <[email protected]> - 68.8.0-1
- Update to 68.8.0 build2
* Wed Apr 15 2020 Jan Horak <[email protected]> - 68.7.0-2
- Removed gconf-2.0 build requirement, added perl-interpreter instead to fulfill
perl dependency