Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 2229 - DJB's publicfile (a static and safe http and ftp daemon)
Summary: DJB's publicfile (a static and safe http and ftp daemon)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Thilo Bangert (RETIRED) (RETIRED)
URL: http://cr.yp.to/publicfile.html
Whiteboard:
Keywords:
: 2314 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-04-29 09:45 UTC by jakd
Modified: 2003-02-04 19:42 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
publicfile.tgz (publicfile.tgz,722 bytes, application/octet-stream)
2002-04-29 09:47 UTC, jakd
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jakd 2002-04-29 09:45:48 UTC
included is publicfile.tar.gz which is an ebuild of DJB's publicfile http and
ftp daemon.   it is completely described at the url provided.

we may want to provide a virtual/httpd and virtual/ftpd sometime to avoid
possible port collisions.
Comment 1 jakd 2002-04-29 09:47:20 UTC
Created attachment 713 [details]
publicfile.tgz
Comment 2 jakd 2002-04-29 09:51:13 UTC
#
#

S=${WORKDIR}/${P}
DESCRIPTION="publish files through FTP and HTTP"
SRC_URI="http://cr.yp.to/publicfile/${P}.tar.gz"
HOMEPAGE="http://cr.yp.to/publicfile.html"

RDEPEND=">=sys-apps/daemontools-0.70
         >=sys-apps/ucspi-tcp-0.83"

src_compile() {                           
        echo "gcc ${CFLAGS}" > conf-cc
        echo "gcc" > conf-ld
        echo "/usr/local/publicfile" > conf-home
        emake || die "emake failed"
}

src_install() {                               
        into /usr/local
        dobin ftpd httpd
        into /usr/local/publicfile
        dobin configure
        dodoc CHANGES FILES README SYSDEPS TARGETS TODO VERSION
}
Comment 3 Arcady Genkin (RETIRED) gentoo-dev 2002-04-29 11:08:18 UTC
I'll take this one.
Comment 4 Arcady Genkin (RETIRED) gentoo-dev 2002-04-29 11:17:05 UTC
Thanks for the submission.  Could you please update the ebuild the following way:

1. It should install under /usr (it is not Gentoo's policy to install anything
under /usr/local).
2. If you meant /usr/local/publicfile as a place where publicfile will keep the
served files and stuff, perhaps it would be a better idea to use
/home/publicfile instead, the way Gentoo's apache does it.  If not, then what
was that directory for?
3. It would be nice to include a startup script.
Comment 5 jakd 2002-04-29 11:29:40 UTC
Arcady~

1. I installed it in /usr/local to comply with DJBs distribution restrictions
and online usage instructions (stated here:
http://cr.yp.to/publicfile/install.html).   He basically wants a consistent user
experience across all platforms while adhering to the current documentation on
his site.

2. /usr/local/publicfile is meant to adhere to that stated in 1 and to give a
namespace to the 'configure' program in this directory.

3. /usr/local/publicfile/configure creates both the serving directory and
startup scripts (it's svscan based).  Doing this at buildtime would be bad iff
apache, ftpd, or another httpd/ftpd server is running.   svscan will spin and
hog the processor trying to start up these services when the ports are already
bound.   This is why I mentioned perhaps providing a virtual/httpd and
virtual/ftpd to give warning to the user(?).

I wanted to voice these concerns before changing anything.   Suggestions?  
Please have a read of http://cr.yp.to/distributors.html for DJBs distribution
restrictions.

tag,jakd
Comment 6 Troy Dack 2002-05-01 22:33:25 UTC
Just to play a bit of devils advocate re DJB's distribution policy.

Gentoo is only mirroring the source -- this is allowed
Gentoo is not distributing pre-compiled binaries (as such)

In relation to:
"installing your package produces exactly the same files, in exactly the same 
locations, that a user would obtain by installing one of my packages listed 
above"

What is stopping an end user of the packages manually modifying the configure 
process to install the components where they want them to go -- not where DJB 
wants them (it's my system, not his!)?

I guess what it comes down to is that gentoo is not distributing modified 
versions of DJB's source, or precompiled binaries (the end user does that!) -- 
they are simply providing a convenient method to install that application on 
their system.
Comment 7 Arcady Genkin (RETIRED) gentoo-dev 2002-05-02 20:55:44 UTC
*** Bug 2314 has been marked as a duplicate of this bug. ***
Comment 8 Arcady Genkin (RETIRED) gentoo-dev 2002-05-04 07:01:38 UTC
Thilo: since you seem to be our DJBware specialist, would you like to deal with
thius one?  Feel free to punt it back to me if you don't have the time.
[reassigning to bangert]
Comment 9 jakd 2002-05-04 17:30:29 UTC
good point.   here's an updated ebuild:


#
#

S=${WORKDIR}/${P}
DESCRIPTION="publish files through FTP and HTTP"
SRC_URI="http://cr.yp.to/publicfile/${P}.tar.gz"
HOMEPAGE="http://cr.yp.to/publicfile.html"

RDEPEND=">=sys-apps/daemontools-0.70
         >=sys-apps/ucspi-tcp-0.83"

src_compile() {                           
        echo "gcc ${CFLAGS}" > conf-cc
        echo "gcc" > conf-ld
        echo "/usr" > conf-home
        emake || die "emake failed"
}

src_install() {                               
        exeinto /usr/bin
        doexe ftpd httpd
        newexe configure publicfile-conf
        dodoc CHANGES FILES README SYSDEPS TARGETS TODO VERSION
}

pkg_setup() {
        groupadd nofiles
        id ftp || useradd -g nofiles -d /public ftp
        id ftplog || useradd -g nofiles -d /public ftplog
}

pkg_postinst() {
        /usr/bin/publicfile-conf ftp ftplog /public `hostname`
        echo
        echo -e "\e[32;01m httpd and ftpd are serving out of /public.\033[0m"
        echo -e "\e[32;01m remember to start the servers with:\033[0m"
        echo -e "\e[32;01m   ln -s /public/httpd /public/ftpd /service\033[0m"
        echo
}

pkg_postrm() {
        userdel ftplog
}
Comment 10 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2002-05-09 05:28:51 UTC
is committed!  
  
i changed /public to /home/public and added a LICENSE (as-is  
for now)  
 
its in net-www 
 
thanks for the contribution  
regards  
Thilo  
Comment 11 jakd 2002-05-09 09:19:18 UTC
excellent.   one fix: we need to change the postinst description to read
"serving out of /home/public" instead of "serving out of /public".   also, the
soft link description needs to be updated to: "ln -s /home/public/httpd
/home/public/ftpd /service".

thanks!