[arch-commits] Commit in eslint/trunk (PKGBUILD)

Daniel M. Capella polyzen at gemini.archlinux.org
Fri Mar 25 23:32:00 UTC 2022


    Date: Friday, March 25, 2022 @ 23:31:59
  Author: polyzen
Revision: 1176739

Style touch ups

- Split out _npmdir

- Uniform use of $pkgname

Modified:
  eslint/trunk/PKGBUILD

----------+
 PKGBUILD |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-03-25 23:25:11 UTC (rev 1176738)
+++ PKGBUILD	2022-03-25 23:31:59 UTC (rev 1176739)
@@ -11,32 +11,33 @@
 depends=('acorn' 'nodejs')
 makedepends=('npm' 'rsync')
 options=('!emptydirs')
-source=("https://github.com/eslint/eslint/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
+source=("https://github.com/$pkgname/$pkgname/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
 b2sums=('fe80db0438b961c2ba29207444a3e1712fc98217bb56c0c468cab8c22c412f814dee123cb0092793ef9043470988e02858dcfb0c7d58e544ab7ae8e96107edbb')
 
 prepare() {
-  cd eslint-$pkgver
+  cd $pkgname-$pkgver
   npm install
 }
 
 check() {
-  cd eslint-$pkgver
+  cd $pkgname-$pkgver
   node Makefile mocha
 }
 
 package() {
-  cd eslint-$pkgver
+  cd $pkgname-$pkgver
 
   npm prune --production
 
+  _npmdir=/usr/lib/node_modules/$pkgname
   install -d "$pkgdir"/usr/bin
-  ln -s ../lib/node_modules/$pkgname/bin/$pkgname.js "$pkgdir"/usr/bin/$pkgname
-  install -Dt "$pkgdir"/usr/lib/node_modules/$pkgname/bin bin/$pkgname.js
+  ln $_npmdir/bin/$pkgname.js "$pkgdir"/usr/bin/$pkgname
+  install -Dt "$pkgdir"/$_npmdir/bin bin/$pkgname.js
   rsync -r --exclude .cache conf lib messages node_modules package.json \
-    "$pkgdir"/usr/lib/node_modules/$pkgname
+    "$pkgdir"/$_npmdir
   install -Dm644 -t "$pkgdir"/usr/share/doc/$pkgname README.md
   install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname LICENSE
 
   # Experimental dedup
-  rm -r "$pkgdir"/usr/lib/node_modules/$pkgname/node_modules/acorn
+  rm -r "$pkgdir"/$_npmdir/node_modules/acorn
 }



More information about the arch-commits mailing list