- update to 5.1

- add a simple rc.d script
- move files/patch to post-patch:
  o in6 part incorporated upstream
  o LOG_FTP handled in post-patch already
  o tzset() now handled in post-patch

Submitted by:	infofarmer
Feature safe:	yes
This commit is contained in:
Brooks Davis 2011-12-02 22:33:35 +00:00
parent 551259fe10
commit 4723a97981
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=286790
4 changed files with 31 additions and 29 deletions

View File

@ -6,7 +6,7 @@
#
PORTNAME= tftp-hpa
PORTVERSION= 0.49
PORTVERSION= 5.1
CATEGORIES= ftp
MASTER_SITES= ${MASTER_SITE_KERNEL_ORG}
MASTER_SITE_SUBDIR= software/network/tftp
@ -17,6 +17,7 @@ COMMENT= An advanced tftp server
USE_BZIP2= yes
GNU_CONFIGURE= yes
USE_GMAKE= yes
USE_RC_SUBR= tftpd
PLIST_FILES= bin/tftp \
libexec/in.tftpd
@ -36,6 +37,7 @@ post-patch:
@${REINPLACE_CMD} -e 's,SBINDIR,LIBEXECDIR,g' \
${WRKSRC}/tftpd/Makefile
@${REINPLACE_CMD} -e 's,LOG_DAEMON,LOG_FTP,g' \
-e 's,openlog(,tzset();openlog(,g' \
${WRKSRC}/tftpd/tftpd.c
.ifdef PORTDOCS

View File

@ -1,2 +1,2 @@
SHA256 (tftp-hpa-0.49.tar.bz2) = 9055064ea0aea223e82e99cbdead970dc46fa9456c91a7b3d6c0b37b62b6dd8c
SIZE (tftp-hpa-0.49.tar.bz2) = 91829
SHA256 (tftp-hpa-5.1.tar.bz2) = fd3f92064f26367051af91ea44b2553566e3d96cd73b4ccdf28e547e18d0e24c
SIZE (tftp-hpa-5.1.tar.bz2) = 93919

View File

@ -1,26 +0,0 @@
$FreeBSD$
--- tftpd/tftpd.c.orig
+++ tftpd/tftpd.c
@@ -355,7 +355,10 @@
p = strrchr(argv[0], '/');
__progname = (p && p[1]) ? p + 1 : argv[0];
- openlog(__progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
+ /* syslog in localtime */
+ tzset();
+
+ openlog(__progname, LOG_PID | LOG_NDELAY, LOG_FTP);
srand(time(NULL) ^ getpid());
@@ -841,7 +844,7 @@
sizeof(bindaddr4.sin_addr));
#ifdef HAVE_IPV6
} else if ((from.sa.sa_family == AF_INET6) &&
- IN6_IS_ADDR_UNSPECIFIED(SOCKADDR_P(&myaddr))) {
+ IN6_IS_ADDR_UNSPECIFIED((struct in6_addr*)SOCKADDR_P(&myaddr))) {
memcpy(SOCKADDR_P(&myaddr), &bindaddr6.sin6_addr,
sizeof(bindaddr6.sin6_addr));
#endif

View File

@ -0,0 +1,26 @@
#!/bin/sh
# $FreeBSD$
#
# PROVIDE: tftpd
# REQUIRE: NETWORKING
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable tftpd:
#
# tftpd_enable="YES"
#
. /etc/rc.subr
name="tftpd"
rcvar=`set_rcvar`
pidfile=${tftpd_pidfile:-"/var/run/tftpd.pid"}
command="%%PREFIX%%/libexec/in.tftpd"
command_args="-P $pidfile -l"
load_rc_config $name
: ${tftpd_enable:="NO"}
: ${tftpd_flags:="-s %%PREFIX%%/tftp"}
run_rc_command "$1"