#!/bin/env beesh

# BEE_VERSION netcdf-4.6.1-1

SRCURL[0]="https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-${PKGVERSION}.tar.gz"
SRCURL[0]="/src/mariux/md5repo/ee81c593efc8a6229d9bcb350b6d7849/netcdf-4.6.1.tar.gz"

PATCHURL[0]=""

mee_patch() {
    bee_patch
}

#
# NOTE: to achieve a similar build result with enclosed autotools, one needs only:
#
#    CFLAGS='-fPIC -O2' ac_cv_search_H5DSis_scale=-lhdf5_hl ac_cv_search_H5Fflush='-lhdf5 -ldl' \
#    ./configure --prefix=/dev/shm/netcdf-4.6.1-test --enable-shared=no --disable-silent-rules
#
#  The above is so beautiful that I've felt a strong urge to preserve it in this bee file :)
#

mee_configure() {
    bee_configure                 \
      -DCMAKE_C_FLAGS=-fPIC       \
      -DCMAKE_INSTALL_LIBDIR=lib  \
      -DBUILD_SHARED_LIBS=OFF     \
      -DCMAKE_BUILD_TYPE=RELEASE  \
      -DCMAKE_VERBOSE_MAKEFILE=ON \
      -DENABLE_TESTS=OFF

}

mee_build() {
    bee_build
}

mee_install() {
    bee_install
}