ports/63716: [patch] Mk/bsd.port.mk: move sysctl to ${SYSCTL} and add IS_JAILED variable
Clement Laforet
clement at FreeBSD.org
Wed Mar 3 22:00:37 UTC 2004
>Number: 63716
>Category: ports
>Synopsis: [patch] Mk/bsd.port.mk: move sysctl to ${SYSCTL} and add IS_JAILED variable
>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 Mar 03 14:00:36 PST 2004
>Closed-Date:
>Last-Modified:
>Originator: Clement Laforet
>Release: FreeBSD 5.1-CURRENT i386
>Organization:
FreeBSD
>Environment:
System: FreeBSD goofy.cultdeadsheep.org 5.1-CURRENT FreeBSD 5.1-CURRENT #2: Mon Sep 1 10:07:15 CEST 2003 root at lucifer.cultdeadsheep.org:/usr/obj/usr/src/sys/LUCIFER i386
>Description:
- define ${SYSCTL}
- if a port is built in a jail, IS_JAILED is defined (or can be defined)
It can be useful for ports which fail or need special configuration
if they are built in a jail
>How-To-Repeat:
N/A.
>Fix:
--- bsd.port.mk.diff begins here ---
Index: /usr/ports/Mk/bsd.port.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.484
diff -u -u -r1.484 bsd.port.mk
--- /usr/ports/Mk/bsd.port.mk 4 Feb 2004 04:27:04 -0000 1.484
+++ /usr/ports/Mk/bsd.port.mk 3 Mar 2004 20:35:56 -0000
@@ -877,6 +877,7 @@
# DISABLE_SIZE - Do not check the size of a distfile even if the SIZE field
# has been specified in distinfo. This is useful
# when using an alternate FETCH_CMD.
+# IS_JAILED - If defined, considers the build environment as a jail.
#
# End of the list of all variables that need to be defined in a port.
# Most port authors should not need to understand anything after this point.
@@ -960,6 +961,11 @@
WHICH?= /usr/bin/which
XARGS?= /usr/bin/xargs
YACC?= /usr/bin/yacc
+.if exists(/usr/sbin/sysctl)
+SYSCTL?= /usr/sbin/sysctl
+.else
+SYSCTL?= /sbin/sysctl
+.endif
# ECHO is defined in /usr/share/mk/sys.mk, which can either be "echo",
# or "true" if the make flag -s is given. Use ECHO_CMD where you mean
@@ -989,11 +995,18 @@
# Get __FreeBSD_version
.if !defined(OSVERSION)
-.if exists(/sbin/sysctl)
-OSVERSION!= /sbin/sysctl -n kern.osreldate
-.else
-OSVERSION!= /usr/sbin/sysctl -n kern.osreldate
+OSVERSION!= ${SYSCTL} -n kern.osreldate
.endif
+
+.if !defined(IS_JAILED)
+. if ${OSVERSION} >= 502104
+IS_JAILED!= ${SYSCTL} -n security.jail.jailed
+. if ${IS_JAILED} == 1
+IS_JAILED= YES
+. else
+.undef IS_JAILED
+. endif
+. endif
.endif
# Get the object format.
@@ -2636,11 +2649,7 @@
.if defined(GNU_CONFIGURE)
# Maximum command line length
.if !defined(CONFIGURE_MAX_CMD_LEN)
-.if exists(/sbin/sysctl)
-CONFIGURE_MAX_CMD_LEN!= /sbin/sysctl -n kern.argmax
-.else
-CONFIGURE_MAX_CMD_LEN!= /usr/sbin/sysctl -n kern.argmax
-.endif
+CONFIGURE_MAX_CMD_LEN!= ${SYSCTL} -n kern.argmax
.endif
CONFIGURE_ARGS+= --prefix=${PREFIX} ${CONFIGURE_TARGET}
CONFIGURE_ENV+= lt_cv_sys_max_cmd_len=${CONFIGURE_MAX_CMD_LEN}
--- bsd.port.mk.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list