Support for gdata package and adding lightning langpack support

This commit is contained in:
Jan Horak 2015-07-09 14:42:25 +02:00
parent 22ebc347ff
commit 30e8c99df9
4 changed files with 89 additions and 10 deletions

34
mklangsource.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
# This checks out and builds the language sources. The lightning source needs
# to already be unpacked
#lver=`awk '/^%global *lightning_ver/ { print $3; exit }' thunderbird.spec`
tbver=`awk '/^Version:/ { print $2; exit }' thunderbird.spec`
#tag=CALENDAR_${lver//./_}_RELEASE
tag=THUNDERBIRD_${tbver//./_}_RELEASE
branch=`awk '/^%define *tarballdir/ { print $3; exit }' thunderbird.spec`
locales=$PWD/thunderbird-${tbver}/${branch}/calendar/locales/shipped-locales
#locales=$PWD/shipped-locales
if [ ! -f $locales ]
then
echo "ERROR: missing $locales, try fedpkg prep first"
exit 1
fi
[ ! -d l10n ] && mkdir l10n
cd l10n
for lang in $(<$locales)
do
if [ -d $lang ]
then
pushd $lang
hg pull
hg update $tag
popd
else
hg clone -u $tag http://hg.mozilla.org/releases/l10n/mozilla-release/$lang
fi
done
# Tar up, minus the mercurial files
cd ..
rm -f l10n-${lver}.tar.xz
tar caf l10n-lightning-${tbver}.tar.xz --exclude='.hg*' l10n

View File

@ -29,7 +29,10 @@ ac_add_options --enable-startup-notification
ac_add_options --enable-gio ac_add_options --enable-gio
ac_add_options --disable-gnomevfs ac_add_options --disable-gnomevfs
ac_add_options --disable-gstreamer ac_add_options --disable-gstreamer
# lightning related
ac_add_options --enable-calendar ac_add_options --enable-calendar
ac_add_options --with-l10n-base=../../l10n
export BUILD_OFFICIAL=1 export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1 export MOZILLA_OFFICIAL=1

View File

@ -77,12 +77,9 @@ FEDORA_LANGPACK_CONFIG="$MOZ_EXTENSIONS_PROFILE_DIR/.fedora-langpack-install"
# MOZ_DISABLE_LANGPACKS disables language packs completelly # MOZ_DISABLE_LANGPACKS disables language packs completelly
MOZILLA_DOWN=0 MOZILLA_DOWN=0
if ! [ $MOZ_DISABLE_LANGPACKS ] || [ $MOZ_DISABLE_LANGPACKS -eq 0 ]; then if ! [ $MOZ_DISABLE_LANGPACKS ] || [ $MOZ_DISABLE_LANGPACKS -eq 0 ]; then
if [ -x $MOZ_DIST_BIN/mozilla-xremote-client ]; then pidof thunderbird > /dev/null 2>&1
# Is thunderbird running?
$MOZ_DIST_BIN/mozilla-xremote-client -a thunderbird 'ping()' > /dev/null 2>&1
MOZILLA_DOWN=$? MOZILLA_DOWN=$?
fi fi
fi
# Modify language pack configuration only when thunderbird is not running # Modify language pack configuration only when thunderbird is not running
# and language packs are not disabled # and language packs are not disabled

View File

@ -36,6 +36,9 @@
%define _default_patch_fuzz 2 %define _default_patch_fuzz 2
%define thunderbird_app_id \{3550f703-e582-4d05-9a08-453d09bdfdc6\} %define thunderbird_app_id \{3550f703-e582-4d05-9a08-453d09bdfdc6\}
# Bump one with each minor lightning release
%define gdata_version 1.9
%global gdata_extname %{_libdir}/mozilla/extensions/{3550f703-e582-4d05-9a08-453d09bdfdc6}/{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}
# The tarball is pretty inconsistent with directory structure. # The tarball is pretty inconsistent with directory structure.
# Sometimes there is a top level directory. That goes here. # Sometimes there is a top level directory. That goes here.
@ -66,6 +69,10 @@ Source0: ftp://ftp.mozilla.org/pub/thunderbird/releases/%{version}%{?pre_
%if %{build_langpacks} %if %{build_langpacks}
Source1: thunderbird-langpacks-%{version}-20150609.tar.xz Source1: thunderbird-langpacks-%{version}-20150609.tar.xz
%endif %endif
# Locales for lightning
Source2: l10n-lightning-%{version}.tar.xz
Source3: mklangsource.sh
Source10: thunderbird-mozconfig Source10: thunderbird-mozconfig
Source11: thunderbird-mozconfig-branded Source11: thunderbird-mozconfig-branded
Source12: thunderbird-redhat-default-prefs.js Source12: thunderbird-redhat-default-prefs.js
@ -140,7 +147,7 @@ Requires: libvpx >= %{libvpx_version}
BuildRequires: pulseaudio-libs-devel BuildRequires: pulseaudio-libs-devel
BuildRequires: libicu-devel BuildRequires: libicu-devel
Requires: mozilla-filesystem Requires: mozilla-filesystem
Obsoletes: thunderbird-lightning thunderbird-lightning-gdata Obsoletes: thunderbird-lightning
%if 0%{?epel} %if 0%{?epel}
ExcludeArch: ppc64 ExcludeArch: ppc64
%endif %endif
@ -167,6 +174,20 @@ debug %{name}, you want to install %{name}-debuginfo instead.
%defattr(-,root,root) %defattr(-,root,root)
%endif %endif
%global tb_version %{version}
%package lightning-gdata
Summary: Lightning data provider for Google Calendar
Version: %{gdata_version}
Requires: %{name}%{?_isa} = %{tb_version}-%{release}
%description lightning-gdata
This extension allows Lightning to read and write events to a Google Calendar.
Please read http://wiki.mozilla.org/Calendar:GDATA_Provider for more details
and before filing a bug. Also, be sure to visit the dicussion forums, maybe
your bug already has a solution!
%prep %prep
%setup -q -c %setup -q -c
@ -262,6 +283,10 @@ echo "ac_add_options --disable-ion" >> .mozconfig
echo "ac_add_options --disable-yarr-jit" >> .mozconfig echo "ac_add_options --disable-yarr-jit" >> .mozconfig
%endif %endif
# install lightning langpacks
cd ..
%{__tar} xf %{SOURCE2}
cd -
#=============================================================================== #===============================================================================
%build %build
@ -322,6 +347,16 @@ MOZ_SMP_FLAGS=-j1
make -f client.mk build STRIP="/bin/true" MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS" make -f client.mk build STRIP="/bin/true" MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS"
# Package l10n files
cd %{objdir}/calendar/lightning
grep -v 'osx' ../../../calendar/locales/shipped-locales | while read lang x
do
make AB_CD=en-US L10N_XPI_NAME=lightning libs-$lang
done
# install l10n files
make tools
cd -
# create debuginfo for crash-stats.mozilla.com # create debuginfo for crash-stats.mozilla.com
%if %{enable_mozilla_crashreporter} %if %{enable_mozilla_crashreporter}
make -C %{objdir} buildsymbols make -C %{objdir} buildsymbols
@ -355,7 +390,7 @@ rm -f $RPM_BUILD_ROOT/%{_bindir}/thunderbird
%{__chmod} 755 $RPM_BUILD_ROOT/%{_bindir}/thunderbird %{__chmod} 755 $RPM_BUILD_ROOT/%{_bindir}/thunderbird
# set up our default preferences # set up our default preferences
%{__cat} %{SOURCE12} | %{__sed} -e 's,THUNDERBIRD_RPM_VR,%{version}-%{release},g' > \ %{__cat} %{SOURCE12} | %{__sed} -e 's,THUNDERBIRD_RPM_VR,%{tb_version}-%{release},g' > \
$RPM_BUILD_ROOT/rh-default-prefs $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}/greprefs/all-redhat.js
%{__install} -D $RPM_BUILD_ROOT/rh-default-prefs $RPM_BUILD_ROOT/%{mozappdir}/defaults/pref/all-redhat.js %{__install} -D $RPM_BUILD_ROOT/rh-default-prefs $RPM_BUILD_ROOT/%{mozappdir}/defaults/pref/all-redhat.js
@ -388,7 +423,7 @@ done
%endif # build_langpacks %endif # build_langpacks
# Get rid of devel package and its debugsymbols # Get rid of devel package and its debugsymbols
%{__rm} -rf $RPM_BUILD_ROOT%{_libdir}/%{name}-devel-%{version} %{__rm} -rf $RPM_BUILD_ROOT%{_libdir}/%{name}-devel-%{tb_version}
# Copy over the LICENSE # Copy over the LICENSE
cd mozilla cd mozilla
@ -457,6 +492,12 @@ SentUpstream: 2014-09-22
</application> </application>
EOF EOF
# lightning-gdata
mkdir -p $RPM_BUILD_ROOT%{gdata_extname}
touch $RPM_BUILD_ROOT%{gdata_extname}/chrome.manifest
unzip -qod $RPM_BUILD_ROOT%{gdata_extname} %{objdir}/dist/xpi-stage/gdata-provider-%{gdata_version}.en-US.linux-*.xpi
#=============================================================================== #===============================================================================
%post %post
@ -473,6 +514,10 @@ fi
%posttrans %posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
# lightning-gdata files=========================================================
%files lightning-gdata
%doc %{tarballdir}/mozilla/LEGAL %{tarballdir}/mozilla/LICENSE %{tarballdir}/mozilla/README.txt
%{gdata_extname}
#=============================================================================== #===============================================================================
%files -f %{tarballdir}/%{name}.lang %files -f %{tarballdir}/%{name}.lang
%defattr(-,root,root,-) %defattr(-,root,root,-)
@ -521,8 +566,8 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%if !%{?system_nss} %if !%{?system_nss}
%{mozappdir}/*.chk %{mozappdir}/*.chk
%endif %endif
%exclude %{_datadir}/idl/%{name}-%{version} %exclude %{_datadir}/idl/%{name}-%{tb_version}
%exclude %{_includedir}/%{name}-%{version} %exclude %{_includedir}/%{name}-%{tb_version}
%{mozappdir}/chrome.manifest %{mozappdir}/chrome.manifest
%{mozappdir}/searchplugins %{mozappdir}/searchplugins
%{mozappdir}/dependentlibs.list %{mozappdir}/dependentlibs.list