%define official_branding 1 %define upstream_version %{version} %define release_dir comm-release %if %{official_branding} %define title Mozilla Thunderbird %else %define title Mail/News %endif %define oname thunderbird %define tb_appid \{3550f703-e582-4d05-9a08-453d09bdfdc6\} %define tbdir %{_libdir}/%{oname}-%{version} %define tbextdir %{_libdir}/mozilla/extensions/%{tb_appid} %define xpi 0 %define enigmail_version 1.4.3 %define enigmail_short_version 1.5 %define enigmail_id \{847b3a00-7ab1-11d4-8f02-006008948af5\} %define _provides_exceptions libgtkembedmoz.so\\|libxpcom.so %define _requires_exceptions libgtkembedmoz.so\\|libxpcom.so\\|libxul.so # this seems fragile, so require the exact version or later (#58754) %define sqlite3_version %(pkg-config --modversion sqlite3 &>/dev/null && pkg-config --modversion sqlite3 2>/dev/null || echo 0) # this one as well (#59759) %define nss_libname %mklibname nss 3 %define nss_version %(pkg-config --modversion nss &>/dev/null && pkg-config --modversion nss 2>/dev/null || echo 0) Name: thunderbird Epoch: 0 Version: 14.0 Release: %mkrel 1 Summary: Full-featured email, RSS, and newsgroup client License: MPL Group: Networking/Mail URL: http://www.mozilla.org/en-US/thunderbird/ Source0: ftp://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/%{upstream_version}/source/thunderbird-%{upstream_version}.source.tar.bz2 Source12: mozilla-thunderbird-mageia-default-prefs.js # Mandriva sources (Source300+) Source300: http://www.mozilla-enigmail.org/download/source/enigmail-%{enigmail_version}.tar.gz Source301: http://www.mozilla-enigmail.org/download/source/enigmail-%{enigmail_version}.tar.gz.asc Source302: %{name}-icons.tar.bz2 Source303: thunderbird.desktop # Build patches Patch2: mozilla-firefox-1.0-prdtoa.patch Patch3: thunderbird-14.0-buildfix.patch # Mageia patches (patch100+) # Debian patches (Patch200+) Patch201: mozilla-thunderbird-5.0-mga-default-mailer.patch # Mandriva patches (Patch300+) Patch300: mozilla-thunderbird-0.8-progname.patch Patch301: mozilla-thunderbird-enigmail-package.patch Patch304: mozilla-thunderbird-run-mozilla.patch # OpenSuse patches (Patch400+) Patch400: thunderbird-appname.patch BuildRequires: autoconf2.1 BuildRequires: cairo-devel >= 1.8.8 Requires: %{mklibname sqlite3_ 0} >= %{sqlite3_version} BuildRequires: sqlite3-devel >= 3.7.5 Requires: %{nss_libname} >= 2:%{nss_version} BuildRequires: yasm BuildRequires: mesagl-devel BuildRequires: gtk2-devel BuildRequires: gzip BuildRequires: python-devel BuildRequires: libjpeg-devel #(tpg) older versions doesn't support apng extension BuildRequires: libpng-devel >= 2:1.4 BuildRequires: nspr-devel >= 2:4.8.8 BuildRequires: nss-static-devel >= 2:3.12.10 BuildRequires: unzip BuildRequires: zip BuildRequires: zlib-devel BuildRequires: libIDL-devel BuildRequires: freetype2-devel BuildRequires: pkgconfig(xft) BuildRequires: libxt-devel BuildRequires: hunspell-devel BuildRequires: dbus-glib-devel Requires(post): mktemp Requires(post): rpm-helper Requires(postun): rpm-helper # Integrates thunderbird with xdg-utils. Requires: xdg-utils %if %{official_branding} BuildRequires: imagemagick %endif # Thunderbird 3 requires alsa BuildRequires: libalsa-devel BuildRequires: python BuildRequires: libnotify-devel BuildRequires: startup-notification-devel BuildRequires: libiw-devel BuildRequires: libevent-devel >= 1.4.7 BuildRequires: libvpx-devel >= 0.9.7 Suggests: %{_lib}canberra0 Suggests: %{_lib}cups2 Obsoletes: mozilla-thunderbird < %{epoch}:%{version}-%{release} Provides: mozilla-thunderbird = %{epoch}:%{version}-%{release} %description %{title} is a full-featured email, RSS and newsgroup client that makes emailing safer, faster and easier than ever before. #=============================================================================== #enigmail # Supported l10n language lists %define l10n_langlist ar ca cs de el es fi fr it ja ko nb nl pl pt pt_BR ru sl sv tr vi zh_CN zh_TW # Disabled l10n languages, for any reason # nl sk es_AR do not support 0.95.0 yet %define disabled_l10n_langlist hu # global disabled_l10n_langlist %{nil} # Language descriptions %define language_ar ar %define language_ca ca %define language_cs cs-CZ %define language_de de %define language_el el %define language_es_AR es-AR %define language_es es-ES %define language_fi fi-FI %define language_fr fr %define language_hu hu-HU %define language_it it-IT %define langname_it Italian %define language_ja ja-JP %define language_ko ko-KR %define language_nb nb-NO %define language_nl nl %define language_pl pl %define language_pt pt-PT %define language_pt_BR pt-BR %define language_ro ro-RO %define language_ru ru-RU %define language_sk sk %define language_sl sl-SI %define language_sv sv-SE %define language_tr tr %define language_vi vi %define language_zh_CN zh-CN %define language_zh_TW zh-TW # --- Danger line --- # All langs %{expand:%%global langlist %(for lang in %l10n_langlist; do echo "$lang"; done | sort -u | sed ':a;$!N;s/\n/ /;ta')} # Defaults (all languages enabled by default) # l10n %{expand:%(for lang in %l10n_langlist; do echo "%%define l10n_$lang 1"; done)} %{expand:%(for lang in %disabled_l10n_langlist; do echo "%%define l10n_$lang 0"; done)} # Params %{expand:%(for lang in %langlist; do echo "%%bcond_without $lang"; done)} %package enigmail Summary: Access the authentication and encryption features provided by GnuPG Group: Networking/Mail Requires: %{name} = %{epoch}:%{version} Obsoletes: %{name}-enigmime < %{epoch}:%{version}-%{release} Provides: %{name}-enigmime = %{epoch}:%{version}-%{release} Obsoletes: mozilla-thunderbird-enigmime < %{epoch}:%{version}-%{release} Obsoletes: mozilla-thunderbird-enigmail < %{epoch}:%{version}-%{release} Provides: mozilla-thunderbird-enigmime = %{epoch}:%{version}-%{release} Provides: mozilla-thunderbird-enigmail = %{epoch}:%{version}-%{release} Requires: gnupg Requires(post): %{name} = %{epoch}:%{version} Requires(preun): %{name} = %{epoch}:%{version} Requires(post): mktemp Requires(postun): mktemp Suggests: pinentry-gtk %(for lang in %l10n_langlist %disabled_l10n_langlist; do echo "Obsoletes: thunderbird-enigmail-$lang < 0:10.0.2" echo "Obsoletes: mozilla-thunderbird-enigmail-$lang < %{epoch}:%{version}-%{release}" echo "Obsoletes: mozilla-thunderbird-enigmail-l10n-$lang < %{epoch}:%{version}-%{release}" done) %description enigmail Enigmail is an extension to the mail client of %{title} which allows users to access the authentication and encryption features provided by GnuPG. Main Features * Encrypt/sign mail when sending, decrypt/authenticate received mail * Support for inline-PGP (RFC 2440) and PGP/MIME (RFC 3156) * Per-Account based encryption and signing defaults * Per-Recipient rules for automated key selection, and enabling/disabling encryption and signing * OpenPGP key management interface #=============================================================================== %package -n nsinstall Summary: Netscape portable install command Group: Development/Other %description -n nsinstall Netscape portable install command. #=============================================================================== %prep %setup -q -c -n %{name}-%{version} #=================== # Thunderbird itself %setup -q -T -D -n %{name}-%{version}/%{release_dir} %patch2 -p0 pushd mozilla %patch3 -p0 popd %patch201 -p0 -b .default_mailer %patch300 -p0 -b .progname %patch301 -p1 -b .enigmailpackage %patch304 -p0 -b .run-mozilla %patch400 -p1 -b .appname #=============================================================================== # Enigmail %setup -q -T -D -n %{name}-%{version}/%{release_dir}/mozilla/extensions -a300 %if !%{official_branding} %setup -q -T -D -n %{name}-%{version}/%{release_dir} -a302 %endif %setup -q -T -D -n %{name}-%{version}/%{release_dir} #=============================================================================== %build export BUILD_OFFICIAL=1 export MOZILLA_OFFICIAL=1 CFLAGS=$(echo %optflags | %{__sed} -e 's/-fexceptions//') CFLAGS="$CFLAGS -fno-strict-aliasing -fpermissive" CXXFLAGS="$CFLAGS" RPM_OPT_FLAGS="$CFLAGS" LDFLAGS="%ldflags" export CFLAGS export CXXFLAGS export RPM_OPT_FLAGS export LDFLAGS export MOZCONFIG=`pwd`/.mozconfig cat > $MOZCONFIG << EOF mk_add_options MOZILLA_OFFICIAL=1 mk_add_options BUILD_OFFICIAL=1 mk_add_options MOZ_MAKE_FLAGS="%{_smp_mflags}" mk_add_options MOZ_OBJDIR=@TOPSRCDIR@ ac_add_options --prefix="%{_prefix}" ac_add_options --libdir="%{_libdir}" ac_add_options --sysconfdir="%{_sysconfdir}" ac_add_options --mandir="%{_mandir}" ac_add_options --includedir="%{_includedir}" ac_add_options --datadir="%{_datadir}" ac_add_options --enable-application=mail ac_add_options --with-system-nspr ac_add_options --with-system-nss ac_add_options --with-system-jpeg ac_add_options --with-system-zlib ac_add_options --with-system-png ac_add_options --with-system-bz2 ac_add_options --enable-system-sqlite ac_add_options --enable-system-hunspell ac_add_options --enable-system-cairo ac_add_options --with-pthreads ac_add_options --disable-tests ac_add_options --disable-debug ac_add_options --disable-installer ac_add_options --disable-updater ac_add_options --enable-xinerama ac_add_options --disable-crashreporter ac_add_options --enable-default-toolkit=cairo-gtk2 ac_add_options --disable-xprint ac_add_options --disable-strip ac_add_options --enable-pango ac_add_options --enable-startup-notification ac_add_options --enable-svg ac_add_options --enable-canvas ac_add_options --enable-crypto ac_add_options --enable-mathml ac_add_options --disable-gnomevfs ac_add_options --enable-gio ac_add_options --enable-optimize ac_add_options --with-system-libevent ac_add_options --with-system-libvpx ac_add_options --enable-official-branding ac_add_options --with-distribution-id=org.mageia EOF %make -f client.mk build #=============================================================================== pushd mozilla/extensions/enigmail for i in `find . -type f -name Makefile.in`; do if [ -f $i.bak ]; then cp $i.bak $i else %{__cp} $i $i.bak fi # %{__perl} -pi -e 's|^(DEPTH.*= )../|\1|;' $i done ./makemake -r %{make} LOCAL_INCLUDES+="-I\$(DEPTH)/mailnews/mime/src -I../build -I../src -I../ipc/src" (cd lang %{__perl} -pi -e 's|es-AR/enigmail.properties|es-ES/enigmail.properties|' jar.mn echo 'zh-TW' >> current-languages.txt %{make} LOCAL_INCLUDES+="-I\$(DEPTH)/mailnews/mime/src -I../build -I../src -I../ipc/src" for i in `cat current-languages.txt`; do ./make-lang.sh $i %{enigmail_short_version} done ) %{make} xpi popd #=============================================================================== %install %{__rm} -rf %{buildroot} %{__mkdir_p} %{buildroot}{%{_libdir},%{_bindir},%{_datadir}/applications} %{__mkdir_p} %buildroot%tbdir rm -f extensions/spellcheck/locales/en-US/hunspell/en-US.{dic,aff} # workaround to use system nss shlibsign instead currently missing bundled one # https://bugzilla.mozilla.org/show_bug.cgi?id=736327 ln -s %{_bindir}/shlibsign %{_builddir}/%{name}-%{version}/%{release_dir}/mozilla/dist/bin/shlibsign %makeinstall_std rm -rf %buildroot%tbdir/dictionaries ln -s %{_datadir}/hunspell %buildroot%tbdir/dictionaries %if %{official_branding} %{__install} -p -D %{buildroot}/%{tbdir}/chrome/icons/default/default256.png %{buildroot}%{_datadir}/pixmaps/%{name}.png %else %{__install} -p -D %{SOURCE302} %{buildroot}%{_datadir}/pixmaps/%{name}.png %endif %{__install} -p -D %{SOURCE303} %{buildroot}/%{_datadir}/applications/%{name}.desktop %{__perl} -pi -e 's|^moz_libdir=.*|moz_libdir=%{tbdir}|' %{buildroot}%{_bindir}/thunderbird %{__perl} -pi -e 's|^MRE_HOME=.*|MRE_HOME=%{tbdir}|' %{buildroot}%{_bindir}/thunderbird #used for matching system locale on startup %{__cat} %{SOURCE12} | %{__perl} -p -e 's,THUNDERBIRD_RPM_VR,%{version}-%{release},g;' \ -e 's,THUNDERBIRD_VENDOR_COMMENT,%{product_release},g;' \ > %{buildroot}%{tbdir}/defaults/pref/all-mageia.js #=============================================================================== # icons %{__mkdir_p} %{buildroot}{%{_liconsdir},%{_iconsdir},%{_miconsdir}} %if %{official_branding} %{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/{16x16,22x22,24x24,32x32,48x48,256x256}/apps %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default48.png %{buildroot}%{_liconsdir}/%{name}.png %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default32.png %{buildroot}%{_iconsdir}/%{name}.png %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default16.png %{buildroot}%{_miconsdir}/%{name}.png %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/%{name}.png %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default22.png %{buildroot}%{_datadir}/icons/hicolor/22x22/apps/%{name}.png %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default24.png %{buildroot}%{_datadir}/icons/hicolor/24x24/apps/%{name}.png %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png %{__install} -m 644 %{buildroot}/%{tbdir}/chrome/icons/default/default256.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/%{name}.png %else #%{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/{64x64,128x128}/apps %{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/{16x16,22x22,24x24,32x32,48x48,256x256}/apps %{__install} -m 644 %{name}-48.png %{buildroot}%{_liconsdir}/%{name}.png %{__install} -m 644 %{name}-32.png %{buildroot}%{_iconsdir}/%{name}.png %{__install} -m 644 %{name}-16.png %{buildroot}%{_miconsdir}/%{name}.png # Converting up, but not a big issue now that we have official branding %{__install} -m 644 %{name}-16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/%{name}.png %{__install} -m 644 %{name}-22.png %{buildroot}%{_datadir}/icons/hicolor/22x22/apps/%{name}.png %{__install} -m 644 %{name}-24.png %{buildroot}%{_datadir}/icons/hicolor/24x24/apps/%{name}.png %{__install} -m 644 %{name}-32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png %{__install} -m 644 %{name}-48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png %{__install} -m 644 %{name}-256.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/%{name}.png %endif #=============================================================================== %{__mkdir_p} %{buildroot}%{tbextdir}/%{enigmail_id} %if !%{xpi} %{_bindir}/unzip -q mozilla/dist/bin/enigmail-%{enigmail_short_version}*.xpi -d %{buildroot}%{tbextdir}/%{enigmail_id} %{__chmod} 644 %{buildroot}%{tbextdir}/%{enigmail_id}/chrome.manifest # as we rename libipc.so & libenigmime.so and don't install them into %%{tbdir} # we need to remove them from %%{tbdir}/components/binary.manifest # otherwise thunderbird will try to load them, which will fail sed -i 's,binary-component libipc.so,,' %{buildroot}%{tbdir}/components/binary.manifest sed -i 's,binary-component libenigmime.so,,' %{buildroot}%{tbdir}/components/binary.manifest %else %{__cp} -aL mozilla/dist/bin/enigmail-%{enigmail_short_version}*.xpi %{buildroot}%{tbextdir}/%{enigmail_id}/%{enigmail_id}.xpi %endif #============================================================================== #enigmail lang package # Convert rpm macros to bash variables %{expand:%(for lang in %langlist; do echo "language_$lang=%%{language_$lang}"; done)} %{expand:%(for lang in %langlist; do echo "with_$lang=%%{with $lang}"; done)} %{expand:%(for lang in %l10n_langlist; do echo "l10n_$lang=%%{l10n_$lang}"; done)} pushd mozilla/extensions/enigmail/lang for lang in %langlist; do %{__mkdir_p} %{buildroot}%{_datadir}/mozilla/extensions/%{tb_appid}/enigmail-$lang@enigmail.mozdev.org language="language_$lang" language=${!language} %{_bindir}/unzip -q enigmail-${language}-%{enigmail_short_version}.xpi -d %{buildroot}%{_datadir}/mozilla/extensions/%{tb_appid}/enigmail-$lang@enigmail.mozdev.org/ done popd #=============================================================================== %{__cp} -aL mozilla/dist/bin/nsinstall %{buildroot}%{_bindir} #=============================================================================== #exclude devel files %{__rm} -rf %{buildroot}%{_datadir}/idl/%{oname}-%{version} %{__rm} -rf %{buildroot}%{_includedir}/%{oname}-%{version} %{__rm} -rf %{buildroot}%{_libdir}/%{oname}-devel-%{version} %clean %{__rm} -rf %{buildroot} #=============================================================================== %pre if [ $1 == 2 ]; then if [ -d %{tbdir}/dictionaries ]; then # Otherelse rpm can't switch this into a symlink :( rm -rf %{tbdir}/dictionaries fi fi %post mktemp="/bin/mktemp -d -q -p /tmp -t %{name}.XXXXXXXXXX" TMPDIR= TB_TMPDIR=`$mktemp` && { HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -register test -d "$TB_TMPDIR" && %{__rm} -rf -- "$TB_TMPDIR" } #=============================================================================== %post enigmail if [ -f %{tbdir}/components/compreg.dat ]; then %{__rm} -f %{tbdir}/components/compreg.dat fi if [ -f %{tbdir}/components/xpti.dat ]; then %{__rm} -f %{tbdir}/components/xpti.dat fi mktemp="/bin/mktemp -d -q -p /tmp -t %{name}.XXXXXXXXXX" TMPDIR= TB_TMPDIR=`$mktemp` && { %if %{xpi} HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -install-global-extension %{tbextdir}/enigmail-%{enigmail_version}-linux-*.xpi %endif HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -register test -d "$TB_TMPDIR" && %{__rm} -rf -- "$TB_TMPDIR" } %preun enigmail if [ -f %{tbdir}/components/compreg.dat ]; then %{__rm} -f %{tbdir}/components/compreg.dat fi if [ -f %{tbdir}/components/xpti.dat ]; then %{__rm} -f %{tbdir}/components/xpti.dat fi if [ -x %{tbdir}/thunderbird-bin ]; then mktemp="/bin/mktemp -d -q -p /tmp -t %{name}.XXXXXXXXXX" TMPDIR= TB_TMPDIR=`$mktemp` && { %if %{xpi} HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -install-global-extension %{tbextdir}/enigmail-%{enigmail_version}-linux-*.xpi %endif HOME="$TB_TMPDIR" LD_LIBRARY_PATH="%{tbdir}" %{tbdir}/thunderbird-bin -nox -register test -d "$TB_TMPDIR" && %{__rm} -rf -- "$TB_TMPDIR" } fi #=============================================================================== %files %defattr(-,root,root,-) %doc mozilla/LEGAL %attr(755,root,root) %{_bindir}/thunderbird %attr(644,root,root) %{_datadir}/applications/*.desktop %attr(644,root,root) %{_datadir}/pixmaps/%{name}.png %{tbdir} %if %{xpi} %dir %{tbextdir} %endif # Mandriva menu %{_miconsdir}/%{name}.png %{_iconsdir}/%{name}.png %{_liconsdir}/%{name}.png # other icons %if %{official_branding} %{_datadir}/icons/hicolor/16x16/apps/%{name}.png %{_datadir}/icons/hicolor/22x22/apps/%{name}.png %{_datadir}/icons/hicolor/24x24/apps/%{name}.png %{_datadir}/icons/hicolor/32x32/apps/%{name}.png %{_datadir}/icons/hicolor/48x48/apps/%{name}.png %{_datadir}/icons/hicolor/256x256/apps/%{name}.png %else %{_datadir}/icons/hicolor/16x16/apps/%{name}.png %{_datadir}/icons/hicolor/22x22/apps/%{name}.png %{_datadir}/icons/hicolor/24x24/apps/%{name}.png %{_datadir}/icons/hicolor/32x32/apps/%{name}.png %{_datadir}/icons/hicolor/48x48/apps/%{name}.png %{_datadir}/icons/hicolor/256x256/apps/%{name}.png %endif %exclude %{tbextdir}/%{enigmail_id} %files enigmail %defattr(-,root,root) %{tbextdir}/%{enigmail_id} %(for lang in %langlist; do echo "%%lang($lang) %{_datadir}/mozilla/extensions/%{tb_appid}/enigmail-$lang@enigmail.mozdev.org" done) %files -n nsinstall %defattr(-,root,root) %{_bindir}/nsinstall