NAME="jasper"
DESC="Open-source initiative to provide a free software-based reference implementation of the JPEG-2000 codec"
VERSION="4.0.0"
FILES=("https://github.com/jasper-software/jasper/archive/version-$VERSION/jasper-$VERSION.tar.gz")
HASHES=("1578be3c1e329fdaae35d98dd804ed95")
DEPENDS=("libjpeg-turbo")

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

  mkdir BUILD
  cd    BUILD

  cmake -DCMAKE_INSTALL_PREFIX=/usr                         \
      -DCMAKE_BUILD_TYPE=Release                            \
      -DCMAKE_SKIP_INSTALL_RPATH=YES                        \
      -DJAS_ENABLE_DOC=NO                                   \
      -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/jasper-$VERSION \
      .. 
  make && make DESTDIR="$ROOTDIR" install

  cd ../.. && rm -r $NAME-version-$VERSION
}
