ports/60827: [patch] RC_SUBR/USE_RC_SUBR in bsd.port.mk

Sunpoet sunpoet at sunpoet.net
Fri Jan 2 17:31:29 UTC 2004

>Number:         60827
>Category:       ports
>Synopsis:       [patch] RC_SUBR/USE_RC_SUBR in bsd.port.mk
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 02 09:30:19 PST 2004
>Originator:     Sunpoet Po-Chuan Hsieh
>Release:        FreeBSD 5.2-CURRENT i386

System: FreeBSD IRIS.sunpoet.net 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Sun Dec 21 18:12:22 CST 2003 root@:/usr/obj/usr/src/sys/sunpoet i386


    Since RC_SUBR (rcNG) support was added in ports/Mk/bsd.port.mk
after rev. 1.463, ports which depends on rcNG may use USE_RC_SUBR
to enable rcNG support easily. But for FreeBSD 5.x users, they have
/etc/rc.subr already.

    bsd.port.mk adds sysutils/rc_subr to the list of run dependencies
(RUN_DEPENDS) without checking the existence of /etc/rc.subr. It
defines ${RC_SUBR} as ${LOCALBASE}/etc/rc.subr and user may not set
${RC_SUBR} to any other values, e.g. /etc/rc.subr.

    In this patch, it checks if /etc/rc.subr exists first. If so, it
skips adding RUN_DEPENDS. Users who wish to use other rcNG scripts may
set ${RC_SUBR} to the corresponding path. Note if the scripts is absent,
bsd.port.mk adds run dependency on sysutils/rc_subr as usual.


    Run "make run-depends-list" in any port directories which defines
USE_RC_SUBR=yes in the Makefile, e.g. security/cyrus-sasl2-saslauthd.
It depends on sysutils/rc_subr while running. After applying the patch,
it doesn't need sysutils/rc_subr.

% cd /usr/ports/security/cyrus-sasl2-saslauthd
% grep USE_RC_SUBR= Makefile

% make run-depends-list

### patching /usr/ports/Mk/bsd.port.mk ###

% make run-depends-list


% diff -u bsd.port.mk.orig bsd.port.mk
--- bsd.port.mk.orig	Mon Nov 24 09:08:41 2003
+++ bsd.port.mk	Sat Jan  3 00:28:10 2004
@@ -1530,8 +1530,13 @@
 .if defined(USE_RC_SUBR)
+.if !defined(RC_SUBR)
+RC_SUBR=	/etc/rc.subr
+.if !exists(${RC_SUBR})
 RUN_DEPENDS+=	${LOCALBASE}/etc/rc.subr:${PORTSDIR}/sysutils/rc_subr
 RC_SUBR=	${LOCALBASE}/etc/rc.subr
 .if defined(USE_LINUX)


More information about the freebsd-ports-bugs mailing list