APP=openssl
VERSION=1.1.1k
BUILD=1sml
HOMEPAGE='https://www.openssl.org/'
DOWNLOAD='https://www.openssl.org/source/openssl-1.1.1k.tar.gz'
DESC="commercial-grade, robust, fully featured crypto library from OpenSSL Project that implements TLS and SSLv3"
REQUIRES="perl"

build() {
  mkandenterbuilddir
  rm -rf $APP-$VERSION

  tar xf $SRCDIR/$APP-$VERSION.tar.?z*
  cd $APP-$VERSION
  fixbuilddirpermissions

  if [ "$ARCH" = "aarch64" ]; then
    cpuflag="linux-aarch64"
  elif [ "$ARCH" = "x86_64" ]; then
    cpuflag="linux-x86_64"
  fi

  ./Configure "$cpuflag" \
     --prefix="/" \
     --openssldir=/etc/ssl \
     shared enable-md2 no-weak-ssl-ciphers

  make
  make install DESTDIR=$PKG

  rm -rf $PKG/share/doc

  cp LICENSE $PKGDOCS/


  mkfinalpkg
}

SHA512SUMS="
73cd042d4056585e5a9dd7ab68e7c7310a3a4c783eafa07ab0b560e7462b924e4376436a6d38a155c687f6942a881cfc0c1b9394afcde1d8c46bf396e7d51121  openssl-1.1.1k.tar.gz
"
