Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Feb 2008 10:57:17 -0900
From:      "Beech Rintoul" <beech@FreeBSD.org>
To:        "FreeBSD gnats submit" <FreeBSD-gnats-submit@FreeBSD.org>
Subject:   ports/120328: mk/bsd.port.mk - [New macros] INSTALL_WWW COPYTREE_WWW
Message-ID:  <1202327837.35414@stargate.alaskaparadise.com>
Resent-Message-ID: <200802062000.m16K03qb088776@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         120328
>Category:       ports
>Synopsis:       mk/bsd.port.mk - [New macros] INSTALL_WWW COPYTREE_WWW
>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 06 20:00:03 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Beech Rintoul
>Release:        FreeBSD 8.0-CURRENT i386
>Organization:
The FreeBSD Project 
>Environment:


System: FreeBSD 8.0-CURRENT #20: Wed Jan 30 07:32:30 AKST 2008
    root@stargate.alaskaparadise.com:/usr/obj/usr/src/sys/STARGATE



>Description:


Add new macros INSTALL_WWW and COPYTREE_WWW to install web aplications with the right ownership/permissions.


>How-To-Repeat:





>Fix:


Index: bsd.port.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.589
diff -u -r1.589 bsd.port.mk
--- bsd.port.mk	17 Oct 2007 10:12:24 -0000	1.589
+++ bsd.port.mk	6 Feb 2008 19:06:30 -0000
@@ -588,6 +588,7 @@
 # INSTALL_DATA	- A command to install sharable data.
 # INSTALL_MAN	- A command to install manpages.  May or not compress,
 #				  depending on the value of MANCOMPRESSED (see below).
+# INSTALL_WWW	- A command to install webdata.
 #
 # Boolean to control whether manpages are installed.
 #
@@ -2251,12 +2252,16 @@
 _BINOWNGRP=	-o ${BINOWN} -g ${BINGRP}
 _SHROWNGRP=	-o ${SHAREOWN} -g ${SHAREGRP}
 _MANOWNGRP=	-o ${MANOWN} -g ${MANGRP}
+_WWWOWNGRP=	-o ${WWWOWN} -g ${WWWGRP}
 .else
 _BINOWNGRP=
 _SHROWNGRP=
 _MANOWNGRP=
+_WWWOWNGRP=
 .endif
 
+WWWMODE?=	755
+
 # A few aliases for *-install targets
 INSTALL_PROGRAM= \
 	${INSTALL} ${COPY} ${STRIP} ${_BINOWNGRP} -m ${BINMODE}
@@ -2268,11 +2273,14 @@
 	${INSTALL} ${COPY} ${_SHROWNGRP} -m ${SHAREMODE}
 INSTALL_MAN= \
 	${INSTALL} ${COPY} ${_MANOWNGRP} -m ${MANMODE}
+INSTALL_WWW= \
+	${INSTALL} ${COPY} ${_WWWOWNGRP} -m ${WWWMODE}
 
 INSTALL_MACROS=	BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
 			BSD_INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
 			BSD_INSTALL_DATA="${INSTALL_DATA}" \
-			BSD_INSTALL_MAN="${INSTALL_MAN}"
+			BSD_INSTALL_MAN="${INSTALL_MAN}"  \
+			BSD_INSTALL_WWW="${INSTALL_WWW}"
 MAKE_ENV+=	${INSTALL_MACROS}
 SCRIPTS_ENV+=	${INSTALL_MACROS}
 
@@ -2288,6 +2296,11 @@
 					${CHOWN} -R ${SHAREOWN}:${SHAREGRP} $$1 && \
 					${FIND} $$1/ -type d -exec chmod 755 {} \; && \
 					${FIND} $$1/ -type f -exec chmod ${SHAREMODE} {} \;' --
+COPYTREE_WWW=	${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
+					2>&1) && \
+					${CHOWN} -R ${WWWOWN}:${WWWGRP} $$1 && \
+					${FIND} $$1/ -type d -exec chmod 755 {} \; && \
+					${FIND} $$1/ -type f -exec chmod ${WWWMODE} {} \;' --
 .else
 COPYTREE_BIN=	${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
 					2>&1) && \
@@ -2297,6 +2310,10 @@
 					2>&1) && \
 					${FIND} $$1/ -type d -exec chmod 755 {} \; && \
 					${FIND} $$1/ -type f -exec chmod ${SHAREMODE} {} \;' --
+COPYTREE_WWW=	${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
+					2>&1) && \
+					${FIND} $$1/ -type d -exec chmod 755 {} \; && \
+					${FIND} $$1/ -type f -exec chmod ${WWWMODE} {} \;' --
 .endif
 
 # The user can override the NO_PACKAGE by specifying this from
@@ -3519,17 +3536,20 @@
 .if ${USE_DOS2UNIX:U}=="YES"
 	@${ECHO_MSG} "===>   Converting DOS text files to UNIX text files"
 	@${FIND} -E ${WRKSRC} -type f -iregex '${DOS2UNIX_REGEX}' -print0 | \
-			${XARGS} -0 ${REINPLACE_CMD} -i '' -e 's/
$$//'
+			${XARGS} -0 ${REINPLACE_CMD} -i '' -e 's/
+$$//'
 .else
 	@${ECHO_MSG} "===>   Converting DOS text file to UNIX text file: ${f}"
 .if ${USE_DOS2UNIX:M*/*}
 .for f in ${USE_DOS2UNIX}
-	@${REINPLACE_CMD} -i '' -e 's/
$$//' ${WRKSRC}/${f}
+	@${REINPLACE_CMD} -i '' -e 's/
+$$//' ${WRKSRC}/${f}
 .endfor
 .else
 .for f in ${USE_DOS2UNIX}
 	@${FIND} ${WRKSRC} -type f -name '${f}' -print0 | \
-			${XARGS} -0 ${REINPLACE_CMD} -i '' -e 's/
$$//'
+			${XARGS} -0 ${REINPLACE_CMD} -i '' -e 's/
+$$//'
 .endfor
 .endif
 .endif



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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1202327837.35414>