Import of pkgsrc-2015Q1

This commit is contained in:
2015-04-22 14:34:26 +02:00
committed by Lionel Sambuc
parent 9a8c06dafb
commit 4af1cdf7a9
25114 changed files with 870550 additions and 795435 deletions

2
net/publicfile-run/DESCR Normal file
View File

@@ -0,0 +1,2 @@
This package creates the users and group needed to run publicfile
services and provides NetBSD-style rc.d scripts.

View File

@@ -0,0 +1,22 @@
===========================================================================
$NetBSD: MESSAGE,v 1.1 2015/01/27 23:01:31 schmonz Exp $
Please read ${PREFIX}/share/doc/publicfile-run/README.pkgsrc.
To enable the...
FTP service:
- Set pubftpd=YES in /etc/rc.conf.
- Create ${VARBASE}/public with suitable contents.
This is the _root_ directory described at
<http://cr.yp.to/publicfile/ftpd.html> and the _D_/file directory
described at <http://cr.yp.to/publicfile/configure.html>.
HTTP service:
- Set pubhttpd=YES in /etc/rc.conf.
- Create ${VARBASE}/public with suitable contents.
This is the _root_ directory described at
<http://cr.yp.to/publicfile/httpd.html> and the _D_/file directory
described at <http://cr.yp.to/publicfile/configure.html>.
===========================================================================

View File

@@ -0,0 +1,59 @@
# $NetBSD: Makefile,v 1.1 2015/01/27 23:01:31 schmonz Exp $
DISTNAME= publicfile-run-20150109
CATEGORIES= net
MASTER_SITES= # empty
DISTFILES= # empty
MAINTAINER= jlmuir@imca-cat.org
COMMENT= Configures publicfile to serve public files
LICENSE= 2-clause-bsd
DEPENDS+= publicfile>=0.52:../../net/publicfile
DEPENDS+= daemontools-[0-9]*:../../sysutils/daemontools
DEPENDS+= ucspi-tcp-[0-9]*:../../net/ucspi-tcp
WRKSRC= ${WRKDIR}
NO_BUILD= yes
NO_CHECKSUM= yes
REPLACE_SH= libexec-pubftpd
PKG_GROUPS= pubfile
PKG_USERS+= pubftp:pubfile
PKG_USERS+= pubhttp:pubfile
PKG_USERS+= publog:pubfile
RCD_SCRIPTS= pubfile pubftpd pubhttpd
MESSAGE_SUBST+= VARBASE=${VARBASE:Q}
EVAL_PREFIX+= DAEMONTOOLS_PREFIX=daemontools
EVAL_PREFIX+= PUBLICFILE_PREFIX=publicfile
EVAL_PREFIX+= UCSPI_TCP_PREFIX=ucspi-tcp
FILES_SUBST+= PKGNAME=${PKGNAME:Q}
FILES_SUBST+= DAEMONTOOLS_PREFIX=${DAEMONTOOLS_PREFIX:Q}
FILES_SUBST+= PUBLICFILE_PREFIX=${PUBLICFILE_PREFIX:Q}
FILES_SUBST+= UCSPI_TCP_PREFIX=${UCSPI_TCP_PREFIX:Q}
SUBST_CLASSES+= paths
SUBST_MESSAGE.paths= Substituting paths.
SUBST_STAGE.paths= post-patch
SUBST_FILES.paths= libexec-pubftpd
SUBST_VARS.paths= UCSPI_TCP_PREFIX
BUILD_DEFS+= VARBASE
INSTALLATION_DIRS= libexec share/doc/publicfile-run
.include "../../mk/bsd.prefs.mk"
post-extract:
${CP} ${FILESDIR}/libexec-pubftpd.sh ${WRKSRC}/libexec-pubftpd
do-install:
${INSTALL_SCRIPT} ${WRKSRC}/libexec-pubftpd \
${DESTDIR}${PREFIX}/libexec/pubftpd
${INSTALL_DATA} ${FILESDIR}/README.pkgsrc \
${DESTDIR}${PREFIX}/share/doc/publicfile-run
.include "../../mk/bsd.pkg.mk"

3
net/publicfile-run/PLIST Normal file
View File

@@ -0,0 +1,3 @@
@comment $NetBSD: PLIST,v 1.1 2015/01/27 23:01:31 schmonz Exp $
libexec/pubftpd
share/doc/publicfile-run/README.pkgsrc

View File

@@ -0,0 +1,11 @@
Getting help
============
You've installed an automated and customized publicfile-run package.
If you're having trouble getting the publicfile daemons to run, ask
the package's maintainer:
<URL:mailto:jlmuir@imca-cat.org>
If you need to ask for help on the publicfile list, please mention that
you're using the publicfile-run package from pkgsrc.

View File

@@ -0,0 +1,16 @@
#!/bin/sh
#
# Executes tcpserver with "pubftpd" as the 0th argument and with a fixed banner
# appropriate for DJB's publicfile FTP server.
#
# The reason for this script, as opposed to invoking tcpserver directly, is
# that the banner (specified with the -B option) needs to include a trailing
# carriage-return and newline (\015\012) which is difficult, if not impossible,
# to specify in a NetBSD rc(8) script because rc(8) uses "eval" to evaluate the
# constructed command.
#
exec @UCSPI_TCP_PREFIX@/bin/argv0 @UCSPI_TCP_PREFIX@/bin/tcpserver pubftpd \
-B'220 Features: a p .
' "$@"

View File

@@ -0,0 +1,60 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: pubfile.sh,v 1.1 2015/01/27 23:01:31 schmonz Exp $
#
# @PKGNAME@ master script for administrators to control publicfile
# services.
#
# For Red Hat chkconfig
# chkconfig: - 85 15
# description: DJB's publicfile HTTP and FTP services
#
# KEYWORD: nostart
if [ -f /etc/rc.subr ]; then
. /etc/rc.subr
fi
rcd_dir=`@DIRNAME@ $0`
# NOTE: run_rc_command sets $rc_arg
#
forward_commands()
{
# Backward compat with NetBSD <1.6:
[ -z "$rc_arg" ] && rc_arg=$_arg
for file in $COMMAND_LIST; do
$rcd_dir/$file $rc_arg
done
}
reverse_commands()
{
# Backward compat with NetBSD <1.6:
[ -z "$rc_arg" ] && rc_arg=$_arg
REVCOMMAND_LIST=
for file in $COMMAND_LIST; do
REVCOMMAND_LIST="$file $REVCOMMAND_LIST"
done
for file in $REVCOMMAND_LIST; do
$rcd_dir/$file $rc_arg
done
}
COMMAND_LIST="pubftpd pubhttpd"
name="pubfile"
start_cmd="forward_commands"
stop_cmd="reverse_commands"
status_cmd="forward_commands"
extra_commands="status"
if [ -f /etc/rc.subr ]; then
run_rc_command "$1"
else
_arg="$1"
${start_cmd}
fi

View File

@@ -0,0 +1,54 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: pubftpd.sh,v 1.1 2015/01/27 23:01:31 schmonz Exp $
#
# @PKGNAME@ script to control publicfile ftpd (FTP server)
#
# PROVIDE: pubftpd
# REQUIRE: NETWORKING mountcritremote syslogd
# BEFORE: DAEMON
name="pubftpd"
# User-settable rc.conf variables and their default values:
: ${pubftpd_root:="@VARBASE@/public"}
: ${pubftpd_postenv:=""}
: ${pubftpd_datalimit:="50000"}
: ${pubftpd_localname:="0"}
: ${pubftpd_backlog:="20"}
: ${pubftpd_conlimit:="40"}
: ${pubftpd_host:="0"}
: ${pubftpd_port:="21"}
: ${pubftpd_log:="YES"}
: ${pubftpd_logcmd:="logger -t nb${name} -p ftp.info"}
: ${pubftpd_nologcmd:="@DAEMONTOOLS_PREFIX@/bin/multilog -*"}
if [ -f /etc/rc.subr ]; then
. /etc/rc.subr
fi
rcvar=${name}
required_dirs="${pubftpd_root}"
command="@PREFIX@/libexec/pubftpd"
procname=${name}
start_precmd="pubftpd_precmd"
pubftpd_precmd()
{
if [ -f /etc/rc.subr ]; then
checkyesno pubftpd_log || pubftpd_logcmd=${pubftpd_nologcmd}
fi
command="@SETENV@ - ${pubftpd_postenv} @DAEMONTOOLS_PREFIX@/bin/envuidgid pubftp @DAEMONTOOLS_PREFIX@/bin/softlimit -o20 -d${pubftpd_datalimit} @PREFIX@/libexec/pubftpd -vDRH -l${pubftpd_localname} -b${pubftpd_backlog} -c${pubftpd_conlimit} ${pubftpd_host} ${pubftpd_port} @PUBLICFILE_PREFIX@/publicfile/bin/ftpd ${pubftpd_root} 2>&1 | @DAEMONTOOLS_PREFIX@/bin/setuidgid publog ${pubftpd_logcmd}"
command_args="&"
rc_flags=""
}
if [ -f /etc/rc.subr ]; then
load_rc_config $name
run_rc_command "$1"
else
@ECHO_N@ " ${name}"
pubftpd_precmd
eval ${command} ${pubftpd_flags} ${command_args}
fi

View File

@@ -0,0 +1,57 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: pubhttpd.sh,v 1.1 2015/01/27 23:01:31 schmonz Exp $
#
# @PKGNAME@ script to control publicfile httpd (HTTP server)
#
# PROVIDE: pubhttpd
# REQUIRE: NETWORKING mountcritremote syslogd
# BEFORE: DAEMON
name="pubhttpd"
# User-settable rc.conf variables and their default values:
: ${pubhttpd_root:="@VARBASE@/public"}
: ${pubhttpd_postenv:=""}
: ${pubhttpd_datalimit:="50000"}
: ${pubhttpd_localname:="0"}
: ${pubhttpd_backlog:="50"}
: ${pubhttpd_conlimit:="100"}
: ${pubhttpd_host:="0"}
: ${pubhttpd_port:="80"}
: ${pubhttpd_log:="YES"}
: ${pubhttpd_logcmd:="logger -t nb${name} -p ftp.info"}
: ${pubhttpd_nologcmd:="@DAEMONTOOLS_PREFIX@/bin/multilog -*"}
if [ -f /etc/rc.subr ]; then
. /etc/rc.subr
fi
rcvar=${name}
required_dirs="${pubhttpd_root}"
command="@UCSPI_TCP_PREFIX@/bin/tcpserver"
procname=${name}
start_precmd="pubhttpd_precmd"
pubhttpd_precmd()
{
# tcpserver(1) is akin to inetd(8), but runs one service per process.
# We want to signal only the tcpserver process responsible for the HTTP
# service. Use argv0(1) to set the process name to "pubhttpd".
if [ -f /etc/rc.subr ]; then
checkyesno pubhttpd_log || pubhttpd_logcmd=${pubhttpd_nologcmd}
fi
command="@SETENV@ - ${pubhttpd_postenv} @DAEMONTOOLS_PREFIX@/bin/envuidgid pubhttp @DAEMONTOOLS_PREFIX@/bin/softlimit -o20 -d${pubhttpd_datalimit} @UCSPI_TCP_PREFIX@/bin/argv0 @UCSPI_TCP_PREFIX@/bin/tcpserver ${name} -vDRH -l${pubhttpd_localname} -b${pubhttpd_backlog} -c${pubhttpd_conlimit} ${pubhttpd_host} ${pubhttpd_port} @PUBLICFILE_PREFIX@/publicfile/bin/httpd ${pubhttpd_root} 2>&1 | @DAEMONTOOLS_PREFIX@/bin/setuidgid publog ${pubhttpd_logcmd}"
command_args="&"
rc_flags=""
}
if [ -f /etc/rc.subr ]; then
load_rc_config $name
run_rc_command "$1"
else
@ECHO_N@ " ${name}"
pubhttpd_precmd
eval ${command} ${pubhttpd_flags} ${command_args}
fi