diff --git a/.gitignore b/.gitignore index 0f51c38..4c6e54e 100644 --- a/.gitignore +++ b/.gitignore @@ -213,3 +213,4 @@ thunderbird-langpacks-3.1.2-20100803.tar.bz2 /thunderbird-60.2.1.source.tar.xz /thunderbird-langpacks-60.2.1-20181003.tar.xz /l10n-lightning-60.2.1.tar.xz +/lightning-langpacks-60.2.1.tar.xz diff --git a/get-calendar-langpacks.sh b/get-calendar-langpacks.sh new file mode 100755 index 0000000..d3f5e86 --- /dev/null +++ b/get-calendar-langpacks.sh @@ -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 <> .mozconfig echo "ac_add_options --disable-crashreporter" >> .mozconfig %endif -# install lightning langpacks -cd .. -%{__tar} xf %{SOURCE2} -cd - #=============================================================================== %build @@ -466,17 +462,6 @@ MOZ_SMP_FLAGS=-j1 export MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS" export STRIP=/bin/true ./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 %if %{enable_mozilla_crashreporter} @@ -548,6 +533,12 @@ for langpack in `ls thunderbird-langpacks/*.xpi`; do echo "%%lang($language) %{langpackdir}/${extensionID}.xpi" >> %{name}.lang done %{__rm} -rf thunderbird-langpacks + +# lightning langpacks install +cd %{buildroot}%{langpackdir} +%{__tar} xf %{SOURCE2} +chmod a+r *.xpi +cd - %endif # build_langpacks # Get rid of devel package and its debugsymbols