makedeb


nodejs20-renamed-bin 20.18.1-0


Renamed nodejs 20 that doesn't conflict with other versions and unrenamed in libexec/node20 for adding to PATH

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for nodejs20-renamed-bin.

# Maintainer: exponential <echo ZXhwb25lbnRpYWxtYXRyaXhAcHJvdG9ubWFpbC5jb20K | base64 -d>

_pkgvermain="20"
_pkgname="nodejs${_pkgvermain}"
_pkgnameshort="node${_pkgvermain}"
pkgname="${_pkgname}-renamed-bin"
pkgver="20.18.1"
pkgrel=0
pkgdesc="Renamed nodejs ${_pkgvermain} that doesn't conflict with other versions and unrenamed in libexec/node${_pkgvermain} for adding to PATH"
# MULTYARCH NOT TESTED, names probably messed up
arch=('amd64' 'arm64' 'armhf' 'ppc64el' 's390x')
  case "$(arch)" in
  x86_64)
       _archname="x64"
        ;;
  aarch64)
       _archname="arm64"
        ;;
  armv7h)
       _archname="armv7l"
        ;;
  ppc64le)
      _archname="ppc64le"
        ;;
  s390x)
       _archname="s390x"
        ;;
  *)
     echo "arch name not recognized"
     exit 1
        ;;
  esac
_srcname=node-v${pkgver}-linux-${_archname}
url="https://nodejs.org/"
license=('MIT')
source_amd64=("https://nodejs.org/download/release/v${pkgver}/node-v${pkgver}-linux-x64.tar.xz")
source_arm64=("https://nodejs.org/download/release/v${pkgver}/node-v${pkgver}-linux-arm64.tar.xz")
source_armhf=("https://nodejs.org/download/release/v${pkgver}/node-v${pkgver}-linux-armv7l.tar.xz")
source_ppc64el=("https://nodejs.org/download/release/v${pkgver}/node-v${pkgver}-linux-ppc64le.tar.xz")
source_s390x=("https://nodejs.org/download/release/v${pkgver}/node-v${pkgver}-linux-s390x.tar.xz")
provides=("nodejs=$pkgver")
# uncomment to disable strip
#extensions=()
sha256sums_amd64=('c6fa75c841cbffac851678a472f2a5bd612fff8308ef39236190e1f8dbb0e567')
sha256sums_arm64=('44d1ffc5905c005ace4515ca6f8c090c4c7cfce3a9a67df0dba35c727590b8f6')
sha256sums_armhf=('b5a02f354f67d8f4bda8c563954f4805eccb4039f66a5dcdf755168aaac4e16c')
sha256sums_ppc64el=('ad01ea5905e8fb587f306d6cf44cce62a334aaa5e689f1f086ae4d03c4eaf2f2')
sha256sums_s390x=('1df248c207d8557ec1c554242758b5852bad5e0da49108d2dd94abcb9e9eae52')

prepare() {
  cd "${srcdir}/${_srcname}"
  mv share/man/man1/node.1 share/man/man1/${_pkgnameshort}.1
}

package() {
  cd "${srcdir}/${_srcname}"
  #Creating Directories
  install -m755 -d $pkgdir/usr/{bin,include,share/doc}
  # install
  install -D -m755 bin/node "$pkgdir/usr/libexec/${_pkgname}/node"
  mv lib/node_modules "$pkgdir/usr/share/${_pkgname}"
  mv include/node "$pkgdir/usr/include/${_pkgnameshort}"
  mv share/doc/node "$pkgdir/usr/share/doc/${_pkgname}"
  mv share/man "$pkgdir/usr/share/man"
  # ln libexec
  ln -s "/usr/libexec/${_pkgname}/node" "$pkgdir/usr/libexec/${_pkgname}/nodejs"
  ln -s "/usr/share/${_pkgname}/corepack/dist/corepack.js" "$pkgdir/usr/libexec/${_pkgname}/corepack"
  ln -s "/usr/share/${_pkgname}/npm/bin/npm-cli.js" "$pkgdir/usr/libexec/${_pkgname}/npm"
  ln -s "/usr/share/${_pkgname}/npm/bin/npm-cli.js" "$pkgdir/usr/libexec/${_pkgname}/npx"
  # ln bin
  ln -s "/usr/libexec/${_pkgname}/node" "$pkgdir/usr/bin/${_pkgnameshort}"
  ln -s "/usr/libexec/${_pkgname}/nodejs" "$pkgdir/usr/bin/${_pkgname}"
  ln -s "/usr/libexec/${_pkgname}/corepack" "$pkgdir/usr/bin/corepack${_pkgvermain}"
  ln -s "/usr/libexec/${_pkgname}/npm" "$pkgdir/usr/bin/npm${_pkgvermain}"
  ln -s "/usr/libexec/${_pkgname}/npm" "$pkgdir/usr/bin/npx${_pkgvermain}"
  # doc
  install -D -m644 CHANGELOG.md "$pkgdir/usr/share/doc/${_pkgname}/changelog"
  install -D -m644 README.md "$pkgdir/usr/share/doc/${_pkgname}/readme"
  install -D -m644 LICENSE "$pkgdir/usr/share/doc/${_pkgname}/license"
}