From 0683581aac2e290ac79de89e0c2b69a32d624ab0 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 15 Dec 2015 18:26:24 -0500 Subject: [PATCH] fix firefox extension signing issues --- trunk/PKGBUILD | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD index a684346..3cd8999 100644 --- a/trunk/PKGBUILD +++ b/trunk/PKGBUILD @@ -1,25 +1,37 @@ # $Id$ # Maintainer: Sergej Pupykin +# Contributor: Eschwartz -pkgname=firefox-noscript +_pkgname=noscript +pkgname=firefox-${_pkgname} pkgver=2.7 -pkgrel=1 +pkgrel=2 pkgdesc="Extension for firefox which disables script" arch=('any') url="http://noscript.net/" license=('GPL2') -depends=() +groups=('firefox-addons') +depends=('firefox') makedepends=('unzip') -source=(https://secure.informaction.com/download/releases/noscript-$pkgver.xpi) +source=(https://secure.informaction.com/download/releases/${_pkgname}-${pkgver}.xpi) +noextract=("${_pkgname}-${pkgver}.xpi") md5sums=('25fd6771919ae72f525f3b89cfa70b05') +prepare() { + cd "${srcdir}" + unzip -qqo "${_pkgname}-${pkgver}.xpi" -d "${_pkgname}-${pkgver}" +} + package() { - depends=("firefox") + cd "${srcdir}" - cd $srcdir - 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} - install -d $dstdir - cp -R * $dstdir - rm $dstdir/noscript-$pkgver.xpi + _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