[arch-commits] Commit in htmlhint/repos/community-any (PKGBUILD PKGBUILD)
Daniel M. Capella
polyzen at archlinux.org
Mon Feb 15 12:01:00 UTC 2021
Date: Monday, February 15, 2021 @ 12:00:59
Author: polyzen
Revision: 861070
archrelease: copy trunk to community-any
Added:
htmlhint/repos/community-any/PKGBUILD
(from rev 861069, htmlhint/trunk/PKGBUILD)
Deleted:
htmlhint/repos/community-any/PKGBUILD
----------+
PKGBUILD | 83 ++++++++++++++++++++++++++++++++++++++++++-------------------
1 file changed, 58 insertions(+), 25 deletions(-)
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2021-02-15 12:00:34 UTC (rev 861069)
+++ PKGBUILD 2021-02-15 12:00:59 UTC (rev 861070)
@@ -1,25 +0,0 @@
-# Maintainer: Daniel M. Capella <polyzen at archlinux.org>
-
-pkgname=htmlhint
-pkgver=0.14.2
-pkgrel=1
-pkgdesc='Static Code Analysis Tool for your HTML'
-arch=('any')
-url=https://htmlhint.com/
-license=('MIT')
-depends=('nodejs')
-makedepends=('npm')
-source=("https://registry.npmjs.org/$pkgname/-/$pkgname-$pkgver.tgz")
-noextract=("$pkgname-$pkgver.tgz")
-sha512sums=('9540a019567fa320a4a600e421ae487c29705fc3e9cb5d4393b5dd7956e80064a62a322e38ac7acb2f3a592d16d3c285b4246ec5fb73372f8a7508cce148ea08')
-
-package() {
- npm install -g --user root --prefix "$pkgdir"/usr --ignore-scripts --production $pkgname-$pkgver.tgz
-
- cd "$pkgdir"
- mkdir -p usr/share/licenses/$pkgname
- mv usr/lib/node_modules/$pkgname/LICENSE.md usr/share/licenses/$pkgname
- chown -R root:root .
-}
-
-# vim:set ts=2 sw=2 et:
Copied: htmlhint/repos/community-any/PKGBUILD (from rev 861069, htmlhint/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2021-02-15 12:00:59 UTC (rev 861070)
@@ -0,0 +1,58 @@
+# Maintainer: Daniel M. Capella <polyzen at archlinux.org>
+
+_name=HTMLHint
+pkgname=htmlhint
+pkgver=0.14.2
+pkgrel=2
+pkgdesc='Static Code Analysis Tool for your HTML'
+arch=('any')
+url=https://htmlhint.com/
+license=('MIT')
+depends=('nodejs')
+makedepends=('git' 'jq' 'npm')
+source=("git+https://github.com/htmlhint/HTMLHint.git#tag=v$pkgver")
+b2sums=('SKIP')
+
+build() {
+ cd $_name
+ npm ci
+ npm run build
+ npm pack
+}
+
+check() {
+ cd $_name
+ npm test
+}
+
+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'
+
+ 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
+}
+
+# vim:set ts=2 sw=2 et:
More information about the arch-commits
mailing list