Ticket #13115: Portfile-tftphpa.diff

File Portfile-tftphpa.diff, 3.7 KB (added by markd@…, 16 years ago)
  • Portfile

    old new  
    11# $Id: Portfile 30551 2007-10-31 05:02:34Z ryandesign@macports.org $
    22
    33PortSystem 1.0
     4
    45name            tftp-hpa
    5 version         0.40
     6version         0.48
    67categories      net
    78maintainers     digdog@macports.org
    89description     Enhanced port of the BSD TFTP server
     
    1516homepage        http://www.kernel.org/pub/software/network/tftp/
    1617master_sites    ${homepage}
    1718use_bzip2       yes
    18 checksums       md5 bfcdd49bf94900e610f2cc937d8980ef
     19checksums       md5 f2e0a1ca0c49ae46ecad26a54df3e887
     20
     21set tftp-root   ${prefix}/var/${name}/
     22
     23variant enable_upload description { If invoked with the server variant, tftp uploads
     24        are enabled; without the server variant, this variant has no effect } {}
     25
     26variant server description { Install launchd scripts to run tftpd at system boot } {
     27        startupitem.create      yes
     28        startupitem.name        tftpd
     29                if { ! [variant_isset enable_upload] } {
     30                        startupitem.executable  ${prefix}/sbin/tftpd -L -s ${tftp-root}
     31                } else {
     32                        startupitem.executable  ${prefix}/sbin/tftpd -L -c -s ${tftp-root}
     33                }
     34}
    1935
    2036configure.args  --mandir=\\\${prefix}/share/man
    2137
     
    2844        file delete ${destroot}${prefix}/share/man/man8/tftpd.8
    2945        file rename ${destroot}${prefix}/share/man/man8/in.tftpd.8 \
    3046                ${destroot}${prefix}/share/man/man8/tftpd.8
     47
     48        reinplace "s|in.tftpd|tftpd|g" \
     49                ${destroot}${prefix}/share/man/man8/tftpd.8
     50
     51        xinstall -m 777 -d ${tftp-root}
     52        destroot.keepdirs ${tftp-root}
    3153}
    3254
    33 # Tell the user that the server needs to be used through (x)inetd/launchd
     55# tftp-ha setup instructions
    3456post-install {
    35         ui_msg "\nTo use tftpd, you'll need to modify settings in inetd.conf/xinetd.d/launchd"
    36         ui_msg "depending on what you use on your system.\n\n"
    37         ui_msg "For inetd, something like:"
    38         ui_msg "tftp  dgram   udp  wait    nobody  ${prefix}/sbin/in.tftd  tftpd /private/tftpboot"
    39         ui_msg "should do it. And tell inetd to reload its configuration.\n\n"
    40         ui_msg "For xinetd (the default on Mac OS X 10.3), you should edit the file /etc/xinetd.d/tftp\n"
    41         ui_msg "and change the server setting from /usr/libexec/tftpd to ${prefix}/sbin/in.tftd\n"
    42         ui_msg "Then, use service(8) command to reload the xinetd configuration.\n\n"
    43         ui_msg "For launchd (the default on Mac OS X 10.4 Tiger), you'll need to change the \n"
    44         ui_msg "tftp.plist file in /System/Library/LaunchDaemons/. By changing the first string\n"
    45         ui_msg "value inside the ProgramArguments key from /usr/libexec/tftpd to ${prefix}/sbin/in.tftd\n"
    46         ui_msg "And start the server with the service(8) command.\n"
     57        ui_msg "\n
     58
     59***** Setup Instructions *****
     60
     61To run tftpd manually for download only access, use this command:
     62        sudo ${prefix}/sbin/tftpd -L -s <tftp-root-dir>
     63
     64To run tftpd manually and support tftp uploads, add \"-c\" to the command:
     65        sudo ${prefix}/sbin/tftpd -L -c -s <tftp-root-dir>
     66
     67You may run tftpd at system boot on OS X 10.4 or 10.5 if you installed tftp-hpa
     68using the server variant; if so, you may load it using launchctl:
     69        sudo launchctl load -w /Library/LaunchDaemons/org.macports.tftpd.plist
     70
     71By default, tftp-hpa listens to the tftp port specified in /etc/services (port 69)
     72on all local addresses.
     73
     74NOTE: When loading tftp-hpa using launchctl, make sure to place the files you want to serve
     75in ${tftp-root}, because that is the location set by the StartupItem.
     76
     77*******************************
     78
     79If you wish to run tftpd in inetd mode, you may make an inetd compatible .plist
     80file and replace the one installed by MacPorts in /Library/LaunchDaemons.  You
     81may use /System/Library/LaunchDaemons/tftp.plist as a template.
     82
     83\n"
    4784}
    4885