Projects
home:Eustace:branches:Eulaceura:Factory
thunderbird
_service:obs_scm:thunderbird.spec
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:thunderbird.spec of Package thunderbird
%ifarch riscv64 #!needsrootforbuild %endif # # spec file for package thunderbird # # Copyright (c) 2022 Yunche Information Technology (Shenzhen) Co., Ltd. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # # Below spec file is refer to fedora thunderbird SRPM # Link: https://src.fedoraproject.org/rpms/thunderbird/tree/f36 %global dictionarydir hunspell %define debug_build 0 %define hardened_build 1 %define system_ffi 1 %define build_langpacks 1 %bcond_with toolchain_clang %global use_bundled_cbindgen 1 # We need to disable elfhack %global disable_elfhack 0 %define freetype_version 2.1.9 %define libnotify_version 0.4 %define _default_patch_fuzz 2 %define system_jpeg 1 %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 %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: 128.2.0 Release: 1 URL: http://www.mozilla.org/projects/thunderbird/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: %{name}-128.2.0esr.source.tar.xz %if %{build_langpacks} Source1: %{name}-langpacks-%{version}esr-20240905.tar.xz %endif Source3: get-calendar-langpacks.sh Source4: cbindgen-vendor.tar.xz Source5: https://ftp.mozilla.org/pub/%{name}/releases/%{version}esr/source/%{name}-%{version}esr.source.tar.xz.asc Source6: https://ftp.mozilla.org/pub/%{name}/releases/%{version}esr/KEY#/mozilla.keyring Source10: thunderbird-mozconfig Source11: thunderbird-mozconfig-branded Source12: thunderbird-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 Patch0: build-aarch64-skia.patch # gcc 12 build fix patches Patch422: 0001-GLIBCXX-fix-for-GCC-12.patch Patch425: build-disable-elfhack.patch # Upstream patches Patch402: mozilla-526293.patch Patch406: mozilla-1170092.patch # Bundled expat backported patches Patch501: expat-CVE-2022-25235.patch Patch502: expat-CVE-2022-25236.patch Patch503: expat-CVE-2022-25315.patch # openEuler specific BuildRequires: make BuildRequires: gcc-c++ 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: pkgconfig(gtk+-2.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 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 # Why rustup provides cargo? This is wrong. - 251 #!BuildIgnore: rustup >= 1.27.1 BuildRequires: rust >= 1.80.0 BuildRequires: cargo >= 1.80.0 BuildRequires: clang-devel %if !0%{?use_bundled_cbindgen} BuildRequires: cbindgen %endif BuildRequires: nodejs BuildRequires: nasm >= 1.13 # require any OpenPGP backend with the librnp interface Requires: thunderbird-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 # download source0 and gpg check wget -qO %{SOURCE0} https://user-repo.openeuler.openatom.cn/lfs-tar/thunderbird/thunderbird-%{version}esr.source.tar.xz gpg --import %{SOURCE6} gpg --verify %{SOURCE5} %{SOURCE0} %setup -q # Build patches %patch -P 0 -p1 -b .build-aarch64-skia %patch -P 402 -p1 -b .526293 %patch -P 406 -p1 -b .1170092-etc-conf %patch -P 422 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %if 0%{?disable_elfhack} %patch -P 425 -p1 -b .build-disable-elfhack %endif %patch -P 501 -p1 -b .expat-CVE-2022-25235 %patch -P 502 -p1 -b .expat-CVE-2022-25236 %patch -P 503 -p1 -b .expat-CVE-2022-25315 %{__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 echo "ac_add_options --without-system-nspr" >> .mozconfig echo "ac_add_options --without-system-nss" >> .mozconfig # 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 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 %if !%{?system_jpeg} echo "ac_add_options --without-system-jpeg" >> .mozconfig %else echo "ac_add_options --with-system-jpeg" >> .mozconfig %endif %if %{enable_mozilla_crashreporter} echo "ac_add_options --enable-crashreporter" >> .mozconfig %else echo "ac_add_options --disable-crashreporter" >> .mozconfig %endif # TODO: add it back? #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 %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 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//') # Thunderbird is not supposed to build with exceptions globally enabled MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | sed -e 's/-fexceptions//') # Workaround for mozbz#1531309 MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-Werror=format-security//') # 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 %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 # 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 x86_64 aarch64 riscv64 [ -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/%{distro}-default-prefs %{__install} -D $RPM_BUILD_ROOT/%{distro}-default-prefs $RPM_BUILD_ROOT/%{mozappdir}/greprefs/all-%{distro}.js %{__install} -D $RPM_BUILD_ROOT/%{distro}-default-prefs $RPM_BUILD_ROOT/%{mozappdir}/defaults/pref/all-%{distro}.js %{__rm} $RPM_BUILD_ROOT/%{distro}-default-prefs %{__rm} -f $RPM_BUILD_ROOT%{_bindir}/thunderbird-config # own mozilla plugin dir %{__mkdir_p} $RPM_BUILD_ROOT%{_libdir}/mozilla/plugins # System config dir %{__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` extensionID=langpack-$language@thunderbird.mozilla.org %{__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 %{mozappdir} %doc %{mozappdir}/LICENSE %{mozappdir}/chrome %dir %{mozappdir}/components %ghost %{mozappdir}/components/compreg.dat %ghost %{mozappdir}/components/xpti.dat %{mozappdir}/omni.ja %{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 %{mozappdir}/dependentlibs.list %{mozappdir}/fonts %{mozappdir}/pingsender %{mozappdir}/glxtest %{mozappdir}/vaapitest #=============================================================================== %changelog * Mon Sep 09 2024 misaka00251 <liuxin@iscas.ac.cn> - 128.2.0-1 - Upgrade to 128.2.0 * Tue Feb 27 2024 misaka00251 <liuxin@iscas.ac.cn> - 115.5.0-1 - Upgrade to 115.5.0 * Fri Aug 5 2022 Chenxi Mao <chenxi.mao@suse.com> - 91.12.0-1 - Update to 91.12.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2