blob: 3e763d8c92c2f61ac896bf2245544954fcc06e92 (
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
|
# Maintainer: qwjyh <urataw421@gmail.com>
# Contributor: PY Chuang <pychuang@pm.me>
# Contributor: Arjun Nemani <nemaniarjun@gmail.com>
pkgname=textlint
pkgver=15.5.4
pkgrel=1
pkgdesc="The pluggable natural language linter for text and markdown."
arch=(any)
url="https://github.com/textlint/textlint/"
license=("MIT")
depends=("nodejs")
makedepends=("npm")
source=(https://registry.npmjs.org/$pkgname/-/$pkgname-$pkgver.tgz)
sha1sums=('06d1b73291bb424ef39138252085764cc135fe4a')
package() {
cd $srcdir
# remove cache folder
if [[ -d npm-cache ]]; then rm -rf npm-cache; fi
# npm install with the local tarball
npm install \
--cache "${srcdir}/npm-cache" \
--omit=dev \
--omit=optional \
--no-audit \
-g \
--prefix "$pkgdir/usr" \
$pkgname-$pkgver.tgz
# change the destination of references
grep -Rl "$pkgdir" "$pkgdir" | xargs -r sed -i "s@${pkgdir}@@g"
grep -Rl "$srcdir" "$pkgdir" | xargs -r sed -i "s@\"${srcdir}.*\"@\"\"@g"
# change owner
chown -R root:root "${pkgdir}"
# to shut up namcap's warning, even though it's a MIT license
install -Dm644 "${srcdir}/package/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname"
# install README
install -Dm644 "${srcdir}/package/README.md" -t "$pkgdir/usr/share/doc/$pkgname"
}
|