Since the implemenation of rc.subr, a lot of ports have adapted the system and the quality of the startup/shutdown/status scripts have increased. But a lot of duplicate code has grown into the ports Makefiles to make sure that the startup scripts got installed properly. Look at the additional www/apache2 port overhead: USE_RC_SUBR= yes RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} post-patch: @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ ${FILESDIR}/apache.sh > ${WRKDIR}/apache2.sh .if !defined(WITH_APR_FROM_PORTS) @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ ${FILESDIR}/apache2libs.sh > ${WRKDIR}/apache2libs.sh .endif post-install: .if !defined(WITH_APR_FROM_PORTS) @${ECHO_CMD} "Installing ${PREFIX}/etc/rc.d/000.apache2libs.sh startup script." @${INSTALL_SCRIPT} -m 751 ${WRKDIR}/apache2libs.sh ${PREFIX}/etc/rc.d/000.apache2libs.sh .endif @${ECHO_CMD} "Installing ${PREFIX}/etc/rc.d/apache2.sh startup script." @${INSTALL_SCRIPT} -m 751 ${WRKDIR}/apache2.sh ${PREFIX}/etc/rc.d/apache2.sh Imagine every port which uses rc.subr to have these identical additional lines to it, that's not really making life easier to maintain. Imagine the following configuration: USE_RC_SUBR= yes RC_FILES= apache2.sh .if !defined(WITH_APR_FROM_PORTS) RC_FILES+= apache2libs.sh .endif And bsd.port.mk would automaticly do the patching, installation and pkg-plist additions! The patch attached is harmless for ports which don't use this new system (since the trigger isn't USE_RC_SUBR but RC_FILES). The patch does.... - It patches the files defined in RC_FILES with the variables defined in RC_SUBST (LOCALBASE, PREFIX, RC_SUBR, X11BASE by default). - It installs the files defined in RC_FILES to PREFIX/etc/rc.d - It adds the files defined in RC_FILES to the PKGPLIST.
On Tue, Nov 09, 2004 at 11:20:28AM +1100, Edwin Groothuis wrote: [...] An more detailed description for the porters handbook will be submitted when this patch is in the pipeline of being accepted. -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/
Responsible Changed From-To: freebsd-ports-bugs->portmgr Over to port managers
I've done such a similar patch some months ago (ports/69217). I don't know if mine is better or worse, that's just to avoid my PR being kept open if this one is approved.
State Changed From-To: open->closed Committed, thanks!