summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorDaniel M. Capella2021-02-16 21:50:38 +0000
committerDaniel M. Capella2021-02-16 21:50:38 +0000
commit1590239d4b0a2d46deb6f50deb27f4891c05d03c (patch)
tree16b1666fe42325a26697528e09e4ce116491df75 /PKGBUILD
parent7163a3ad30cf1f0040dbabb52883ecadc89066fc (diff)
downloadaur-1590239d4b0a2d46deb6f50deb27f4891c05d03c.tar.gz
Respect lockfiles (take 2)
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD37
1 files changed, 10 insertions, 27 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 402fa5e354ae..5cfccca66433 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,13 +3,13 @@
_name=HTMLHint
pkgname=htmlhint
pkgver=0.14.2
-pkgrel=2
+pkgrel=3
pkgdesc='Static Code Analysis Tool for your HTML'
arch=('any')
url=https://htmlhint.com/
license=('MIT')
depends=('nodejs')
-makedepends=('git' 'jq' 'npm')
+makedepends=('git' 'npm')
source=("git+https://github.com/htmlhint/HTMLHint.git#tag=v$pkgver")
b2sums=('SKIP')
@@ -17,7 +17,6 @@ build() {
cd $_name
npm ci
npm run build
- npm pack
}
check() {
@@ -27,32 +26,16 @@ check() {
package() {
cd $_name
- npm install --global \
- --user root \
- --prefix "$pkgdir"/usr \
- --production \
- $pkgname-$pkgver.tgz
- chown -R root:root "$pkgdir"
- cp -r dist "$pkgdir"/usr/lib/node_modules/$pkgname
- install -d "$pkgdir"/usr/share/licenses/$pkgname
- ln -s /usr/lib/node_modules/$pkgname/LICENSE.md \
- "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.md
- # Remove references to $srcdir and $pkgdir
- find "$pkgdir" -name package.json -print0 | xargs -r -0 sed -i '/_where/d'
+ npm prune --production
- local tmppackage="$(mktemp)"
- local pkgjson="$pkgdir/usr/lib/node_modules/$pkgname/package.json"
- jq '.|=with_entries(select(.key|test("_.+")|not))' "$pkgjson" > "$tmppackage"
- mv "$tmppackage" "$pkgjson"
- chmod 644 "$pkgjson"
-
- find "$pkgdir" -type f -name package.json | while read pkgjson; do
- local tmppackage="$(mktemp)"
- jq 'del(.man)' "$pkgjson" > "$tmppackage"
- mv "$tmppackage" "$pkgjson"
- chmod 644 "$pkgjson"
- done
+ install -d "$pkgdir"/usr/bin
+ ln -s ../lib/node_modules/$pkgname/bin/$pkgname "$pkgdir"/usr/bin/$pkgname
+ install -Dt "$pkgdir"/usr/lib/node_modules/$pkgname/bin bin/$pkgname
+ cp -r dist node_modules package.json "$pkgdir"/usr/lib/node_modules/$pkgname
+ install -Dm644 -t "$pkgdir"/usr/share/doc/$pkgname \
+ {CHANGELOG,CONTRIBUTING,README}.md
+ install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname LICENSE.md
}
# vim:set ts=2 sw=2 et: