From 4a94f843b2402300b15872bc467e511dce86a1af Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 12 Jan 2013 17:58:25 -0500 Subject: libre/iceweasel-libre: build locales as split packages --- libre/iceweasel-libre/PKGBUILD | 60 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) (limited to 'libre/iceweasel-libre') 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 # Contributor: Muhammad 'MJ' Jassim +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' -- cgit v1.2.3-54-g00ecf