mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 09:49:18 -04:00
Out with the old rc.d script, in with the new.
PR: ports/91442 (requested by) Submitted by: Mike <mspam@hideaway.net> Approved by: mi (maintainer, timeout 4 weeks)
This commit is contained in:
parent
e160263de0
commit
3d301eecf9
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=155751
4 changed files with 46 additions and 31 deletions
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
PORTNAME= tclhttpd
|
PORTNAME= tclhttpd
|
||||||
PORTVERSION= 3.5.1
|
PORTVERSION= 3.5.1
|
||||||
|
PORTREVISION= 1
|
||||||
CATEGORIES= www tcl83 tcl84
|
CATEGORIES= www tcl83 tcl84
|
||||||
MASTER_SITES= ${MASTER_SITE_TCLTK}
|
MASTER_SITES= ${MASTER_SITE_TCLTK}
|
||||||
MASTER_SITE_SUBDIR= httpd
|
MASTER_SITE_SUBDIR= httpd
|
||||||
|
@ -18,6 +19,7 @@ COMMENT= An http-server implemented in TCL
|
||||||
RUN_DEPENDS= ${LOCALBASE}/lib/tcllib1.7/pkgIndex.tcl:${PORTSDIR}/devel/tcllib
|
RUN_DEPENDS= ${LOCALBASE}/lib/tcllib1.7/pkgIndex.tcl:${PORTSDIR}/devel/tcllib
|
||||||
LIB_DEPENDS= tcl${TCL_VER}:${PORTSDIR}/lang/tcl${TCL_VER}
|
LIB_DEPENDS= tcl${TCL_VER}:${PORTSDIR}/lang/tcl${TCL_VER}
|
||||||
|
|
||||||
|
USE_RC_SUBR= tclhttpd.sh
|
||||||
TCL_DVER?= 8.4
|
TCL_DVER?= 8.4
|
||||||
TCL_VER= ${TCL_DVER:S/.//}
|
TCL_VER= ${TCL_DVER:S/.//}
|
||||||
GNU_CONFIGURE= yes
|
GNU_CONFIGURE= yes
|
||||||
|
@ -25,7 +27,6 @@ CONFIGURE_ARGS= --with-tcl="${LOCALBASE}/lib/tcl${TCL_DVER}" \
|
||||||
--with-tclinclude="${LOCALBASE}/include/tcl${TCL_DVER}"
|
--with-tclinclude="${LOCALBASE}/include/tcl${TCL_DVER}"
|
||||||
|
|
||||||
MAN1= tclhttpd.1
|
MAN1= tclhttpd.1
|
||||||
RCD= ${LOCALBASE}/etc/rc.d/tclhttpd.sh
|
|
||||||
|
|
||||||
.include <bsd.port.pre.mk>
|
.include <bsd.port.pre.mk>
|
||||||
SHLIB_NAME!= ${MAKE} -f "${FILESDIR}/Makefile.lib" -V SHLIB_NAME
|
SHLIB_NAME!= ${MAKE} -f "${FILESDIR}/Makefile.lib" -V SHLIB_NAME
|
||||||
|
@ -33,6 +34,7 @@ PLIST_SUB+= TCL_VER=${TCL_VER} PORTVERSION=${PORTVERSION} \
|
||||||
SHLIB_NAME=${SHLIB_NAME}
|
SHLIB_NAME=${SHLIB_NAME}
|
||||||
MAKE_ENV+= TCLSH_PROG=tclsh${TCL_DVER}
|
MAKE_ENV+= TCLSH_PROG=tclsh${TCL_DVER}
|
||||||
SCRIPTS_ENV+= TCL_DVER=${TCL_DVER}
|
SCRIPTS_ENV+= TCL_DVER=${TCL_DVER}
|
||||||
|
SUB_LIST+= TCL_DVER=${TCL_DVER}
|
||||||
|
|
||||||
do-build:
|
do-build:
|
||||||
cd ${WRKSRC} && ${MAKE_ENV} ${MAKE} -j 2 TCL_DVER="${TCL_DVER}" \
|
cd ${WRKSRC} && ${MAKE_ENV} ${MAKE} -j 2 TCL_DVER="${TCL_DVER}" \
|
||||||
|
@ -47,11 +49,7 @@ pre-install:
|
||||||
${MKDIR} ${PREFIX}/tclhttpd/custom
|
${MKDIR} ${PREFIX}/tclhttpd/custom
|
||||||
|
|
||||||
post-install:
|
post-install:
|
||||||
test -e ${RCD} || ${SED} \
|
|
||||||
"s%COMMAND_LINE%${LOCALBASE}/bin/tclsh${TCL_DVER} ${PREFIX}/bin/httpd.tcl%" \
|
|
||||||
< ${FILESDIR}/tclhttpd.sh > ${RCD}
|
|
||||||
${CHOWN} -R nobody ${DATADIR}${PORTVERSION}
|
${CHOWN} -R nobody ${DATADIR}${PORTVERSION}
|
||||||
${CHMOD} +x ${RCD}
|
|
||||||
${INSTALL_DATA} ${WRKSRC}/${SHLIB_NAME} \
|
${INSTALL_DATA} ${WRKSRC}/${SHLIB_NAME} \
|
||||||
${PREFIX}/lib/${PORTNAME}${PORTVERSION}/${SHLIB_NAME}
|
${PREFIX}/lib/${PORTNAME}${PORTVERSION}/${SHLIB_NAME}
|
||||||
${INSTALL_SCRIPT} ${WRKSRC}/bin/httpd.tcl \
|
${INSTALL_SCRIPT} ${WRKSRC}/bin/httpd.tcl \
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
PID_FILE=/var/run/tclhttpd.pid
|
|
||||||
case $1 in
|
|
||||||
stop)
|
|
||||||
if [ -e $PID_FILE ] ; then
|
|
||||||
PID=`cat $PID_FILE`
|
|
||||||
if kill $PID ; then
|
|
||||||
exec rm -f $PID_FILE
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "No $PID_FILE presenet, tclhttpd is, probably, not running" > /dev/stderr
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
''|start)
|
|
||||||
env LANG=C COMMAND_LINE &
|
|
||||||
sleep 2
|
|
||||||
if kill -0 $! ; then
|
|
||||||
echo -n ' tclhttpd'
|
|
||||||
echo $! > $PID_FILE
|
|
||||||
else
|
|
||||||
exec logger -s "tclhttpd failed to start"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
42
www/tclhttpd/files/tclhttpd.sh.in
Normal file
42
www/tclhttpd/files/tclhttpd.sh.in
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# $FreeBSD$
|
||||||
|
#
|
||||||
|
# PROVIDE: tclhttpd
|
||||||
|
# REQUIRE: NETWORKING SERVERS
|
||||||
|
# KEYWORD: shutdown
|
||||||
|
#
|
||||||
|
# Add the following lines to /etc/rc.conf to enable tclhttpd:
|
||||||
|
#
|
||||||
|
# tclhttpd_enable (bool): Set it to "YES" to enable tclhttpd
|
||||||
|
# Default is "NO".
|
||||||
|
#
|
||||||
|
# tclhttpd_flags (str): Arguments to be passed to tclhttpd.
|
||||||
|
# Default is "".
|
||||||
|
#
|
||||||
|
# tclhttpd_stdout_log(str): Set to the location for the tclhttpd
|
||||||
|
# process log (standard out)
|
||||||
|
#
|
||||||
|
# tclhttpd_stderr_log (str): Set to the location for the tclhttpd
|
||||||
|
# process log (standard error)
|
||||||
|
|
||||||
|
. %%RC_SUBR%%
|
||||||
|
|
||||||
|
name="tclhttpd"
|
||||||
|
rcvar=`set_rcvar`
|
||||||
|
|
||||||
|
load_rc_config $name
|
||||||
|
|
||||||
|
: ${tclhttpd_enable="NO"}
|
||||||
|
: ${tclhttpd_flags=""}
|
||||||
|
: ${tclhttpd_stdout_log="/var/log/tclhttpd-stdout.log"}
|
||||||
|
: ${tclhttpd_stderr_log="/var/log/tclhttpd-stderr.log"}
|
||||||
|
|
||||||
|
procname="%%LOCALBASE%%/bin/tclsh%%TCL_DVER%%"
|
||||||
|
pidfile=/var/run/tclhttpd.pid
|
||||||
|
log_args=">> ${tclhttpd_stdout_log} \
|
||||||
|
2>> ${tclhttpd_stderr_log} "
|
||||||
|
command="/usr/sbin/daemon"
|
||||||
|
flags="-p ${pidfile} %%LOCALBASE%%/bin/tclsh%%TCL_DVER%% %%PREFIX%%/bin/httpd.tcl ${tclhttpd_flags} ${log_args}"
|
||||||
|
|
||||||
|
run_rc_command "$1"
|
|
@ -2,7 +2,6 @@ bin/httpd.tcl
|
||||||
bin/httpdthread.tcl
|
bin/httpdthread.tcl
|
||||||
etc/tclhttpd.rc
|
etc/tclhttpd.rc
|
||||||
etc/tclhttpd.rc.default
|
etc/tclhttpd.rc.default
|
||||||
etc/rc.d/tclhttpd.sh
|
|
||||||
lib/tclhttpd%%PORTVERSION%%/%%SHLIB_NAME%%
|
lib/tclhttpd%%PORTVERSION%%/%%SHLIB_NAME%%
|
||||||
lib/tclhttpd%%PORTVERSION%%/admin.tcl
|
lib/tclhttpd%%PORTVERSION%%/admin.tcl
|
||||||
lib/tclhttpd%%PORTVERSION%%/auth.tcl
|
lib/tclhttpd%%PORTVERSION%%/auth.tcl
|
||||||
|
|
Loading…
Add table
Reference in a new issue