summaryrefslogtreecommitdiff
path: root/libre/iceweasel-noscript/PKGBUILD
blob: 200145b7ca21fd930bc475c9b3098871655ca5b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# $Id: PKGBUILD 208501 2017-01-23 11:37:51Z spupykin $
# Maintainer (Arch): Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor (Arch): Eschwartz <eschwartz93@gmail.com>
# Maintainer: André Silva <emulatorman@parabola.nu>
# Contributor: jc_gargma <jc_gargma@iserlohn-fortress.net>

pkgname=iceweasel-noscript
pkgver=5.0.6
pkgrel=1
pkgdesc="Extension for iceweasel which disables script"
arch=('any')
url="http://noscript.net/"
license=('GPL2')
groups=('iceweasel-addons')
depends=('iceweasel')
makedepends=('unzip')
replaces=('firefox-noscript')
source=(https://secure.informaction.com/download/releases/noscript-${pkgver}.xpi)
noextract=("noscript-${pkgver}.xpi")
sha512sums=('3fe2fbaf8b419e95b1ca858c5ebb9dab61f28bebf5a7ef4012f7feb8969785acf5d2f757a1acc55d3fee23ad463b36929522ab68238d4ec95be984223326cfbc')
whirlpoolsums=('31de8173792205fff165b1e25888ee3c1f417abc47f33f7335ac1b7a8ec6d6e351b9b469267601ccec27e2e89030c50692a686b86d8ccd1faa3f363ca35609fb')

prepare() {
  cd "${srcdir}"
  unzip -qqo "noscript-${pkgver}.xpi" -d "noscript-${pkgver}"
}

package() {
  cd "${srcdir}"

  _extension_id="$(sed -n '/.*<em:id>\(.*\)<\/em:id>.*/{s//\1/p;q}' noscript-${pkgver}/install.rdf)"
  _extension_dest="${pkgdir}/usr/lib/iceweasel/browser/extensions/${_extension_id}"
  if grep '<em:unpack>true</em:unpack>' noscript-${pkgver}/install.rdf > /dev/null; then
    install -dm755 "${_extension_dest}"
    cp -R noscript-${pkgver}/* "${_extension_dest}"
    chmod -R ugo+rX "${_extension_dest}"
  else
    install -Dm644 noscript-${pkgver}.xpi "${_extension_dest}.xpi"
  fi
}