1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-18 19:49:40 +00:00

- Utilize new features: USE_RC_SUBR, SUB_FILES. It simplifies Makefile.

- Fix pkg-message
- Remove redundant code from a startup script
- Install a sample config in EXAMPLESDIR instead of PREFIX/etc
- Refine pkg-descr a little
This commit is contained in:
Sergey Matveychuk 2006-02-07 12:50:29 +00:00
parent 2fb9fbd8a1
commit 346ee7892f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=155415
5 changed files with 25 additions and 47 deletions

View File

@ -21,23 +21,17 @@ USE_GMAKE= yes
GNU_CONFIGURE= yes
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
USE_RC_SUBR= yes
RC_DIR?= ${PREFIX}/etc/rc.d
RC_SUFX?= .sh
SED_SCRIPT= -e 's|%%PREFIX%%|${PREFIX}|g' \
-e 's|%%RC_SUBR%%|${RC_SUBR}|g' \
-e 's|%%RC_DIR%%|${RC_DIR}|g' \
-e 's|%%RC_SUFX%%|${RC_SUFX}|g'
USE_RC_SUBR= frox.sh
SUB_FILES= pkg-message
PLIST_SUB+= RC_DIR=${RC_DIR} RC_SUFX=${RC_SUFX}
MAN1= frox.1
MAN5= frox.conf.5
MAN1= frox.1
MAN5= frox.conf.5
PORTDOCS= SECURITY CREDITS ChangeLog FAQ.html FAQ-1.html FAQ-2.html \
FAQ-3.html FAQ-4.html FAQ-5.html FAQ-6.html FAQ-7.html \
FAQ-8.html
PLIST_FILES= sbin/frox etc/frox.conf.sample etc/rc.d/frox.sh
PLIST_FILES= sbin/frox ${EXAMPLESDIR:S,${PREFIX}/,,}/frox.conf
PLIST_DIRS= ${EXAMPLESDIR:S,${PREFIX}/,,}
PKGMESSAGE= ${WRKDIR}/pkg-message
@ -78,13 +72,10 @@ CONFIGURE_ARGS+= --enable-ccp
CONFIGURE_ARGS+= --enable-run-as-root
.endif
pre-patch:
@${SED} ${SED_SCRIPT} ${PKGDIR}/pkg-message >${PKGMESSAGE}
@${SED} ${SED_SCRIPT} ${FILESDIR}/frox.sh > ${WRKDIR}/frox.sh
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/src/frox ${PREFIX}/sbin
${INSTALL_DATA} ${WRKSRC}/src/frox.conf ${PREFIX}/etc/frox.conf.sample
${MKDIR} ${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/src/frox.conf ${EXAMPLESDIR}/frox.conf
${INSTALL_MAN} ${WRKSRC}/doc/frox.man ${PREFIX}/man/man1/frox.1
${INSTALL_MAN} ${WRKSRC}/doc/frox.conf.man ${PREFIX}/man/man5/frox.conf.5
@ -97,7 +88,6 @@ post-install:
.endif
@${STRIP_CMD} ${PREFIX}/sbin/frox; \
${ECHO_MSG} "Install ${RC_DIR}/frox${RC_SUFX} startup file."; \
${INSTALL_SCRIPT} -m 751 ${WRKDIR}/frox.sh ${RC_DIR}/frox${RC_SUFX}; \
${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>

View File

@ -5,7 +5,7 @@
# PROVIDE: frox
# REQUIRE: NETWORKING
# KEYWORD: FreeBSD shutdown
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable frox:
@ -24,20 +24,8 @@ command=%%PREFIX%%/sbin/frox
pidfile=/var/run/frox.pid
required_files=%%PREFIX%%/etc/frox.conf
start_precmd=start_precmd
stop_postcmd=stop_postcmd
# if require start from inetd?
start_precmd()
{
if grep -iq '^[[:space:]]*frominetd[[:space:]]*yes' %%PREFIX%%/etc/frox.conf;
then
return 1
else
return 0
fi
}
stop_postcmd()
{
rm -f $pidfile

View File

@ -0,0 +1,15 @@
**************************************************************************
Don't forget to create %%PREFIX%%/etc/frox.conf.
See an example in %%EXAMPLESDIR%%/frox.conf
You can use frox by two ways:
1) run as a daemon:
Add `frox_enable="YES"' in /etc/rc.conf and run %%PREFIX%%/etc/rc.d/frox.sh
2) run frox with inetd(8):
* uncomment 'FromInetd yes' in your %%PREFIX%%/etc/frox.conf
* add a line in /etc/inetd.conf:
frox stream tcp nowait nobody %%PREFIX%%/sbin/frox frox
* assign a port number for frox inside /etc/services (e.g. 2121):
frox 2121/tcp
**************************************************************************

View File

@ -2,8 +2,7 @@ This is frox, a transparent ftp proxy by James Hollingshead.
Current features include:
o rfc959 compliant (I think) transparent proxying of ftp
connections.
o rfc959 compliant transparent proxying of ftp connections.
o active --> passive mode conversion for data connections.
o Optional caching support either locally or through an external
HTTP cache.

View File

@ -1,14 +0,0 @@
**************************************************************************
NOTES:
Don't forget to create %%PREFIX%%/etc/frox.conf
from %%PREFIX%%/etc/frox.conf.sample.
Then add `frox_enable="YES"' in /etc/rc.conf and run frox with
%%RC_DIR%%/frox%%RC_SUFX%% start
Or you can run frox with inetd this way:
* uncomment 'FromInetd yes' in your %%PREFIX%%/etc/frox.conf
* add this line in /etc/inetd.conf:
frox stream tcp nowait nobody %%PREFIX%%/sbin/frox frox
* and assign port number for frox you want in /etc/services (e.g. 2121):
frox 2121/tcp
**************************************************************************