(define-module (glicid packages nfs)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system cmake)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages shells)
  #:use-module (gnu packages python)
  #:use-module (gnu packages kerberos)
  #:use-module (gnu packages gsasl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages onc-rpc)
  #:use-module (gnu packages flex)
  #:use-module (gnu packages bison)
  #:use-module (gnu packages datastructures)
  #:use-module (gnu packages file-systems)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages jemalloc)
  #:use-module (gnu packages storage)
;  #:use-module (glicid packages storage)
)

(define-public nfs-ganesha
  (package
    (name "nfs-ganesha")
    (version "3.5")
    (source
      (origin
        (method git-fetch)
        (uri
          (git-reference
            (url "https://github.com/nfs-ganesha/nfs-ganesha.git")
            (commit (string-append "V" version))
            (recursive? #t)
          )
        )
        (sha256 (base32 "0rdg3mjqrr4a8mywxkfis25gkbn4fylw42hg1d9cvp4dwrjk3hl4"))
        (file-name (string-append name "-" version "-checkout"))
      )
    )
    (build-system cmake-build-system)
    (arguments `(
      #:configure-flags (list
        (string-append "-DLIB_INSTALL_DIR=" (assoc-ref %outputs "out") "/lib" )
      )
      #:phases (modify-phases %standard-phases
        (add-after 'unpack 'chdir (
          lambda _ (chdir "src")
          #t
        )) 
      )
    ))
    (inputs `(
      ("perl", perl)
      ("oksh", oksh)
      ("python-3", python-3)
      ("mit-krb5", mit-krb5)
      ("gss", gss)
      ("pkg-config", pkg-config)
      ("jemalloc", jemalloc)
      ("ceph:lib", ceph "lib")
      ("libnfsidmap", libnfsidmap)
      ("libnfs", libnfs)
      ("liburcu", liburcu)
      ("bison", bison)
      ("flex", flex)
      ("libnsl", libnsl)
      ("util-linux", util-linux "lib")
    ))
    (synopsis "nfs-ganesha")
    (description "NFS-Ganesha.")
    (home-page "https://")
    (license license:gpl3+)
  )
)
