Date: 3 Mar 2004 22:55:18 +0100 From: Clement Laforet <clement@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Cc: Clement Laforet <clement@FreeBSD.org> Subject: ports/63716: [patch] Mk/bsd.port.mk: move sysctl to ${SYSCTL} and add IS_JAILED variable Message-ID: <20040303215518.22936.qmail@cultdeadsheep.org> Resent-Message-ID: <200403032200.i23M0a2K085615@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040303215518.22936.qmail>