(define-module (glicid packages admin)
  #:use-module ((gnu packages admin) #:prefix gnu:)
  #:use-module (gnu packages base)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages cyrus-sasl)
  #:use-module (gnu packages groff)
  #:use-module (gnu packages hurd)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages openldap)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages tls)
  #:use-module (guix build-system gnu)
  #:use-module (guix download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix utils)
)


(define-public shadow
  (package
    (inherit gnu:shadow)
    (name "shadow")
    (version "4.11.1")
    (source (origin
      (method url-fetch)
      (uri (list
        (string-append "https://github.com/shadow-maint/shadow/releases/download/v" version "/shadow-" version ".tar.xz")
      ))
      (sha256 (base32 "15bwf2krh4crj4w2frkzw9pkxiwbq7h56m8wk8w5zbmjb3797w21"))
    ))
  )
)

(define-public sudo
  (let* ((sudo-minimal gnu:sudo))
    (package
      (inherit sudo-minimal)
      (name (string-append (package-name sudo-minimal) "-with-ldap"))
      (arguments
       (substitute-keyword-arguments (package-arguments sudo-minimal)
         ((#:configure-flags flags)
          `(append (list
                     "--enable-sasl"
                     "--with-ldap"
                     "--enable-openssl"
                     "--with-nsswitch")
                   ,flags))))
      (inputs (modify-inputs (package-inputs sudo-minimal)
                (append openldap
                        openssl
                        cyrus-sasl)))
      (native-inputs (modify-inputs (package-native-inputs sudo-minimal)
                       (append pkg-config))))))
