summaryrefslogtreecommitdiff
path: root/libre/iceweasel-libre/PKGBUILD
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-01-12 17:58:25 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-01-12 17:58:25 -0500
commit4a94f843b2402300b15872bc467e511dce86a1af (patch)
treefd89396343d17ce26d42b2ba00fc39cccc509bf2 /libre/iceweasel-libre/PKGBUILD
parent005cec01792d1fc62eb011ea35acad0f6d9cb70e (diff)
downloadabslibre-4a94f843b2402300b15872bc467e511dce86a1af.tar.gz
abslibre-4a94f843b2402300b15872bc467e511dce86a1af.tar.bz2
abslibre-4a94f843b2402300b15872bc467e511dce86a1af.zip
libre/iceweasel-libre: build locales as split packages
Diffstat (limited to 'libre/iceweasel-libre/PKGBUILD')
-rw-r--r--libre/iceweasel-libre/PKGBUILD60
1 files changed, 58 insertions, 2 deletions
diff --git a/libre/iceweasel-libre/PKGBUILD b/libre/iceweasel-libre/PKGBUILD
index baa53d015..d557073d5 100644
--- a/libre/iceweasel-libre/PKGBUILD
+++ b/libre/iceweasel-libre/PKGBUILD
@@ -14,6 +14,8 @@
# Contributor: evr <evanroman at gmail>
# Contributor: Muhammad 'MJ' Jassim <UnbreakableMJ@gmail.com>
+lowercase() { tr A-Z a-z <<<"$*"; }
+
# Version Configuration ##############################################
_pgo=false
@@ -28,7 +30,10 @@ _debrepo=http://ftp.debian.org/debian/pool/main
_locales=(ach af ak ar as ast be bg bn-BD bn-IN br bs ca cs csb cy da de el en-GB en-ZA eo es-AR es-CL es-ES es-MX et eu fa ff fi fr fy-NL ga-IE gd gl gu-IN he hi-IN hr hu hy-AM id is it ja kk km kn ko ku lg lij lt lv mai mk ml mr nb-NO nl nn-NO nso or pa-IN pl pt-BR pt-PT rm ro ru si sk sl son sq sr sv-SE ta-LK ta te th tr uk vi zh-CN zh-TW zu)
pkgbase=iceweasel
-pkgname=iceweasel-libre
+pkgname=(iceweasel-libre)
+for locale in "${_locales[@]}"; do
+ pkgname+=("iceweasel-libre-l10n-$(lowercase ${locale})")
+done
pkgver=${_debver}.${_debrel}
pkgrel=1
@@ -143,6 +148,18 @@ prepare() {
fi
done
+ # Liberate the locales
+ printf '%s\n' l10n-*/*/searchplugins/*.xml \
+ | grep -Ev 'creativecommons|wikipedia|wikipediaro|wiktionary' \
+ | xargs -d '\n' rm -f
+ for dir in l10n-*/*/searchplugins; do
+ pushd "$dir"
+ ls | sed -n 's/\.xml$//p' > list.txt
+ popd
+ done
+ find l10n-* -name 'region.properties' -delete
+
+ # Patch anything that's left
patch -Np1 -i ../libre.patch
# Fix PRE_RELEASE_SUFFIX
@@ -158,6 +175,10 @@ build() {
[[ -f "$srcdir/.makepkg-prepare" ]] || { prepare || return $?; cd "$srcdir"; }
cd "$srcdir"
build_browser
+ for locale in "${_locales[@]}"; do
+ cd "$srcdir"
+ build_locale "${locale}"
+ done
}
build_browser() {
@@ -193,6 +214,26 @@ build_browser() {
return $_fail
}
+build_locale() {
+ locale=$1
+ cd mozilla-release
+
+ export PYTHON="/usr/bin/python2"
+ export PRODUCT='browser'
+
+ # This is an adaptation of the "$(L10N_BUILD_STAMPS)" rule from debian/rules
+ [[ -e l10n ]] || mkdir -p l10n
+ [[ -e l10n/$locale ]] || ln -sf ../l10n-$locale l10n/$locale
+ ${PYTHON} config/pythonpath.py -I$(pwd)/compare-locales/lib \
+ $(pwd)/compare-locales/scripts/compare-locales \
+ -m $(pwd)/moz-objdir/l10n-$locale ${PRODUCT}/locales/l10n.ini $(pwd)/l10n $locale
+ make -C moz-objdir/${PRODUCT}/locales langpack-$locale \
+ L10NBASEDIR=$(pwd)/l10n MOZ_CHROME_FILE_FORMAT=flat \
+ MOZ_LANGPACK_EID=langpack-${locale}@${pkgbase}.mozilla.org \
+ PKG_LANGPACK_BASENAME='$(MOZ_LANGPACK_EID)' PKG_LANGPACK_PATH=xpi/ \
+ LOCALE_MERGEDIR=$(pwd)/moz-objdir/l10n-$locale
+}
+
install-icon() {
local brandingdir=$1 prog=$2 size=$3
local sizedir=${size}x${size} ext=png
@@ -213,7 +254,7 @@ install-icon() {
#return 1
}
-package() {
+package_iceweasel-libre() {
cd mozilla-release
make -j1 -f client.mk DESTDIR="$pkgdir" install
@@ -242,6 +283,21 @@ package() {
ln -sf $pkgbase "$pkgdir/usr/lib/$pkgbase/$pkgbase-bin"
}
+package_locale() {
+ locale=$1
+ cd mozilla-release
+ lang=$(sed -n "/^%define L10N_LANG ${locale}/,+1p" debian/l10n/browser-l10n.control|sed -n 's/%define L10N_LANGUAGE\s\s*//p')
+ pkgdesc="${lang} language package for Iceweasel-libre"
+ depends=("iceweasel-libre=${pkgver}")
+
+ extdir="$pkgdir"/usr/lib/iceweasel/extensions/
+ install -d "${extdir}"
+ install -m644 moz-objdir/dist/xpi/langpack-${locale}@${pkgbase}.mozilla.org.xpi "${extdir}"
+}
+for locale in "${_locales[@]}"; do
+ eval "package_iceweasel-libre-l10n-$(lowercase ${locale})() { package_locale ${locale}; }"
+done
+
md5sums=('263569a577f72314694a711cc6a0d96f'
'6a571d3a3b355c331f67d57702f4fccf'
'366e1e4847d7e00eba77ee5a4be0d3db'