diff options
Diffstat (limited to 'ftp')
-rw-r--r-- | ftp/pure-ftpd/Makefile | 11 | ||||
-rw-r--r-- | ftp/pure-ftpd/files/pure-ftpd.sh.sample | 34 | ||||
-rw-r--r-- | ftp/pure-ftpd/pkg-message | 5 |
3 files changed, 48 insertions, 2 deletions
diff --git a/ftp/pure-ftpd/Makefile b/ftp/pure-ftpd/Makefile index f301b442feba..3502a99ba1e1 100644 --- a/ftp/pure-ftpd/Makefile +++ b/ftp/pure-ftpd/Makefile @@ -7,7 +7,7 @@ PORTNAME= pure-ftpd PORTVERSION= 1.0.20 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= ftp ipv6 MASTER_SITES= ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/ \ ftp://ftp2.fr.pureftpd.org/pub/mirrors/ftp.fr.pureftpd.org/pub/pure-ftpd/releases/ \ @@ -46,7 +46,8 @@ OPTIONS= LDAP "Support for users in LDAP directories" off \ PRIVSEP "Enable privilege separation" off \ PERUSERLIMITS "Per-user concurrency limits" off \ THROTTLING "Bandwidth throttling" off \ - BANNER "Show ${PORTNAME} welcome upon session start" on + BANNER "Show ${PORTNAME} welcome upon session start" on \ + UPLOADSCRIPT "Support uploadscript daemon" off .include <bsd.port.pre.mk> @@ -103,6 +104,11 @@ CONFIGURE_ARGS+= --with-pam CONFIGURE_ARGS+= --without-banner .endif +# support uploadscript? +.if defined (WITH_UPLOADSCRIPT) +CONFIGURE_ARGS+= --with-uploadscript +.endif + .if ${OSVERSION} > 500000 PAM_TEMPL?= ${FILESDIR}/pam.conf.5 .else @@ -158,5 +164,6 @@ post-install: @${ECHO_MSG} "Now you need to examine ${PAM_DIR}/${PAM_TARGET}" @${ECHO_MSG} "and add the relevant PAM configuration lines to your /etc/pam.conf file." .endif + @${CAT} ${PKGMESSAGE} .include <bsd.port.post.mk> diff --git a/ftp/pure-ftpd/files/pure-ftpd.sh.sample b/ftp/pure-ftpd/files/pure-ftpd.sh.sample index 80a6f59e5593..4c53c806cc7b 100644 --- a/ftp/pure-ftpd/files/pure-ftpd.sh.sample +++ b/ftp/pure-ftpd/files/pure-ftpd.sh.sample @@ -10,6 +10,10 @@ # # pureftpd_enable="YES" # +# For launch uploadscript daemon define +# pureftpd_upload_enable="YES" +# pureftpd_uploadscript="/full/path/to/launch_script" +# . %%RC_SUBR%% @@ -19,12 +23,42 @@ rcvar=`set_rcvar` load_rc_config $name command=%%PREFIX%%/sbin/pure-config.pl +command_upload=%%PREFIX%%/sbin/pure-uploadscript +pureftpd_uploadscript=${pureftpd_uploadscript:-"/usr/bin/touch"} pureftpd_config=${pureftpd_config:-"%%PREFIX%%/etc/pure-ftpd.conf"} required_files=${pureftpd_config} pidfile=/var/run/pure-ftpd.pid +pidfile2=/var/run/pure-uploadscript.pid procname=pure-ftpd pureftpd_enable=${pureftpd_enable:-"NO"} command_args=${pureftpd_config} +command_upload_args="-B -r ${pureftpd_uploadscript}" + +start_postcmd=start_postcmd +stop_postcmd=stop_postcmd + +start_postcmd() +{ + if test -n ${pureftpd_upload_enable:-""} && checkyesno pureftpd_upload_enable; then + echo "Starting ${command_upload}." + ${command_upload} ${command_upload_args} + fi +} + +stop_postcmd() +{ + if test -n ${pureftpd_upload_enable:-""} && checkyesno pureftpd_upload_enable; then + pid=$(check_pidfile ${pidfile2} ${command_upload}) + if [ -z ${pid} ]; then + echo "Upload script not running? (check ${pidfile2})." + return 1 + fi + echo "Stopping ${command_upload}." + kill -${sig_stop:-TERM} ${pid} + [ $? -ne 0 ] && [ -z "$rc_force" ] && return 1 + wait_for_pids ${pid} + fi +} run_rc_command "$1" diff --git a/ftp/pure-ftpd/pkg-message b/ftp/pure-ftpd/pkg-message new file mode 100644 index 000000000000..f9b5b06985e7 --- /dev/null +++ b/ftp/pure-ftpd/pkg-message @@ -0,0 +1,5 @@ + +If you defined call upload script in pure-ftpd config +define corresponding vars in rc.conf +Without it pure-ftpd will not listen tcp socket - see +FAQ: http://pureftpd.org/FAQ |