mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-11 07:22:22 +00:00
- Add UPLOADSCRIPT support
PR: ports/85969 Submitted by: dawnshade <h-k@mail.ru> Approved by: maintainer timeout (15 days)
This commit is contained in:
parent
2766cc9b38
commit
502fcf0fbd
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=143642
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
PORTNAME= pure-ftpd
|
PORTNAME= pure-ftpd
|
||||||
PORTVERSION= 1.0.20
|
PORTVERSION= 1.0.20
|
||||||
PORTREVISION= 3
|
PORTREVISION= 4
|
||||||
CATEGORIES= ftp ipv6
|
CATEGORIES= ftp ipv6
|
||||||
MASTER_SITES= ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/ \
|
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/ \
|
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 \
|
PRIVSEP "Enable privilege separation" off \
|
||||||
PERUSERLIMITS "Per-user concurrency limits" off \
|
PERUSERLIMITS "Per-user concurrency limits" off \
|
||||||
THROTTLING "Bandwidth throttling" 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>
|
.include <bsd.port.pre.mk>
|
||||||
|
|
||||||
@ -103,6 +104,11 @@ CONFIGURE_ARGS+= --with-pam
|
|||||||
CONFIGURE_ARGS+= --without-banner
|
CONFIGURE_ARGS+= --without-banner
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
# support uploadscript?
|
||||||
|
.if defined (WITH_UPLOADSCRIPT)
|
||||||
|
CONFIGURE_ARGS+= --with-uploadscript
|
||||||
|
.endif
|
||||||
|
|
||||||
.if ${OSVERSION} > 500000
|
.if ${OSVERSION} > 500000
|
||||||
PAM_TEMPL?= ${FILESDIR}/pam.conf.5
|
PAM_TEMPL?= ${FILESDIR}/pam.conf.5
|
||||||
.else
|
.else
|
||||||
@ -158,5 +164,6 @@ post-install:
|
|||||||
@${ECHO_MSG} "Now you need to examine ${PAM_DIR}/${PAM_TARGET}"
|
@${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."
|
@${ECHO_MSG} "and add the relevant PAM configuration lines to your /etc/pam.conf file."
|
||||||
.endif
|
.endif
|
||||||
|
@${CAT} ${PKGMESSAGE}
|
||||||
|
|
||||||
.include <bsd.port.post.mk>
|
.include <bsd.port.post.mk>
|
||||||
|
@ -10,6 +10,10 @@
|
|||||||
#
|
#
|
||||||
# pureftpd_enable="YES"
|
# pureftpd_enable="YES"
|
||||||
#
|
#
|
||||||
|
# For launch uploadscript daemon define
|
||||||
|
# pureftpd_upload_enable="YES"
|
||||||
|
# pureftpd_uploadscript="/full/path/to/launch_script"
|
||||||
|
#
|
||||||
|
|
||||||
. %%RC_SUBR%%
|
. %%RC_SUBR%%
|
||||||
|
|
||||||
@ -19,12 +23,42 @@ rcvar=`set_rcvar`
|
|||||||
load_rc_config $name
|
load_rc_config $name
|
||||||
|
|
||||||
command=%%PREFIX%%/sbin/pure-config.pl
|
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"}
|
pureftpd_config=${pureftpd_config:-"%%PREFIX%%/etc/pure-ftpd.conf"}
|
||||||
required_files=${pureftpd_config}
|
required_files=${pureftpd_config}
|
||||||
pidfile=/var/run/pure-ftpd.pid
|
pidfile=/var/run/pure-ftpd.pid
|
||||||
|
pidfile2=/var/run/pure-uploadscript.pid
|
||||||
procname=pure-ftpd
|
procname=pure-ftpd
|
||||||
|
|
||||||
pureftpd_enable=${pureftpd_enable:-"NO"}
|
pureftpd_enable=${pureftpd_enable:-"NO"}
|
||||||
command_args=${pureftpd_config}
|
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"
|
run_rc_command "$1"
|
||||||
|
5
ftp/pure-ftpd/pkg-message
Normal file
5
ftp/pure-ftpd/pkg-message
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user