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-i18n/.gitignore | 3 - libre/iceweasel-i18n/Makefile | 59 ---------------- libre/iceweasel-i18n/PKGBUILD | 146 --------------------------------------- libre/iceweasel-i18n/PKGBUILD.in | 63 ----------------- libre/iceweasel-libre/PKGBUILD | 60 +++++++++++++++- 5 files changed, 58 insertions(+), 273 deletions(-) delete mode 100644 libre/iceweasel-i18n/.gitignore delete mode 100644 libre/iceweasel-i18n/Makefile delete mode 100644 libre/iceweasel-i18n/PKGBUILD delete mode 100644 libre/iceweasel-i18n/PKGBUILD.in (limited to 'libre') diff --git a/libre/iceweasel-i18n/.gitignore b/libre/iceweasel-i18n/.gitignore deleted file mode 100644 index 3e1eb57b5..000000000 --- a/libre/iceweasel-i18n/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -PKGBUILD.list -langpacks.txt -*.diff.gz diff --git a/libre/iceweasel-i18n/Makefile b/libre/iceweasel-i18n/Makefile deleted file mode 100644 index d596111f3..000000000 --- a/libre/iceweasel-i18n/Makefile +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/make -f -# Use this script to update the PKGBUILD's list of langpacks. -# This script depends on: -# - coreutils -# - pacman -# - sed - -# Variables: -# This is to get it from Debian Sid -debname=iceweasel-l10n -debver=9.0+debian -debrel=1 -debrepo=http://ftp.debian.org/debian/pool/main/ - -pkgver=9.0 -pkgrel=2.1 - -# Guts: ############################################################## - -default: PHONY all -all: PHONY - $(MAKE) clean - $(MAKE) PKGBUILD -.PRECIOUS: PKGBUILD - -PKGBUILD.list: Makefile - sed \ - -e 's/@DEBNAME@/$(debname)/' \ - -e 's/@DEBVER@/$(debver)/' \ - -e 's/@DEBREL@/$(debrel)/' \ - -e 's%@DEBREPO@%$(debrepo)%' \ - -e 's/@PKGVER@/$(pkgver)/' \ - -e 's/@PKGREL@/$(pkgrel)/' \ - -e "s/@LANGPACKS@/(phony)/" \ - -e '/CUT HERE/,$$d' \ - PKGBUILD.in > $@ - echo 'package() { exit 0; }' >> $@ - makepkg -gp $@ >> $@ -langpacks.txt: PKGBUILD.list Makefile - makepkg -dp $< - ls src/*/upstream | sed 's/\.xpi//' > $@ -PKGBUILD: PKGBUILD.in langpacks.txt Makefile - sed \ - -e 's/@DEBNAME@/$(debname)/' \ - -e 's/@DEBVER@/$(debver)/' \ - -e 's/@DEBREL@/$(debrel)/' \ - -e 's%@DEBREPO@%$(debrepo)%' \ - -e 's/@PKGVER@/$(pkgver)/' \ - -e 's/@PKGREL@/$(pkgrel)/' \ - -e "s/@LANGPACKS@/(`xargs echo < langpacks.txt`)/" \ - -e '/CUT HERE/d' \ - -e '/md5sums/,$$d' \ - PKGBUILD.in > $@ - makepkg -dg >> $@ - -clean: PHONY - rm -f PKGBUILD.list langpacks.txt - -.PHONY: PHONY FORCE diff --git a/libre/iceweasel-i18n/PKGBUILD b/libre/iceweasel-i18n/PKGBUILD deleted file mode 100644 index 3476c68f5..000000000 --- a/libre/iceweasel-i18n/PKGBUILD +++ /dev/null @@ -1,146 +0,0 @@ -# Maintainer: Luke Shumaker -# Contributor: fauno -# Contributor: Figue -# Based on icecat-i18n package, which is in turn based on firefox-i18n - -# When updating to a newer upstream release: -# - Edit variables in in Makefile. -# - (optionally) edit PKGBUILD.in -# - Run 'make'. It will take care of everything else for you. - -_debname=iceweasel -_debver=17.0.1 -_debrel=1 -_debrepo=http://ftp.debian.org/debian/pool/main/ -debfile() { echo $@|sed -r 's@(.).*@\1/&/&@'; } - -_langpacks=(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 ta-LK te th tr uk vi zh-CN zh-TW zu) - -pkgbase=iceweasel-i18n -pkgname=($(for lang in ${_langpacks[@]} - do echo $pkgbase-$lang | tr A-Z a-z - done)) -_pkgver=17.0.1 -pkgver=${_debver}.${_debrel} -pkgrel=1 - -pkgdesc="Language packs for Debian Iceweasel." -arch=('any') -url="http://www.geticeweasel.org/" -license=('MPL') -depends=("iceweasel-libre>=$pkgver") -source=() -for lang in ${_langpacks[@]} -do - source+=("${_debrepo}/`debfile ${_debname}`-l10n-$(echo $lang | tr A-Z a-z)_${_debver}-${_debrel}_all.deb") -done - -build() { - cd "${srcdir}" - for f in *.deb - do - bsdtar xf $f - bsdtar xf data.tar.xz - done -} - -_path="/usr/lib/iceweasel/extensions" - - -for lang in ${_langpacks[@]} -do - eval " -package_iceweasel-i18n-$(echo $lang | tr A-Z a-z)() { - install -Dm644 \"\$srcdir$_path/langpack-$lang@iceweasel.mozilla.org.xpi\" \"\$pkgdir$_path/langpack-$lang@iceweasel.mozilla.org.xpi\" -} -" -done - -md5sums=('9d0c6dcde68b688ba613c9704dad8cf6' - 'c3f7acd38f4fd0810a8bbc9c1a1ef990' - 'c806782ef309ecac56b0e736081555ac' - '41f9def213a2de76687be9bd36341c71' - '2aafaa1710de038f7741b1e5c1e40f19' - 'c536bdb01893b53346726cdf572cdda8' - '1b292d4cb415fb0b493fd88529d8add1' - 'eaa814301018cbcbcc9145fd60a0ad3e' - 'a7ffe62f5d1a676db58d6bcd0cb5a29e' - '25c8732aba36a5f8e58f35788a89b2f6' - '5ac90a12d8d1f0bbd0c32e6411168461' - 'f47b78c5f086ec511388a143330e22d5' - 'ae97555f6474f597a15da089b6ef0089' - '0c46ab829c0597dc3faa5e70d64bb903' - '555ccc2a64ce110308ae55569cf0d612' - 'f2bdc9390388552cebde424ccb533b56' - '0f857bdca9f2bcb24b5e8a2f46f398af' - '508928bf9b224786e3fdad9bcfda4230' - 'af8f928b3dcf59489291ed99ad216c10' - 'b97d8915f520de0d760070e7a058492c' - '5d894ccd869331f6ba81b79d66452d29' - 'c3e268cd4c829cb0852ed02c9de2dd4d' - '408c8e898900efc97d3c449382958607' - 'ad9568a88b73189cc73c25728d23db3a' - 'e6e84f910d33d75953a4abc4fb0e78d5' - '403991c8eaa55675b433701901042791' - '8b317a2f84f3ab4f20f213134fa4e89f' - 'f6e192717ea383206793b5ac51d94b9d' - '5a1f2ff1a18c58bf7eae079f0058d3ac' - 'd65eeba91a938d95466fb602919a8253' - '6719800c6c4ea969af4597386900eed5' - '09152085c533d5cfaa3281bd56791ab3' - '5c3b9ba64919931ba924aeb82b6d511d' - '0a5392e0edf416304fa3501e09a9e755' - '9d17cc7f1238db2edda76736ecee56af' - '56b19d666ae1df919b26d6c04ede6ec7' - '16648d2f5b226786487d9f6dd4bf1e11' - '5cc3b11c6dc4399d9024ce58be31dd0b' - '999685ea1e48118e0a033f9b64eec244' - '3b7cb8fb5da908558ad2843ab61bec57' - '7a566e091f024f9cb458e57c20f59fff' - 'eca90e7e61b2b628ddceb230229b8fda' - '58dc4acfb114088852c1e12708778f6a' - '6e6755330cea230f334a6618e5c06268' - 'bf1ffad887e9bf769f021790abdfe79b' - '83baeeed748511bdd7996aa34e074f39' - 'cecea99a977d0849a2077c7c4aca175d' - '01b9b43a1ed30e05f96c10365011b980' - 'e08db859318bd525f37fe5e90c15bc15' - 'e9ba8aeb43ba9465231d91ab4d9046af' - 'af84a3746532b3a1e71bbf173f37acae' - '0694facbec186997b5e3e56f16924371' - 'daeb31829220fc001c9fe63e2fe8de5e' - 'f1573ce43e917553c2720bca8f24569d' - '8afafca7d0a34532d77f9e22929b591c' - 'c67cbab5cb06b30e21c310e3d29fcaa8' - '201292f43d1c354bd0189906d03cbbd0' - '9cf84d585fea1ac3002e2cced729c8a3' - 'b32934822634ebd1a82f64ac70597ef9' - '63cb7e54400f55eb5b4995c299174b40' - '7bdb7601e9c21af7f6e8d4c6f2acc8d4' - 'd998310ca5c38ef8babcc18a4faffae0' - 'f9896f39830058b9b003568f4d67b73b' - '9568dedd80dc5401bd69880952ef42e1' - 'b8863db55f206abf8c4fcc34fd82347b' - '8f4df43a91550692497b599856323bf7' - '4b91b600a3fa5f520c3c0953128695f5' - '0a1fdc989d107d323fb80ea05b13b832' - 'ca6e721d01ee9ec6719c1813ebb7f35b' - '5c40e59819a74f47dc95b58d5e1005ea' - '6506433c61b5811cf600f48a0b5e8074' - 'e4410eaaece0a283bb4060d3eb428a96' - '635a91b20ba7ecde88de1bdf8517c7bb' - 'b884f988301169f17e5f181be5768e74' - '4358aa4e516f38b91e284eb75d729978' - 'f386732f9fb2629f35defe354e85ce02' - '9312ded30c12d367e9280ccfe5f22261' - 'a17cd6c8190d0a31938292b77c6c50fb' - '01187464580ccd34874e48e8113e4e5c' - 'af362b174706ab93851ac1e6e6078422' - 'a8291043c75079d9c66258897b30bba6' - '5ec754344dba9cfdc3021bb03ec118e0' - '04a79f1876c05c62f270f757cf34780c' - '494444bb9df2fbefc8689c3c3be61e6f' - '9b8c613d0f6cb51209021c436f7313d5' - '9ac2c4bab905675ab3cefbc10742f9cb' - 'c1a67c2551a9d0de73d72b3bad887159' - '2153d65575351ac1974fbb5874b4788b') \ No newline at end of file diff --git a/libre/iceweasel-i18n/PKGBUILD.in b/libre/iceweasel-i18n/PKGBUILD.in deleted file mode 100644 index 05477caef..000000000 --- a/libre/iceweasel-i18n/PKGBUILD.in +++ /dev/null @@ -1,63 +0,0 @@ -# Maintainer: Luke Shumaker -# Contributor: fauno -# Contributor: Figue -# Based on icecat-i18n package, which is in turn based on firefox-i18n - -# When updating to a newer upstream release: -# - Edit variables in in Makefile. -# - (optionally) edit PKGBUILD.in -# - Run 'make'. It will take care of everything else for you. - -_debname=@DEBNAME@ -_debver=@DEBVER@ -_debrel=@DEBREL@ -_debrepo=@DEBREPO@ -debfile() { echo $@|sed -r 's@(.).*@\1/&/&@'; } - -_langpacks=@LANGPACKS@ - -pkgbase=iceweasel-i18n -pkgname=($(for lang in ${_langpacks[@]} - do echo $pkgbase-$lang | tr A-Z a-z - done)) -_pkgver=@PKGVER@ -pkgver=${_debver}.${_debrel} -pkgrel=@PKGREL@ - -pkgdesc="Language packs for Debian Iceweasel." -arch=('any') -url="http://www.geticeweasel.org/" -license=('MPL') -depends=("iceweasel=$_pkgver") -source=("${_debrepo}/`debfile ${_debname}`_${_debver}.orig.tar.gz" - "${_debrepo}/`debfile ${_debname}`_${_debver}-${_debrel}.diff.gz" - "${_debrepo}/`debfile ${_debname}`_${_debver}-${_debrel}.dsc") -noextract=($(for lang in ${_langpacks[@]} - do echo $lang.xpi - done)) - -dpkg-source() { - # This will simulate dpkg-source -x ${_debname}_${_debver}-${_debrel}.dsc - cd "${_debname}-${_debver}" - patch -p1 -i "${srcdir}/${_debname}_${_debver}-${_debrel}.diff" - cd .. -} - -build() { - cd "${srcdir}" - dpkg-source -x ${_debname}_${_debver}-${_debrel}.dsc -} - -_path="/usr/lib/iceweasel-${_pkgver}/extensions" - -# CUT HERE <-- Separates package_*() functions from everything else. - -for lang in ${_langpacks[@]} -do - eval " -package_iceweasel-i18n-$(echo $lang | tr A-Z a-z) () { - install -Dm644 '$srcdir/'*'/upstream/$lang.xpi' \"\$pkgdir\"'$_path/langpack-$lang@firefox.mozilla.org.xpi' -} -" -done - 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