NAME="nasm"
DESC="80x86 assembler designed for portability and modularity"
VERSION="2.16.01"
FILES=(
  "https://www.nasm.us/pub/nasm/releasebuilds/$VERSION/nasm-$VERSION.tar.xz"
  "https://www.nasm.us/pub/nasm/releasebuilds/$VERSION/nasm-$VERSION-xdoc.tar.xz"
)
HASHES=(
  "d755ba0d16f94616c2907f8cab7c748b"
  "801867a71f4c3d513a927ba09b3fa12ef9c7c5c98c0aaafc59c7f342faeab2c9"
)
DEPENDS=()

PACKAGE() {
  tar xf $NAME-$VERSION.tar.xz
  cd $NAME-$VERSION

  tar -xf ../nasm-$VERSION-xdoc.tar.xz --strip-components=1
  ./configure --prefix=/usr
  make && make DESTDIR="$ROOTDIR" install

  install -m755 -d         "$ROOTDIR/usr/share/doc/nasm-$VERSION/html"
  cp -v doc/html/*.html    "$ROOTDIR/usr/share/doc/nasm-$VERSION/html"
  cp -v doc/*.{txt,ps,pdf} "$ROOTDIR/usr/share/doc/nasm-$VERSION"

  cd .. && rm -rf $NAME-$VERSION
}
