NAME="liboauth"
DESC="Collection of POSIX-C functions implementing the OAuth Core RFC 5849 standard"
VERSION="1.0.3"
FILES=(
  "https://downloads.sourceforge.net/liboauth/liboauth-$VERSION.tar.gz"
  "https://www.linuxfromscratch.org/patches/blfs/12.0/liboauth-$VERSION-openssl-1.1.0-3.patch" 
)
HASHES=(
  "689b46c2b3ab1a39735ac33f714c4f7f"
  "fad8bdb5e0d97c353099304616c847622251a9d5dd00552d48100569e6f25e03" 
)
DEPENDS=("curl" "nss")

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

  patch -Np1 -i ../liboauth-$VERSION-openssl-1.1.0-3.patch
  ./configure --prefix=/usr --disable-static
  make && make dox && make DESTDIR="$ROOTDIR" install
  
  install -v -dm755 "$ROOTDIR/usr/share/doc/liboauth-$VERSION"
  cp -rv doc/html/* "$ROOTDIR/usr/share/doc/liboauth-$VERSION"

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