# Maintainer: PktSurf <smlinux@pktsurf.in>
app=openssl
version=1.1.1t
build=2sml
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 1.x protocol"
requires="perl"

prepbuilddir() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version
  fixbuilddirpermissions
}

build() {
  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 DOCDIR="/share/doc/$app-$version" DESTDIR=$pkg

  cp LICENSE $pkgdocs/

  mkfinalpkg
}

sha512sums="
f89af9fa565f77bc1d94b76e87b9ffa0d7e54f6f2c10363b428215ba0365b927ff2a6cd4dab39858b233c7dff02091b6b3643d23f4443299f72facab48d0ec2e  openssl-1.1.1t.tar.lz
"
