ports/93373: bsd.port.mk: introduse a new keyword for PLIST: @stopdaemon

Sergey Matveychuk sem at FreeBSD.org
Wed Feb 15 07:40:10 UTC 2006


>Number:         93373
>Category:       ports
>Synopsis:       bsd.port.mk: introduse a new keyword for PLIST: @stopdaemon
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 15 07:40:03 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Sergey Matveychuk
>Release:        FreeBSD 6.0-STABLE i386
>Organization:
>Environment:
System: FreeBSD freefall.freebsd.org 6.0-STABLE FreeBSD 6.0-STABLE #0: Sat Dec 10 03:18:20 UTC 2005 kensmith at freefall.freebsd.org:/usr/obj/usr/src/sys/FREEFALL i386


	
>Description:
	
	We have a USE_RC_SUBR macro which when defined make a port system
	installs a stratup script. For FreeBSD < 7.0 it's installed as
	'name.sh' and for >=7.0 as just 'name'.
	This caused a problem for a stop daemon command that common
	looks like:
	@unexec %D/etc/rc.d/name.sh stop 2>/dev/null > /dev/null || true

	The problem is obvious: the command will not work on systems >=7.0.
>How-To-Repeat:
	
>Fix:
	I offer introduce a new keyword '@stopdaemon name' that will
	be replaced with an according command.
	

--- bsd.port.mk.diff begins here ---
Index: bsd.port.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.525
diff -u -r1.525 bsd.port.mk
--- bsd.port.mk	11 Feb 2006 02:34:48 -0000	1.525
+++ bsd.port.mk	15 Feb 2006 07:22:50 -0000
@@ -1451,8 +1451,13 @@
 SUB_LIST+=	PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE}	\
 			DATADIR=${DATADIR} DOCSDIR=${DOCSDIR} EXAMPLESDIR=${EXAMPLESDIR}
 
-PLIST_REINPLACE+=	dirrmtry
+PLIST_REINPLACE+=	dirrmtry stopdaemon
 PLIST_REINPLACE_DIRRMTRY=s!^@dirrmtry \(.*\)!@unexec rmdir %D/\1 2>/dev/null || true!
+.if ${OSVERSION} >= 700007
+PLIST_REINPLACE_STOPDAEMON=s!@stopdaemon \(.*\)!@unexec %D/etc/rc.d/\1 forcestop 2>/dev/null || true!
+.else
+PLIST_REINPLACE_STOPDAEMON=s!@stopdaemon \(.*\)!@unexec %D/etc/rc.d/\1.sh forcestop 2>/dev/null || true!
+.endif
 
 .if defined(WITHOUT_CPU_CFLAGS)
 .if defined(_CPUCFLAGS)
--- bsd.port.mk.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list