Fixed calendar langpacks

This commit is contained in:
Jan Horak 2018-10-30 16:21:52 +01:00
parent 78bde015a4
commit 2ac34672c3
6 changed files with 137 additions and 71 deletions

1
.gitignore vendored
View File

@ -213,3 +213,4 @@ thunderbird-langpacks-3.1.2-20100803.tar.bz2
/thunderbird-60.2.1.source.tar.xz /thunderbird-60.2.1.source.tar.xz
/thunderbird-langpacks-60.2.1-20181003.tar.xz /thunderbird-langpacks-60.2.1-20181003.tar.xz
/l10n-lightning-60.2.1.tar.xz /l10n-lightning-60.2.1.tar.xz
/lightning-langpacks-60.2.1.tar.xz

126
get-calendar-langpacks.sh Executable file
View File

@ -0,0 +1,126 @@
#!/bin/bash
#set -x
set -e
usage()
{
cat << EOF
usage: $0 options
This script downloads calendar langpacks for Thunderbird.
OPTIONS:
-h Show this message
-v Version string (7.0.1)
-b Build number (1, 2, 3)
-r Reuse downloaded files (when you don't want to redownload)
EOF
}
VER=
BUILDNUM=
LANG_DATE=`date "+%Y%m%d"`
while getopts “hv:b:r” OPTION
do
case $OPTION in
h)
usage
exit 1
;;
v)
VER=$OPTARG
;;
b)
BUILDNUM=$OPTARG
;;
?)
usage
exit
;;
esac
done
if [ -z "$VER" -o -z "$BUILDNUM" ]
then
echo "Missing version or build number."
usage
exit 1
fi
WHITE='\033[1;33m'
NC='\033[0m' # No Color
LOCALES=`curl -f https://archive.mozilla.org/pub/thunderbird/candidates/$VER-candidates/build$BUILDNUM/linux-i686/ | grep "a href"|sed -e "s|.*/\([^/]*\)/\".*|\1|"|tail -n+2 |grep -v xpi`
#echo $LOCALES
rm -rf lightning-langpacks
mkdir -p lightning-langpacks
cd lightning-langpacks
LOCALE_COUNT=`echo $LOCALES| tr ' ' '\n' | wc -l`
LOCALE_NUM=0
for lang in $LOCALES; do
LOCALE_NUM=$((LOCALE_NUM+1))
echo -e "${WHITE}Processing calendar locale: $lang ($LOCALE_NUM/$LOCALE_COUNT)${NC}"
mkdir -p extracted_lightning
mkdir -p calendar-locales
#echo Downloading TB binary for locale: $lang
wget --quiet https://archive.mozilla.org/pub/thunderbird/candidates/$VER-candidates/build$BUILDNUM/linux-i686/$lang/thunderbird-$VER.tar.bz2
cd extracted_lightning
tar -xf ../thunderbird-$VER.tar.bz2 thunderbird/distribution/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}.xpi
set +e
unzip -qq thunderbird/distribution/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}.xpi
set -e
LIGHTNING_VERSION=`cat app.ini |grep "^Version="|sed -e 's/Version=//'`
BUILD_ID=`cat app.ini |grep "^BuildID="|sed -e 's/BuildID=//'`
MAX_VERSION=`cat app.ini |grep MaxVersion|sed -e s/MaxVersion=//`
MIN_VERSION=`cat app.ini |grep MinVersion|sed -e s/MinVersion=//`
rm -rf thunderbird
mkdir -p ../calendar-locales/chrome
cp -r chrome/calendar-$lang ../calendar-locales/chrome
cp -r chrome/lightning-$lang ../calendar-locales/chrome
cd -
cd calendar-locales
# create manifest
cat > manifest.json <<EOL
{
"languages": {
"$lang": {
"chrome_resources": {
"calendar": "chrome/calendar-$lang/locale/$lang/calendar/",
"lightning": "chrome/lightning-$lang/locale/$lang/lightning/"
},
"version": "$LIGHTNING_VERSION"
}
},
"applications": {
"gecko": {
"strict_min_version": "$MIN_VERSION",
"id": "langpack-cal-$lang@lightning.mozilla.org",
"strict_max_version": "$MAX_VERSION"
}
},
"langpack_id": "$lang",
"version": "$LIGHTNING_VERSION$BUILD_ID",
"name": "$lang Language Pack Calendar",
"manifest_version": 2,
"sources": {
"browser": {
"base_path": "browser/"
}
},
"author": "Mozilla.cz (contributors: Pavel Cvrček, Pavel Franc, Michal Stanke, Michal Vašíček)",
"description": "Language pack for Thunderbird for $lang, this was repacked by Fedora/RHEL package maintainer from original binaries."
}
EOL
zip --quiet -r ../langpack-cal-$lang@lightning.mozilla.org.xpi *
cd -
rm -rf calendar-locales
rm -rf extracted_lightning
rm -f thunderbird-$VER.tar.bz2
done
echo "Creating lightning-langpacks-$VER.tar.xz..."
tar cJf ../lightning-langpacks-$VER.tar.xz *.xpi
cd ..
rm -rf lightning-langpacks

View File

@ -1,52 +0,0 @@
#!/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`
set -x
#tbver=`awk '/^Version:/ { print $2; exit }' thunderbird.spec`
tbver=`rpmspec -P thunderbird.spec |awk '/^Version:/ { print $2; exit }'`
#tag=CALENDAR_${lver//./_}_RELEASE
tag=THUNDERBIRD_${tbver//./_}_RELEASE
branch=`rpmspec -P thunderbird.spec | awk '/^%define *tarballdir/ { print $3; exit }'`
#locales=$PWD/thunderbird-${tbver}/${branch}/calendar/locales/shipped-locales
#locales=$PWD/thunderbird-${tbver}/calendar/locales/shipped-locales
locales=$PWD/thunderbird-${tbver}/comm/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
#hg update
popd
else
hg clone -u $tag http://hg.mozilla.org/releases/l10n/mozilla-release/$lang
#hg clone http://hg.mozilla.org/l10n-central/$lang
fi
done
cd ..
# Need to merge by compare-locale tool
# More info here: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/compare-locales
# how to get compare-locales: sudo easy_install -U compare-locales
# Make copy to merge with
rm -rf l10n-merged
cp -R l10n l10n-merged
for lang in $(<$locales)
do
compare-locales --merge l10n-merged/$lang $PWD/thunderbird-${tbver}/comm/calendar/locales/l10n.ini l10n $lang
done
# Tar up, minus the mercurial files
rm -f l10n-${lver}.tar.xz
tar caf l10n-lightning-${tbver}.tar.xz --exclude='.hg*' l10n-merged

View File

@ -1,3 +1,4 @@
SHA512 (thunderbird-60.2.1.source.tar.xz) = d74da3c90658c5baf09c22760cad31594524c09f2cd5aba81c5b15bb6db64d78f613562cb015d8a725b4902caa4a57a2d1dafce28284533747faed00f8268a02 SHA512 (thunderbird-60.2.1.source.tar.xz) = d74da3c90658c5baf09c22760cad31594524c09f2cd5aba81c5b15bb6db64d78f613562cb015d8a725b4902caa4a57a2d1dafce28284533747faed00f8268a02
SHA512 (thunderbird-langpacks-60.2.1-20181003.tar.xz) = c8ac34e9d8f8bd996b9a17f59dc4266f3c5b9c283f6d1fdc693ed3d64dc8fc43992304b07b7941c026c350351da85700ef99c6b2550c3530582db4b262c2a563 SHA512 (thunderbird-langpacks-60.2.1-20181003.tar.xz) = c8ac34e9d8f8bd996b9a17f59dc4266f3c5b9c283f6d1fdc693ed3d64dc8fc43992304b07b7941c026c350351da85700ef99c6b2550c3530582db4b262c2a563
SHA512 (l10n-lightning-60.2.1.tar.xz) = 1c686cf889908792d979fd2a2811da8e82f2eef4ff27b1430c2842aaa2c50996b52c52fe5b2504ff419fc0b3e9791f453be14a02640f633210eef7c39e83c4ab SHA512 (l10n-lightning-60.2.1.tar.xz) = 1c686cf889908792d979fd2a2811da8e82f2eef4ff27b1430c2842aaa2c50996b52c52fe5b2504ff419fc0b3e9791f453be14a02640f633210eef7c39e83c4ab
SHA512 (lightning-langpacks-60.2.1.tar.xz) = 9b9edaba374d7fae103b42b2ca2add51807846ae93c57221407cd72818c78f5adeb70deef2a6bb3de54eccc99eba10e2a0f793e5c6e923328e5efc8a8497dedb

View File

@ -21,7 +21,6 @@ ac_add_options --with-system-icu
# lightning related # lightning related
ac_add_options --enable-calendar ac_add_options --enable-calendar
ac_add_options --with-l10n-base=../../l10n-merged
export BUILD_OFFICIAL=1 export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1 export MOZILLA_OFFICIAL=1

View File

@ -96,10 +96,10 @@ Group: Applications/Internet
Source0: ftp://ftp.mozilla.org/pub/thunderbird/releases/%{version}%{?pre_version}/source/thunderbird-%{version}%{?pre_version}.source.tar.xz Source0: ftp://ftp.mozilla.org/pub/thunderbird/releases/%{version}%{?pre_version}/source/thunderbird-%{version}%{?pre_version}.source.tar.xz
%if %{build_langpacks} %if %{build_langpacks}
Source1: thunderbird-langpacks-%{version}-20181003.tar.xz Source1: thunderbird-langpacks-%{version}-20181003.tar.xz
%endif
# Locales for lightning # Locales for lightning
Source2: l10n-lightning-%{version}.tar.xz Source2: lightning-langpacks-%{version}.tar.xz
Source3: mklangsource.sh %endif
Source3: get-calendar-langpacks.sh
Source10: thunderbird-mozconfig Source10: thunderbird-mozconfig
Source11: thunderbird-mozconfig-branded Source11: thunderbird-mozconfig-branded
@ -385,10 +385,6 @@ echo "ac_add_options --enable-crashreporter" >> .mozconfig
echo "ac_add_options --disable-crashreporter" >> .mozconfig echo "ac_add_options --disable-crashreporter" >> .mozconfig
%endif %endif
# install lightning langpacks
cd ..
%{__tar} xf %{SOURCE2}
cd -
#=============================================================================== #===============================================================================
%build %build
@ -466,17 +462,6 @@ MOZ_SMP_FLAGS=-j1
export MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS" export MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS"
export STRIP=/bin/true export STRIP=/bin/true
./mach build ./mach build
#make -f client.mk build STRIP="/bin/true" MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS"
# Package l10n files
cd %{objdir}/comm/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}
@ -548,6 +533,12 @@ for langpack in `ls thunderbird-langpacks/*.xpi`; do
echo "%%lang($language) %{langpackdir}/${extensionID}.xpi" >> %{name}.lang echo "%%lang($language) %{langpackdir}/${extensionID}.xpi" >> %{name}.lang
done done
%{__rm} -rf thunderbird-langpacks %{__rm} -rf thunderbird-langpacks
# lightning langpacks install
cd %{buildroot}%{langpackdir}
%{__tar} xf %{SOURCE2}
chmod a+r *.xpi
cd -
%endif # build_langpacks %endif # build_langpacks
# Get rid of devel package and its debugsymbols # Get rid of devel package and its debugsymbols