aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvs <vs@FreeBSD.org>2005-12-13 23:20:16 +0800
committervs <vs@FreeBSD.org>2005-12-13 23:20:16 +0800
commit968756b64e6fe42536b959a876c5639996c6bebb (patch)
tree82f097d243a158d279756a1fa7081658e48d98c1
parent1a75f71ea57bdb413e2df402f228873f8934bdb1 (diff)
downloadfreebsd-ports-gnome-968756b64e6fe42536b959a876c5639996c6bebb.tar.gz
freebsd-ports-gnome-968756b64e6fe42536b959a876c5639996c6bebb.tar.zst
freebsd-ports-gnome-968756b64e6fe42536b959a876c5639996c6bebb.zip
- Add RCng startup-script [1]
- Do not use perl at build-time - Pet portlint wrt. IGNORE - Raise necessary PERL_LEVEL to 5.8, conditionally depend on p5-Encode PR: ports/90078 [1] Submitted by: Josh Carroll
-rw-r--r--audio/gnump3d/Makefile17
-rw-r--r--audio/gnump3d/files/gnump3.sh.in37
2 files changed, 49 insertions, 5 deletions
diff --git a/audio/gnump3d/Makefile b/audio/gnump3d/Makefile
index 8905ad2eac8e..6868cad57f03 100644
--- a/audio/gnump3d/Makefile
+++ b/audio/gnump3d/Makefile
@@ -7,6 +7,7 @@
PORTNAME= gnump3d
PORTVERSION= 2.9.8
+PORTREVISION= 1
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_SAVANNAH}
MASTER_SITE_SUBDIR= ${PORTNAME}
@@ -23,8 +24,11 @@ RUN_DEPENDS= lame:${PORTSDIR}/audio/lame \
USE_GPG?= yes
SIG_FILES= ${DISTNAME}${EXTRACT_SUFX}.asc
USE_BZIP2= yes
-USE_PERL5= yes
+USE_REINPLACE= yes
+USE_PERL5_RUN= yes
NO_BUILD= yes
+USE_RC_SUBR= gnump3.sh
+SUB_LIST+= PERL=${PERL}
MAN1= gnump3d-index.1 gnump3d-top.1 gnump3d.1 gnump3d.conf.1
@@ -32,16 +36,19 @@ CONFDIR= ${PREFIX}/etc/${PORTNAME}
.include <bsd.port.pre.mk>
-.if ${PERL_LEVEL} < 500600
-IGNORE= You need at least perl 5.6.0. Do not use FreeBSD 4.x' system perl,\
- it's outdated. Install lang/perl5 and issue 'use.perl port'
+.if ${PERL_LEVEL} < 500800
+IGNORE= needs at least perl 5.8. Do not use FreeBSD 4.x' system perl,\
+ it's outdated. Install lang/perl5.8 and issue 'use.perl port'
+.elif ${PERL_LEVEL} < 500806
+RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/Encode.pm:${PORTSDIR}/devel/p5-Encode
.endif
post-patch:
.for f in bin/gnump3d-index bin/gnump3d-top bin/gnump3d2 etc/gnump3d.conf \
man/gnump3d.conf.1
- @${PERL} -pi -e 's|%%PREFIX%%|${PREFIX}|g ; \
+ @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g ; \
s|%%LOCALBASE%%|${LOCALBASE}|g ; \
+ s|!/usr/bin/perl|!${PERL}| ; \
s|%%SITE_PERL%%|${SITE_PERL}|g' ${WRKSRC}/${f}
.endfor
diff --git a/audio/gnump3d/files/gnump3.sh.in b/audio/gnump3d/files/gnump3.sh.in
new file mode 100644
index 000000000000..98de6a39fb00
--- /dev/null
+++ b/audio/gnump3d/files/gnump3.sh.in
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# PROVIDE: gnump3d
+# REQUIRE: DAEMON NETWORKING LOGIN
+# KEYWORD: FreeBSD shutdown
+
+. %%RC_SUBR%%
+
+gnump3d_enable=${gnump3d_enable-"NO"}
+gnump3d_program=${gnump3d_program:-%%PREFIX%%/bin/gnump3d}
+gnump3d_flags=${gnump3d_flags-"--quiet --background"}
+gnump3d_pidfile=${gnump3d_pidfile:-/var/run/gnump3d.pid}
+
+name="gnump3d"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/bin/gnump3d"
+command_interpreter="%%PERL%%"
+pidfile="${gnump3d_pidfile}"
+
+load_rc_config $name
+
+start_cmd=gnump3d_start
+
+# hack to capture the PID
+gnump3d_start() {
+ pid=`check_process ${command} ${command_interpreter}`
+ if [ -z $pid ]; then
+ echo "Starting ${name}."
+ ${command} ${gnump3d_flags}
+ pid=`check_process ${command} ${command_interpreter}`
+ echo $pid > ${gnump3d_pidfile}
+ else
+ echo "${name} already running? (pid = $pid)"
+ fi
+}
+
+run_rc_command "$1"