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

Nicola Squartini tensor5 at archlinux.org
Wed May 1 11:22:14 UTC 2019


    Date: Wednesday, May 1, 2019 @ 11:22:13
  Author: tensor5
Revision: 457399

upgpkg: asar 2.0.1-1

Modified:
  asar/trunk/PKGBUILD

----------+
 PKGBUILD |   53 ++++++++++++-----------------------------------------
 1 file changed, 12 insertions(+), 41 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-05-01 11:21:29 UTC (rev 457398)
+++ PKGBUILD	2019-05-01 11:22:13 UTC (rev 457399)
@@ -1,7 +1,7 @@
 # Maintainer: Nicola Squartini <tensor5 at gmail.com>
 
 pkgname=asar
-pkgver=1.0.0
+pkgver=2.0.1
 pkgrel=1
 pkgdesc='Creating Electron app packages'
 arch=('any')
@@ -8,50 +8,21 @@
 url='https://github.com/electron/asar'
 license=('MIT')
 depends=('nodejs')
-makedepends=('npm')
+makedepends=('modclean' 'npm')
 options=(!emptydirs)
-source=("${pkgname}-${pkgver}.tar.gz::https://github.com/electron/asar/archive/v${pkgver}.tar.gz")
-sha256sums=('7492f857144bfaed939a8285a212ffab92c638c3878ddfcb133f6b469da7193b')
 
 package() {
-    cd ${pkgname}-${pkgver}
+    npm install -g --prefix="${srcdir}/usr" ${pkgname}@${pkgver}
+    cp -r "${srcdir}/usr" "${pkgdir}"
 
-    npm install -g --prefix="${pkgdir}"/usr "${srcdir}/${pkgname}-${pkgver}.tar.gz"
-
-    moduledir=/usr/lib/node_modules/${pkgname}
-
-    install -d "${pkgdir}/usr/share/licenses/${pkgname}"
-    ln -s $(realpath \
-            --relative-to="${pkgdir}"/usr/share/licenses/${pkgname} \
-            "${pkgdir}"${moduledir})/LICENSE.md \
+    cd "${pkgdir}/usr/lib/node_modules/${pkgname}"
+    install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}"
+    ln -s \
+        $(realpath --relative-to="${pkgdir}"/usr/share/licenses/${pkgname} LICENSE.md) \
         "${pkgdir}/usr/share/licenses/${pkgname}"
 
-    find "${pkgdir}" -type d -exec chmod 755 {} \;
-
-    # Remove useless stuff and occurrences of ${pkgdir} and ${srcdir}
-    find "${pkgdir}"${moduledir} \
-        -name '.*' -prune -exec rm -r '{}' \; \
-        -or -name '*.sh' -exec rm '{}' \; \
-        -or -name 'appveyor.yml' -exec rm '{}' \; \
-        -or -name 'benchmark' -prune -exec rm -r '{}' \; \
-        -or -path "*/${pkgname}/node_modules/*/bin" -prune -exec rm -r '{}' \; \
-        -or -name 'bin.js' -exec rm '{}' \; \
-        -or -name 'bower.json' -exec rm '{}' \; \
-        -or -name 'cleanup.sh' -exec rm '{}' \; \
-        -or -name 'component.json' -exec rm '{}' \; \
-        -or -name 'example' -prune -exec rm -r '{}' \; \
-        -or -name 'example.js' -exec rm '{}' \; \
-        -or -name 'examples' -prune -exec rm -r '{}' \; \
-        -or -name 'Gruntfile.js' -exec rm '{}' \; \
-        -or -name 'Makefile' -exec rm '{}' \; \
-        -or -name 'man' -prune -exec rm -r '{}' \; \
-        -or -name 'package.json' -exec sed -e "s|${pkgdir}||" \
-            -e "s|${srcdir}/${pkgname}-${pkgver}|${moduledir}|" -i '{}' \; \
-        -or -name 'perf' -prune -exec rm -r '{}' \; \
-        -or -name 'scripts' -prune -exec rm -r '{}' \; \
-        -or -name 'sync-package-managers.js' -exec rm '{}' \; \
-        -or -name 'test' -prune -exec rm -r '{}' \; \
-        -or -name 'test.js' -exec rm '{}' \; \
-        -or -name 'tools' -prune -exec rm -r '{}' \; \
-        -or -name 'tst' -prune -exec rm -r '{}' \;
+    sed -e "s|${srcdir}|/|" -i package.json
+    find node_modules -name 'package.json' -exec sed -e "s|${srcdir}||" -i {} \;
+    rm -r node_modules/{bluebird/js/browser,mkdirp/bin}
+    modclean -r -a "*.ts,.bin,.vscode" --ignore='license'  # --ignore='license*'
 }



More information about the arch-commits mailing list