app=openssl
version=1.1.1q
build=1sml
homepage="https://www.openssl.org/"
download="https://www.openssl.org/source/openssl-$version.tar.gz"
desc="Commercial-grade, full-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 LIBDIR=lib DESTDIR=$pkg

  cp LICENSE $pkgdocs/

  mkfinalpkg
}

sha512sums="
cb9f184ec4974a3423ef59c8ec86b6bf523d5b887da2087ae58c217249da3246896fdd6966ee9c13aea9e6306783365239197e9f742c508a0e35e5744e3e085f  openssl-1.1.1q.tar.gz
"
