summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 85e017167d2570b1ef3b1795b8a7a2c8ba0bc7d7 (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
41
42
43
44
45
46
47
48
49
50
# Maintainer: Dimitris Kiziridis <ragouel at outlook dot com>

pkgname=('lua-web_sanitize' 'lua51-web_sanitize' 'lua52-web_sanitize')
pkgver=1.0.0
pkgrel=1
pkgdesc="Lua library for sanitizing untrusted HTML"
arch=('any')
url='https://github.com/leafo/web_sanitize'
license=('MIT')
makedepends=('luarocks' 'git')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/leafo/web_sanitize/archive/v${pkgver}.tar.gz")
sha256sums=('64da4fcfd2c025c250b6a91e1a26558c2d9265bb8f1f28d71f323ac55ec5eab3')

build() {
  mkdir -p 5.1 5.2 5.3

  # Build for 5.1
  (cd 5.1; luarocks build --pack-binary-rock --lua-version=5.1 --deps-mode=none .."/web_sanitize-${pkgver}/web_sanitize-dev-1.rockspec")
  # Build for 5.2
  (cd 5.2; luarocks build --pack-binary-rock --lua-version=5.2 --deps-mode=none .."/web_sanitize-${pkgver}/web_sanitize-dev-1.rockspec")
  # Build for 5.3
  (cd 5.3; luarocks build --pack-binary-rock --lua-version=5.3 --deps-mode=none .."/web_sanitize-${pkgver}/web_sanitize-dev-1.rockspec")
}

package_lua-web_sanitize() {
  pkgdesc='Lua library for sanitizing untrusted HTML for Lua 5.3'

  luarocks install --lua-version=5.3 --tree="$pkgdir/usr/" --deps-mode=none 5.3/*.rock

  # remove luarocks-created root manifest
  rm "$pkgdir/usr/lib/luarocks/rocks-5.3/manifest"
}

package_lua51-web_sanitize() {
  pkgdesc='Lua library for sanitizing untrusted HTML for Lua 5.1'

  luarocks install --lua-version=5.1 --tree="$pkgdir/usr/" --deps-mode=none 5.1/*.rock

  # remove luarocks-created root manifest
  rm "$pkgdir/usr/lib/luarocks/rocks-5.1/manifest"
}

package_lua52-web_sanitize() {
  pkgdesc='Lua library for sanitizing untrusted HTML for Lua 5.2'

  luarocks install --lua-version=5.2 --tree="$pkgdir/usr/" --deps-mode=none 5.2/*.rock

  # remove luarocks-created root manifest
  rm "$pkgdir/usr/lib/luarocks/rocks-5.2/manifest"
}