summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD57
1 files changed, 39 insertions, 18 deletions
diff --git a/PKGBUILD b/PKGBUILD
index aab19c161f08..fa25e5bf09b6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,24 +1,45 @@
-_npmname=textlint
-_npmver=10.2.1
-pkgname=textlint # All lowercase
-pkgver=10.2.1
+# Maintainer: PY Chuang <pychuang@pm.me>
+# Contributor: Arjun Nemani <nemaniarjun@gmail.com>
+pkgname=textlint
+pkgver=11.7.6
pkgrel=1
-pkgdesc="The pluggable linting tool for text and markdown."
+pkgdesc="The pluggable natural language linter for text and markdown."
arch=(any)
url="https://github.com/textlint/textlint/"
-license=()
-depends=('nodejs' 'npm' )
-optdepends=()
-source=(http://registry.npmjs.org/$_npmname/-/$_npmname-$_npmver.tgz)
-noextract=($_npmname-$_npmver.tgz)
-sha1sums=(ee22b7967d59cef7c74a04a5f4e8883134e5c79d)
+license=("MIT")
+depends=("nodejs")
+makedepends=("npm")
+source=(https://registry.npmjs.org/$pkgname/-/$pkgname-$pkgver.tgz)
+sha256sums=("3cbd430dc6f548fc9a07efc26ccf10c8dd1f61258935a1d6696f076997d7a0a1")
package() {
- cd $srcdir
- local _npmdir="$pkgdir/usr/lib/node_modules/"
- mkdir -p $_npmdir
- cd $_npmdir
- npm install -g --prefix "$pkgdir/usr" $_npmname@$_npmver
-}
-# vim:set ts=2 sw=2 et:
+ 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" \
+ --production \
+ --no-optional \
+ --no-audit \
+ -g \
+ --user root \
+ --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"
+}