pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/publicfile-run Add publicfile-run, a package that ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3a99608dc867
branches:  trunk
changeset: 645370:3a99608dc867
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Tue Jan 27 23:01:31 2015 +0000

description:
Add publicfile-run, a package that creates the users and group
needed to run publicfile services and provides NetBSD-style rc.d
scripts, in the pkgsrc tradition of qmail-run and djbdns-run. By
J. Lewis Muir, from wip.

diffstat:

 net/publicfile-run/DESCR                    |   2 +
 net/publicfile-run/MESSAGE                  |  22 ++++++++++
 net/publicfile-run/Makefile                 |  59 ++++++++++++++++++++++++++++
 net/publicfile-run/PLIST                    |   3 +
 net/publicfile-run/files/README.pkgsrc      |  11 +++++
 net/publicfile-run/files/libexec-pubftpd.sh |  16 +++++++
 net/publicfile-run/files/pubfile.sh         |  60 +++++++++++++++++++++++++++++
 net/publicfile-run/files/pubftpd.sh         |  54 ++++++++++++++++++++++++++
 net/publicfile-run/files/pubhttpd.sh        |  57 +++++++++++++++++++++++++++
 9 files changed, 284 insertions(+), 0 deletions(-)

diffs (truncated from 320 to 300 lines):

diff -r acdd8c7cdf18 -r 3a99608dc867 net/publicfile-run/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/publicfile-run/DESCR  Tue Jan 27 23:01:31 2015 +0000
@@ -0,0 +1,2 @@
+This package creates the users and group needed to run publicfile
+services and provides NetBSD-style rc.d scripts.
diff -r acdd8c7cdf18 -r 3a99608dc867 net/publicfile-run/MESSAGE
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/publicfile-run/MESSAGE        Tue Jan 27 23:01:31 2015 +0000
@@ -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>.
+
+===========================================================================
diff -r acdd8c7cdf18 -r 3a99608dc867 net/publicfile-run/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/publicfile-run/Makefile       Tue Jan 27 23:01:31 2015 +0000
@@ -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@localhost
+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"
diff -r acdd8c7cdf18 -r 3a99608dc867 net/publicfile-run/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/publicfile-run/PLIST  Tue Jan 27 23:01:31 2015 +0000
@@ -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
diff -r acdd8c7cdf18 -r 3a99608dc867 net/publicfile-run/files/README.pkgsrc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/publicfile-run/files/README.pkgsrc    Tue Jan 27 23:01:31 2015 +0000
@@ -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@localhost>
+
+If you need to ask for help on the publicfile list, please mention that
+you're using the publicfile-run package from pkgsrc.
diff -r acdd8c7cdf18 -r 3a99608dc867 net/publicfile-run/files/libexec-pubftpd.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/publicfile-run/files/libexec-pubftpd.sh       Tue Jan 27 23:01:31 2015 +0000
@@ -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 .
+' "$@"
diff -r acdd8c7cdf18 -r 3a99608dc867 net/publicfile-run/files/pubfile.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/publicfile-run/files/pubfile.sh       Tue Jan 27 23:01:31 2015 +0000
@@ -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
diff -r acdd8c7cdf18 -r 3a99608dc867 net/publicfile-run/files/pubftpd.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/publicfile-run/files/pubftpd.sh       Tue Jan 27 23:01:31 2015 +0000
@@ -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
diff -r acdd8c7cdf18 -r 3a99608dc867 net/publicfile-run/files/pubhttpd.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/publicfile-run/files/pubhttpd.sh      Tue Jan 27 23:01:31 2015 +0000
@@ -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()



Home | Main Index | Thread Index | Old Index