BlackArch / blackarch

An ArchLinux based distribution for penetration testers and security researchers.
https://www.blackarch.org
Other
2.79k stars 562 forks source link

[Tool request] threat-dragon #2393

Open vdun opened 5 years ago

vdun commented 5 years ago

https://github.com/mike-goodwin/owasp-threat-dragon

D3vil0p3r commented 21 hours ago

@noraj by BA-pkgbuilds nodejs-npm, the one in the subject could be:

# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=owasp-threat-dragon
pkgver=v1.2.r2.g18076b1
pkgrel=1
pkgdesc='An open source, online threat modeling tool from OWASP.'
arch=('any')
groups=('blackarch' 'blackarch-webapp')
url='https://mike-goodwin.github.io/owasp-threat-dragon/'
license=('Apache-2.0')
depends=('nodejs')
makedepends=('git' 'npm')
source=("git+https://github.com/mike-goodwin/owasp-threat-dragon.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  ( set -o pipefail
    git describe --long --tags --abbrev=7 2>/dev/null |
      sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "%s.%s" "$(git rev-list --count HEAD)" \
      "$(git rev-parse --short=7 HEAD)"
  )
}

package() {
  cd $pkgname

  _npmdir="$pkgdir/usr/lib/node_modules/"

  install -dm 755 "$_npmdir"

  cd $_npmdir

  npm install --user root -g --prefix "$pkgdir/usr" "$pkgname-common@"

  cd $pkgname

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" *.md
}

When running the several tests, it goes to search for ./node_modules/.bin/karma but this karma is missing. Should it be managed upstream or we must force its install by npm install --user root --prefix "$pkgdir/usr/lib/node_modules/$pkgname" karma karma-cli in the PKGBUILD?

noraj commented 21 hours ago

We could rename it until upstream fixes if it just looking for the wrong binary name.