Properly utilize USE_RC_SUBR
Make pkg-message dynamic PR: ports/143141 Submitted by: Sevan Janiyan <venture37@geeklan.co.uk> Approved by: maintainer timeout
This commit is contained in:
parent
a24e89e5ca
commit
0610039dca
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=251559
3 changed files with 7 additions and 42 deletions
|
@ -7,6 +7,7 @@
|
|||
|
||||
PORTNAME= minisapserver
|
||||
PORTVERSION= 0.3.4
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= net multimedia
|
||||
MASTER_SITES= http://downloads.videolan.org/pub/videolan/miniSAPserver/${PORTVERSION}/
|
||||
|
||||
|
@ -17,15 +18,15 @@ USE_BZIP2= yes
|
|||
GNU_CONFIGURE= yes
|
||||
USE_GMAKE= yes
|
||||
MAN1= sapserver.1
|
||||
PLIST_FILES= bin/sapserver etc/sap.cfg-dist etc/rc.d/sapserver.sh
|
||||
USE_RC_SUBR= yes
|
||||
PKGMESSAGE= ${WRKDIR}/pkg-message
|
||||
PLIST_FILES= bin/sapserver etc/sap.cfg-dist
|
||||
USE_RC_SUBR= sapserver
|
||||
SUB_FILES= pkg-message
|
||||
OPTIONS= SLP "Enable SLP support via openslp" off
|
||||
|
||||
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
|
||||
LDFLAGS="-L${LOCALBASE}/lib"
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
.include <bsd.port.options.mk>
|
||||
|
||||
.if defined(WITH_SLP)
|
||||
LIB_DEPENDS+= slp.1:${PORTSDIR}/net/openslp
|
||||
|
@ -37,6 +38,8 @@ CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include" \
|
|||
CONFIGURE_ARGS+=--disable-slp
|
||||
.endif
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
post-patch:
|
||||
@${REINPLACE_CMD} -e 's|$$(prefix)/share/man|${MANPREFIX}/man|; \
|
||||
s|$$(prefix)/share/doc/sapserver|${DOCSDIR}|; \
|
||||
|
@ -46,14 +49,9 @@ post-patch:
|
|||
${WRKSRC}/configure
|
||||
@${REINPLACE_CMD} -e 's|/etc/sap.cfg|${PREFIX}/etc/sap.cfg|' \
|
||||
${WRKSRC}/sapserver.h
|
||||
@${SED} -e 's|/usr/local|${PREFIX}|' \
|
||||
${PKGDIR}/pkg-message >${PKGMESSAGE}
|
||||
@${SED} -e 's|%%PREFIX%%|${PREFIX}|; s|%%RC_SUBR%%|${RC_SUBR}|' \
|
||||
${FILESDIR}/sapserver.sh >${WRKDIR}/sapserver.sh
|
||||
@${CP} -f ${WRKSRC}/sap.cfg ${WRKSRC}/sap.cfg-dist
|
||||
|
||||
post-install:
|
||||
@${INSTALL_SCRIPT} ${WRKDIR}/sapserver.sh ${PREFIX}/etc/rc.d/
|
||||
@${CAT} ${PKGMESSAGE}
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD: /tmp/pcvs/ports/net/minisapserver/files/Attic/sapserver.sh,v 1.4 2010-03-27 00:13:48 dougb Exp $
|
||||
#
|
||||
|
||||
# PROVIDE: sapserver
|
||||
# REQUIRE: NETWORKING
|
||||
# KEYWORD: shutdown
|
||||
|
||||
#
|
||||
# Add the following lines to /etc/rc.conf to enable sapserver:
|
||||
#
|
||||
#sapserver_enable="YES"
|
||||
#
|
||||
sapserver_enable="${sapserver_enable-NO}"
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name=sapserver
|
||||
rcvar=`set_rcvar`
|
||||
|
||||
command=%%PREFIX%%/bin/${name}
|
||||
required_files=%%PREFIX%%/etc/sap.cfg
|
||||
|
||||
load_rc_config ${name}
|
||||
run_rc_command "$1"
|
|
@ -1,7 +0,0 @@
|
|||
*******************************************************************************
|
||||
A sample configuration file, sap.cfg-dist has been installed in /usr/local/etc/
|
||||
Please 'cp sap.cfg-dist sap.cfg' and edit sap.cfg.
|
||||
|
||||
To start sapserver at boot time:
|
||||
echo "sapserver_enable=yes" >> /etc/rc.conf
|
||||
*******************************************************************************
|
Loading…
Reference in a new issue