Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 May 2014 17:53:04 GMT
From:      Joseph Benden <joe@thrallingpenguin.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/190377: [patch] Add staging support to www/py-webware
Message-ID:  <201405291753.s4THr40d062761@cgiserv.freebsd.org>
Resent-Message-ID: <201405291800.s4TI00Q1082709@freefall.freebsd.org>

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

>Number:         190377
>Category:       ports
>Synopsis:       [patch] Add staging support to www/py-webware
>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:   Thu May 29 18:00:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Joseph Benden
>Release:        FreeBSD 11
>Organization:
>Environment:
FreeBSD lucy 11.0-CURRENT FreeBSD 11.0-CURRENT #4 r264887: Thu Apr 24 12:43:46 MST 2014     root@lucy:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
Adds staging support to www/py-webware.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff --git a/www/py-webware/Makefile b/www/py-webware/Makefile
index 5f6e4ed..706010a 100644
--- a/www/py-webware/Makefile
+++ b/www/py-webware/Makefile
@@ -18,6 +18,8 @@ NO_BUILD=	yes
 
 WEBWARE_USER?=	webkit
 WEBWARE_GROUP?=	${WEBWARE_USER}
+USERS=${WEBWARE_USER}
+GROUPS=${WEBWARE_GROUP}
 WEBWARE_MASTER_DIR?=${PREFIX}/share/webware
 WEBKIT_HOME_DIR?=${PREFIX}/www/webkit
 INSTALL_ENV=	PKG_PREFIX=${PREFIX} \
@@ -30,7 +32,6 @@ INSTALL_ENV=	PKG_PREFIX=${PREFIX} \
 
 PLIST_SUB+=	WEBWARE_MASTER_DIR=${WEBWARE_MASTER_DIR:S,^${PREFIX}/,,}
 
-NO_STAGE=	yes
 .include <bsd.port.pre.mk>
 
 post-patch:
@@ -39,23 +40,22 @@ post-patch:
 	@${RM} ${WRKSRC}/WebKit/Adapters/mod_webkit2/Makefile.bak
 	@${RM} ${WRKSRC}/WebKit/Adapters/mod_webkit1/Makefile.bak
 
-pre-install:
-	@ ${ECHO} '---> Making webware default user and its group'
-	${SETENV} ${INSTALL_ENV} ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
-
 do-install:
-	@${MKDIR} ${WEBWARE_MASTER_DIR}
-	@${CP} -R ${WRKSRC}/* ${WEBWARE_MASTER_DIR}
+	@${MKDIR} ${STAGEDIR}${WEBWARE_MASTER_DIR}
+	@${CP} -R ${WRKSRC}/* ${STAGEDIR}${WEBWARE_MASTER_DIR}
 
 	@ ${ECHO} '---> Installing start/stop script'
+	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/rc.d
 	${SED} -e "s|%%WEBKIT_HOME_DIR%%|${WEBKIT_HOME_DIR}|g" \
 		< ${FILESDIR}/webkit.sh.tmpl \
-		> ${PREFIX}/etc/rc.d/webkit.sh-dist
-	${CHMOD} 755 ${PREFIX}/etc/rc.d/webkit.sh-dist && \
-	${CHOWN} root:wheel ${PREFIX}/etc/rc.d/webkit.sh-dist
+		> ${STAGEDIR}${PREFIX}/etc/rc.d/webkit.sh-dist
+	${CHMOD} 755 ${STAGEDIR}${PREFIX}/etc/rc.d/webkit.sh-dist && \
+	${CHOWN} root:wheel ${STAGEDIR}${PREFIX}/etc/rc.d/webkit.sh-dist
 
 post-install:
 	@ ${ECHO} '---> Compiling Python files and making webkit home directory'
-	${SETENV} ${INSTALL_ENV} ${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL
+	${SETENV} ${INSTALL_ENV} STAGEDIR=${STAGEDIR} ${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL
+	${FIND} ${STAGEDIR} \( -name "*.pyc" -o -name "*.html" -o -name "*.cgi" -o -name "*.log" -o -name "*.py" \) -exec ${REINPLACE_CMD} -e "s|${STAGEDIR}||g" {} \;
+	${FIND} ${STAGEDIR} -name "*.bak" -exec ${RM} {} \;
 
 .include <bsd.port.post.mk>
diff --git a/www/py-webware/pkg-install b/www/py-webware/pkg-install
index 00e1832..4a39490 100644
--- a/www/py-webware/pkg-install
+++ b/www/py-webware/pkg-install
@@ -11,8 +11,8 @@ PATH=/bin:/usr/sbin:${LOCALBASE}/bin:
 # set these if not provided by the Makefile
 WEBWARE_USER=${WEBWARE_USER:-webkit}
 WEBWARE_GROUP=${WEBWARE_USER:-webkit}
-WEBWARE_MASTER_DIR=${WEBWARE_MASTER_DIR:-${PKG_PREFIX}/share/webware}
-WEBKIT_HOME_DIR=${WEBKIT_HOME_DIR:-${PKG_PREFIX}/www/webkit}
+WEBWARE_MASTER_DIR=${STAGEDIR}${WEBWARE_MASTER_DIR:-${PKG_PREFIX}/share/webware}
+WEBKIT_HOME_DIR=${STAGEDIR}${WEBKIT_HOME_DIR:-${PKG_PREFIX}/www/webkit}
 
 add_webkit_account()
 {
@@ -56,13 +56,6 @@ make_webkit_home_dir()
         # make application workdir for webkit user
         ${PYTHON} ${WEBWARE_MASTER_DIR}/bin/MakeAppWorkDir.py \
                ${WEBKIT_HOME_DIR}
-        chown -R root:wheel ${WEBKIT_HOME_DIR}
-        echo chown -R ${WEBWARE_USER}:${WEBWARE_GROUP} \
-            ${WEBKIT_HOME_DIR}/Cache ${WEBKIT_HOME_DIR}/ErrorMsgs \
-            ${WEBKIT_HOME_DIR}/Logs ${WEBKIT_HOME_DIR}/Sessions
-        chown -R ${WEBWARE_USER}:${WEBWARE_GROUP} \
-            ${WEBKIT_HOME_DIR}/Cache ${WEBKIT_HOME_DIR}/ErrorMsgs \
-            ${WEBKIT_HOME_DIR}/Logs ${WEBKIT_HOME_DIR}/Sessions
     fi
 }
 
diff --git a/www/py-webware/pkg-plist b/www/py-webware/pkg-plist
index ebcfad7..4868039 100644
--- a/www/py-webware/pkg-plist
+++ b/www/py-webware/pkg-plist
@@ -1826,6 +1826,7 @@ www/webkit/MyContext/__init__.py
 www/webkit/WebKit.cgi
 www/webkit/error404.html
 www/webkit/webkit
+@exec chown -R webkit:webkit %D/www/webkit/Cache %D/www/webkit/Logs %D/www/webkit/ErrorMsgs %D/www/webkit/Sessions
 @dirrm www/webkit/Cache
 @dirrm www/webkit/Configs
 @dirrm www/webkit/ErrorMsgs


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



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