summaryrefslogtreecommitdiff
path: root/libre/icecat-noscript/PKGBUILD
blob: 89f6cbdea74a21decd938de930ff314af7f45714 (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
# $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@hyperbola.info>
# Contributor: jc_gargma <jc_gargma@iserlohn-fortress.net>

pkgname=icecat-noscript
pkgver=5.0.9
pkgrel=1
pkgdesc="Extension for icecat which disables script"
arch=('any')
url="https://noscript.net/"
license=('GPL2')
groups=('icecat-addons')
depends=('icecat')
makedepends=('unzip')
source=(https://secure.informaction.com/download/releases/noscript-${pkgver}.xpi)
noextract=("noscript-${pkgver}.xpi")
sha512sums=('00e7222f2deb407e3091071a3d9a1a5593582a9ad5b802eb9804c07ae64bd3f22f807ea9cee0be669fb597c75c2891fb8c432fccd51f7466ec1d6fed70ad1768')
whirlpoolsums=('2978fe4fea484c5bd45503b72838a3fa3bb1021a4203305064477ae042f1617416d2407303183b5c4c2a17b6eadff14629ac7fc5a0e11d38efa533091526c340')

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/icecat/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
}