cvs commit: ports/comms/conserver Makefile
ports/comms/conserver/files conserver.sh
Doug Barton
dougb at FreeBSD.org
Wed Jun 11 01:41:24 UTC 2008
Cy Schubert wrote:
> cy 2008-06-10 19:28:06 UTC
>
> FreeBSD ports repository
>
> Modified files:
> comms/conserver Makefile
> comms/conserver/files conserver.sh
> Log:
> Implmement rcNG.
>
> Revision Changes Path
> 1.30 +1 -1 ports/comms/conserver/Makefile
> 1.5 +28 -17 ports/comms/conserver/files/conserver.sh
>
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/comms/conserver/Makefile.diff?&r1=1.29&r2=1.30&f=h
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/comms/conserver/files/conserver.sh.diff?&r1=1.4&r2=1.5&f=h
Thanks for doing this! I have a few comments. First a minor one, it's
rc.d now, since it's not "next generation" anymore. :) You'll probably
also want to take a look at
http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/rc-scripts.html
for a more detailed explanation of these concepts.
1. You need 'USE_RC_SUBR= conserver' in the Makefile.
2. You'll want to nuke the bit about conserver.sh at the end of
post-install in the Makefile and in the pkg-plist. (No need to add
anything to the pkg-plist, USE_RC_SUBR takes care of that for you.)
3. You should rename conserver.sh to conserver.in. Don't worry about
doing a repo copy for this, it is a nice to have but we haven't
bothered for this issue.
4. I'm not sure why you included 'BEFORE: LOGIN'. If setting up the
user identities requires something in the port (which it does not
appear to) then 'REQUIRE: LOGIN' is preferred.
5. The script itself can be simplified quite a bit by relying on
rc.subr. I've attached a version that works for me (although
admittedly lightly tested) and patches to the Makefile and plist.
hth,
Doug
--
This .signature sanitized for your protection
-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /usr/local/ncvs/ports/comms/conserver/Makefile,v
retrieving revision 1.30
diff -u -r1.30 Makefile
--- Makefile 10 Jun 2008 19:28:06 -0000 1.30
+++ Makefile 11 Jun 2008 01:26:57 -0000
@@ -21,6 +21,8 @@
BUILD_DEPENDS= makeme:${PORTSDIR}/devel/msrc0 \
mkcmd:${PORTSDIR}/devel/mkcmd
+USE_RC_SUBR= conserver
+
MAN5= conserver.cf.5
MAN8= autologin.8 console.8 conserver.8
@@ -64,10 +66,6 @@
${PREFIX}/man/man8/autologin.8 \
${PREFIX}/man/man8/conserver.8 \
${PREFIX}/man/man8/console.8
-.if !exists(${PREFIX}/etc/rc.d/conserver.sh)
- @${ECHO_MSG} "Installing ${PREFIX}/etc/rc.d/conserver.sh startup file."
- @${INSTALL_SCRIPT} -m 751 ${FILESDIR}/conserver.sh ${PREFIX}/etc/rc.d
-.endif
@# ${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>
Index: pkg-plist
===================================================================
RCS file: /usr/local/ncvs/ports/comms/conserver/pkg-plist,v
retrieving revision 1.5
diff -u -r1.5 pkg-plist
--- pkg-plist 23 Nov 2000 12:03:35 -0000 1.5
+++ pkg-plist 11 Jun 2008 01:32:24 -0000
@@ -1,6 +1,5 @@
@comment $FreeBSD: ports/comms/conserver/pkg-plist,v 1.5 2000/11/23 12:03:35 obrien Exp $
bin/console
etc/conserver.cf.eg
-etc/rc.d/conserver.sh
sbin/autologin
sbin/conserver
-------------- next part --------------
#!/bin/sh
# $FreeBSD: ports/comms/conserver/files/conserver.sh,v 1.5 2008/06/10 19:28:06 cy Exp $
# PROVIDE: conserver
# REQUIRE: LOGIN
# KEYWORD: shutdown
# To enable conserver, add lines like below to /etc/rc.conf.
#
# conserver_enable="YES"
# conserver_flags="Only add if needed"
. %%RC_SUBR%%
name=conserver
rcvar=`set_rcvar`
command=%%PREFIX%%/sbin/conserver
required_files=$conserver_conf
load_rc_config $name
conserver_enable=${conserver_enable-"no"}
conserver_conf=${conserver_conf-"%%PREFIX%%/etc/conserver.cf"}
command_args="-d -n -C ${conserver_conf}"
run_rc_command "$1"
exit 0
More information about the cvs-ports
mailing list