diff options
author | Kirill Goncharov | 2020-03-28 11:15:46 +0300 |
---|---|---|
committer | Kirill Goncharov | 2020-03-28 11:16:34 +0300 |
commit | 887f75e8b7765a4248fa0cd418a39f843acb586e (patch) | |
tree | c4ddd39b3a280bd0035beb6933306fc08d44f172 | |
parent | 40ad2d68f52336229eba5be03f43e025fdc322eb (diff) | |
download | aur-887f75e8b7765a4248fa0cd418a39f843acb586e.tar.gz |
Do package() according to ArchLinux guidelines
-rw-r--r-- | PKGBUILD | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -15,9 +15,15 @@ depends=('nodejs') sha256sums=('465d85678531ada99de2a2cb75cf1a8a7e08b5e4729e78b1e244982835a783c7') package() { - npm install -g --production --prefix "$pkgdir/usr" "truffle-${pkgver}.tgz" - tar -xf "truffle-${pkgver}.tgz" package/LICENSE - install -D -m644 package/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" - chmod -R 755 "${pkgdir}/usr/lib/node_modules/truffle/node_modules/" - chmod 755 "${pkgdir}/usr/bin" + npm install -g --production --prefix "$pkgdir/usr" "truffle-${pkgver}.tgz" + tar -xf "truffle-${pkgver}.tgz" package/LICENSE + install -D -m644 package/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + + # -> https://wiki.archlinux.org/index.php/Node.js_package_guidelines + # Non-deterministic race in npm gives 777 permissions to random directories. + # See https://github.com/npm/npm/issues/9359 for details. + find "${pkgdir}"/usr -type d -exec chmod 755 {} + + # npm gives ownership of ALL FILES to build user + # https://bugs.archlinux.org/task/63396 + chown -R root:root "$pkgdir" } |