makedepends=(systemd)

description="Encrypt arbitrary TCP connections inside SSL so you can communicate over secure channels"
url="http://www.stunnel.org"

packager="Great-OS Team"
maintainer="Great-OS Team"

name=stunnel
version=5.77
release=1

source=(https://www.stunnel.org/downloads/archive/5.x/$name-$version.tar.gz
        stunnel.conf)

build () {
  cd $name-$version
  ./configure --prefix=/usr \
              --sysconfdir=/etc \
              --localstatedir=/var \
  
  make
}

package () {
  cd $name-$version
  make DESTDIR=$PKG install

  sed -i 's@$2/bin/openssl@/bin/openssl@g' tools/makecert.sh

  install -v -m750 -d $PKG/etc/stunnel
  cp -v ../stunnel.conf $PKG/etc/stunnel/stunnel.conf
}
