From f61c8a68e4dd4cad45e3e1eaf3327273d812c32a Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 15 Dec 2015 18:48:33 -0500 Subject: [PATCH] fix firefox extension signing issues Also update to the latest version --- trunk/PKGBUILD | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD index 46545a2..c711f9a 100644 --- a/trunk/PKGBUILD +++ b/trunk/PKGBUILD @@ -1,9 +1,12 @@ # $Id$ # Maintainer: Sergej Pupykin +# Contributor: Eschwartz -pkgname=firefox-adblock-plus -pkgver=2.6.13 +_pkgname=adblock-plus +pkgname=firefox-${_pkgname} +pkgver=2.7 pkgrel=1 +_file=375345 pkgdesc="Extension for firefox which block ads and banners" arch=('any') url="http://adblockplus.org/" @@ -11,19 +14,25 @@ license=('GPL') groups=('firefox-addons') depends=("firefox") makedepends=('unzip') -noextract=("adblockplus-$pkgver.xpi") -source=("https://downloads.adblockplus.org/adblockplus-$pkgver.xpi") -md5sums=('5750b871f82e37c78fc0ac234aea1ba7') +source=("https://addons.mozilla.org/firefox/downloads/file/${_file}/${_pkgname}-${pkgver}.xpi") +noextract=("${_pkgname}-$pkgver.xpi") +md5sums=('5bedf856552d9333046fe24cb303f469') + +prepare() { + cd "${srcdir}" + unzip -qqo "${_pkgname}-${pkgver}.xpi" -d "${_pkgname}-${pkgver}" +} package() { - cd $srcdir - unzip adblockplus-$pkgver.xpi - local emid=$(sed -n -e '/<\?em:id>\?/!d; s/.*\([\"{].*[}\"]\).*/\1/; s/\"//g; p; q' install.rdf) - local dstdir=$pkgdir/usr/lib/firefox/browser/extensions/${emid} - [ -n ${emid} ] || return 1 - install -d $dstdir - cp -R * $dstdir - rm $dstdir/*.xpi - find $pkgdir -type d -exec chmod 0755 {} \; - find $pkgdir -type f -exec chmod 0644 {} \; + cd "${srcdir}" + + _extension_id="$(sed -n '/.*\(.*\)<\/em:id>.*/{s//\1/p;q}' ${_pkgname}-${pkgver}/install.rdf)" + _extension_dest="${pkgdir}/usr/lib/firefox/browser/extensions/${_extension_id}" + if grep 'true' ${_pkgname}-${pkgver}/install.rdf > /dev/null; then + install -dm755 "${_extension_dest}" + cp -R ${_pkgname}-${pkgver}/* "${_extension_dest}" + chmod -R ugo+rX "${_extension_dest}" + else + install -Dm644 ${_pkgname}-${pkgver}.xpi "${_extension_dest}.xpi" + fi } -- 2.6.4