diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-12-29 15:39:56 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-12-29 15:39:56 -0500 |
commit | 8b9dc14ffc0413ccb5887f7f9502c095ca7e7a57 (patch) | |
tree | 3e0edf69cf90605a39c74a723075b853afcb6746 /mozilla-testing/iceweasel-i18n | |
parent | 0c14c3dd36e1c2f529ffa248383a275cfb21f168 (diff) |
change the ice{cat,weasel}-i18n update systems to use autoconf-style PKGBUILD.in files (more robust)
Diffstat (limited to 'mozilla-testing/iceweasel-i18n')
-rw-r--r-- | mozilla-testing/iceweasel-i18n/.gitignore | 2 | ||||
-rw-r--r-- | mozilla-testing/iceweasel-i18n/Makefile | 47 | ||||
-rw-r--r-- | mozilla-testing/iceweasel-i18n/PKGBUILD | 10 | ||||
-rw-r--r-- | mozilla-testing/iceweasel-i18n/PKGBUILD.in | 57 |
4 files changed, 97 insertions, 19 deletions
diff --git a/mozilla-testing/iceweasel-i18n/.gitignore b/mozilla-testing/iceweasel-i18n/.gitignore index bff578e20..3e1eb57b5 100644 --- a/mozilla-testing/iceweasel-i18n/.gitignore +++ b/mozilla-testing/iceweasel-i18n/.gitignore @@ -1,3 +1,3 @@ -PKGBUILD.* +PKGBUILD.list langpacks.txt *.diff.gz diff --git a/mozilla-testing/iceweasel-i18n/Makefile b/mozilla-testing/iceweasel-i18n/Makefile index a0a767c3d..64e140af6 100644 --- a/mozilla-testing/iceweasel-i18n/Makefile +++ b/mozilla-testing/iceweasel-i18n/Makefile @@ -5,32 +5,55 @@ # - 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 + +# Guts: ############################################################## + default: PHONY all all: PHONY $(MAKE) clean $(MAKE) PKGBUILD .PRECIOUS: PKGBUILD -PKGBUILD.g: Makefile +PKGBUILD.list: Makefile sed \ - -e '/This line is here/,$$d' \ - -e 's/^pkgname=/_pkgname=/' \ - PKGBUILD > $@ - echo 'pkgname=foo' >> $@ + -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.g Makefile +langpacks.txt: PKGBUILD.list Makefile makepkg -dp $< ls src/*/upstream | sed 's/\.xpi//' > $@ -PKGBUILD: langpacks.txt Makefile +PKGBUILD: PKGBUILD.in langpacks.txt Makefile sed \ - -e "s/_langpacks=.*/_langpacks=(`xargs echo < $<`)/" \ + -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' \ - $@ > $@.$$$$ && \ - makepkg -g >> $@.$$$$ && \ - mv $@.$$$$ $@ + PKGBUILD.in > $@ + makepkg -dg >> $@ clean: PHONY - rm -f PKGBUILD.g langpacks.txt + rm -f PKGBUILD.list langpacks.txt .PHONY: PHONY FORCE diff --git a/mozilla-testing/iceweasel-i18n/PKGBUILD b/mozilla-testing/iceweasel-i18n/PKGBUILD index 45555b019..eb4b72af7 100644 --- a/mozilla-testing/iceweasel-i18n/PKGBUILD +++ b/mozilla-testing/iceweasel-i18n/PKGBUILD @@ -1,10 +1,10 @@ # Maintainer: Luke Shumaker <lukeshu@sbcglobal.net> # When updating to a newer upstream release: -# - Update pkgver= and _deb*= below. -# - Run "make". This will do everything else for you. +# - Edit variables in in Makefile. +# - (optionally) edit PKGBUILD.in +# - Run 'make'. It will take care of everything else for you. -# We're getting this from Debian Sid _debname=iceweasel-l10n _debver=9.0+debian _debrel=1 @@ -19,8 +19,7 @@ pkgname=($(for lang in ${_langpacks[@]} done)) _pkgver=9.0 pkgver=${_debver}.${_debrel} -pkgrel=1 - +pkgrel=2 pkgdesc="Language packs for Debian Iceweasel." arch=('any') @@ -42,7 +41,6 @@ build() { _path="/usr/lib/iceweasel-${_pkgver}/extensions" -# This line is here for auto-regeneration purposes. DO NOT EDIT! for lang in ${_langpacks[@]} do diff --git a/mozilla-testing/iceweasel-i18n/PKGBUILD.in b/mozilla-testing/iceweasel-i18n/PKGBUILD.in new file mode 100644 index 000000000..a912414b8 --- /dev/null +++ b/mozilla-testing/iceweasel-i18n/PKGBUILD.in @@ -0,0 +1,57 @@ +# Maintainer: Luke Shumaker <lukeshu@sbcglobal.net> +# Contributor: fauno <fauno@kiwwwi.com.ar> +# Contributor: Figue <ffigue@gmail.com> +# 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") +noextract=($(for lang in ${_langpacks[@]} + do echo $lang.xpi + done)) + +build() { + cd "${srcdir}" + # This will simulate dpkg-source -x ${_debname}_${_debver}-${_debrel}.dsc + cd "${_debname}-${_debver}" + patch -p1 -i "${srcdir}/${_debname}_${_debver}-${_debrel}.diff" +} + +_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 + |