app=proftpd
version=1.3.6
build=1sml
homepage="http://www.proftpd.org/"
download="https://github.com/proftpd/proftpd/archive/refs/tags/v1.3.6.tar.gz"
desc="Secure and configurable FTP server"
requires="attr netbsd-curses libcap"

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

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

  ./configure \
    --prefix="" \
    --sysconfdir=/etc \
    --sbindir=/bin \
    --enable-ipv6 

  make
  make install DESTDIR=$pkg

  cp COPYING $pkgdocs/

  rm -f $pkg/etc/proftpd/* $pkg/etc/proftpd.conf
  cat $srcdir/proftpd.conf > $pkg/etc/proftpd.conf.new
  cat $srcdir/ftpusers > $pkg/etc/ftpusers.new

  mkdir -p $pkg/var/db/proftpd
  chown nobody:nogroup $pkg/var/db/proftpd

  mkfinalpkg
}

sha512sums="
434897811595327c368d39f877e1bdf9840682964efc8e71f5a81c85f22451c061fc520e09e26cd0faa6eb69ca7d6bc79ebfd1bf9978c703f6f2277485e50006  proftpd-1.3.6.tar.lz
"
