A="publicfile-0.52.tar.gz" S="${WORKDIR}/${A}" # Don't need to say this DESCRIPTION="A very secure chrooted http and ftp server" SRC_URI="http://cr.yp.to/publicfile/${A}" HOMEPAGE="http://cr.yp.to/publicfile.html" DEPEND="sys-apps/daemontools sys-apps/ucspi-tcp" pkg_setup() { } src_unpack() { unpack ${A} cd ${S} if [ -e conf-cc ] ; then rm conf-cc fi echo "gcc ${CFLAGS}" > conf-cc if [ -e conf-ld ] ; then rm conf-ld fi echo "gcc" > conf-ld if [ -e conf-home ] ; then rm conf-home fi echo "/usr/${PN}" > conf-home } src_compile() { cd ${S} emake || die } src_install() { einfo "Installing publicfile in ${S}" emake setup check || die local users users="" users=`cat /etc/passwd | cut -f1 -d ":" | grep "^ftp$"` if [ ${users} = "" ] then einfo "Adding user ftp" useradd ftp fi users="" users=`cat /etc/passwd | cut -f1 -d ":" | grep "^ftplog$"` if [ ${users} = "" ] then einfo "Adding user ftplog" useradd ftplog fi dodoc CHANGES FILES README SYSDEPS TARGETS TODO VERSION } pkg_postinst() { einfo "Creating Publicfile html dirs under /public" /usr/${PN}/bin/configure ftp ftplog /public 0 einfo "Informing svscan about publicfile" ln -s /public/httpd /public/ftpd /service if ! [ -e /public/file/0/index.html ] then echo "Hello, this is Publicfile - http and ftp secure server at your service" > /public/file/0/index.html fi }