NAME="sudo"
DESC="Allows a system administrator to give certain users the ability to run commands as another user"
VERSION="1.9.14p3"
FILES=("https://www.sudo.ws/dist/sudo-$VERSION.tar.gz")
HASHES=("4cc21cf7c9a89290b230954aed0d1e11")
DEPENDS=("linux-pam")

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

  ./configure --prefix=/usr            \
            --libexecdir=/usr/lib      \
            --with-secure-path         \
            --with-all-insults         \
            --with-env-editor          \
            --with-pam                 \
            --docdir=/usr/share/doc/sudo-$VERSION \
            --with-passprompt="(sudo) password for %p: "
  
  make && make DESTDIR="$ROOTDIR" install
  ln -sfv libsudo_util.so.0.0.0 "$ROOTDIR/usr/lib/sudo/libsudo_util.so.0"
  mv "$ROOTDIR/etc/sudoers" "$ROOTDIR/etc/sudoers.default"

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