NAME="cmake"
DESC="Modern toolset used for generating Makefiles"
VERSION="3.27.2"
FILES=("https://cmake.org/files/v3.27/cmake-$VERSION.tar.gz")
HASHES=("07786cd23c3d0aa9c2fef69efb13662b")
DEPENDS=("curl" "libarchive")

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

  sed -i '/"lib64"/s/64//' Modules/GNUInstallDirs.cmake
  ./bootstrap --prefix=/usr         \
            --system-libs           \
            --mandir=/share/man     \
            --no-system-jsoncpp     \
            --no-system-cppdap      \
            --no-system-librhash    \
            --docdir=/share/doc/cmake-$VERSION
  make && make DESTDIR=${ROOTDIR} install

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