description="Encrypt arbitrary TCP connections inside SSL so you can communicate over secure channels"
url="http://www.stunnel.org"
contributors="Berlius, Fanch, Tnut, Greg"
packager="tnut <tnut@nutyx.org>"


name=stunnel
version=5.55
nutyx_version=11.1


source=(http://downloads.nutyx.org/files/nutyx-${nutyx_version}.tar.xz
	ftp://ftp.stunnel.org/stunnel/archive/5.x/$name-$version.tar.gz
	stunnel.conf)
prepare () {
SN="stunnel"
IDN="51"

if ! (getent group $SN > /dev/null); then
   groupadd -g $IDN $SN
fi
if ! (getent passwd $SN > /dev/null); then
   useradd -c "stunnel Daemon" -d /var/lib/$SN \
   -u $IDN -g $SN -s /bin/false $SN
fi

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


}


package () {

cd $name-$version
make DESTDIR=$PKG install


cd ../nutyx-${nutyx_version}
make DESTDIR=$PKG install-stunnel

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

}
